Commit 5cce083a606a3f06660347b2614d16426656e418

Authored by mahuandong
1 parent fdcf40a0

修改收货是是否收完的判断

src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
... ... @@ -212,6 +212,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService
212 212 * @param receiptContainerDetail
213 213 * @return
214 214 */
  215 + @Override
215 216 public String taskPositioning(ReceiptContainerDetail receiptContainerDetail){
216 217 ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId());
217 218 String locatingRule = receiptContainerHeader.getLocatingRule(); //定位规则
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... ... @@ -37,6 +37,10 @@ import java.util.Arrays;
37 37 import java.util.Comparator;
38 38 import java.util.List;
39 39  
  40 +/**
  41 + * 入库组盘头表控制
  42 + * @author mahuaheng
  43 + */
40 44 @Controller
41 45 @RequestMapping("/receipt/receiptContainerHeader")
42 46 public class ReceiptContainerHeaderController extends BaseController {
... ... @@ -155,8 +159,10 @@ public class ReceiptContainerHeaderController extends BaseController {
155 159 LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery();
156 160 lambda.eq(ReceiptContainerDetail::getReceiptContainerId, idList.get(i));
157 161 List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda);
158   - for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails)
159   - receivingService.position(receiptContainerDetail);
  162 + for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails){
  163 + receivingService.position(receiptContainerDetail);
  164 + }
  165 +
160 166 }
161 167 return AjaxResult.success("定位成功");
162 168 }
... ... @@ -177,8 +183,9 @@ public class ReceiptContainerHeaderController extends BaseController {
177 183 LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery();
178 184 lambda.eq(ReceiptContainerDetail::getReceiptContainerId, idList.get(i));
179 185 List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda);
180   - for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails)
  186 + for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails) {
181 187 receivingService.cancelPosition(receiptContainerDetail);
  188 + }
182 189 }
183 190 return AjaxResult.success("取消定位成功");
184 191 }
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... ... @@ -130,7 +130,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
130 130  
131 131 receiptContainerDetailAdd(receiptContainerHeaders.get(0).getId(), receiptDetail, qty, containerCode, locationCode);
132 132 //如果单据数量等于已收数量,更新入库详情状态和入库单状态
133   - if (receiptDetail.getTotalQty() == receiptDetail.getOpenQty()){
  133 + if (receiptDetail.getTotalQty().equals(receiptDetail.getOpenQty())){
134 134 receiptDetail.setProcessStamp("200");
135 135 if (!receiptDetailService.updateById(receiptDetail)){
136 136 throw new ServiceException("更新入库详情处理标记失败");
... ... @@ -214,7 +214,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
214 214 lambdaQueryWrapper.eq(Material::getCode, materialCode);
215 215 Material material = materialService.getOne(lambdaQueryWrapper);
216 216 if (material.getAutoGenSerialNum() == 0){
217   - return 1; //需自动生成容器编码
  217 + return 1;
  218 + //需自动生成容器编码
218 219 } else {
219 220 throw new ServiceException("容器不能为空");
220 221 }
... ... @@ -233,9 +234,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
233 234 lambdaQueryWrapper.eq(TaskHeader::getContainerCode, containerCode)
234 235 .lt(TaskHeader::getStatus, 100)
235 236 .eq(TaskHeader::getWarehouseCode, ShiroUtils.getWarehouseCode());
236   - if (taskHeaderService.count(lambdaQueryWrapper) > 0)
  237 + if (taskHeaderService.count(lambdaQueryWrapper) > 0){
237 238 throw new ServiceException("容器已经存在任务,请更换容器");
238   -
  239 + }
239 240 if ("empty".equals(container.getStatus())){
240 241 return 100;
241 242 }else if ("some".equals(container.getStatus())) {
... ... @@ -257,10 +258,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
257 258 Boolean checkLocationCode(String locationCode, String containerCode, Integer taskType) {
258 259 //如果选了库位,就要校验库位和已经组盘的库位是否一致,避免重入库
259 260 if (StringUtils.isEmpty(locationCode)) {
260   - if ("200".equals(locationCode))
  261 + if ("200".equals(locationCode)) {
261 262 throw new ServiceException("补充入库,必须填写库位");
262   - else
  263 + } else {
263 264 return true;
  265 + }
264 266 }
265 267  
266 268 //查询组盘头表
... ... @@ -272,10 +274,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
272 274 ReceiptContainerHeader receiptContainerHeader = this.getOne(lambda);
273 275  
274 276 if (receiptContainerHeader != null) {
275   - if (receiptContainerHeader.getToLocation().equals(locationCode))
  277 + if (receiptContainerHeader.getToLocation().equals(locationCode)) {
276 278 return true;
277   - else
  279 + } else {
278 280 throw new ServiceException("容器(" + containerCode + ")对应的库位是:" + receiptContainerHeader.getToLocation());
  281 + }
279 282 }
280 283  
281 284 LambdaQueryWrapper<Location> lambdaLocation = Wrappers.lambdaQuery();
... ... @@ -283,20 +286,23 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
283 286 .eq(Location::getDeleted, false)
284 287 .eq(Location::getCode, locationCode);
285 288 Location location = locationService.getOne(lambdaLocation);
286   - if (location == null)
  289 + if (location == null) {
287 290 throw new ServiceException("库位不存在!");
288   - if (location.getStatus().equals("empty") == false)
  291 + }
  292 + if (!"empty".equals(location.getStatus()) ) {
289 293 throw new ServiceException("库位不是空闲状态!");
  294 + }
290 295 if ("100".equals(taskType)) {
291   - if (com.huaheng.common.utils.StringUtils.isNotEmpty(location.getContainerCode()))
  296 + if (StringUtils.isNotEmpty(location.getContainerCode())){
292 297 throw new ServiceException("库位(" + containerCode + ")有容器(" + location.getContainerCode() + "),不能整盘入库!");
  298 + }
293 299 }
294 300 if("200".equals(taskType)) {
295   - if (com.huaheng.common.utils.StringUtils.isEmpty(location.getContainerCode()))
  301 + if (com.huaheng.common.utils.StringUtils.isEmpty(location.getContainerCode())) {
296 302 throw new ServiceException("库位(" + locationCode + ")没有容器,不能补充入库!");
297   - else
298   - if (location.getContainerCode().equals(containerCode) == false)
  303 + } else if (!location.getContainerCode().equals(containerCode)) {
299 304 throw new ServiceException("库位(" + containerCode + ")对应的容器是:" + location.getContainerCode()+ ",请重选库位!");
  305 + }
300 306 }
301 307  
302 308 LambdaQueryWrapper<Location> lambdaQueryWrapper = Wrappers.lambdaQuery();
... ...
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... ... @@ -84,12 +84,13 @@ public class ReceivingService {
84 84 @Transactional
85 85 public Boolean position(ReceiptContainerDetail receiptContainerDetail){
86 86 ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId());
87   - if (!(0 ==receiptContainerHeader.getStatus())){
  87 + if (0 !=receiptContainerHeader.getStatus()){
88 88 throw new ServiceException("该入库组盘已生成任务不能重新定位");
89 89 }
90 90 //如果入库组盘表中有目标库位说明已经指定
91 91 if (StringUtils.isNotEmpty(receiptContainerHeader.getToLocation())){return true;}
92   - String locatingRule = receiptContainerHeader.getLocatingRule(); //定位规则
  92 + /*定位规则*/
  93 + String locatingRule = receiptContainerHeader.getLocatingRule();
93 94 if (StringUtils.isEmpty(locatingRule)){
94 95 locatingRule = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()).getLocatingRule();
95 96 //入库单明细定位规则不为空时执行
... ... @@ -177,7 +178,7 @@ public class ReceivingService {
177 178 public AjaxResult cancelPosition(ReceiptContainerDetail receiptContainerDetail){
178 179 //查询入库组盘头
179 180 ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId());
180   - if (!(receiptContainerHeader.getStatus() == 0)){
  181 + if (receiptContainerHeader.getStatus() != 0){
181 182 throw new ServiceException("组盘已生成任务不能取消定位");
182 183 }
183 184 //将入库组盘头表中的而库位编码赋值null
... ...