ArrivedAMasterController.java
2.7 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
package com.tianbo.analysis.controller;
import com.tianbo.analysis.model.AdvanceArrive;
import com.tianbo.analysis.model.BatchSend;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.ArriveMasterService;
import com.tianbo.analysis.tools.WaybillTools;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 运抵接口
*/
@RestController
@RequestMapping("/arrive/")
public class ArrivedAMasterController {
@Autowired
ArriveMasterService arriveMasterService;
@ApiOperation(value = "提前运抵接口",notes = "接收卡口车辆过卡放行后的通知,车单数据")
@PostMapping("forkako")
public ResultJson applyfor(@RequestBody AdvanceArrive carAndWayBill){
boolean result = arriveMasterService.arrivedAhead(carAndWayBill);
return result? new ResultJson("200","处理完毕"):new ResultJson("处理失败");
}
@RequestMapping("check")
public void check(@RequestParam String waybill){
WaybillTools.checkWaybillFormat(waybill);
}
@ApiOperation(value = "提前运抵-接收申请数据通知接口",notes = "接收卡口进出场申请中的提前运抵运单数据,并更新到预配中")
@PostMapping("prebill")
public ResultJson acceptWaybill(@RequestBody AdvanceArrive preArrivedWaybillList){
int result = arriveMasterService.updatePremasterArrivedHeadStatus(preArrivedWaybillList);
return result>0? new ResultJson("200","提前运抵状态已更新"):new ResultJson("提前运抵状态更新失败");
}
@PostMapping("batchDel")
public ResultJson batchDel(@RequestBody BatchSend batchSend, @CookieValue("username") String username, @CookieValue("userid") String userid){
if (StringUtils.isEmpty(batchSend.businessAlterLog.getAlterReason())){
return new ResultJson("400","未提交删除申请原因");
}
if (StringUtils.isEmpty(batchSend.businessAlterLog.getContantname())){
return new ResultJson("400","未提交删除申请联系人或电话");
}
if (StringUtils.isEmpty(batchSend.businessAlterLog.getContenttel())){
return new ResultJson("400","未提交删除申请电话");
}
if (batchSend.billListDes==null || batchSend.billListDes.isEmpty()){
return new ResultJson("400","未选择运单");
}
boolean b = arriveMasterService.batchDel(batchSend, username);
if (b){
return new ResultJson("200","批量删除申请发送成功");
}else {
return new ResultJson("400","批量删除申请发送失败");
}
}
}