Commit 39a3af74b86974cd0b30242ff4700ffa05280bc0
1 parent
c1469e35
优化流程
Showing
9 changed files
with
78 additions
and
29 deletions
src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java
... | ... | @@ -42,6 +42,13 @@ public class ContainerType implements Serializable { |
42 | 42 | private String warehouseCode; |
43 | 43 | |
44 | 44 | /** |
45 | + * 库位类型 | |
46 | + */ | |
47 | + @TableField(value = "locationType") | |
48 | + @ApiModelProperty(value="库位类型") | |
49 | + private String locationType; | |
50 | + | |
51 | + /** | |
45 | 52 | * 货主编码 |
46 | 53 | */ |
47 | 54 | @TableField(value = "companyCode") |
... | ... | @@ -800,6 +807,14 @@ public class ContainerType implements Serializable { |
800 | 807 | this.processStamp = processStamp; |
801 | 808 | } |
802 | 809 | |
810 | + public String getLocationType() { | |
811 | + return locationType; | |
812 | + } | |
813 | + | |
814 | + public void setLocationType(String locationType) { | |
815 | + this.locationType = locationType; | |
816 | + } | |
817 | + | |
803 | 818 | @Override |
804 | 819 | public String toString() { |
805 | 820 | StringBuilder sb = new StringBuilder(); |
... | ... |
src/main/java/com/huaheng/pc/config/receiptType/service/ReceiptTypeServiceImpl.java
... | ... | @@ -21,7 +21,8 @@ public class ReceiptTypeServiceImpl extends ServiceImpl<ReceiptTypeMapper, Recei |
21 | 21 | LambdaQueryWrapper<ReceiptType> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
22 | 22 | lambdaQueryWrapper.eq(StringUtils.isNotEmpty(ShiroUtils.getWarehouseCode()),ReceiptType::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
23 | 23 | .in(StringUtils.isNotEmpty(ShiroUtils.getCompanyCodeList()),ReceiptType::getCompanyCode, ShiroUtils.getCompanyCodeList()); |
24 | - return this.listMaps(lambdaQueryWrapper); | |
24 | + List<Map<String, Object>> list = this.listMaps(lambdaQueryWrapper); | |
25 | + return list; | |
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
... | ... |
src/main/java/com/huaheng/pc/config/supplier/controller/SupplierController.java
... | ... | @@ -168,17 +168,17 @@ public class SupplierController extends BaseController { |
168 | 168 | |
169 | 169 | @PostMapping("/getData") |
170 | 170 | @ResponseBody |
171 | - public Map<String, Object> getData(String name, String code) { | |
171 | + public Map<String, Object> getData(String supplierName, String supplierCode) { | |
172 | 172 | LambdaQueryWrapper<Supplier> queryWrapper = Wrappers.lambdaQuery(); |
173 | - queryWrapper.like(StringUtils.isNotEmpty(name), Supplier::getCode, name) | |
173 | + queryWrapper.like(StringUtils.isNotEmpty(supplierName), Supplier::getCode, supplierName) | |
174 | 174 | .or() |
175 | - .like(StringUtils.isNotEmpty(name), Supplier::getName, name); | |
175 | + .like(StringUtils.isNotEmpty(supplierName), Supplier::getName, supplierName); | |
176 | 176 | List<Supplier> supplierList = supplierService.list(queryWrapper); |
177 | 177 | |
178 | 178 | List<Map<String, Object>> list = new ArrayList<>(); |
179 | 179 | for (Supplier supplier : supplierList) { |
180 | 180 | Map<String, Object> resultMap = new HashMap<>(); |
181 | - if (StringUtils.isNotEmpty(code) && supplier.getCode().equals(code)) { | |
181 | + if (StringUtils.isNotEmpty(supplierCode) && supplier.getCode().equals(supplierCode)) { | |
182 | 182 | resultMap.put("selected", true); |
183 | 183 | } |
184 | 184 | resultMap.put("id", supplier.getCode()); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java
... | ... | @@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | 6 | import com.huaheng.common.constant.QuantityConstant; |
7 | 7 | import com.huaheng.common.exception.service.ServiceException; |
8 | +import com.huaheng.common.utils.StringUtils; | |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | 10 | import com.huaheng.framework.web.domain.AjaxResult; |
10 | 11 | import com.huaheng.mobile.receipt.ReceiptBill; |
12 | +import com.huaheng.pc.config.location.service.LocationService; | |
11 | 13 | import com.huaheng.pc.config.material.domain.Material; |
12 | 14 | import com.huaheng.pc.config.material.service.MaterialService; |
13 | 15 | import com.huaheng.common.constant.QuantityConstant; |
... | ... | @@ -52,6 +54,8 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai |
52 | 54 | private ReceiptContainerHeaderService receiptContainerHeaderService; |
53 | 55 | @Resource |
54 | 56 | private MaterialService materialService; |
57 | + @Resource | |
58 | + private LocationService locationService; | |
55 | 59 | /** |
56 | 60 | * 根据入库单编码查询入库组盘明细 |
57 | 61 | * @param receiptCode 入库单编码 |
... | ... | @@ -92,6 +96,10 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai |
92 | 96 | lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerDetail.getReceiptContainerId()); |
93 | 97 | List<ReceiptContainerDetail> list = this.list(lambdaQueryWrapper); |
94 | 98 | if (list.size() == 0){ |
99 | + String locationCode = receiptContainerDetail.getLocationCode(); | |
100 | + if(StringUtils.isNotEmpty(locationCode)) { | |
101 | + locationService.updateStatus(locationCode, "empty"); | |
102 | + } | |
95 | 103 | if (!receiptContainerHeaderService.removeById(receiptContainerDetail.getReceiptContainerId())){ |
96 | 104 | throw new ServiceException("删除入库组盘头失败"); |
97 | 105 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... | ... | @@ -157,7 +157,6 @@ public class ReceiptContainerHeaderController extends BaseController { |
157 | 157 | for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails){ |
158 | 158 | receivingService.position(receiptContainerDetail); |
159 | 159 | } |
160 | - | |
161 | 160 | } |
162 | 161 | return AjaxResult.success("定位成功"); |
163 | 162 | } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... | ... | @@ -16,6 +16,8 @@ import com.huaheng.pc.config.configValue.domain.ConfigValue; |
16 | 16 | import com.huaheng.pc.config.configValue.service.ConfigValueService; |
17 | 17 | import com.huaheng.pc.config.container.domain.Container; |
18 | 18 | import com.huaheng.pc.config.container.service.ContainerService; |
19 | +import com.huaheng.pc.config.containerType.domain.ContainerType; | |
20 | +import com.huaheng.pc.config.containerType.service.ContainerTypeService; | |
19 | 21 | import com.huaheng.pc.config.location.domain.Location; |
20 | 22 | import com.huaheng.pc.config.location.service.LocationService; |
21 | 23 | import com.huaheng.pc.config.locationType.domain.LocationType; |
... | ... | @@ -78,6 +80,8 @@ public class ReceivingService { |
78 | 80 | private LocationTypeService locationTypeService; |
79 | 81 | @Resource |
80 | 82 | private TransferTaskService transferTaskService; |
83 | + @Resource | |
84 | + private ContainerTypeService containerTypeService; | |
81 | 85 | |
82 | 86 | /** |
83 | 87 | * 获取当前单号详情 |
... | ... | @@ -95,9 +99,19 @@ public class ReceivingService { |
95 | 99 | return AjaxResult.success(detail); |
96 | 100 | } |
97 | 101 | |
98 | - public String filter(List<Location> locationList, List<LocationType> locationTypeList, String roadway){ | |
99 | - List<String> codeList = locationTypeList.stream().map(t-> t.getCode()).collect(Collectors.toList()); | |
100 | - List<Location> newLocation = locationList.stream().filter(t-> codeList.contains(t.getLocationType()) && t.getRoadway().equals(roadway)).collect(Collectors.toList()); | |
102 | + public String filter(List<Location> locationList, List<LocationType> locationTypeList, Container container){ | |
103 | + String containerType1 = container.getContainerType(); | |
104 | + LambdaQueryWrapper<ContainerType> containerTypeLambdaQueryWrapper = new LambdaQueryWrapper<>(); | |
105 | + containerTypeLambdaQueryWrapper.eq(ContainerType::getCode, containerType1); | |
106 | + ContainerType containerType = containerTypeService.getOne(containerTypeLambdaQueryWrapper); | |
107 | + String locationType = containerType.getLocationType(); | |
108 | + String[] locationTypes = locationType.split(","); | |
109 | +// List<String> codeList = locationTypeList.stream().map(t-> t.getCode()).collect(Collectors.toList()); | |
110 | + List<String> codeList = new ArrayList<>(); | |
111 | + for(String type : locationTypes) { | |
112 | + codeList.add(type); | |
113 | + } | |
114 | + List<Location> newLocation = locationList.stream().filter(t-> codeList.contains(t.getLocationType())).collect(Collectors.toList()); | |
101 | 115 | if (newLocation.isEmpty()){ |
102 | 116 | return null; |
103 | 117 | } else{ |
... | ... | @@ -146,7 +160,7 @@ public class ReceivingService { |
146 | 160 | //根据定位规则查询库位编码 |
147 | 161 | LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); |
148 | 162 | locationLambda.last(locatingRules[0]); |
149 | - locationLambda.eq(Location::getRoadway, 3); | |
163 | + locationLambda.eq(Location::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
150 | 164 | List<Location> locationList = locationService.list(locationLambda); |
151 | 165 | List<Location> removeLocaationList = new ArrayList<>(); |
152 | 166 | for(Location location1 : locationList) { |
... | ... | @@ -172,9 +186,9 @@ public class ReceivingService { |
172 | 186 | } |
173 | 187 | |
174 | 188 | LambdaQueryWrapper<LocationType> lambdaQueryWrapper2 = Wrappers.lambdaQuery(); |
175 | - lambdaQueryWrapper2.eq(LocationType::getCode, "L"); | |
189 | +// lambdaQueryWrapper2.eq(LocationType::getCode, "L"); | |
176 | 190 | List<LocationType> locationTypeList = locationTypeService.list(lambdaQueryWrapper2); |
177 | - String locationCode = filter(locationList, locationTypeList, "3"); | |
191 | + String locationCode = filter(locationList, locationTypeList, container); | |
178 | 192 | |
179 | 193 | if (StringUtils.isNotEmpty(locationCode)){ |
180 | 194 | locationService.updateStatus(locationCode, "lock"); |
... | ... | @@ -235,9 +249,13 @@ public class ReceivingService { |
235 | 249 | public AjaxResult cancelPosition(ReceiptContainerDetail receiptContainerDetail){ |
236 | 250 | //查询入库组盘头 |
237 | 251 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); |
238 | - if (!(receiptContainerHeader.getStatus().shortValue() == QuantityConstant.RECEIPT_CONTAINER_BUILD)){ | |
252 | + if (!(receiptContainerHeader.getStatus().shortValue() == QuantityConstant.RECEIPT_CONTAINER_BUILD)){ | |
239 | 253 | throw new ServiceException("组盘已生成任务不能取消定位"); |
240 | 254 | } |
255 | + String locationCode = receiptContainerHeader.getToLocation(); | |
256 | + if(StringUtils.isEmpty(locationCode)) { | |
257 | + throw new ServiceException("组盘没有定位,不需要取消定位"); | |
258 | + } | |
241 | 259 | //将入库组盘头表中的而库位编码赋值null |
242 | 260 | receiptContainerHeader.setToLocation(""); |
243 | 261 | if (!receiptContainerHeaderService.updateById(receiptContainerHeader)){ |
... | ... | @@ -262,6 +280,8 @@ public class ReceivingService { |
262 | 280 | throw new ServiceException("回滚入库明细状态失败"); |
263 | 281 | } |
264 | 282 | |
283 | + locationService.updateStatus(locationCode, "empty"); | |
284 | + | |
265 | 285 | receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); |
266 | 286 | |
267 | 287 | return AjaxResult.success("取消定位成功"); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -88,9 +88,9 @@ public class TaskHeaderController extends BaseController { |
88 | 88 | Page<TaskHeader> page = new Page<>(pageNum, pageSize); |
89 | 89 | IPage<TaskHeader> iPage = taskHeaderService.page(page, lambdaQueryWrapper); |
90 | 90 | List<TaskHeader> iPages = iPage.getRecords(); |
91 | - if(InternalTaskType == 700){ | |
92 | - iPages = taskHeaderService.preferenceRealize(iPages) ; | |
93 | - } | |
91 | +// if(InternalTaskType == 700){ | |
92 | +// iPages = taskHeaderService.preferenceRealize(iPages) ; | |
93 | +// } | |
94 | 94 | return getMpDataTable(iPages, iPage.getTotal()); |
95 | 95 | } else { |
96 | 96 | List<TaskHeader> list = taskHeaderService.list(lambdaQueryWrapper); |
... | ... |
src/main/resources/templates/receipt/receiptDetail/add.html
... | ... | @@ -34,12 +34,12 @@ |
34 | 34 | <input id="totalQty" name="totalQty" class="form-control" type="text"> |
35 | 35 | </div> |
36 | 36 | </div> |
37 | - <div class="form-group"> | |
38 | - <label class="col-sm-3 control-label">供应商编码:</label> | |
39 | - <div class="col-sm-8"> | |
40 | - <input id="supplierCode" name="supplierCode" class="form-control" type="text"> | |
41 | - </div> | |
42 | - </div> | |
37 | + <!--<div class="form-group">--> | |
38 | + <!--<label class="col-sm-3 control-label">供应商编码:</label>--> | |
39 | + <!--<div class="col-sm-8">--> | |
40 | + <!--<input id="supplierCode" name="supplierCode" class="form-control" type="text">--> | |
41 | + <!--</div>--> | |
42 | + <!--</div>--> | |
43 | 43 | <div class="form-group"> |
44 | 44 | <label class="col-sm-3 control-label">批次:</label> |
45 | 45 | <div class="col-sm-8"> |
... | ... |
src/main/resources/templates/receipt/receiptHeader/add.html
1 | 1 | <!DOCTYPE HTML> |
2 | 2 | <html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
3 | 3 | <meta charset="utf-8"> |
4 | -<head th:include="include :: header"></head> | |
4 | +<head> | |
5 | + <th:block th:include="include :: header" /> | |
6 | + <th:block th:include="include :: select2-css" /> | |
7 | +</head> | |
5 | 8 | <body class="white-bg"> |
6 | 9 | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
7 | 10 | <form class="form-horizontal m" id="form-receiptHeader-add"> |
... | ... | @@ -24,7 +27,7 @@ |
24 | 27 | <div class="form-group"> |
25 | 28 | <label class="col-sm-3 control-label">供应商:</label> |
26 | 29 | <div class="col-sm-8"> |
27 | - <select id="supplierName" name="supplierName" class="form-control"></select> | |
30 | + <select id="supplierName2" name="supplierName2" class="form-control"></select> | |
28 | 31 | </div> |
29 | 32 | </div> |
30 | 33 | <div class="form-group"> |
... | ... | @@ -47,7 +50,8 @@ |
47 | 50 | </div> |
48 | 51 | </form> |
49 | 52 | </div> |
50 | - <div th:include="include::footer"></div> | |
53 | + <th:block th:include="include :: footer" /> | |
54 | + <th:block th:include="include :: select2-js" /> | |
51 | 55 | <script type="text/javascript"> |
52 | 56 | var prefix = ctx + "receipt/receiptHeader"; |
53 | 57 | |
... | ... | @@ -58,6 +62,9 @@ |
58 | 62 | }, |
59 | 63 | companyCode:{ |
60 | 64 | required:true, |
65 | + }, | |
66 | + supplierName2:{ | |
67 | + required:true, | |
61 | 68 | } |
62 | 69 | }, |
63 | 70 | submitHandler: function(form) { |
... | ... | @@ -68,7 +75,7 @@ |
68 | 75 | data : { |
69 | 76 | "receiptType": $("#receiptType option:selected").val(), |
70 | 77 | "companyCode": $("#companyCode option:selected").val(), |
71 | - "supplierCode": $("input[name='supplierCode']").val(), | |
78 | + "supplierCode": $("#supplierName2 option:selected").val(), | |
72 | 79 | "receiptNote": $("input[name='receiptNote']").val(), |
73 | 80 | "scheduledArriveDate": $("input[name='scheduledArriveDate']").val(), |
74 | 81 | }, |
... | ... | @@ -88,15 +95,14 @@ |
88 | 95 | var laydate = layui.laydate; |
89 | 96 | laydate.render({ elem: '#scheduledArriveDate',min: 0, theme: 'molv', format: 'yyyy-MM-dd HH:mm:ss'}); |
90 | 97 | }); |
91 | - | |
92 | - $('#supplierName').select2({ | |
98 | + $('#supplierName2').select2({ | |
93 | 99 | ajax: { |
94 | 100 | url: ctx+'config/supplier/getData', |
95 | 101 | dataType: 'json', |
96 | 102 | type: 'post', |
97 | 103 | data: function (params) { |
98 | 104 | let query = { |
99 | - supplierCode: params.term, | |
105 | + supplierName: params.term, | |
100 | 106 | } |
101 | 107 | return query; |
102 | 108 | } |
... | ... |