ReceiptApiController.java
3.18 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.huaheng.api.general.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.huaheng.api.general.domain.Receipt;
import com.huaheng.api.general.domain.ReceiptDomain;
import com.huaheng.api.general.service.ReceiptApiService;
import com.huaheng.api.general.service.ReceiptService;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/api/receiptApi")
@Api(tags = {"入库单接口"}, value = "入库单接口receipt")
public class ReceiptApiController {
@Resource
private ReceiptApiService receiptApiService;
@Resource
private ReceiptService receiptService;
/**
* 同步入库单
*/
@Log(title = "入库单添加", action = BusinessType.INSERT)
@PostMapping("/receipt")
@ApiOperation("入库单添加公共接口")
@ResponseBody
@ApiLogger(apiName = "添加入库单", from="ERP")
public AjaxResult receipt(@RequestBody ReceiptDomain receiptDomain)
{
AjaxResult ajaxResult = receiptApiService.receipt(receiptDomain);
return ajaxResult;
}
// /**
// * 入库单下发
// */
// @Log(title = "入库单下发", action = BusinessType.INSERT)
// @PostMapping("/insertReceipt")
// @ApiOperation("入库单下发接口")
// @ResponseBody
// @ApiLogger(apiName = "下发入库单", from="ERP")
// public AjaxResult MaterialApi(@RequestBody Receipt receipt) {
// System.out.println("————————开始接收入库单——————————");
// System.out.println(receipt);
// AjaxResult ajaxResult = receiptService.insertReceipt(receipt);
// return ajaxResult;
// }
/**
* 取消入库单
*/
@Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
@PostMapping("/remove")
@ResponseBody
@ApiLogger(apiName = "取消入库单", from="ERP")
public AjaxResult remove(@RequestBody List<String> receiptCodeList){
if (receiptCodeList==null && receiptCodeList.size()<1){
return AjaxResult.error("单号列表为空");
}
return receiptApiService.remove(receiptCodeList);
}
/**
* 入库单查询
*/
@Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
@GetMapping("/search")
@ResponseBody
@ApiLogger(apiName = "查询入库单", from="ERP")
public AjaxResult search(@RequestParam String receiptCode,
@RequestParam String companyCode,
@RequestParam String warehouseCode){
return receiptApiService.search(receiptCode,companyCode,warehouseCode);
}
}