Commit 501e5c6e4f4e67731019b242cfa1566733fc42da

Authored by 游杰
2 parents dc71bac9 35fd0a04

Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop

src/main/java/com/huaheng/api/wcs/controller/EmptyOutHandle.java
... ... @@ -27,10 +27,10 @@ public class EmptyOutHandle extends BaseController {
27 27 private EmptyOutHandleService emptyOutHandleService;
28 28  
29 29 @Log(title = "wcs空出处理", action = BusinessType.INSERT)
30   - @PostMapping("/EmptyOutHandle")
  30 + @PostMapping("/emptyOutHandle")
31 31 @ApiOperation("wcs空出处理")
32 32 @ResponseBody
33   - public AjaxResult EmptyOutHandle(@RequestBody Map<String,String> map) {
  33 + public AjaxResult emptyOutHandle(@RequestBody Map<String,String> map) {
34 34 String taskNo = map.get("taskNo");
35 35 AjaxResult ajaxResult = emptyOutHandleService.EmptyOutHandle(taskNo);
36 36 return ajaxResult;
... ...
src/main/java/com/huaheng/api/wcs/domain/TaskFinishDomain.java
1 1 package com.huaheng.api.wcs.domain;
2 2  
3 3  
  4 +import com.huaheng.framework.aspectj.lang.annotation.Excel;
4 5 import lombok.Data;
5 6  
6 7 /**
... ...
src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java
... ... @@ -111,12 +111,6 @@ public class OverrideHandleServiceImpl implements OverrideHandleService {
111 111 if(location == null) {
112 112 return AjaxResult.error("此任务的原目的库位在系统中不存在");
113 113 }
114   - location.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY);
115   - location.setContainerCode("");
116   - Boolean flag = locationService.updateById(location);
117   - if(flag == false) {
118   - return AjaxResult.error("修改此任务的原目的库位错误");
119   - }
120 114 /**
121 115 * 查看新库位有两种情况
122 116 * 1、重入的库位由wcs提供
... ... @@ -155,15 +149,20 @@ public class OverrideHandleServiceImpl implements OverrideHandleService {
155 149 String destination = location.getArea();
156 150 String containerCode = taskHeader.getContainerCode();
157 151 List<TaskDetail> taskDetailList = taskDetailService.findByTaskId(taskHeader.getId());
158   - String materialCode = taskDetailList.get(0).getMaterialCode();
159   - Material material = materialService.findAllByCode(materialCode, warehouseCode);
160   - String materialAreaCode = material.getMaterialAreaCode();
  152 + String materialAreaCode = null;
  153 + if(taskDetailList != null && taskDetailList.size() > 0) {
  154 + String materialCode = taskDetailList.get(0).getMaterialCode();
  155 + Material material = materialService.findAllByCode(materialCode, warehouseCode);
  156 + materialAreaCode = material.getMaterialAreaCode();
  157 + }
161 158 String locationCode = locationAllocationService.allocation(allocationRule,
162 159 locationTypeCodeList, high, destination, warehouseCode, containerCode, materialAreaCode);
163 160 if (StringUtils.isEmpty(locationCode)) {
164 161 return AjaxResult.error("没有库位可分配");
165 162 }
166   - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_RECEIPT)) {
  163 + int taskType = taskHeader.getTaskType();
  164 + if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT ||
  165 + taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) {
167 166 //查询入库组盘明细
168 167 List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>();
169 168 if(taskDetailList != null) {
... ... @@ -182,6 +181,7 @@ public class OverrideHandleServiceImpl implements OverrideHandleService {
182 181 }
183 182 newLocationCode = locationCode;
184 183 }
  184 +
185 185 if (StringUtils.isEmpty(newLocationCode)) {
186 186 return AjaxResult.error("没有库位可以分配");
187 187 }
... ... @@ -192,7 +192,10 @@ public class OverrideHandleServiceImpl implements OverrideHandleService {
192 192 taskHeader.setToLocation(newLocationCode);
193 193 taskHeader.setExceptionCode("重入处理");
194 194 taskHeader.setIsDoubleIn(QuantityConstant.DOUBLE_IN);
195   - taskHeader.setOriginLocation(toLocationCode);
  195 + String originLocationCode = taskHeader.getOriginLocation();
  196 + if(StringUtils.isEmpty(originLocationCode)) {
  197 + taskHeader.setOriginLocation(toLocationCode);
  198 + }
196 199 if(!taskHeaderService.updateById(taskHeader)){
197 200 throw new ServiceException("修改此任务错误");
198 201 }
... ...
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
... ... @@ -14,6 +14,8 @@ import com.huaheng.pc.config.location.domain.Location;
14 14 import com.huaheng.pc.config.location.service.LocationService;
15 15 import com.huaheng.pc.config.locationType.domain.LocationType;
16 16 import com.huaheng.pc.config.locationType.service.LocationTypeService;
  17 +import com.huaheng.pc.config.zone.domain.Zone;
  18 +import com.huaheng.pc.config.zone.service.ZoneService;
17 19 import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
18 20 import org.springframework.stereotype.Service;
19 21  
... ... @@ -37,6 +39,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
37 39 private ContainerTypeService containerTypeService;
38 40 @Resource
39 41 private TaskHeaderService taskHeaderService;
  42 + @Resource
  43 + private ZoneService zoneService;
40 44  
41 45 @Override
42 46 public String allocation(int locationRule, List<String> locationTypeCodeList,
... ... @@ -50,17 +54,30 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
50 54 containerTypeLambdaQueryWrapper.eq(ContainerType::getCode, container.getContainerType())
51 55 .eq(ContainerType::getWarehouseCode, warehouseCode);
52 56 ContainerType containerType = containerTypeService.getOne(containerTypeLambdaQueryWrapper);
53   -
54   - String locationType = containerType.getLocationType();
55 57 List<LocationType> locationTypeList = new ArrayList<>();
56   - String[] list = locationType.split(",");
57   - for(String str : list) {
58   - LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery();
59   - locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode)
60   - .eq(LocationType::getCode, str);
61   - LocationType locationType1 = locationTypeService.getOne(locationTypeLambdaQueryWrapper);
62   - locationTypeList.add(locationType1);
  58 + if(containerType != null) {
  59 + String locationType = containerType.getLocationType();
  60 + String[] list = locationType.split(",");
  61 + for (String str : list) {
  62 + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery();
  63 + locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode)
  64 + .eq(LocationType::getCode, str);
  65 + LocationType locationType1 = locationTypeService.getOne(locationTypeLambdaQueryWrapper);
  66 + locationTypeList.add(locationType1);
  67 + }
  68 + } else {
  69 + LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery();
  70 + zoneLambdaQueryWrapper.eq(Zone::getWarehouseCode, warehouseCode)
  71 + .eq(Zone::getArea, area);
  72 + Zone zone = zoneService.getOne(zoneLambdaQueryWrapper);
  73 + if(zone != null) {
  74 + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery();
  75 + locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode)
  76 + .eq(LocationType::getZoneCode, zone.getCode());
  77 + locationTypeList = locationTypeService.list(locationTypeLambdaQueryWrapper);
  78 + }
63 79 }
  80 +
64 81 List<String> locationTypeCodes = locationTypeList.stream().
65 82 map(t -> t.getCode()).collect(toList());
66 83 List<String> mergelocationTypeCodeList = locationTypeCodeList.stream().filter(item -> locationTypeCodes.contains(item)).collect(toList());
... ... @@ -131,12 +148,4 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
131 148 return locationCode;
132 149 }
133 150  
134   -// private String filter(List<Location> locationList, List<String> locationTypeList, String area) {
135   -// List<Location> newLocation = locationList.stream().filter(t -> locationTypeList.contains(t.getLocationType()) && t.getArea().equals(area)).collect(toList());
136   -// if (newLocation.isEmpty()) {
137   -// return null;
138   -// } else {
139   -// return newLocation.get(0).getCode();
140   -// }
141   -// }
142 151 }
... ...
src/main/java/com/huaheng/pc/config/address/domain/Address.java
... ... @@ -33,7 +33,7 @@ public class Address implements Serializable {
33 33 private String warehouseCode;
34 34  
35 35 /**
36   -
  36 +
37 37 /**
38 38 * 区域
39 39 */
... ... @@ -42,9 +42,10 @@ public class Address implements Serializable {
42 42 private Integer number;
43 43  
44 44 /**
  45 + * 参数
  46 + */
45 47 @TableField(value = "param")
46 48 @ApiModelProperty(value="参数")
47   - */
48 49 private String param;
49 50  
50 51 /**
... ... @@ -93,4 +94,4 @@ public class Address implements Serializable {
93 94 public void setArea(Integer area) {
94 95 this.number = area;
95 96 }
96   -}
97 97 \ No newline at end of file
  98 +}
... ...
src/main/java/com/huaheng/pc/config/location/controller/LocationController.java
... ... @@ -223,11 +223,11 @@ public class LocationController extends BaseController {
223 223 @Log(title = "通用-库位管理", operating = "批量修改库位", action = BusinessType.UPDATE)
224 224 @PostMapping("/editBatchSave")
225 225 @ResponseBody
226   - public AjaxResult editBatchSave (String ids, String area, Integer high, String status) {
  226 + public AjaxResult editBatchSave (String ids, String materialAreaCode, Integer high, String status) {
227 227 String[] idArray = Convert.toStrArray(ids);
228 228 LambdaUpdateWrapper<Location> wrapper = Wrappers.lambdaUpdate();
229 229 wrapper.in(Location::getId, idArray)
230   - .set(Location::getArea, area)
  230 + .set(Location::getMaterialAreaCode, materialAreaCode)
231 231 .set(Location::getHigh, high)
232 232 .set(Location::getStatus, status);
233 233 return toAjax(locationService.update(wrapper));
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -363,15 +363,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
363 363 //如果已完成则不管
364 364 if (task.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) {
365 365 return AjaxResult.success("任务(" + taskIds[i] + ")任务已经是完成的!");
366   -
367 366 }
368 367 //整盘入库,空托入库库位自动分配
369 368 //整盘入库手动完成分配库位,已分配则略过
370   - if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)) {
  369 + if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT)
  370 + || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)) {
371 371 if (StringUtils.isEmpty(task.getToLocation())) {
372 372 //自动分配库位
373   - AjaxResult ajaxResult = this.setLocationCode(task.getId(), 0);
374   - task.setToLocation((String) ajaxResult.getData());
  373 +// AjaxResult ajaxResult = this.setLocationCode(task.getId(), 0);
  374 +// task.setToLocation((String) ajaxResult.getData());
375 375 }
376 376 }
377 377 //如果没有库位不能完成
... ...
src/main/resources/templates/config/location/editBatch.html
... ... @@ -23,11 +23,9 @@
23 23 </div>
24 24 </div>
25 25 <div class="form-group">
26   - <label class="col-sm-3 control-label">物料分区</label>
  26 + <label class="col-sm-3 control-label">物料分区编码</label>
27 27 <div class="col-sm-8">
28   - <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('material_areas')}">
29   - <option th:each="item : ${areas}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option>
30   - </select>
  28 + <input id="materialAreaCode" name="materialAreaCode" class="form-control" type="text">
31 29 </div>
32 30 </div>
33 31 <div class="form-group">
... ... @@ -48,10 +46,10 @@
48 46 type : "POST",
49 47 url : prefix + "/editBatchSave",
50 48 data : {
51   - "ids": $("input[name='ids']").val(),
  49 + "ids" : $("input[name='ids']").val(),
  50 + "materialAreaCode" : $("input[name='materialAreaCode']").val(),
52 51 "high" : $("#high option:selected").val(),
53 52 "status" : $("#status option:selected").val(),
54   - "area" : $("#area option:selected").val()
55 53 },
56 54 async : false,
57 55 error : function(request) {
... ...
src/main/resources/templates/config/location/location.html
... ... @@ -99,7 +99,7 @@
99 99 var datas = [[${@dict.getType('sys_normal_disable')}]];
100 100 var rowFlags = [[${@dict.getType('rowFlag')}]];
101 101 var high = [[${@dict.getType('high')}]];
102   - var locationTypes = [[${@dict.getType('locationType')}]];
  102 + var locationTypes = [[${@locationType.getLocationPrefix()}]];
103 103 var locationStatus = [[${@dict.getType('locationStatus')}]];
104 104 var zone =[[${@zone.getCode()}]];
105 105  
... ... @@ -126,6 +126,18 @@
126 126 title : '库位编码'
127 127 },
128 128 {
  129 + field : 'containerCode',
  130 + title : '容器编码'
  131 + },
  132 + {
  133 + field : 'status',
  134 + title : '状态' ,
  135 + align: 'center',
  136 + formatter: function(value, row, index) {
  137 + return $.table.selectDictLabel(locationStatus, value);
  138 + }
  139 + },
  140 + {
129 141 field : 'warehouseCode',
130 142 title : '仓库',
131 143 visible : false
... ... @@ -142,10 +154,6 @@
142 154 field : 'iLayer',
143 155 title : '层'
144 156 },
145   - // {
146   - // field : 'iGrid',
147   - // title : '格'
148   - // },
149 157 {
150 158 field : 'rowFlag',
151 159 title : '内外侧',
... ... @@ -164,21 +172,20 @@
164 172 field : 'roadway',
165 173 title : '巷道'
166 174 },
167   - // {
168   - // field : 'area',
169   - // title : '区域'
170   - // },
171 175 {
172 176 field : 'locationType',
173 177 title : '库位类型' ,
174 178 align: 'center',
175   - formatter: function(value, row, index) {
176   - return $.table.selectDictLabel(locationTypes, value);
177   - }
178   - },
179   - {
180   - field : 'containerCode',
181   - title : '容器编号'
  179 + formatter: function(value, row, index) {
  180 + var actions = [];
  181 + $.each(locationTypes, function(index, dict) {
  182 + if (dict.code == value) {
  183 + actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
  184 + return false;
  185 + }
  186 + });
  187 + return actions.join('');
  188 + }
182 189 },
183 190 {
184 191 field: 'zoneCode',
... ... @@ -196,12 +203,8 @@
196 203 }
197 204 },
198 205 {
199   - field : 'status',
200   - title : '状态' ,
201   - align: 'center',
202   - formatter: function(value, row, index) {
203   - return $.table.selectDictLabel(locationStatus, value);
204   - }
  206 + field : 'materialAreaCode',
  207 + title : '物料分区'
205 208 },
206 209 {
207 210 field : 'lastCycleCountDate',
... ...
src/main/resources/templates/config/locationType/locationType.html
... ... @@ -110,26 +110,6 @@
110 110 title : '高m'
111 111 },
112 112 {
113   - field : 'maxWeight',
114   - title : '最大重量kg'
115   - },
116   - {
117   - field : 'minQtyUm',
118   - title : '最小允许单位'
119   - },
120   - {
121   - field : 'checkDigit',
122   - title : '校验位'
123   - },
124   - {
125   - field : 'maxMaterials',
126   - title : '最多混放物料数'
127   - },
128   - {
129   - field : 'maxContainers',
130   - title : '最大允许托盘数'
131   - },
132   - {
133 113 field : 'created',
134 114 title : '创建时间'
135 115 },
... ... @@ -138,14 +118,6 @@
138 118 title : '创建用户'
139 119 },
140 120 {
141   - field : 'lastUpdated',
142   - title : '更新时间'
143   - },
144   - {
145   - field : 'lastUpdatedBy',
146   - title : '更新用户'
147   - },
148   - {
149 121 field : 'enable',
150 122 title : '是否有效',
151 123 formatter: function(value, row, index) {
... ...
src/main/resources/templates/config/material/edit.html
... ... @@ -128,36 +128,7 @@
128 128 <input id="minShelfLifeDays" name="minShelfLifeDays" class="form-control" type="text" th:field="*{minShelfLifeDays}">
129 129 </div>
130 130 </div>
131   - <!--<div class="form-group">
132   - <label class="col-sm-3 control-label">数据版本:</label>
133   - <div class="col-sm-8">
134   - <input id="version" name="version" class="form-control" type="text">
135   - </div>
136   - </div>-->
137   - <!--<div class="form-group"> -->
138   - <!--<label class="col-sm-3 control-label">创建时间:</label>-->
139   - <!--<div class="col-sm-8">-->
140   - <!--<input id="created" name="created" class="form-control" type="text">-->
141   - <!--</div>-->
142   - <!--</div>-->
143   - <!--<div class="form-group"> -->
144   - <!--<label class="col-sm-3 control-label">创建用户:</label>-->
145   - <!--<div class="col-sm-8">-->
146   - <!--<input id="createdBy" name="createdBy" class="form-control" type="text">-->
147   - <!--</div>-->
148   - <!--</div>-->
149   - <!--<div class="form-group"> -->
150   - <!--<label class="col-sm-3 control-label">最后修改间:</label>-->
151   - <!--<div class="col-sm-8">-->
152   - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">-->
153   - <!--</div>-->
154   - <!--</div>-->
155   - <!--<div class="form-group"> -->
156   - <!--<label class="col-sm-3 control-label">更新用户:</label>-->
157   - <!--<div class="col-sm-8">-->
158   - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">-->
159   - <!--</div>-->
160   - <!--</div>-->
  131 +
161 132  
162 133 <div class="form-group">
163 134 <label class="col-sm-3 control-label">状态:</label>
... ... @@ -171,60 +142,7 @@
171 142 </div>
172 143 </div>
173 144 </div>
174   - <!--<div class="form-group"> -->
175   - <!--<label class="col-sm-3 control-label">是否删除:</label>-->
176   - <!--<div class="col-sm-8">-->
177   - <!--<input id="deleted" name="deleted" class="form-control" type="text">-->
178   - <!--</div>-->
179   - <!--</div>-->
180   - <!--<div class="form-group"> -->
181   - <!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
182   - <!--<div class="col-sm-8">-->
183   - <!--<input id="userDef1" name="userDef1" class="form-control" type="text">-->
184   - <!--</div>-->
185   - <!--</div>-->
186   - <!--<div class="form-group"> -->
187   - <!--<label class="col-sm-3 control-label">自定义字段2:</label>-->
188   - <!--<div class="col-sm-8">-->
189   - <!--<input id="userDef2" name="userDef2" class="form-control" type="text">-->
190   - <!--</div>-->
191   - <!--</div>-->
192   - <!--<div class="form-group"> -->
193   - <!--<label class="col-sm-3 control-label">自定义字段3:</label>-->
194   - <!--<div class="col-sm-8">-->
195   - <!--<input id="userDef3" name="userDef3" class="form-control" type="text">-->
196   - <!--</div>-->
197   - <!--</div>-->
198   - <!--<div class="form-group"> -->
199   - <!--<label class="col-sm-3 control-label">自定义字段4:</label>-->
200   - <!--<div class="col-sm-8">-->
201   - <!--<input id="userDef4" name="userDef4" class="form-control" type="text">-->
202   - <!--</div>-->
203   - <!--</div>-->
204   - <!--<div class="form-group"> -->
205   - <!--<label class="col-sm-3 control-label">自定义字段5:</label>-->
206   - <!--<div class="col-sm-8">-->
207   - <!--<input id="userDef5" name="userDef5" class="form-control" type="text">-->
208   - <!--</div>-->
209   - <!--</div>-->
210   - <!--<div class="form-group"> -->
211   - <!--<label class="col-sm-3 control-label">自定义字段6:</label>-->
212   - <!--<div class="col-sm-8">-->
213   - <!--<input id="userDef6" name="userDef6" class="form-control" type="text">-->
214   - <!--</div>-->
215   - <!--</div>-->
216   - <!--<div class="form-group"> -->
217   - <!--<label class="col-sm-3 control-label">自定义字段7:</label>-->
218   - <!--<div class="col-sm-8">-->
219   - <!--<input id="userDef7" name="userDef7" class="form-control" type="text">-->
220   - <!--</div>-->
221   - <!--</div>-->
222   - <!--<div class="form-group"> -->
223   - <!--<label class="col-sm-3 control-label">自定义字段8:</label>-->
224   - <!--<div class="col-sm-8">-->
225   - <!--<input id="userDef8" name="userDef8" class="form-control" type="text">-->
226   - <!--</div>-->
227   - <!--</div>-->
  145 +
228 146 <div class="form-group">
229 147 <div class="form-control-static col-sm-offset-9">
230 148 <button type="submit" class="btn btn-primary">提交</button>
... ...