|
|
|
@ -19,11 +19,14 @@ package com.logpm.distribution.appcontroller;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient; |
|
|
|
|
import com.logpm.basicdata.vo.BasicdataGoodsAreaVO; |
|
|
|
|
import com.logpm.distribution.bean.Resp; |
|
|
|
|
import com.logpm.distribution.dto.app.StockupDTO; |
|
|
|
|
import com.logpm.distribution.entity.DistributionReservationEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockupEntity; |
|
|
|
|
import com.logpm.distribution.service.*; |
|
|
|
|
import com.logpm.distribution.vo.*; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@ -34,6 +37,7 @@ import org.springblade.common.constant.DictBizConstant;
|
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
@ -58,6 +62,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
private final IDistributionStockupService distributionStockupService; |
|
|
|
|
|
|
|
|
|
private final IDistributionReservationService distributionReservationService; |
|
|
|
|
private final IBasicdataGoodsAreaClient basicdataGoodsAreaClient; |
|
|
|
|
|
|
|
|
|
private final IDistributionStockService distributionStockService; |
|
|
|
|
private final IDistributionReservationPackageService distributionReservationPackageService; |
|
|
|
@ -103,7 +108,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
public R<Map<String,Object>> homePageList(@RequestBody StockupDTO stockupDTO) { |
|
|
|
|
// Integer current = stockupDTO.getCurrent();
|
|
|
|
|
// Integer size = stockupDTO.getSize();
|
|
|
|
|
String stockupId = stockupDTO.getStockupId(); |
|
|
|
|
Long stockupId = stockupDTO.getStockupId(); |
|
|
|
|
// if(Objects.isNull(current)){
|
|
|
|
|
// log.info("#################pageList: 当前页码不能为空");
|
|
|
|
|
// return R.fail(401,"当前页码不能为空");
|
|
|
|
@ -159,6 +164,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
for (DistributionStockupStockListVO vo:list){ |
|
|
|
|
planNum = planNum + vo.getPlanNum(); |
|
|
|
|
scanNum = scanNum + vo.getRealNum(); |
|
|
|
|
// Boolean aBoolean = distributionStockupService.getClientStockupTray(reservationId, vo.getAllocationId());
|
|
|
|
|
// vo.setTrayLean(aBoolean);
|
|
|
|
|
} |
|
|
|
|
map.put("planNum",planNum); |
|
|
|
|
map.put("scanNum",scanNum); |
|
|
|
@ -242,7 +249,7 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@PostMapping("/scanningCode") |
|
|
|
|
@ApiOperation(value = "整托扫码") |
|
|
|
|
@ApiOperation(value = "整托备货") |
|
|
|
|
public R scanningCodelist(@RequestBody StockupDTO stockupDTO){ |
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getStockupId())){ |
|
|
|
|
return R.fail(3002,"备货id不能为空"); |
|
|
|
@ -253,9 +260,45 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getTrayId())){ |
|
|
|
|
return R.fail(3002,"托盘码不能为空"); |
|
|
|
|
} |
|
|
|
|
boolean b = distributionStockupService.addPackTrayList(stockupDTO); |
|
|
|
|
R b = distributionStockupService.addPackTrayList(stockupDTO); |
|
|
|
|
return b; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PutMapping("/updateStockArea") |
|
|
|
|
@ApiOperation(value = "修改备货区") |
|
|
|
|
public R updateStockArea(@RequestBody StockupDTO stockupDTO){ |
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getStockupId())){ |
|
|
|
|
return R.fail(3002,"备货任务id不能为空"); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getStockupAreaId())){ |
|
|
|
|
return R.fail(3002,"备货区Id不能为空"); |
|
|
|
|
} |
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getStockupArea())){ |
|
|
|
|
return R.fail(3002,"备货区名称不能为空"); |
|
|
|
|
} |
|
|
|
|
DistributionStockupEntity distributionStockupEntity = new DistributionStockupEntity(); |
|
|
|
|
distributionStockupEntity.setGoodsAreaId(stockupDTO.getStockupAreaId()); |
|
|
|
|
distributionStockupEntity.setId(stockupDTO.getStockupId()); |
|
|
|
|
distributionStockupEntity.setStockupArea(stockupDTO.getStockupArea()); |
|
|
|
|
return R.data(distributionStockupService.updateById(distributionStockupEntity)); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@PostMapping("/getStockupArea") |
|
|
|
|
@ApiOperation(value = "查询可修改备货区") |
|
|
|
|
public R getGoodsArea(@RequestBody StockupDTO stockupDTO){ |
|
|
|
|
|
|
|
|
|
return R.data(b); |
|
|
|
|
if(ObjectUtils.isNull(stockupDTO.getUserId())){ |
|
|
|
|
return R.fail(3002,"当前操作人ID不能为空"); |
|
|
|
|
} |
|
|
|
|
Long userId = AuthUtil.getUserId(); |
|
|
|
|
if(stockupDTO.getUserId().equals(userId)){ |
|
|
|
|
String deptId = AuthUtil.getDeptId(); |
|
|
|
|
return R.data(basicdataGoodsAreaClient.getDepartmentId(Long.parseLong(deptId))); |
|
|
|
|
}else{ |
|
|
|
|
R.fail(3005,"操作人不对!"); |
|
|
|
|
} |
|
|
|
|
return R.fail(500,"未知错误!"); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -270,7 +313,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
//包件扫描
|
|
|
|
|
String orderCode = stockupDTO.getOrderCode();//订单自编号
|
|
|
|
|
String packetBarCode = stockupDTO.getPacketBarCode();//包件码
|
|
|
|
|
String stockupArea = stockupDTO.getStockupArea();//备货区
|
|
|
|
|
// String stockupArea = stockupDTO.getStockupArea();//备货区
|
|
|
|
|
Long stockupId = stockupDTO.getStockupId();//备货任务ID
|
|
|
|
|
Long reservationId = stockupDTO.getReservationId();//预约单id
|
|
|
|
|
if(StringUtil.isBlank(orderCode)){ |
|
|
|
|
log.warn("##################stockupScan: 包件扫码,订单自编号为空"); |
|
|
|
@ -280,9 +324,9 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
log.warn("##################stockupScan: 包件扫码,包件码为空"); |
|
|
|
|
return R.fail("包件扫码:包件码不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(stockupArea)){ |
|
|
|
|
log.warn("##################stockupScan: 包件扫码,备货区为空"); |
|
|
|
|
return R.fail("包件扫码:备货区不能为空"); |
|
|
|
|
if(ObjectUtils.isNull(stockupId)){ |
|
|
|
|
log.warn("##################stockupId: 包件扫码,备货区为空"); |
|
|
|
|
return R.fail("包件扫码:备货任务ID不能为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(reservationId)){ |
|
|
|
|
log.warn("##################stockupScan: 包件扫码,预约单id为空"); |
|
|
|
@ -293,7 +337,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
DistributionStockEntity entity = new DistributionStockEntity(); |
|
|
|
|
entity.setOrderSelfNumbering(orderCode); |
|
|
|
|
entity.setCoding(packetBarCode); |
|
|
|
|
entity.setStockupArea(stockupArea); |
|
|
|
|
// entity.setStockupArea(stockupArea);
|
|
|
|
|
entity.setStockupId(stockupId); |
|
|
|
|
entity.setReservationId(reservationId); |
|
|
|
|
entity.setConditions("0"); |
|
|
|
|
entity.setType(2); |
|
|
|
@ -316,14 +361,15 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
Long reservationId = stockupDTO.getReservationId(); |
|
|
|
|
Long stockListId = stockupDTO.getStockListId(); |
|
|
|
|
String packetBarCode = stockupDTO.getPacketBarCode(); |
|
|
|
|
String stockupArea = stockupDTO.getStockupArea();//备货区
|
|
|
|
|
// String stockupArea = stockupDTO.getStockupArea();//备货区
|
|
|
|
|
Long stockupId = stockupDTO.getStockupId();//备货区
|
|
|
|
|
if(StringUtil.isBlank(packetBarCode)){ |
|
|
|
|
log.warn("##################stockupScan: 库存品扫码,包件码为空"); |
|
|
|
|
return R.fail("库存品扫码:包件码不能为空"); |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(stockupArea)){ |
|
|
|
|
if(ObjectUtils.isNull(stockupId)){ |
|
|
|
|
log.warn("##################stockupScan: 库存品扫码,备货区为空"); |
|
|
|
|
return R.fail("库存品扫码:备货区不能为空"); |
|
|
|
|
return R.fail("库存品扫码:备货任务ID不能为空"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(stockListId)){ |
|
|
|
|
log.warn("##################stockupScan: 库存品扫码,库存品id为空"); |
|
|
|
@ -337,7 +383,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
//先保存扫码包件信息,后续由队列来出来余下补充信息
|
|
|
|
|
DistributionStockEntity entity = new DistributionStockEntity(); |
|
|
|
|
entity.setCoding(packetBarCode); |
|
|
|
|
entity.setStockupArea(stockupArea); |
|
|
|
|
// entity.setStockupArea(stockupArea);
|
|
|
|
|
entity.setStockupId(stockupId); |
|
|
|
|
entity.setReservationId(reservationId); |
|
|
|
|
entity.setStockListId(stockListId); |
|
|
|
|
//添加物料信息
|
|
|
|
|