MobileBatchReceiptController.java
2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.huaheng.mobile.receipt;
import com.alibaba.fastjson.JSONException;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.general.container.service.IContainerService;
import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerView;
import com.huaheng.pc.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
import com.huaheng.pc.receipt.receiptHeader.service.IReceiptHeaderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@CrossOrigin
@RestController
@RequestMapping("/mobile/receipt/batch")
@Api(tags = {"MobileBatchReceiptController"}, description = "移动端收货")
public class MobileBatchReceiptController {
@Resource
private IContainerService containerService;
@Resource
private IReceiptHeaderService receiptHeaderService;
@Resource
private IReceiptContainerHeaderService receiptContainerHeaderService;
@PostMapping("/scanBill")
@ApiOperation("移动端扫描入库单")
@Log(title = "移动端扫描入库单", action = BusinessType.OTHER)
public AjaxResult scanBill(@RequestBody @ApiParam(value="收货单号") Map<String, String> param) throws Exception {
if (param.get("code") == null || param.get("code").trim().length() < 1)
throw new JSONException("收货单号(code)不能为空");
AjaxResult result = receiptHeaderService.scanReceiptCode(param.get("code"));
return result;
}
@PostMapping("/scanContainer")
@ApiOperation("移动端入库扫描容器")
@Log(title = "移动端入库扫描容器", action = BusinessType.OTHER)
public AjaxResult scanContainer(@RequestBody @ApiParam(value="容器号") Map<String, String> param) throws Exception {
if (param.get("code") == null || param.get("code").trim().length() < 1)
throw new JSONException("容器号(code)不能为空");
AjaxResult result = containerService.CheckContainer(param.get("code"));
return result;
}
@PostMapping("/save")
@ApiOperation("移动端收货保存")
@Log(title = "移动端收货保存", action = BusinessType.OTHER)
public AjaxResult save(@RequestBody @ApiParam(value="容器号") List<ReceiptContainerView> record) throws Exception {
AjaxResult result = receiptContainerHeaderService.batchSave(record);
return result;
}
}