Browse Source

Merge remote-tracking branch 'origin/dev' into dev

pull/8/head
pref_mail@163.com 1 year ago
parent
commit
436cc3e641
  1. 10
      blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  2. 4
      blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  3. 28
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java
  4. 21
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/SyncTaskErrorLogEntity.java
  5. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java
  6. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  7. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownTypeClient.java
  8. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/PositionVO.java
  9. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestContrastVO.java
  10. 33
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskPackagelistVO.java
  11. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskallocationVO.java
  12. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java
  13. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTrayService.java
  14. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java
  15. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java
  16. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  17. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  18. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  19. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  20. 153
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  21. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  22. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  23. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  24. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  25. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  26. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  27. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  28. 2
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/controller/OrderController.java
  29. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java
  30. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/receiver/SyncUpdownDataHandler.java
  31. 6
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  32. 2
      blade-service/logpm-report/Dockerfile
  33. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  34. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  35. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  36. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  37. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  38. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  39. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  40. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  41. 21
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  42. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  43. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  44. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java
  45. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  46. 16
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java
  47. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java
  48. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java
  49. 20
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java
  50. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/SyncTaskErrorLogMapper.java
  51. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java
  52. 70
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  53. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  54. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  55. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IAsyncDataService.java
  56. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ISyncTaskErrorLogService.java
  57. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  58. 18
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  59. 18
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java
  60. 781
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java
  61. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/SyncTaskErrorLogServiceImpl.java
  62. 579
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  63. 44
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  64. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java
  65. 86
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

10
blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@ -43,11 +43,11 @@ public class LauncherServiceImpl implements LauncherService {
// PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos");
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123");
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos");
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123");
// dubbo注册
PropsUtil.setProperty(props, "dubbo.application.name", appName);
PropsUtil.setProperty(props, "dubbo.application.qos.enable", "false");

4
blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@ -250,8 +250,8 @@ public class CommonUtil {
public static String getHaxCodeByLong(String str,int changdu){
int hashValue = str.hashCode(); // 获取哈希值(32位)
long time = new Date().getTime();
int hashValue = (str+time).hashCode(); // 获取哈希值(32位)
// 将32位哈希值转换为6位长度的纯数字形式
String s = Math.abs(hashValue) + "";
String substring = s.substring(0, changdu);

28
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java

@ -91,6 +91,11 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "盘点方式;1. 随机 2 库位3 订单 4 托盘")
private Integer questType;
/**
* 盘点方式;1. 随机 2 库位3 订单 4 托盘
*/
@ApiModelProperty(value = "有无数据;1.有数据 0无数据")
private Integer hasData;
/**
* 盘点对象;1.定制品 2零担 3 库存品
*/
@ -198,6 +203,19 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "托盘id")
private String trayId;
/**
* 新托盘id
*/
@ApiModelProperty(value = "新托盘id")
private Long newTrayId;
/**
* 新托盘编码
*/
@ApiModelProperty(value = "新托盘编码")
private String newTrayCode;
/**
* 货位id
*/
@ -209,7 +227,17 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "是否是新增数据")
private Integer isNew;
/**
* 是否是变更 0否 1是
*/
@ApiModelProperty(value = "是否是变更 0否 1是")
private Integer isChange;
/**
* 是否是变更 0否 1是
*/
@ApiModelProperty(value = "是否是变更库位托盘 0否 1是")
private Integer isChangeAt;
/**
* 货位
*/

21
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/SyncTaskErrorLogEntity.java

@ -0,0 +1,21 @@
package com.logpm.warehouse.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_sync_task_error_log")
@ApiModel(value = "SyncTaskErrorLog对象", description = "同步盘点错误日志")
@EqualsAndHashCode(callSuper = true)
public class SyncTaskErrorLogEntity extends TenantEntity {
private String questNum;
private Long questDetailId;
private String msg;
}

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java

@ -65,7 +65,7 @@ public interface IWarehouseTrayGoodsClient {
* 通过主表Id删除所有关联表
*/
@PostMapping(TOP+"/delByTrayByCode")
Boolean delByTrayByCode(@RequestParam String code);
Boolean delByTrayByCode(@RequestParam String code,@RequestParam String remark);
/**
* 通过托盘id查询托盘上面的货物
*

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java

@ -68,10 +68,10 @@ public interface IWarehouseTrayTypeClient {
List<JSONObject> findAllGoodsByTrayCodeAndWarehouseId(@RequestParam String trayCode, @RequestParam Long warehouseId);
@GetMapping(API_PREFIX+"/deleteZeroOrderByTrayCode")
void deleteZeroOrderByTrayCode(@RequestParam String orderCode, @RequestParam String palletCode, @RequestParam Long wid);
void deleteZeroOrderByTrayCode(@RequestParam String orderCode, @RequestParam String palletCode, @RequestParam Long wid, @RequestParam String remark);
@GetMapping(API_PREFIX+"/changeTrayWarehouseInfo")
void changeTrayWarehouseInfo(@RequestParam String trayCode, @RequestParam Long warehouseId);
@GetMapping(API_PREFIX+"/trayToNull")
void trayToNull(@RequestParam String trayCode);
void trayToNull(@RequestParam String trayCode,@RequestParam String remark);
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownTypeClient.java

@ -42,7 +42,7 @@ public interface IWarehouseUpdownTypeClient {
String TOP = API_PREFIX + "/top";
@GetMapping(TOP + "/downPackage")
R downPackage(@RequestParam("orderPackageCodes") String orderPackageCodes, @RequestParam("warehouseId") Long warehouseId);
R downPackage(@RequestParam("orderPackageCodes") String orderPackageCodes, @RequestParam("warehouseId") Long warehouseId,@RequestParam("remark") String remark);
@GetMapping(TOP + "/downDeliveryPackage")
@ -58,7 +58,7 @@ public interface IWarehouseUpdownTypeClient {
boolean packageChangeStock(@RequestBody List<String> orderPackageCodes);
@GetMapping(TOP + "/downPackageOrDelTray")
R downPackageOrDelTray(@RequestParam("orderPackageCodes") String orderPackageCodes, @RequestParam("warehouseId") Long warehouseId);
R downPackageOrDelTray(@RequestParam("orderPackageCodes") String orderPackageCodes, @RequestParam("warehouseId") Long warehouseId,@RequestParam("remark") String remark);
@GetMapping(TOP + "/downTray")
R downTray(@RequestParam("trayCode") String trayCode, @RequestParam("warehouseId") Long warehouseId);
@ -67,7 +67,7 @@ public interface IWarehouseUpdownTypeClient {
boolean upShelfTray(@RequestParam("trayCode") String trayCode, @RequestParam("locationId") Long locationId, @RequestParam("warehouseId") Long warehouseId);
@GetMapping(TOP + "/upShelfPackage")
boolean upShelfPackage(@RequestParam String orderPackageCode, @RequestParam Long locationId, @RequestParam Long warehouseId);
boolean upShelfPackage(@RequestParam String orderPackageCode, @RequestParam Long locationId, @RequestParam Long warehouseId,@RequestParam String remark);
@GetMapping(TOP + "/findUpdownTypeInforByAllocationId")
R findUpdownTypeInforByAllocationId(@RequestParam Long allocationId, @RequestParam Long warehouseId);

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/PositionVO.java

@ -10,9 +10,12 @@ public class PositionVO implements Serializable {
private String areaName;//货区
private String shelfName;//货架
private String allocationName;//货位
private String positionCode;//完整货位
private String warehouseName;//仓库
private String trayCode;//托盘
private String trayName;//托盘名称
private Integer num;//数量
private Long allocationId;//库位id
private Long trayId;//托盘id
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestContrastVO.java

@ -94,6 +94,12 @@ public class QuestContrastVO {
* 更新的货物信息
*/
private String groundingPositionCode;
/**
* 更新的托盘信息
*/
private String newTrayCode;
/**
* 货物状态
*/

33
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskPackagelistVO.java

@ -1,7 +1,6 @@
package com.logpm.warehouse.vo;
import com.logpm.warehouse.entity.QuestDetailChildEntity;
import com.logpm.warehouse.entity.QuestDetailEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -40,6 +39,36 @@ public class TaskPackagelistVO {
@ApiModelProperty(value = "库位信息")
private String allocation;
/**
* 托盘id
*/
@ApiModelProperty(value = "托盘id")
private String trayId;
/**
* 托盘码
*/
@ApiModelProperty(value = "托盘码")
private String trayCode;
/**
* 托盘名称
*/
@ApiModelProperty(value = "托盘名称")
private String trayName;
/**
* 货位id
*/
@ApiModelProperty(value = "货位id")
private String allocationId;
/**
* 货位
*/
@ApiModelProperty(value = "货位")
private String positionCode;
/**
* 订单号
@ -55,7 +84,7 @@ public class TaskPackagelistVO {
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer quantity;
private Integer stockNum;
/**
* 盘点方式

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskallocationVO.java

@ -15,7 +15,7 @@ public class TaskallocationVO {
* 货位id
*/
@ApiModelProperty(value = "货位id")
private Long allocationId;
private String allocationId;
/**

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTrayController.java

@ -154,7 +154,7 @@ public class BasicdataTrayController extends BladeController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "空置", notes = "传入BasicdataTray")
public R vacant(@Valid @RequestBody BasicdataTrayEntity BasicdataTray) {
return R.status(trayService.vacantById(BasicdataTray));
return R.status(trayService.vacantById(BasicdataTray,"托盘空置"));
}
/**
@ -164,7 +164,7 @@ public class BasicdataTrayController extends BladeController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "空置", notes = "传入BasicdataTray")
public R vacants(@Valid @RequestBody List<String> codes) {
return R.status(trayService.vacantBycodes(codes));
return R.status(trayService.vacantBycodes(codes,"托盘空置"));
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTrayService.java

@ -99,7 +99,7 @@ public interface IBasicdataTrayService extends BaseService<BasicdataTrayEntity>
/**
* 托盘 一键空闲
*/
Boolean vacantById(BasicdataTrayEntity basicdataTray);
Boolean vacantById(BasicdataTrayEntity basicdataTray,String remark);
/**
* 托盘 打印包条
*/
@ -127,5 +127,5 @@ public interface IBasicdataTrayService extends BaseService<BasicdataTrayEntity>
* @param codes
* @return
*/
Boolean vacantBycodes(List<String> codes);
Boolean vacantBycodes(List<String> codes,String remark);
}

11
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java

@ -38,9 +38,6 @@ import com.logpm.basicdata.vo.BasicdataStockArticleVO;
import com.logpm.basicdata.vo.BasicdataTrayVO;
import com.logpm.basicdata.vo.WarehouseParcelListVO;
import com.logpm.basicdata.vo.WarehouseStockListVO;
import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO;
import com.logpm.warehouse.entity.WarehouseTrayEntity;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.vo.WarehouseTrayQRCode;
import com.logpm.warehouse.vo.WarehouseTraybarCode;
@ -198,7 +195,7 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
}
@Override
public Boolean vacantById(BasicdataTrayEntity basicdataTray) {
public Boolean vacantById(BasicdataTrayEntity basicdataTray,String remark) {
// //删除托盘货物绑定表
// Boolean aBoolean = warehouseTrayGoodsClient.removeByMasterId(basicdataTray.getId());
// //删除托盘打托方式表
@ -206,7 +203,7 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
// log.info("删除托盘货物绑定表>>>>>>>>>>>>>>>>{}",aBoolean);
// log.info("删除托盘打托方式表>>>>>>>>>>>>>>>>{}",aBoolean1);
log.info("basicdataTray>>>>>>>>>>>>>>{}",basicdataTray.getPalletCode());
Boolean aBoolean = warehouseTrayGoodsClient.delByTrayByCode(basicdataTray.getPalletCode());
Boolean aBoolean = warehouseTrayGoodsClient.delByTrayByCode(basicdataTray.getPalletCode(),remark);
//修改托盘表状态
// boolean update = this.update(new UpdateWrapper<BasicdataTrayEntity>().lambda()
// .eq(BasicdataTrayEntity::getId, basicdataTray.getId())
@ -305,9 +302,9 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
}
@Override
public Boolean vacantBycodes(List<String> codes) {
public Boolean vacantBycodes(List<String> codes,String remark) {
for (String code : codes) {
Boolean aBoolean = warehouseTrayGoodsClient.delByTrayByCode(code);
Boolean aBoolean = warehouseTrayGoodsClient.delByTrayByCode(code,remark);
}
return true;
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java

@ -160,7 +160,7 @@ public class DistributionSignforAppController {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId());
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"签收下架解托");
}
}catch (Exception e){
@ -251,7 +251,7 @@ public class DistributionSignforAppController {
}
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId());
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"司机一键签收下架解托");
}catch (Exception e){
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}",packageCodes);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -51,7 +51,6 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.pda.PdaAudioLingoStatus;
import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant;
@ -1430,6 +1429,7 @@ public class DistributionStockupAppController extends BladeController {
jsonObject.put("incomingBatch", byId.getIncomingBatch());
jsonObject.put("enterNum", 1);
jsonObject.put("allocationId", stockupDTO.getAllocationId());
jsonObject.put("remark","备货无数据库存品下架");
List<JSONObject> list = new ArrayList<>();
list.add(jsonObject);
R r = warehouseUpdownTypeClient.downStock(list);
@ -1438,7 +1438,7 @@ public class DistributionStockupAppController extends BladeController {
// return Resp.scanFail("下架失败,请联系管理员!!", "下架失败,请联系管理员!!");
}
} else {
R r = warehouseUpdownTypeClient.downPackage(packetBarCode, byId.getWarehouseId());
R r = warehouseUpdownTypeClient.downPackage(packetBarCode, byId.getWarehouseId(),"备货下架包件");
if (r.getCode() != 200) {
log.debug("##########" + r.getMsg());
// return Resp.scanFail("下架失败,请联系管理员!!", "下架失败,请联系管理员!!");

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -497,7 +497,7 @@ public class DistributionDeliveryListController extends BladeController {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"签收下架解托");
}
}catch (Exception e){

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -297,7 +297,7 @@ public class DistributionSignforController extends BladeController {
orderPackageCodes = orderPackageCodes + "," +packageCode;
}
}
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId());
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"文员一键签收下架解托");
}catch (Exception e){
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}",packageCodes);
}

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -229,4 +229,24 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
DistributionParcelListNodeVO selectPackageExamineAbnormal(@Param("orderPackageCode") String orderPackageCode,@Param("warehouseId") Long warehouseId);
String findOrderWaybillNo(@Param("orderId") Long orderId);
/**
* 查询自提包件计划记录
* @param orderPackageCode
* @param id
* @return
*/
List<DistributionParcelListNodeVO> selectPackagePlanBillLading(@Param("orderPackageCode")String orderPackageCode,@Param("warehouseId") Long warehouseId);
/**
* 查询自提签收扫描记录
* @param orderPackageCode
* @param id
* @return
*/
List<DistributionParcelListNodeVO> selectPackageSignForlBillLading(@Param("orderPackageCode")String orderPackageCode,@Param("warehouseId") Long warehouseId);
List<DistributionParcelListNodeVO> selectPackageCancelBillLading(@Param("orderPackageCode")String orderPackageCode,@Param("warehouseId") Long warehouseId);
}

153
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -38,68 +38,22 @@
select ldsa.mall_name mallName,ldpl.order_code orderCode,ldpl.id,ldpl.conditions,ldpl.order_package_code orderPackageCode,ldsa.id stockArticleId,
ldsa.mall_id mallId,ldsa.genre ,ldsa.is_zero isZero,ldpl.send_warehouse_name sendWarehouseName,ldpl.second,ldpl.third_product thirdProduct,
ldpl.waybill_number waybillNumber,ldpl.firsts,ldpl.quantity,ldpl.warehouse_id warehouseId,ldpl.material_name materialName,ldpl.material_code materialCode,
CASE WHEN ldpl.conditions = 1 THEN
(select GROUP_CONCAT(tray_id)
from logpm_warehouse_tray_goods
where association_id = ldpl.id )
WHEN ldpl.conditions = 2 THEN
(select GROUP_CONCAT(tray_id)
from logpm_warehouse_tray_goods
where association_id = ldpl.material_id and incoming_batch = ldpl.order_code and market_id = ldsa.mall_id)
ELSE
( select GROUP_CONCAT(tray_id)
from logpm_warehouse_tray_goods
where association_id = ldpl.stock_article_id)
END trayId,
CASE WHEN ldpl.conditions = 1 THEN
(select GROUP_CONCAT(tray_code)
from logpm_warehouse_tray_goods
where association_id = ldpl.id )
WHEN ldpl.conditions = 2 THEN
(select GROUP_CONCAT(tray_code)
from logpm_warehouse_tray_goods
where association_id = ldpl.material_id and incoming_batch = ldpl.order_code and market_id = ldsa.mall_id)
ELSE
( select GROUP_CONCAT(tray_code)
from logpm_warehouse_tray_goods
where association_id = ldpl.stock_article_id)
END trayCode,
CASE WHEN ldpl.conditions = 1 THEN
(select GROUP_CONCAT(allocation_id)
from logpm_warehouse_updown_goods
where association_id = ldpl.id )
WHEN ldpl.conditions = 2 THEN
(select GROUP_CONCAT(allocation_id)
from logpm_warehouse_updown_goods
where association_id = ldpl.material_id and incoming_batch = ldpl.order_code and market_id = ldsa.mall_id)
ELSE
( select GROUP_CONCAT(allocation_id)
from logpm_warehouse_updown_goods
where association_id = ldpl.stock_article_id)
END allocationId,
CASE WHEN ldpl.conditions = 1 THEN
(select GROUP_CONCAT(position_code)
from logpm_warehouse_updown_goods
where association_id = ldpl.id )
WHEN ldpl.conditions = 2 THEN
(select GROUP_CONCAT(position_code)
from logpm_warehouse_updown_goods
where association_id = ldpl.material_id and incoming_batch = ldpl.order_code and market_id = ldsa.mall_id)
ELSE
( select GROUP_CONCAT(position_code)
from logpm_warehouse_updown_goods
where association_id = ldpl.stock_article_id)
END positionCode,
CASE WHEN ldpl.conditions = 2 THEN
(select GROUP_CONCAT(DISTINCT id)
from logpm_distribution_stock_list
where material_id = ldpl.material_id and incoming_batch = ldpl.order_code and market_id = ldsa.mall_id)
END stockId ,ldsa.brand brandName
ldsa.brand brandName,
lwtg.tray_id trayId,
lwtg.tray_code trayCode,
lwug.allocation_id allocationId,
lwug.position_code positionCode,
CASE
WHEN ldpl.conditions = 2 THEN
( SELECT GROUP_CONCAT( DISTINCT id ) FROM logpm_distribution_stock_list WHERE material_id = ldpl.material_id AND incoming_batch = ldpl.order_code AND market_id = ldsa.mall_id )
END stockId
from logpm_distribution_stock_article ldsa
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
left join logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = '3'
<where>
ldsa.warehouse_id = #{param.warehouseId} and ldpl.order_package_status in (20,30,40)
ldsa.warehouse_id = #{param.warehouseId} and ldpl.order_package_status = '20'
<if test="param.mallId != null and param.mallId != ''"> and ldsa.mall_id = #{param.mallId} </if>
<if test="param.genre != null and param.genre != ''">and ldsa.genre = #{param.genre}</if>
<if test="param.isZero != null and param.isZero != ''">and ldsa.is_zero = #{param.isZero}</if>
@ -1346,6 +1300,85 @@
and ldpl.waybill_number is not null
and ldpl.waybill_number != ''
</select>
<select id="selectPackagePlanBillLading"
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO">
SELECT
ldpl.order_code AS orderCode,
ldpl.order_package_code AS orderPackageCode,
ldpl.warehouse AS warehouseName,
ldpl.warehouse_id AS warehouseId,
ldpl.quantity AS quantity,
ldpl.train_number AS tranNumber,
ldpl.waybill_number AS waybillNumber,
ldbl.create_time AS nodeTime,
ldbl.create_user AS nodeControlsUserId,
'自提配送' AS nodeName,
lwt.pallet_name,
lwga.qr_code,
CASE ldbp.packet_bar_status
WHEN '3' THEN CONCAT('提货新增计划配送成功,自提单:',ldbl.pickup_batch)
ELSE CONCAT('计划提货,自提单:',ldbl.pickup_batch)
END description
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbp.bill_lading_id = ldbl.id
LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.order_package_code = lwug.association_value
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.order_package_code = lwtg.association_value
LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id
WHERE
ldpl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId}
AND ldbp.is_deleted = 0
</select>
<select id="selectPackageSignForlBillLading"
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO">
SELECT
ldpl.order_code AS orderCode,
ldpl.order_package_code AS orderPackageCode,
ldpl.warehouse AS warehouseName,
ldpl.warehouse_id AS warehouseId,
ldpl.quantity AS quantity,
ldbl.pickup_batch AS tranNumber,
ldpl.waybill_number AS waybillNumber,
ldbls.create_time AS nodeTime,
ldbls.create_user AS nodeControlsUserId,
'扫描签收' AS nodeName,
CONCAT( '签收操作成功' ) AS description
FROM
logpm_distribution_bill_lading_scan AS ldbls
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbls.parcel_list_id = ldpl.id
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbls.bill_lading_id = ldbl.id
WHERE
ldpl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId}
AND ldbls.is_deleted = 0
</select>
<select id="selectPackageCancelBillLading"
resultType="com.logpm.distribution.vo.DistributionParcelListNodeVO">
SELECT
ldpl.order_code AS orderCode,
ldpl.order_package_code AS orderPackageCode,
ldpl.warehouse AS warehouseName,
ldpl.warehouse_id AS warehouseId,
ldpl.quantity AS quantity,
ldpl.train_number AS tranNumber,
ldpl.waybill_number AS waybillNumber,
ldbl.update_time AS nodeTime,
ldbl.update_user AS nodeControlsUserId,
'自提取消' AS nodeName,
lwt.pallet_name,
lwga.qr_code,
CONCAT('取消提货,自提单:',ldbl.pickup_batch) AS description
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbp.bill_lading_id = ldbl.id
LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.order_package_code = lwug.association_value
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.order_package_code = lwtg.association_value
LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id
WHERE
ldpl.order_package_code = #{orderPackageCode} AND ldpl.warehouse_id = #{warehouseId} AND ldbp.packet_bar_status = '2'
AND ldbp.is_deleted = 0
</select>
</mapper>

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -95,9 +95,16 @@
</select>
<select id="getStockListInfo" resultType="com.logpm.distribution.vo.DistributionStockListVO">
select ldsl.market_name marketName,ldsl.incoming_batch incomingBatch,ldsl.quantity_stock quantityStock,ldsl.warehouse_id warehouseId,
ldsl.description_goods descriptionGoods,ldsl.cargo_number cargoNumber,ldsl.market_id marketId,ldsl.material_id materialId,
ldsl.id id,ldsl.brand_name brandName
select ldsl.market_name marketName,
ldsl.incoming_batch incomingBatch,
ldsl.quantity_stock quantityStock,
ldsl.warehouse_id warehouseId,
ldsl.description_goods descriptionGoods,
ldsl.cargo_number cargoNumber,
ldsl.market_id marketId,
ldsl.material_id materialId,
ldsl.id id,
ldsl.brand_name brandName
from logpm_distribution_stock_list ldsl
<where>
ldsl.warehouse_id = #{par.warehouseId} and ldsl.quantity_stock > 0 and ldsl.source_type = 2

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -37,7 +37,7 @@
GROUP_CONCAT(DISTINCT dsa.service_number) serviceNumber,
GROUP_CONCAT(DISTINCT dsa.waybill_number) waybillNumber,
GROUP_CONCAT(DISTINCT dsa.consignee_unit)
consigneeUnit,GROUP_CONCAT(DISTINCT dsa.customer_name) customerName,
consigneeUnit,GROUP_CONCAT(DISTINCT dsa.consignee_person) customerName,
GROUP_CONCAT(DISTINCT dsa.customer_telephone)
customerTelephone,dsa.warehouse,dsa.warehouse_entry_time warehouseEntryTime,dsa.storage_fee
storageFee,
@ -430,10 +430,10 @@
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.waybill_number)) AS waybillNumber,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.service_number)) AS serviceNumber,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_unit)) AS consigneeUnit,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.customer_name)) AS customerName,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.customer_telephone)) AS customerTelephone
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_person)) AS customerName,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_mobile)) AS customerTelephone
FROM logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id AND order_status != '2'
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa.id
WHERE ldbl.id = #{id}
GROUP BY ldbl.id;

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -759,7 +759,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
if (a.get() == b.get()) {
//下架
list.forEach(i -> {
warehouseUpdownTypeClient.downPackage(i, stockupDTO.getWarehouseId());
warehouseUpdownTypeClient.downPackage(i, stockupDTO.getWarehouseId(),"备货包件下架");
});
}
@ -796,7 +796,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
// }
//维护订单状态
// distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId());
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), parcelListEntity.getWarehouseId());
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), parcelListEntity.getWarehouseId(),"配送装车包件下架");
checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId);
}
@ -1461,7 +1461,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
String collect = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
warehouseUpdownTypeClient.downPackageOrDelTray(collect, warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(collect, warehouseId,"装车下架解托");
// 进行批量下架
}
@ -2139,7 +2139,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
*
* @param reservationId
*/
@Transactional
private void maintenanceReservationPackageNum(Long reservationId) {
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId);
if (Func.isNotEmpty(distributionReservationEntity)) {

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -76,6 +76,7 @@ import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
@ -1024,7 +1025,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionParcelListNodeVO.setNodeControlsUserId(parcelListEntity.getCreateUser());
distributionParcelListNodeVO.setQuantity(parcelListEntity.getQuantity());
distributionParcelListNodeVO.setOrderCode(parcelListEntity.getOrderCode());
distributionParcelListNodeVO.setOrderCode(parcelListEntity.getWaybillNumber());
distributionParcelListNodeVO.setWaybillNumber(parcelListEntity.getWaybillNumber());
distributionParcelListNodeVO.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
distributionParcelListNodeVO.setDescription("入库");
distributionParcelListNodeVO.setWarehouseName(parcelListEntity.getWarehouse());
@ -1042,6 +1043,29 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if (Func.isNotEmpty(planDeliveryPackage)) {
parcelListNodeVOS.addAll(planDeliveryPackage);
}
//查询自提计划
List<DistributionParcelListNodeVO> planBillLadingPackage =baseMapper.selectPackagePlanBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(planBillLadingPackage)){
parcelListNodeVOS.addAll(planBillLadingPackage);
}
//查询自提取消
List<DistributionParcelListNodeVO> cancelBillLadingPackage =baseMapper.selectPackageCancelBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(cancelBillLadingPackage)){
cancelBillLadingPackage.forEach(s->{
R<User> userR = userClient.userInfoById(s.getNodeControlsUserId());
s.setNodeControlsUserName(userR.getData().getName());
});
parcelListNodeVOS.addAll(cancelBillLadingPackage);
}
//查询自提签收扫描
List<DistributionParcelListNodeVO> signForBillLadingPackage =baseMapper.selectPackageSignForlBillLading(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(signForBillLadingPackage)){
signForBillLadingPackage.forEach(s->{
R<User> userR = userClient.userInfoById(s.getNodeControlsUserId());
s.setNodeControlsUserName(userR.getData().getName());
});
parcelListNodeVOS.addAll(signForBillLadingPackage);
}
//查询计划取消的包件
List<DistributionParcelListNodeVO> cancelPlanDeliveryPackage = baseMapper.selectPackageCancelPlanDelivery(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (Func.isNotEmpty(cancelPlanDeliveryPackage)) {

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -2073,7 +2073,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(),"签收下架解托");
//维护订单状态
} else {
//这里装车的数据需要进行补录
@ -2142,7 +2142,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId(),"签收下架解托");
}
//修改包件状态为装车、签收
DistributionParcelListEntity updatePackage = collect.get(0);
@ -2297,7 +2297,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(),"签收下架解托");
//维护订单状态
} else {
//这里装车的数据需要进行补录
@ -2692,7 +2692,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改签收数量
//包件下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(),"签收下架解托");
// Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
if (Func.isEmpty(loadscanEntity)) {
@ -2759,7 +2759,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setIsAbnormalLoading(2);
distributionLoadscanEntity.setIsAbnormalSigning(2);
distributionLoadscanEntity.setAbnormalNote("异常签收");
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(),"签收下架解托");
if (Func.isEmpty(loadscanEntity)) {
distributionLoadscanService.save(distributionLoadscanEntity);
} else {

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -74,7 +74,6 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
@ -2626,7 +2625,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
//有货位下架
jsonObject.put("allocationId", stockupDTO.getAllocationId());
jsonObject.put("remark","备货零担下架");
jsonObjectList.add(jsonObject);
}

25
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -43,7 +43,6 @@ import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant;
@ -81,7 +80,6 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -1021,7 +1019,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
UpdateWrapper<DistrilbutionBillPackageEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.in(DistrilbutionBillPackageEntity::getBillLadingId, ids)
.set(DistrilbutionBillPackageEntity::getPacketBarStatus, "3")
.set(DistrilbutionBillPackageEntity::getPacketBarStatus, "2")
;
distrilbutionBillPackageService.update(updateWrapper);
@ -1029,13 +1027,26 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
UpdateWrapper<DistrilbutionBillStockEntity> orderUpdateWrapper = new UpdateWrapper<>();
orderUpdateWrapper.lambda()
.in(DistrilbutionBillStockEntity::getBillLadingId, ids)
.set(DistrilbutionBillStockEntity::getOrderStatus, "3")
.set(DistrilbutionBillStockEntity::getOrderStatus, "2")
;
distrilbutionBillStockService.update(orderUpdateWrapper);
List<Long> packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
//将这些包件还原成可操作状态
Integer num = distributionParcelListService.restorePakcageByIds(packageIds);
log.info("######################取消自提单释放包件>>>>>:{}",num);
ids.forEach(id ->{
//查询自提单存在的零担订单
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, id)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "2")
);
if (Func.isNotEmpty(reservationZeroPackageEntities)){
List<Long> collect = reservationZeroPackageEntities.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList());
//释放零担资源
distributionZeroPackageService.recoverZeroPackage(id,collect);
}
});
//维护订单状态
String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCodes, myCurrentWarehouse.getId());
@ -1049,7 +1060,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//恢复库存品数量
distributionStockListService.updateInventoryQuantityOccupied(ddd.getStockListId(), ddd.getQuantity());
//进行库存品包件取消
if (ddd.getStockStatus().equals("3")) {
if (ddd.getStockStatus().equals("2")) {
disStockListDetailService.cancelInventoryPackageByReservationIdAnStockListId(ddd.getStockListId(), ddd.getBillLadingId());
}
@ -1060,7 +1071,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//对所有的库存品相关进行取消标识
UpdateWrapper<DistributionDeliveryDetailsEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.set(DistributionDeliveryDetailsEntity::getInventoryStatus, 3)
.set(DistributionDeliveryDetailsEntity::getInventoryStatus, 2)
.set(DistributionDeliveryDetailsEntity::getQuantity, 0)
.in(DistributionDeliveryDetailsEntity::getBillLadingId, ids);
distributionDeliveryDetailsService.update(updateWrapper);
@ -2627,7 +2638,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionBillLadingScan.setBillLadingId(Long.parseLong((String) billLadingId));
//包件解脱
try {
warehouseUpdownTypeClient.downPackageOrDelTray((String) coding, myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackageOrDelTray((String) coding, myCurrentWarehouse.getId(),"签收下架解托");
} catch (Exception e) {
log.info("自提签收包件解托报错:" + e.getMessage());
}

2
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/controller/OrderController.java

@ -48,7 +48,7 @@ public class OrderController {
String jsonStr = JSONUtil.toJsonStr(zbReceiptDTO);
log.info("接收志邦工厂数据:{} ", jsonStr);
String method = request.getParameter("method");
if (ObjectUtil.equal(ZbomConstants.Method.ENTRY_ORDER_CREATE, method)) {
if (!ObjectUtil.equal(ZbomConstants.Method.ENTRY_ORDER_CREATE, method)) {
return ZbResp.fail("暂不支持该功能");
}
String corpId = request.getHeader("corpId");

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -87,7 +87,7 @@ public class DistributionDatarepair {
packageMap.forEach((k, v) -> {
String orderPackageCodes = v.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
stringBuffer.append("仓库:"+k).append("包件解托"+orderPackageCodes);;
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, k);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCodes, k,"签收下架解托");
});
}
log.info("执行包件下架操作>>>>>>>>>>>>>"+stringBuffer.toString());

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/receiver/SyncUpdownDataHandler.java

@ -45,7 +45,7 @@ public class SyncUpdownDataHandler {
log.error("#############syncUpdownData: XXXX上架托盘失败 trayCode={} locationId={}",code,locationId);
}
}else{
boolean a=warehouseUpdownTypeClient.upShelfPackage(code,locationId,warehouseId);
boolean a=warehouseUpdownTypeClient.upShelfPackage(code,locationId,warehouseId,"系统包件上架");
if(a){
log.info("#############syncUpdownData: 上架包件成功 orderPackageCode={} locationId={}",code,locationId);
}else{

6
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -317,7 +317,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionParcelListClient.update(parcelListEntity);
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统签收下架解托");
}
}
@ -331,7 +331,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionParcelListClient.update(parcelListEntity);
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统在库下架解托");
}
}
@ -345,7 +345,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionParcelListClient.update(parcelListEntity);
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"系统出库下架解托");
}
}

2
blade-service/logpm-report/Dockerfile

@ -11,5 +11,5 @@ EXPOSE 8900
ADD ./target/logpm-report.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar","-Xms128m","-Xmx512m", "app.jar"]
CMD ["--spring.profiles.active=dev"]
CMD ["--spring.profiles.active=test"]

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java

@ -45,4 +45,6 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
List<String> findIncomingWarehouseName(@Param("advanceId") Long advanceId);
List<String> findNoIncomingPackageCode(@Param("advanceId") Long advanceId);
Integer findListByAdvanceIdAndPackageStatus(@Param("advanceId") Long advanceId, @Param("packageStatus") String packageStatus);
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -187,4 +187,12 @@
and package_status = '0'
</select>
<select id="findListByAdvanceIdAndPackageStatus" resultType="int">
select count(id)
from logpm_trunkline_advance_detail
where advance_id = #{advanceId}
and package_status = #{packageStatus}
and is_deleted = 0
</select>
</mapper>

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -65,7 +65,7 @@
<if test="param.endCreateTime != null">
and lta.create_time &lt;= #{param.endCreateTime}
</if>
<if test="param.htMallName != null and param.htallName != ''">
<if test="param.htMallName != null and param.htMallName != ''">
and Locate(#{param.htMallName},lbc.client_name) &gt; 0
</if>
order by lta.create_time desc
@ -134,20 +134,18 @@
<update id="updateIncomingWarehouseName" >
update logpm_trunkline_advance
set incoming_warehouse_name = #{incomingWarehouseName}
and id = #{advanceId}
where id = #{advanceId}
</update>
<select id="findIncomingOrderList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceVO">
select lta.*,
IF(count(ltad.id)>0,1,0) isIncoming
select lta.*
from logpm_trunkline_advance lta
left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id and ltad.package_status = '0'
WHERE 1=1
and lta.warehouse_id = #{param.warehouseId}
<if test="param.incomingType == '4'" >
<if test="param.incomingType == 4" >
and lta.train_number = #{param.incomingCode}
</if>
<if test="param.incomingType == '5'" >
<if test="param.incomingType == 5" >
and lta.order_code = #{param.incomingCode}
</if>
</select>

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -55,4 +55,6 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
List<String> findIncomingWarehouseName(Long advanceId);
List<String> findNoIncomingPackageCode(Long advanceId);
Integer findListByAdvanceIdAndPackageStatus(Long advanceId, String packageStatus);
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -108,6 +108,16 @@ public class InComingServiceImpl implements IInComingService {
@Override
public R findIncomingOrderList(InComingDTO inComingDTO) {
List<TrunklineAdvanceVO> ls = advanceService.findIncomingOrderList(inComingDTO);
for (TrunklineAdvanceVO advanceVO : ls) {
Long advanceId = advanceVO.getId();
Integer num = advanceDetailService.findListByAdvanceIdAndPackageStatus(advanceId,"0");
if(num > 0){
advanceVO.setIsIncoming(1);
}else{
advanceVO.setIsIncoming(0);
}
}
return R.data(ls);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -906,6 +906,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailModel.setOrderCode(openLabelDTO.getOrderCode());
advanceDetailModel.setBrand(openLabelDTO.getBrand());
advanceDetailModel.setSystemType("线上");
advanceDetailModel.setOrderPackageCode(basicdataCodeClient.getCodeByType(CodeNumConstant.PACKAGE,warehouseCode,orderCode));
advanceDetailModel.setFirstPackName(firsts);
String sencods = openLabelDTO.getSencods();

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -245,4 +245,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
public List<String> findNoIncomingPackageCode(Long advanceId) {
return baseMapper.findNoIncomingPackageCode(advanceId);
}
@Override
public Integer findListByAdvanceIdAndPackageStatus(Long advanceId, String packageStatus) {
return baseMapper.findListByAdvanceIdAndPackageStatus(advanceId,packageStatus);
}
}

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -142,7 +142,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setConsigneeAddress(consigneeAddress);
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(consigneeId, 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
if(!Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
@ -167,7 +167,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setMallCode(pidEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
if(!Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
@ -179,7 +179,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
if(!Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}

21
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -1886,7 +1886,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionStockArticleClient.submitHandleNumByOrderId(1,articleId);
remark = "有数据,不在当前仓,异常装车";
updownTypeClient.downPackageOrDelTray(orderPackageCode,fromWarehouseId);
updownTypeClient.downPackageOrDelTray(orderPackageCode,fromWarehouseId,"干线装车下架解托");
}
}else{
@ -1959,7 +1959,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionParcelListClient.updateOrderPackageCodeById(packageId,"60");
distributionStockArticleClient.submitHandleNumByOrderId(1,articleId);
if (StringUtil.isBlank(trayCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId);
updownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId,"干线装车下架解托");
}
}
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
@ -2723,6 +2723,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
map.put("warehouseId",warehouseId);
map.put("orderCode",orderCode);
map.put("num",enterNum);
map.put("remark","卸分一体零担打托");
boolean b = trayTypeClient.enterZeroOrderByTrayCode(map);
if(!b){
log.warn("##########findNextNodeList: 打托失败 trayCode={} orderCode={}",trayCode,orderCode);
@ -2909,7 +2910,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionStockArticleClient.submitHandleNumByOrderId(1,articleId);
distributionParcelListClient.updateOrderPackageCodeById(pacakageId,"60");
updownTypeClient.downPackageOrDelTray(orderPackageCode,wid);
updownTypeClient.downPackageOrDelTray(orderPackageCode,wid,"中转卸车下架解托");
}
}else{
// carsLoadScanEntity.getS
@ -2947,7 +2948,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trayName = trayEntity.getPalletName();
}
if(unbindTray == 1){
updownTypeClient.downPackageOrDelTray(orderPackageCode,fromWarehouseId);
updownTypeClient.downPackageOrDelTray(orderPackageCode,fromWarehouseId,"中转卸车下架解托");
}
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
@ -3029,7 +3030,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if(unbindTray == 1){
if(!StringUtil.isBlank(trayCode)){
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,fromWarehouseId);
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,fromWarehouseId,"干线中转零担解托");
}
}
@ -4144,9 +4145,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
parcelListEntity.setOrderPackageStatus("20");
}
distributionParcelListClient.update(parcelListEntity);
updownTypeClient.downPackageOrDelTray(scanCode,warehouseId);
updownTypeClient.downPackageOrDelTray(scanCode,warehouseId,"包件下架解托");
}else{
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId);
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId,"零担解托");
}
}
@ -4423,7 +4424,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
distributionParcelListClient.update(distributionParcelListEntity);
}
updownTypeClient.downPackageOrDelTray(orderPackageCode,wid);
updownTypeClient.downPackageOrDelTray(orderPackageCode,wid,"干线卸车下架解托");
}
//无装车记录异常日志记录
@ -4462,7 +4463,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trayName = trayEntity.getPalletName();
}
if(unbindTray == 1){
updownTypeClient.downPackageOrDelTray(orderPackageCode,fromWarehouseId);
updownTypeClient.downPackageOrDelTray(orderPackageCode,fromWarehouseId,"干线卸车下架解托");
}
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
@ -4673,7 +4674,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if(unbindTray == 1){
if(!StringUtil.isBlank(trayCode)){
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,fromWarehouseId);
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,fromWarehouseId,"干线卸车零担解托");
}
}

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -203,7 +203,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
return warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,myCurrentWarehouse.getId());
return warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,myCurrentWarehouse.getId(),"扫描包件打托");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -428,7 +428,7 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"打托方式不能为空 trayCode={}",trayCode);
return R.fail(403,"打托方式不能为空");
}
return warehouseTrayTypeService.enterZeroOrderByTrayCode(trayType,trayCode,zeroList,myCurrentWarehouse.getId());
return warehouseTrayTypeService.enterZeroOrderByTrayCode(trayType,trayCode,zeroList,myCurrentWarehouse.getId(),"零担打托");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -463,7 +463,7 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"订单不能为空 trayCode={}",trayCode);
return R.fail(403,"打托方式不能为空");
}
return warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,trayCode,myCurrentWarehouse.getId());
return warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,trayCode,myCurrentWarehouse.getId(),"零担解托");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -504,7 +504,7 @@ public class WarehouseTrayTypeApiController {
}
if(num == 0){
//编辑为0相当于删除
return warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,trayCode,myCurrentWarehouse.getId());
return warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,trayCode,myCurrentWarehouse.getId(),"零担解托");
}else{
return warehouseTrayTypeService.updateEntityNumByOrderCodeAndTrayCode(orderCode,trayCode,num,myCurrentWarehouse.getId());
}
@ -687,7 +687,7 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"托盘货物关联id不能为空 trayGoodsId={}",trayGoodsId);
return R.fail(403,"托盘货物关联id不能为空");
}
return warehouseTrayTypeService.deleteStockByTrayGoodsId(trayGoodsId,myCurrentWarehouse.getId());
return warehouseTrayTypeService.deleteStockByTrayGoodsId(trayGoodsId,myCurrentWarehouse.getId(),"无数据库存品解托");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -923,7 +923,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"数量不正确");
}
return warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,materialCode,marketId,num,incomingBatch,myCurrentWarehouse.getId());
return warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,materialCode,marketId,num,incomingBatch,myCurrentWarehouse.getId(),"无数据库存品打托");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -978,7 +978,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"托盘码不能为空");
}
return warehouseTrayTypeService.trayToNull(trayCode);
return warehouseTrayTypeService.trayToNull(trayCode,"托盘空置");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -1290,7 +1290,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"托盘码不能为空");
}
return warehouseTrayTypeService.syncOldTrayData(trayCode,trayType,orderPackageCodes,myCurrentWarehouse.getId());
return warehouseTrayTypeService.syncOldTrayData(trayCode,trayType,orderPackageCodes,myCurrentWarehouse.getId(),"同步老系统打托");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -213,7 +213,7 @@ public class WarehouseUpdownTypeApiController {
}
//查询该库位的货物信息
return warehouseUpdownTypeService.upShelfOrder(upShelfOrderList,allocationId,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.upShelfOrder(upShelfOrderList,allocationId,myCurrentWarehouse.getId(),"扫码订单上架");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -251,7 +251,7 @@ public class WarehouseUpdownTypeApiController {
}
//查询该库位的货物信息
return warehouseUpdownTypeService.upShelfPackage(upShelfPackageList,allocationId,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.upShelfPackage(upShelfPackageList,allocationId,myCurrentWarehouse.getId(),"包件扫码上架");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -375,7 +375,7 @@ public class WarehouseUpdownTypeApiController {
}
//查询该库位的货物信息
return warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList,allocationId,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList,allocationId,myCurrentWarehouse.getId(),"零担上架");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -464,7 +464,7 @@ public class WarehouseUpdownTypeApiController {
}
//查询该库位的货物信息
return warehouseUpdownTypeService.upShelfStockList(upShelfStockList,allocationId,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.upShelfStockList(upShelfStockList,allocationId,myCurrentWarehouse.getId(),"无数据库存品上架");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -530,7 +530,7 @@ public class WarehouseUpdownTypeApiController {
return R.fail(403,"无处理数据");
}
//查询该库位的货物信息
return warehouseUpdownTypeService.downPackage(upShelfPackageList,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.downPackage(upShelfPackageList,myCurrentWarehouse.getId(),"下架包件");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -606,7 +606,7 @@ public class WarehouseUpdownTypeApiController {
}
//查询该库位的货物信息
return warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList,myCurrentWarehouse.getId(),"零担下架");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -687,7 +687,7 @@ public class WarehouseUpdownTypeApiController {
}
//查询该库位的货物信息
return warehouseUpdownTypeService.downStock(upShelfStockList,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.downStock(upShelfStockList,myCurrentWarehouse.getId(),"无数据库存品下架");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
@ -883,7 +883,7 @@ public class WarehouseUpdownTypeApiController {
return R.fail(403,"库位id不能为空");
}
//查询该库位的货物信息
return warehouseUpdownTypeService.moveAllocationPackageList(upShelfPackageList,allocationId,myCurrentWarehouse.getId());
return warehouseUpdownTypeService.moveAllocationPackageList(upShelfPackageList,allocationId,myCurrentWarehouse.getId(),"移库包件");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java

@ -124,11 +124,11 @@ public class OldSystemPushController {
Long allocationEntity = taryAllocationService.getAllocationIdByTrayId(newTrayId);
if(Objects.isNull(allocationEntity)){
//没有上架,直接空置
trayTypeService.trayToNull("T"+trayId);
trayTypeService.trayToNull("T"+trayId,"系统空置托盘");
}else{
//有上架,先下架,再空置
updownTypeService.downTrayCode("T"+trayId,warehouseId);
trayTypeService.trayToNull("T"+trayId);
trayTypeService.trayToNull("T"+trayId,"系统空置托盘");
}
return R.success("调用成功");
}catch (CustomerException e){

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

@ -382,7 +382,6 @@ public class TaskQuestController extends BladeController {
return R.fail(405,"盘点任务编码为空");
}
try{
taskQuestService.syncTaskData(questNum);
return R.success("同步成功");
}catch (CustomerException e){

16
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java

@ -232,7 +232,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
return R.fail(403,"仓库信息为空");
}
R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId(),"扫码订单上架");
// if (r.getCode() == 200) {
// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
// }
@ -275,7 +275,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
upShelfOrderList = warehouseGoodsAllocationService.selectorderByServiceNumber(ServiceNumberList);
}
R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.upShelfOrder(upShelfOrderList, allocationId,myCurrentWarehouse.getId(),"扫描服务号上架");
// if (r.getCode() == 200) {
// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
// }
@ -311,7 +311,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
return R.fail("仓库信息不能为空");
}
R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId(),"扫描包件上架");
// if (r.getCode() == 200) {
// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
@ -383,7 +383,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
}
//查询该库位的货物信息
R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId(),"无数据库存品上架");
// if (r.getCode() == 200) {
// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
// }
@ -420,7 +420,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
}
//查询该库位的货物信息
R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId(),"零担上架");
// if (r.getCode() == 200) {
// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
// }
@ -538,7 +538,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
return R.fail(403,"仓库信息不能为空");
}
try {
R r = warehouseUpdownTypeService.downPackage(upShelfPackageList,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.downPackage(upShelfPackageList,myCurrentWarehouse.getId(),"下架包件");
// if (r.getCode() == 200) {
// String prefix = Url+"/*";
// bladeRedis.del(bladeRedis.keys(prefix));
@ -569,7 +569,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
return R.fail(403,"仓库信息不能为空");
}
try {
R r = warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.downZeroOrder(upShelfZeroOrderList,myCurrentWarehouse.getId(),"零担下架");
// if (r.getCode() == 200) {
// String prefix = Url+"/*";
// bladeRedis.del(bladeRedis.keys(prefix));
@ -602,7 +602,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
}
try {
R r = warehouseUpdownTypeService.downStock(upShelfStockList,myCurrentWarehouse.getId());
R r = warehouseUpdownTypeService.downStock(upShelfStockList,myCurrentWarehouse.getId(),"无数据库存品下架");
// if (r.getCode() == 200) {
// String prefix = Url+"/*";
// bladeRedis.del(bladeRedis.keys(prefix));

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java

@ -42,8 +42,8 @@ public class WarehouseTrayGoodsClient implements IWarehouseTrayGoodsClient {
@Override
@PostMapping(TOP+"/delByTrayByCode")
public Boolean delByTrayByCode(String code) {
R r = warehouseTrayTypeService.trayToNull(code);
public Boolean delByTrayByCode(String code,String remark) {
R r = warehouseTrayTypeService.trayToNull(code,remark);
return r.isSuccess() ;
}

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -69,14 +69,14 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
Long warehouseId = (Long) map.get("warehouseId");
String orderCode = (String) map.get("orderCode");
Integer num = (Integer) map.get("num");
String remark = (String) map.get("orderCode");
List<ZeroOrderVO> ls = new ArrayList<>();
ZeroOrderVO zeroOrderVO = new ZeroOrderVO();
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(num);
ls.add(zeroOrderVO);
R r = warehouseTrayTypeService.enterZeroOrderByTrayCodeSync(trayType,trayCode,ls,warehouseId);
R r = warehouseTrayTypeService.enterZeroOrderByTrayCodeSync(trayType,trayCode,ls,warehouseId,remark);
if(r.getCode() == 200){
return true;
@ -91,8 +91,8 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
}
@Override
public void deleteZeroOrderByTrayCode(String orderCode, String palletCode, Long wid) {
warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,palletCode,wid);
public void deleteZeroOrderByTrayCode(String orderCode, String palletCode, Long wid,String remark) {
warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,palletCode,wid,remark);
}
@Override
@ -101,8 +101,8 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
}
@Override
public void trayToNull(String trayCode) {
warehouseTrayTypeService.trayToNull(trayCode);
public void trayToNull(String trayCode,String remark) {
warehouseTrayTypeService.trayToNull(trayCode,remark);
}

20
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownTypeClient.java

@ -46,7 +46,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
private final IWarehouseUpdownTypeService warehouseUpdownTypeService;
@Override
public R downPackage(String orderPackageCodes,Long warehouseId) {
public R downPackage(String orderPackageCodes,Long warehouseId,String remark) {
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
String[] split = orderPackageCodes.split(",");
for(String orderPackageCode:split){
@ -55,7 +55,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
upShelfPackageList.add(dto);
}
if(upShelfPackageList.size() > 0){
return warehouseUpdownTypeService.downPackage(upShelfPackageList,warehouseId);
return warehouseUpdownTypeService.downPackage(upShelfPackageList,warehouseId,remark);
}else{
return R.fail(403,"处理失败");
}
@ -79,7 +79,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
@Override
public R downPackageOrDelTray(String orderPackageCodes,Long warehouseId) {
public R downPackageOrDelTray(String orderPackageCodes,Long warehouseId,String remark) {
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
String[] split = orderPackageCodes.split(",");
for(String orderPackageCode:split){
@ -88,7 +88,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
upShelfPackageList.add(dto);
}
if(!upShelfPackageList.isEmpty()){
return warehouseUpdownTypeService.downPackageOrDelTray(upShelfPackageList,warehouseId);
return warehouseUpdownTypeService.downPackageOrDelTray(upShelfPackageList,warehouseId,remark);
}else{
return R.fail(403,"处理失败");
}
@ -112,7 +112,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
}
@Override
public boolean upShelfPackage(String orderPackageCode, Long locationId, Long warehouseId) {
public boolean upShelfPackage(String orderPackageCode, Long locationId, Long warehouseId,String remark) {
String[] split = orderPackageCode.split(",");
List<UpShelfPackageDTO> ls = new ArrayList<>();
for (String packageCode:split){
@ -121,7 +121,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
ls.add(upShelfPackageDTO);
}
R r = warehouseUpdownTypeService.upShelfPackage(ls,locationId,warehouseId);
R r = warehouseUpdownTypeService.upShelfPackage(ls,locationId,warehouseId,remark);
int code = r.getCode();
if(code == 200){
return true;
@ -146,6 +146,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
public R downZeroOrder(List<JSONObject> zeroOrders) {
List<UpShelfZeroOrderDTO> ls = new ArrayList<>();
Long warehouseId = null;
String remark = null;
for (JSONObject jsonObject:zeroOrders){
warehouseId = jsonObject.getLong("warehouseId");
UpShelfZeroOrderDTO dto = new UpShelfZeroOrderDTO();
@ -153,12 +154,13 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
dto.setWaybillCode(jsonObject.getString("waybillCode"));//运单号
dto.setEnterNum(jsonObject.getInteger("enterNum"));//件数
dto.setAllocationId(jsonObject.getLong("allocationId"));//库位id
remark = jsonObject.getString("remark");
dto.setWarehouseId(warehouseId);
ls.add(dto);
}
if(ls.size() > 0){
return warehouseUpdownTypeService.downZeroOrder(ls,warehouseId);
return warehouseUpdownTypeService.downZeroOrder(ls,warehouseId,remark);
}else{
return R.fail(403,"处理失败");
}
@ -168,8 +170,10 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
public R downStock(List<JSONObject> stockLists) {
List<UpShelfStockDTO> ls = new ArrayList<>();
Long warehouseId = null;
String remark = null;
for (JSONObject jsonObject:stockLists){
warehouseId = jsonObject.getLong("warehouseId");
remark = jsonObject.getString("remark");
UpShelfStockDTO dto = new UpShelfStockDTO();
dto.setMarketId(jsonObject.getLong("marketId"));//商场id
dto.setMaterialCode(jsonObject.getString("materialCode"));//物料编码
@ -181,7 +185,7 @@ public class WarehouseUpdownTypeClient implements IWarehouseUpdownTypeClient {
}
if(ls.size() > 0){
return warehouseUpdownTypeService.downStock(ls,warehouseId);
return warehouseUpdownTypeService.downStock(ls,warehouseId,remark);
}else{
return R.fail(403,"处理失败");
}

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/SyncTaskErrorLogMapper.java

@ -0,0 +1,9 @@
package com.logpm.warehouse.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.warehouse.entity.SyncTaskErrorLogEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SyncTaskErrorLogMapper extends BaseMapper<SyncTaskErrorLogEntity> {
}

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.mapper;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.warehouse.dto.QuestDetailDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.QuestDetailChildEntity;
import com.logpm.warehouse.entity.QuestDetailEntity;
@ -189,4 +190,12 @@ public interface TaskQuestMapper extends BaseMapper<TaskQuestEntity> {
List<DistributionStockListEntity> findStockList(@Param("param") TaskSearchDTO taskSearchDTO);
List<TaskQueryDataExcel> selectContrastStockInfo(@Param("questNum") String questNum);
QuestDetailEntity findEntityById(@Param("questNum") String questNum,@Param("taskID") Long taskID);
IPage<QuestDetailVO> findContrastList(IPage<Object> page, @Param("param") QuestDetailDTO questDetailDTO);
List<QuestDetailEntity> findIsChangeData(@Param("questNum") String questNum);
Integer findStockNum(@Param("questDetailId") Long questDetailId, @Param("tableName") String tableName);
}

70
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -108,7 +108,12 @@
`tray_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '托盘id(按托盘)',
`allocation_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '货位id(按库位)',
`grounding_allocation_id` bigint(20) NULL DEFAULT NULL COMMENT '上架后的库位ID',
`is_new` int(20) NULL DEFAULT NULL COMMENT '是否是新增数据',
`new_tray_id` bigint(20) NULL DEFAULT NULL COMMENT '新托盘ID',
`new_tray_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '新托盘编码',
`is_new` int(20) NULL DEFAULT 0 COMMENT '是否是新增数据',
`is_change` int(4) NULL DEFAULT 0 COMMENT '是否有变更 0未变更 1有变更',
`is_change_at` int(4) NULL DEFAULT 0 COMMENT '是否有变更库位托盘 0未变更 1有变更',
`has_data` int(4) NULL DEFAULT NULL COMMENT '是否有数据 0无 1有',
`grounding_position_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上架后的完整库位',
`material_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料编码(库存品)',
`firsts` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '一级品',
@ -137,14 +142,14 @@
INSERT INTO ${questNum}(`id`, `tenant_id`, `create_user`, `create_time`, `update_user`, `update_time`, `create_dept`,
`is_deleted`, `status`, `reserve1`, `reserve2`, `reserve3`, `reserve4`, `reserve5`, `order_code`, `quest_id`, `order_id`, `quest_type`, `quest_target`,
`order_package_code`, `order_package_id`, `category_name`, `stock_id`, `quest_status`, `stock_num`, `warehouse_id`, `position_code`, `tray_code`, `tray_id`,
`allocation_id`, `grounding_allocation_id`, `is_new`, `grounding_position_code`, `material_code`, `market_name`, `firsts`, `second`,
`allocation_id`, `grounding_allocation_id`, `is_new`,`has_data`, `grounding_position_code`, `material_code`, `market_name`, `firsts`, `second`,
`third_product`, `incoming_batch`, `material_name`, `waybill_number`,`send_warehouse_name`,`tray_name`,`brand_name`) VALUES
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.tenantId}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime}, #{item.createDept}, #{item.isDeleted}
, #{item.status}, #{item.reserve1}, #{item.reserve2}, #{item.reserve3}, #{item.reserve4}, #{item.reserve5}, #{item.orderCode}, #{item.questId}, #{item.orderId}
, #{item.questType}, #{item.questTarget}, #{item.orderPackageCode}, #{item.orderPackageId}, #{item.categoryName}, #{item.stockId}, #{item.questStatus},
#{item.stockNum}, #{item.warehouseId} , #{item.positionCode}, #{item.trayCode}, #{item.trayId}, #{item.allocationId}, #{item.groundingAllocationId},
#{item.isNew}, #{item.groundingPositionCode}, #{item.materialCode}, #{item.marketName} , #{item.firsts} , #{item.second} ,
#{item.isNew},#{item.hasData}, #{item.groundingPositionCode}, #{item.materialCode}, #{item.marketName} , #{item.firsts} , #{item.second} ,
#{item.thirdProduct} , #{item.incomingBatch}, #{item.materialName}, #{item.waybillNumber}, #{item.sendWarehouseName},#{item.trayName},#{item.brandName}
)
</foreach>
@ -159,8 +164,8 @@
<if test="param.questType != null and param.questType != ''">and quest_type =#{param.questType } </if>
<if test="param.questTarget != null and param.questTarget != ''">and quest_target =#{param.questTarget } </if>
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and (allocation_id =#{param.allocationId } or grounding_allocation_id = #{param.allocationId}) </if>
<if test="param.trayId != null and param.trayId != ''">and (tray_id =#{param.trayId } or new_tray_id = #{param.trayId}) </if>
<if test="param.orderCode != null and param.orderCode != ''">and order_code =#{param.orderCode } </if>
<if test="param.orderPackageCode != null and param.orderPackageCode != ''">and order_package_code =#{param.orderPackageCode } </if>
<if test="param.code != null and param.code!= '' ">and CONCAT(order_package_code, order_code) like concat('%',#{param.code},'%')</if>
@ -215,12 +220,12 @@
<if test="param.questType != null and param.questType != ''">and quest_type =#{param.questType } </if>
<if test="param.questTarget != null and param.questTarget != ''">and quest_target =#{param.questTarget } </if>
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and (allocation_id =#{param.allocationId } or grounding_allocation_id =#{param.allocationId }) </if>
<if test="param.trayId != null and param.trayId != ''">and (tray_id =#{param.trayId } or new_tray_id =#{param.trayId }) </if>
<if test="param.orderCode != null and param.orderCode != ''">and order_code =#{param.orderCode } </if>
<if test="param.orderPackageCode != null and param.orderPackageCode != ''">and order_package_code =#{param.orderPackageCode } </if>
<if test="param.marketNames != null">
and material_name in
and market_name in
<foreach collection="param.marketNames" item="a" open="(" close=")" separator=",">
#{a}
</foreach>
@ -287,8 +292,8 @@
<if test="param.questType != null and param.questType != ''">and quest_type = #{param.questType } </if>
<if test="param.questTarget != null and param.questTarget != ''">and quest_target =#{param.questTarget } </if>
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and (allocation_id =#{param.allocationId } or grounding_allocation_id =#{param.allocationId }) </if>
<if test="param.trayId != null and param.trayId != ''">and (tray_id =#{param.trayId } or new_tray_id =#{param.trayId }) </if>
<if test="param.trayId == null or param.trayId == ''">and tray_id is not null </if>
</where>
</select>
@ -317,6 +322,10 @@
<if test="item.updateTime != null and item.updateTime != null">update_time = #{item.updateTime },</if>
<if test="item.inventoryUser != null and item.inventoryUser != null">inventory_user = #{item.inventoryUser },</if>
<if test="item.inventoryTime != null ">inventory_time = #{item.inventoryTime }, </if>
<if test="item.isChange != null ">is_change = #{item.isChange }, </if>
<if test="item.newTrayId != null ">new_tray_id = #{item.newTrayId }, </if>
<if test="item.newTrayCode != null ">new_tray_code = #{item.newTrayCode }, </if>
<if test="item.isChangeAt != null ">is_change_at = #{item.isChangeAt }, </if>
<!-- <if test="item. != null and item. != null"> = #{item. }</if>
<if test="item. != null and item. != null"> = #{item. }</if>
<if test="item. != null and item. != null"> = #{item. }</if>
@ -329,18 +338,9 @@
<update id="updetaQuestDetailChildList">
<foreach collection="list" item="item" index="index" separator=";">
update ${questNum}
<set>
<if test="item.cargoName != null and item.cargoName != ''" > cargo_name = #{item.cargoName }, </if>
<if test="item.questNum != null and item.questNum != ''" >quest_num = #{item.questNum }, </if>
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
<!-- <if test="item. != null and item. != ''" > = #{item. }, </if>-->
</set>
WHERE `id` = #{ item.id }
set cargo_name = #{item.cargoName },
quest_num = #{item.questNum }
where `id` = #{ item.id }
</foreach>
</update>
<insert id="insertQuestDetailChildList">
@ -672,4 +672,30 @@
from ${questNum} lqd where quest_status =0
</select>
<select id="findEntityById" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select *
from ${questNum}
where id = #{taskID}
</select>
<select id="findContrastList" resultType="com.logpm.warehouse.vo.QuestDetailVO">
select *
from ${questNum}
</select>
<select id="findIsChangeData" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select *
from ${questNum}
where quest_status = 1
and (is_change = 1 or is_change_at = 1 or grounding_allocation_id is not null or new_tray_id is not null)
</select>
<select id="findStockNum" resultType="Integer">
select quest_num
from ${tableName}
where quest_detail_id = #{questDetailId}
and cargo_name = '10'
</select>
</mapper>

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -283,7 +283,8 @@
<select id="getTrayGoodsByZeroOrderIdNoAllocationId" resultType="com.logpm.warehouse.vo.PositionVO">
select lwtg.tray_code trayCode,
lwt.pallet_name trayName,
lwtg.num num
lwtg.num num,
lwtg.tray_id trayId
from logpm_warehouse_tray_goods lwtg
left join logpm_warehouse_tray lwt on lwt.id = lwtg.tray_id and lwt.is_deleted = 0
left join logpm_warehouse_tary_allocation lwta on lwta.tray_id = lwtg.tray_id and lwta.is_deleted = 0
@ -296,7 +297,8 @@
SELECT
lwtg.tray_code trayCode,
lwt.pallet_name trayName,
lwtg.num num
lwtg.num num,
lwtg.tray_id trayId
FROM logpm_warehouse_tray_goods lwtg
left join logpm_warehouse_tray lwt on lwt.id = lwtg.tray_id and lwt.is_deleted = 0
LEFT JOIN logpm_warehouse_tary_allocation lwta ON lwta.tray_id = lwtg.tray_id AND lwta.is_deleted = 0

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml

@ -209,7 +209,10 @@
lwug.shelf_title shelfName,
lwug.allocation_title allocationName,
lwt.pallet_code trayCode,
lwug.num num
lwug.num num,
lwug.allocaation_id allocationId,
lwt.id trayId,
lwug.position_code positionCode
from logpm_warehouse_updown_goods lwug
left join logpm_warehouse_tary_allocation lwta on lwta.allocation_id = lwug.allocation_id and lwta.is_deleted = 0
left join logpm_warehouse_tray lwt on lwt.id = lwta.tray_id
@ -224,7 +227,10 @@
lwug.allocation_title allocationName,
lww.name warehouseName,
lwt.pallet_code trayCode,
lwug.num num
lwug.num num,
lwug.allocation_id allocationId,
lwt.id trayId,
lwug.position_code positionCode
FROM logpm_warehouse_updown_goods lwug
LEFT JOIN logpm_warehouse_tary_allocation lwta ON lwta.allocation_id = lwug.allocation_id AND lwta.is_deleted = 0
LEFT JOIN logpm_warehouse_tray lwt ON lwt.id = lwta.tray_id

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IAsyncDataService.java

@ -5,7 +5,7 @@ import com.logpm.warehouse.dto.TrayInfoDTO;
public interface IAsyncDataService {
void syncTaskData(String questNum, Long warehouseId);
void syncTaskData(String questNum, Long warehouseId,String tenantId,Long userId,String nickName,Long deptId);
void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO);

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ISyncTaskErrorLogService.java

@ -0,0 +1,7 @@
package com.logpm.warehouse.service;
import com.logpm.warehouse.entity.SyncTaskErrorLogEntity;
import org.springblade.core.mp.base.BaseService;
public interface ISyncTaskErrorLogService extends BaseService<SyncTaskErrorLogEntity> {
}

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -274,7 +274,6 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
/**
* 查询盘点任务是否结束
* @param id
*/
void getFinishTask();
@ -302,4 +301,8 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
* @return
*/
List<TaskQueryDataExcel> exportContrastStockInfo(QuestDetailDTO questDetailDTO);
List<QuestDetailEntity> findIsChangeData(String questNum);
Integer findStockNum(Long questDetailId, String tableName);
}

18
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -20,7 +20,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
TrayTypeDataVO getEntityByTrayCodeWithUpdown(String trayCode);
R orderScanOrderPackageCode(String trayType, String trayCode, String orderPackageCode,Long warehouseId);
R orderScanOrderPackageCode(String trayType, String trayCode, String orderPackageCode,Long warehouseId,String remark);
R orderScanOrderPackageCodeSync(String trayType, String trayCode, String orderPackageCode,Long warehouseId);
@ -30,10 +30,10 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
List<TrayTypeDataListVO> getZeroOrderByWaybillCode(String waybillCode,Long warehouseId);
R enterZeroOrderByTrayCode(String trayType ,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId);
R enterZeroOrderByTrayCodeSync(String trayType ,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId);
R enterZeroOrderByTrayCode(String trayType ,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId,String remark);
R enterZeroOrderByTrayCodeSync(String trayType ,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId,String remark);
R deleteZeroOrderByTrayCode(String orderCode, String trayCode,Long warehouseId);
R deleteZeroOrderByTrayCode(String orderCode, String trayCode,Long warehouseId,String remark);
R updateEntityNumByOrderCodeAndTrayCode(String orderCode, String trayCode, Integer num,Long warehouseId);
@ -47,17 +47,17 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
Boolean deleteByMasterId(Long id);
R scanStockOrderPackageCode(String trayCode, String trayType, String orderPackageCode,Long warehouseId);
R deleteStockByTrayGoodsId(Long trayGoodsId,Long warehouseId);
R deleteStockByTrayGoodsId(Long trayGoodsId,Long warehouseId,String remark);
IPage<WarehouseTrayTypeVO> stockNoDataPageList(TrayTypeDTO trayTypeDTO,Long warehouseId);
R findAllMarket(Long warehouseId);
R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num,String incomingBatch,Long warehouseId);
R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num,String incomingBatch,Long warehouseId,String remark);
void downPackageByOrderPackageCode(String orderPackageCode,String remark,Long warehouseId);
void updateEntityNumByTrayGoodsIdAndNumStock(Long trayGoodsId, Integer enterNum);
void updateEntityNumByTrayGoodsIdAndNumStock(Long trayGoodsId, Integer enterNum,String remark);
void downTrayGoodsByTrayId(Long trayId,String remark);
@ -67,7 +67,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
List<ReCheckTrayListVO> getReCheckStockByTrayTypeId(Long trayTypeId);
R trayToNull(String trayCode);
R trayToNull(String trayCode,String remark);
R scanSourceTrayCode(String sourceTrayCode,Long warehouseId);
@ -101,7 +101,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R findSyncOldTrayData(String trayCode, Long warehouseId);
R syncOldTrayData(String trayCode, String trayType, List<String> orderPackageCodes, Long warehouseId);
R syncOldTrayData(String trayCode, String trayType, List<String> orderPackageCodes, Long warehouseId,String remark);
R findTrayData(String trayCode, Long warehouseId);

18
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java

@ -17,33 +17,33 @@ public interface IWarehouseUpdownTypeService extends BaseService<WarehouseUpdown
UpShelfAllocationVO upShelfScanAllocation(Long allocationId,Long warehouseId);
R upShelfOrder(List<UpShelfOrderDTO> upShelfOrderList,Long allocationId,Long warehouseId);
R upShelfOrder(List<UpShelfOrderDTO> upShelfOrderList,Long allocationId,Long warehouseId,String remark);
R upShelfPackage(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId);
R upShelfPackage(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId,String remark);
R upShelfTray(String trayCode, Long allocationId,Long warehouseId);
R upShelfZeroOrder(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, Long allocationId,Long warehouseId);
R upShelfZeroOrder(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, Long allocationId,Long warehouseId,String remark);
R getZeroOrderByCode(Integer zeroType, String code,Long warehouseId);
R getStockByParam(Integer stockType, String value, Long marketId,Long warehouseId);
R upShelfStockList(List<UpShelfStockDTO> upShelfStockList, Long allocationId,Long warehouseId);
R upShelfStockList(List<UpShelfStockDTO> upShelfStockList, Long allocationId,Long warehouseId,String remark);
R downScanPackage(String orderPackageCode,Long warehouseId);
R downEnterZeroOrder(String code, Integer zeroType,Long warehouseId);
R downPackage(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId);
R downPackage(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId,String remark);
R downPackageOrDelTray(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId);
R downPackageOrDelTray(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId,String remark);
R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList,Long warehouseId);
R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList,Long warehouseId,String remark);
R downEnterStock(String code, Integer stockType, Long marketId,Long warehouseId);
R downStock(List<UpShelfStockDTO> upShelfStockList,Long warehouseId);
R downStock(List<UpShelfStockDTO> upShelfStockList,Long warehouseId,String remark);
R downAllocation(Long allocationId,Long warehouseId);
@ -51,7 +51,7 @@ public interface IWarehouseUpdownTypeService extends BaseService<WarehouseUpdown
MovePackInfoVO moveAllocationScanPackage(String orderPackageCode, Long allocationId,Long warehouseId);
R moveAllocationPackageList(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId);
R moveAllocationPackageList(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId,String remark);
R moveAllocationScanTrayCode(String trayCode,Long warehouseId);

781
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java

@ -2,8 +2,6 @@ package com.logpm.warehouse.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
@ -20,8 +18,8 @@ import com.logpm.oldproject.feign.ITrayScanDesClient;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.service.*;
import com.logpm.warehouse.vo.AllocationWithTrayVO;
import com.logpm.warehouse.vo.QuestDetailVO;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.exception.CustomerException;
@ -77,10 +75,12 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private ITrayScanDesClient trayScanDesClient;
@Autowired
private ISyncOldTrayTypeLogService syncOldTrayTypeLogService;
@Autowired
private ISyncTaskErrorLogService syncTaskErrorLogService;
@Override
@Async
public void syncTaskData(String questNum, Long warehouseId) {
public void syncTaskData(String questNum, Long warehouseId,String tenantId,Long userId,String nickName,Long deptId) {
log.info("###############syncTaskData: 同步盘点任务数据开始 questNum={}",questNum);
QueryWrapper<TaskQuestEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("quest_num",questNum);
@ -90,231 +90,602 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
log.warn("##########syncTaskData: 未找到盘点任务信息 questNum={}",questNum);
throw new CustomerException(405,"未找到盘点任务信息");
}
String questType = taskQuestEntity.getQuestType();//1-部分,2-全仓
//先处理有库位的数据
//本次同步会已盘点数据为基准来进行数据处理
List<BasicdataGoodsShelfEntity> shelfList = goodsShelfClient.findAllByWarehouseId(warehouseId);
for (BasicdataGoodsShelfEntity basicdataGoodsShelfEntity : shelfList) {
String goodsShelfName = basicdataGoodsShelfEntity.getGoodsShelfName();
Long shelfId = basicdataGoodsShelfEntity.getId();
log.info("#########syncTaskData: 当前处理的货架为 {}",goodsShelfName);
//根据货架id查询所有货位
List<BasicdataGoodsAllocationEntity> allocationList = goodsAllocationClient.findListByShelfId(shelfId);
for (BasicdataGoodsAllocationEntity goodsAllocationEntity : allocationList) {
Long allocationId = goodsAllocationEntity.getId();
//判断数据是否一致
// boolean flag = checkData(questNum,allocationId);
boolean flag = false;
if(flag){
log.info("##############syncTaskData: 数据一致,不用重新打托上架");
continue;
}else {
//先查询盘点中有没有该库位的数据
List<AllocationWithTrayVO> allocationWithTrayVOS = taskQuestService.findAllocationWithTray(questNum,allocationId);
int size = allocationWithTrayVOS.size();
if(size == 0){
//如果没有数据,则表示该库位不需要上货
log.info("#################syncTaskData: 没有该库位的货 allocationId={}",allocationId);
continue;
}else if(size > 1){
//库位有多过两个托盘的,数据错误也不做操作
log.info("#################syncTaskData: 没有该库位的货 allocationWithTrayVOS={}",allocationWithTrayVOS);
continue;
}else{
//正确数据
AllocationWithTrayVO allocationWithTrayVO = allocationWithTrayVOS.get(0);
String trayCode = allocationWithTrayVO.getTrayCode();
String trayType = "100";
List<QuestDetailVO> list = taskQuestService.findAllocationDataByAllocationId(questNum,allocationId);
updownTypeService.downAllocation(allocationId, warehouseId);
if(!StringUtil.isBlank(trayCode)){
//有托盘,先打托,再整托上架
//查看托盘是否有绑定货物
QueryWrapper<WarehouseTrayTypeEntity> trayTypeQueryWrapper = new QueryWrapper<>();
trayTypeQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
List<WarehouseTrayTypeEntity> trayTypeList = trayTypeService.list(trayTypeQueryWrapper);
if(trayTypeList.size() > 1){
//出现多条同一托盘的打托数据,直接
log.info("#############syncTaskData: 出现多条同一托盘的打托数据 trayCode={}",trayCode);
continue;
}else if(trayTypeList.size() == 1){
WarehouseTrayTypeEntity trayTypeEntity = trayTypeList.get(0);
trayType = trayTypeEntity.getTrayType();
//空置托盘
trayTypeService.downTrayGoodsByTrayId(trayTypeEntity.getTrayId(),"盘点任务:空置托盘");
}
for (QuestDetailVO questDetailVO : list) {
Integer questTarget = questDetailVO.getQuestTarget();
String orderPackageCode = questDetailVO.getOrderPackageCode();
if (questTarget == 1){
log.info("################syncTaskData: 订制品类型");
//处理包件的打托
dealWithPackageTray(orderPackageCode,trayCode,warehouseId,trayType);
}else if(questTarget == 2){
log.info("################syncTaskData: 零担类型");
String orderCode = questDetailVO.getOrderCode();
Long orderId = questDetailVO.getOrderId();
Integer stockNum = questDetailVO.getStockNum();
dealWithZeroTray(orderCode,orderId,stockNum,trayCode,warehouseId,trayType);
}else if(questTarget == 3){
log.info("################syncTaskData: 库存品类型");
if(!StringUtil.isBlank(orderPackageCode)){
//包件码不为空,就是有数据库存品类型,按照包件类型走
dealWithPackageTray(orderPackageCode,trayCode,warehouseId,trayType);
//找出有数量变化或者有数量变更的盘点明细
List<QuestDetailEntity> questDetailList = taskQuestService.findIsChangeData(questNum);
List<SyncTaskErrorLogEntity> syncTaskErrorLogList = new ArrayList<>();
for (QuestDetailEntity questDetailEntity : questDetailList) {
Long questDetailId = questDetailEntity.getId();
Integer questTarget = questDetailEntity.getQuestTarget();//1.定制品 2零担 3 库存品
String orderPackageCode = questDetailEntity.getOrderPackageCode();
Long stockId = questDetailEntity.getStockId();
Long orderId = questDetailEntity.getOrderId();
String orderCode = questDetailEntity.getOrderCode();
Integer stockNum = questDetailEntity.getStockNum();
String newTrayCode = questDetailEntity.getNewTrayCode();
String trayCode = questDetailEntity.getTrayCode();
Long groundingAllocationId = questDetailEntity.getGroundingAllocationId();
String allocationId = questDetailEntity.getAllocationId();
Integer isChange = questDetailEntity.getIsChange();
Integer isChangeAt = questDetailEntity.getIsChangeAt();
Integer hasData = questDetailEntity.getHasData();
try{
//判断有无数据
if(hasData == 1){
//判断是订制品还是库存品
if(questTarget.equals(1) || questTarget.equals(3)){
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
UpShelfPackageDTO dto = new UpShelfPackageDTO();
dto.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(dto);
if(isChangeAt == 1){
if(!Objects.isNull(groundingAllocationId)){
if(StringUtil.isNotBlank(allocationId) || StringUtil.isNotBlank(trayCode)){
//已经上架,先下架再上新库位
R r = updownTypeService.downPackageOrDelTray(upShelfPackageList, warehouseId, "盘点包件下架解托");
if(r.getCode() == 200){
updownTypeService.upShelfPackage(upShelfPackageList,groundingAllocationId,warehouseId,"盘点包件上架");
// if(!Objects.isNull(groundingAllocationId)){
// updownTypeService.upShelfPackage(upShelfPackageList,groundingAllocationId,warehouseId,"盘点包件上架");
// }else{
// if(StringUtil.isNotBlank(newTrayCode)){
// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
// String trayType = "100";
// if(!Objects.isNull(entityByTrayCode)){
// trayType = entityByTrayCode.getTrayType();
// }
// //打托
// trayTypeService.orderScanOrderPackageCode(trayType,newTrayCode,orderPackageCode,warehouseId,"盘点包件打托");
// }
// }
}else{
String materialCode = questDetailVO.getMaterialCode();
String marketName = questDetailVO.getMarketName();
String incomingBatch = questDetailVO.getIncomingBatch();
Integer stockNum = questDetailVO.getStockNum();
dealWithStockTray(materialCode,marketName,incomingBatch,stockNum,trayCode,trayType,warehouseId);
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"有数据,下架原库位或原托盘失败questTarget="+questTarget,tenantId,userId,nickName,deptId));
continue;
}
}else{
log.warn("################syncTaskData: 未知的盘点类型数据 questTarget={}",questTarget);
continue;
updownTypeService.upShelfPackage(upShelfPackageList,groundingAllocationId,warehouseId,"盘点包件上架");
// if(!Objects.isNull(groundingAllocationId)){
// updownTypeService.upShelfPackage(upShelfPackageList,groundingAllocationId,warehouseId,"盘点包件上架");
// }else{
// if(StringUtil.isNotBlank(newTrayCode)){
// TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
// String trayType = "100";
// if(!Objects.isNull(entityByTrayCode)){
// trayType = entityByTrayCode.getTrayType();
// }
// //打托
// trayTypeService.orderScanOrderPackageCode(trayType,newTrayCode,orderPackageCode,warehouseId,"盘点包件打托");
// }
// }
}
}else{
if(StringUtil.isNotBlank(newTrayCode)){
if(StringUtil.isNotBlank(allocationId) || StringUtil.isNotBlank(trayCode)){
//已经上架,先下架再上新库位
R r = updownTypeService.downPackageOrDelTray(upShelfPackageList, warehouseId, "盘点包件下架解托");
if(r.getCode() == 200){
//打托
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
trayTypeService.orderScanOrderPackageCode(trayType,newTrayCode,orderPackageCode,warehouseId,"盘点包件打托");
}else{
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"有数据,下架原库位或原托盘失败questTarget="+questTarget,tenantId,userId,nickName,deptId));
continue;
}
}else{
//打托
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode);
if(Objects.isNull(trayEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"有数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId));
continue;
}
Long newTrayId = trayEntity.getId();
Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId);
if(!Objects.isNull(newAllocationId)){
updownTypeService.upShelfPackage(upShelfPackageList,newAllocationId,warehouseId,"盘点包件上架");
}else{
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
trayTypeService.orderScanOrderPackageCode(trayType,newTrayCode,orderPackageCode,warehouseId,"盘点包件打托");
}
}
}
}
}
if(isChange == 1){
//
}
//托盘上架
R r = updownTypeService.upShelfTray(trayCode, allocationId, warehouseId);
int code = r.getCode();
if(code == 200){
log.info("##############syncTaskData: 托盘上架成功 trayCode={} allocationId={}",trayCode,allocationId);
}else {
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"有数据,数据类型错误questTarget="+questTarget,tenantId,userId,nickName,deptId));
continue;
}
}else{
if(questTarget.equals(2)){
if(isChangeAt == 1){
List<UpShelfZeroOrderDTO> upShelfZeroOrderDTOS = new ArrayList<>();
UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO();
upShelfZeroOrderDTO.setOrderCode(orderCode);
upShelfZeroOrderDTO.setAllocationId(Long.parseLong(allocationId));
upShelfZeroOrderDTO.setEnterNum(stockNum);
upShelfZeroOrderDTOS.add(upShelfZeroOrderDTO);
if(!Objects.isNull(groundingAllocationId)){
if(StringUtil.isNotBlank(allocationId)){
R r = updownTypeService.downZeroOrder(upShelfZeroOrderDTOS, warehouseId,"盘点零担下架");
if(r.getCode() == 200){
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架");
}else{
if(!nowStockNum.equals(0)){
upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架");
}
}
}
}else{
if(StringUtil.isNotBlank(trayCode)){
R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托");
if(r.getCode() == 200){
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架");
}else{
if(!nowStockNum.equals(0)){
upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,groundingAllocationId,warehouseId,"盘点零担上架");
}
}
}
}
}
}else {
log.error("XXXXXX#######syncTaskData: 托盘上架失败 trayCode={} allocationId={}",trayCode,allocationId);
if(StringUtil.isNotBlank(newTrayCode)){
if(StringUtil.isNotBlank(allocationId)){
R r = updownTypeService.downZeroOrder(upShelfZeroOrderDTOS, warehouseId,"盘点零担下架");
if(r.getCode() == 200){
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
List<ZeroOrderVO> zeroList = new ArrayList<>();
ZeroOrderVO zeroOrderVO = new ZeroOrderVO();
zeroOrderVO.setOrderId(orderId);
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(stockNum);
zeroList.add(zeroOrderVO);
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
//打托
trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托");
}else{
if(!nowStockNum.equals(0)){
zeroList.get(0).setNum(nowStockNum);
trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托");
}
}
}
}else{
if(StringUtil.isNotBlank(trayCode)){
R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托");
if(r.getCode() == 200){
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
List<ZeroOrderVO> zeroList = new ArrayList<>();
ZeroOrderVO zeroOrderVO = new ZeroOrderVO();
zeroOrderVO.setOrderId(orderId);
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(stockNum);
zeroList.add(zeroOrderVO);
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
//打托
trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托");
}else{
if(!nowStockNum.equals(0)){
zeroList.get(0).setNum(nowStockNum);
trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托");
}
}
}
}else{
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode);
if(Objects.isNull(trayEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId));
continue;
}
Long newTrayId = trayEntity.getId();
Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId);
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(!Objects.isNull(newAllocationId)){
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,newAllocationId,warehouseId,"盘点零担上架");
}else{
if(!nowStockNum.equals(0)){
upShelfZeroOrderDTOS.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfZeroOrder(upShelfZeroOrderDTOS,newAllocationId,warehouseId,"盘点零担上架");
}
}
}else{
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
List<ZeroOrderVO> zeroList = new ArrayList<>();
ZeroOrderVO zeroOrderVO = new ZeroOrderVO();
zeroOrderVO.setOrderId(orderId);
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(stockNum);
zeroList.add(zeroOrderVO);
if(Objects.isNull(nowStockNum)){
//打托
trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托");
}else{
if(!nowStockNum.equals(0)){
zeroList.get(0).setNum(nowStockNum);
trayTypeService.enterZeroOrderByTrayCode(trayType,newTrayCode,zeroList,warehouseId,"盘点零担打托");
}
}
}
}
}
}
}
}
}else{
if(isChange == 1 && isChangeAt == 0){
if(StringUtil.isNotBlank(allocationId)){
List<UpShelfZeroOrderDTO> upShelfZeroOrderDTOS = new ArrayList<>();
UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO();
upShelfZeroOrderDTO.setOrderCode(orderCode);
upShelfZeroOrderDTO.setAllocationId(Long.parseLong(allocationId));
upShelfZeroOrderDTO.setEnterNum(stockNum);
upShelfZeroOrderDTOS.add(upShelfZeroOrderDTO);
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(!Objects.isNull(nowStockNum) && stockNum-nowStockNum != 0){
upShelfZeroOrderDTOS.get(0).setEnterNum(stockNum-nowStockNum);
updownTypeService.downZeroOrder(upShelfZeroOrderDTOS,warehouseId,"盘点下架零担");
}
}else{
if(StringUtil.isNotBlank(trayCode)){
R r = trayTypeService.deleteZeroOrderByTrayCode(orderCode, trayCode, warehouseId, "盘点零担解托");
if(r.getCode() == 200){
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
List<ZeroOrderVO> zeroList = new ArrayList<>();
ZeroOrderVO zeroOrderVO = new ZeroOrderVO();
zeroOrderVO.setOrderId(orderId);
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(nowStockNum);
zeroList.add(zeroOrderVO);
//打托
trayTypeService.enterZeroOrderByTrayCode(trayType,trayCode,zeroList,warehouseId,"盘点零担打托");
}
}
}
for (QuestDetailVO questDetailVO : list) {
Integer questTarget = questDetailVO.getQuestTarget();
String orderPackageCode = questDetailVO.getOrderPackageCode();
if (questTarget == 1){
log.info("################syncTaskData: 订制品类型");
//处理包件
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,warehouseId);
}else if(questTarget == 2){
log.info("################syncTaskData: 零担类型");
String orderCode = questDetailVO.getOrderCode();
Long orderId = questDetailVO.getOrderId();
Integer stockNum = questDetailVO.getStockNum();
List<UpShelfZeroOrderDTO> upShelfZeroOrderList = new ArrayList<>();
UpShelfZeroOrderDTO upShelfZeroOrderDTO = new UpShelfZeroOrderDTO();
upShelfZeroOrderDTO.setOrderCode(orderCode);
upShelfZeroOrderDTO.setEnterNum(stockNum);
upShelfZeroOrderList.add(upShelfZeroOrderDTO);
updownTypeService.upShelfZeroOrder(upShelfZeroOrderList,allocationId,warehouseId);
}else if(questTarget == 3){
log.info("################syncTaskData: 库存品类型");
if(!StringUtil.isBlank(orderPackageCode)){
//包件码不为空,就是有数据库存品类型,按照包件类型走
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,warehouseId);
}else{
String materialCode = questDetailVO.getMaterialCode();
String marketName = questDetailVO.getMarketName();
String incomingBatch = questDetailVO.getIncomingBatch();
Integer stockNum = questDetailVO.getStockNum();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketNameAndMaterialCodeAndIncomingBatch(marketName,materialCode,incomingBatch,warehouseId);
if(Objects.isNull(stockListEntity)){
log.warn("##################syncTaskData: 库存品信息不存在 materialCode={} marketName={} incomingBatch={} ",materialCode,marketName,incomingBatch);
}
}else if (questTarget.equals(3)){
DistributionStockListEntity stockListEntity = distributionStockListClient.getStockListById(stockId);
if(Objects.isNull(stockListEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品信息不存在stockId="+stockId,tenantId,userId,nickName,deptId));
continue;
}
Long marketId = stockListEntity.getMarketId();
String cargoNumber = stockListEntity.getCargoNumber();
String incomingBatch = stockListEntity.getIncomingBatch();
Long materialId = stockListEntity.getMaterialId();
if(isChangeAt == 1){
if(!Objects.isNull(groundingAllocationId)){
if(StringUtil.isNotBlank(allocationId)){
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(Long.parseLong(allocationId));
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
R r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架");
if(r.getCode() == 200){
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架");
}else{
if(!nowStockNum.equals(0)){
upShelfStockList.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架");
}
}
}
}else{
if(StringUtil.isNotBlank(trayCode)){
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
// String trayType = "100";
// if(!Objects.isNull(entityByTrayCode)){
// trayType = entityByTrayCode.getTrayType();
// }
WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId);
if(Objects.isNull(trayGoodsEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId));
continue;
}
Long marketId = stockListEntity.getMarketId();
Long trayGoodsId = trayGoodsEntity.getId();
R r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托");
if(r.getCode() == 200){
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(groundingAllocationId);
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架");
}else{
if(!nowStockNum.equals(0)){
upShelfStockList.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架");
}
}
}
}else{
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(materialCode);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(groundingAllocationId);
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架");
}else{
if(!nowStockNum.equals(0)){
upShelfStockList.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfStockList(upShelfStockList,groundingAllocationId,warehouseId,"盘点无数据库存品上架");
}
}
}
}
}else {
if(StringUtil.isNotBlank(newTrayCode)){
if(StringUtil.isNotBlank(allocationId)){
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(Long.parseLong(allocationId));
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
updownTypeService.upShelfStockList(upShelfStockList,allocationId,warehouseId);
R r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架");
if(r.getCode() == 200){
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
//打托
trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}else{
if(!nowStockNum.equals(0)){
trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}
}
}
}else{
if(StringUtil.isNotBlank(trayCode)){
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在trayCode="+trayCode,tenantId,userId,nickName,deptId));
continue;
}
Long oldTrayId = trayEntity.getId();
Long oldAllocationId = taryAllocationService.getAllocationIdByTrayId(oldTrayId);
String trayType = "100";
R r = null;
if(!Objects.isNull(oldAllocationId)){
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(Long.parseLong(allocationId));
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
r = updownTypeService.downStock(upShelfStockList, warehouseId,"盘点无数据库存品下架");
}else{
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId);
if(Objects.isNull(trayGoodsEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId));
continue;
}
Long trayGoodsId = trayGoodsEntity.getId();
r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托");
}
if(r.getCode() == 200){
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
//打托
trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}else{
if(!nowStockNum.equals(0)){
trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}
}
}
}else{
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(newTrayCode);
if(Objects.isNull(trayEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,托盘信息不存在newTrayCode="+newTrayCode,tenantId,userId,nickName,deptId));
continue;
}
Long newTrayId = trayEntity.getId();
Long newAllocationId = taryAllocationService.getAllocationIdByTrayId(newTrayId);
if(!Objects.isNull(newAllocationId)){
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(groundingAllocationId);
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
updownTypeService.upShelfStockList(upShelfStockList,newAllocationId,warehouseId,"盘点无数据库存品上架");
}else{
if(!nowStockNum.equals(0)){
upShelfStockList.get(0).setEnterNum(nowStockNum);
updownTypeService.upShelfStockList(upShelfStockList,newAllocationId,warehouseId,"盘点无数据库存品上架");
}
}
}else{
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(newTrayCode, warehouseId);
String trayType = "100";
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
List<ZeroOrderVO> zeroList = new ArrayList<>();
ZeroOrderVO zeroOrderVO = new ZeroOrderVO();
zeroOrderVO.setOrderId(orderId);
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(stockNum);
zeroList.add(zeroOrderVO);
//查询目前在库件数
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(Objects.isNull(nowStockNum)){
//打托
trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,stockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}else{
if(!nowStockNum.equals(0)){
trayTypeService.enterStockNoDataMaterialCode(newTrayCode,trayType,cargoNumber,materialId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}
}
}
}
}
}else{
log.warn("################syncTaskData: 未知的盘点类型数据 questTarget={}",questTarget);
continue;
}
}
}
}
}
}
}
//再处理没有库位的数据
List<String> trayCodes = taskQuestService.findNoAllocationIdAndTray(questNum);
for (String trayCode : trayCodes) {
List<QuestDetailVO> list = taskQuestService.findListByTrayCode(questNum,trayCode);
String trayType = "100";
QueryWrapper<WarehouseTrayTypeEntity> trayTypeQueryWrapper = new QueryWrapper<>();
trayTypeQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
List<WarehouseTrayTypeEntity> trayTypeList = trayTypeService.list(trayTypeQueryWrapper);
if(trayTypeList.size() > 1){
//出现多条同一托盘的打托数据,直接
log.info("#############syncTaskData: 出现多条同一托盘的打托数据 trayCode={}",trayCode);
continue;
}else if(trayTypeList.size() == 1){
WarehouseTrayTypeEntity trayTypeEntity = trayTypeList.get(0);
trayType = trayTypeEntity.getTrayType();
//空置托盘
trayTypeService.downTrayGoodsByTrayId(trayTypeEntity.getTrayId(),"盘点任务:空置托盘");
}
if(isChange == 1 && isChangeAt == 0){
//暂不处理数量问题
if(StringUtil.isNotBlank(allocationId)){
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setMaterialCode(cargoNumber);
upShelfStockDTO.setAllocationId(Long.parseLong(allocationId));
upShelfStockDTO.setEnterNum(stockNum);
upShelfStockDTO.setIncomingBatch(incomingBatch);
upShelfStockList.add(upShelfStockDTO);
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
if(!Objects.isNull(nowStockNum) && stockNum-nowStockNum != 0){
upShelfStockList.get(0).setEnterNum(stockNum-nowStockNum);
updownTypeService.downStock(upShelfStockList,warehouseId,"盘点无数据库存品下架");
}
}else{
if (StringUtil.isNotBlank(trayCode)){
String trayType = "100";
TrayTypeDataVO entityByTrayCode = trayTypeService.getEntityByTrayCode(trayCode, warehouseId);
if(!Objects.isNull(entityByTrayCode)){
trayType = entityByTrayCode.getTrayType();
}
WarehouseTrayGoodsEntity trayGoodsEntity = trayGoodsService.getStockDataByMaterialIdAndMarketId(materialId, marketId, entityByTrayCode.getTrayTypeId(), incomingBatch, warehouseId);
if(Objects.isNull(trayGoodsEntity)){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,库存品上架记录不存在stockId="+stockId,tenantId,userId,nickName,deptId));
continue;
}
Long trayGoodsId = trayGoodsEntity.getId();
R r = trayTypeService.deleteStockByTrayGoodsId(trayGoodsId,warehouseId,"盘点无数据库存品解托");
if(r.getCode() == 200){
Integer nowStockNum = taskQuestService.findStockNum(questDetailId,questNum+"_child");
trayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,cargoNumber,marketId,nowStockNum,incomingBatch,warehouseId,"盘点无数据库存品打托");
}
}
}
}
for (QuestDetailVO questDetailVO : list) {
Integer questTarget = questDetailVO.getQuestTarget();
String orderPackageCode = questDetailVO.getOrderPackageCode();
if (questTarget == 1){
log.info("################syncTaskData: 订制品类型");
//处理包件的打托
dealWithPackageTray(orderPackageCode,trayCode,warehouseId,trayType);
}else if(questTarget == 2){
log.info("################syncTaskData: 零担类型");
String orderCode = questDetailVO.getOrderCode();
Long orderId = questDetailVO.getOrderId();
Integer stockNum = questDetailVO.getStockNum();
dealWithZeroTray(orderCode,orderId,stockNum,trayCode,warehouseId,trayType);
}else if(questTarget == 3){
log.info("################syncTaskData: 库存品类型");
if(!StringUtil.isBlank(orderPackageCode)){
//包件码不为空,就是有数据库存品类型,按照包件类型走
dealWithPackageTray(orderPackageCode,trayCode,warehouseId,trayType);
}else{
String materialCode = questDetailVO.getMaterialCode();
String marketName = questDetailVO.getMarketName();
String incomingBatch = questDetailVO.getIncomingBatch();
Integer stockNum = questDetailVO.getStockNum();
dealWithStockTray(materialCode,marketName,incomingBatch,stockNum,trayCode,trayType,warehouseId);
}else {
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"无数据,数据类型错误questTarget="+questTarget,tenantId,userId,nickName,deptId));
continue;
}
}else{
log.warn("################syncTaskData: 未知的盘点类型数据 questTarget={}",questTarget);
continue;
}
}catch (Exception e){
syncTaskErrorLogList.add(createErrorLog(questNum,questDetailId,"处理报错questTarget="+questTarget,tenantId,userId,nickName,deptId));
continue;
}
}
log.info("################syncTaskData: 处理完成");
syncTaskErrorLogService.saveBatch(syncTaskErrorLogList);
taskQuestEntity.setSyncDataStatus(2);
taskQuestEntity.setQuestStatus("4");
taskQuestService.updateById(taskQuestEntity);
log.info("################syncTaskData: 处理完成 盘点任务同步");
}
private SyncTaskErrorLogEntity createErrorLog(String questNum,Long questDetailId,String msg,String tenantId,Long userId,String nickName,Long deptId){
Date date = new Date();
SyncTaskErrorLogEntity syncTaskErrorLogEntity = new SyncTaskErrorLogEntity();
syncTaskErrorLogEntity.setTenantId(tenantId);
syncTaskErrorLogEntity.setCreateUser(userId);
syncTaskErrorLogEntity.setCreateTime(date);
syncTaskErrorLogEntity.setUpdateUser(userId);
syncTaskErrorLogEntity.setUpdateTime(date);
syncTaskErrorLogEntity.setCreateDept(deptId);
syncTaskErrorLogEntity.setIsDeleted(0);
syncTaskErrorLogEntity.setStatus(1);
syncTaskErrorLogEntity.setQuestNum(questNum);
syncTaskErrorLogEntity.setQuestDetailId(questDetailId);
syncTaskErrorLogEntity.setMsg(msg);
return syncTaskErrorLogEntity;
}
@Override
public void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO) {
Integer trayId = trayInfoDTO.getTrayId();
@ -414,7 +785,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.downPackage(upShelfPackageList,wid);
updownTypeService.downPackage(upShelfPackageList,wid,"系统包件下架");
}
}
@ -451,7 +822,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.downPackage(upShelfPackageList,wid);
updownTypeService.downPackage(upShelfPackageList,wid,"系统包件下架");
}
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId);
int code1 = r.getCode();
@ -475,7 +846,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
}else if(code == 4004){
log.info("####################orderStatusHandler: 包件打托方式不正确 orderPackageCode={} ",orderPackageCode);
//先去空置托盘再打托
trayTypeService.trayToNull("T"+trayId);
trayTypeService.trayToNull("T"+trayId,"系统空置托盘");
R r = trayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId);
int code1 = r.getCode();
@ -517,7 +888,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,newWarehouseId);
updownTypeService.upShelfPackage(upShelfPackageList,allocationId,newWarehouseId,"");
}
}
@ -616,7 +987,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
}
Long marketId = stockListEntity.getMarketId();
Long id = stockListEntity.getId();
R r = trayTypeService.enterStockNoDataMaterialCode(trayCode, trayType, materialCode, marketId, stockNum, incomingBatch, warehouseId);
R r = trayTypeService.enterStockNoDataMaterialCode(trayCode, trayType, materialCode, marketId, stockNum, incomingBatch, warehouseId,"系统无数据库存品打托");
int code = r.getCode();
if(code == 200){
log.info("##################dealWithStockTray: 库存品打托成功 trayCode={} trayType={} materialCode={} marketId={} incomingBatch={} stockNum={}",trayCode,trayType,materialCode,marketId,incomingBatch,stockNum);
@ -635,7 +1006,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
zeroOrderVO.setOrderCode(orderCode);
zeroOrderVO.setNum(stockNum);
zeroList.add(zeroOrderVO);
trayTypeService.enterZeroOrderByTrayCodeSync(trayType,trayCode,zeroList,warehouseId);
trayTypeService.enterZeroOrderByTrayCodeSync(trayType,trayCode,zeroList,warehouseId,"系统处理零担打托");
}
private void dealWithPackageTray(String orderPackageCode, String trayCode,Long warehouseId,String trayType) {
@ -647,9 +1018,9 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
//解绑
updownTypeService.downPackageOrDelTray(upShelfPackageList,warehouseId);
updownTypeService.downPackageOrDelTray(upShelfPackageList,warehouseId,"处理包件解托");
R r = trayTypeService.orderScanOrderPackageCode(trayType, trayCode, orderPackageCode, warehouseId);
R r = trayTypeService.orderScanOrderPackageCode(trayType, trayCode, orderPackageCode, warehouseId,"系统包件打托");
int code = r.getCode();
if(code == 200){
log.info("###################dealWithPackageTray: 包件打托成功 orderPackageCode={} trayCode={}",orderPackageCode,trayCode);

15
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/SyncTaskErrorLogServiceImpl.java

@ -0,0 +1,15 @@
package com.logpm.warehouse.service.impl;
import com.logpm.warehouse.entity.SyncTaskErrorLogEntity;
import com.logpm.warehouse.mapper.SyncTaskErrorLogMapper;
import com.logpm.warehouse.service.ISyncTaskErrorLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class SyncTaskErrorLogServiceImpl extends BaseServiceImpl<SyncTaskErrorLogMapper, SyncTaskErrorLogEntity> implements ISyncTaskErrorLogService {
}

579
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -60,6 +60,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.UserCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserSearchClient;
@ -206,6 +207,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setOrderId(i.getStockArticleId());
detailEntity.setSendWarehouseName(i.getSendWarehouseName());
detailEntity.setBrandName(i.getBrandName());
detailEntity.setHasData(1);
// detailEntity.setQuestType();
//盘点对象;1.定制品 2零担 3 库存品
//查询托盘名称
@ -218,6 +220,13 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setTrayName(basicdataTrayEntity.getPalletName());
}
}
Integer conditions = i.getConditions();
if(conditions.equals(1)){
detailEntity.setQuestTarget(1);
}else if (conditions.equals(2)){
detailEntity.setQuestTarget(3);
}
if (ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(1)) {
detailEntity.setQuestTarget(i.getConditions());
} else if (ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(2)) {
@ -271,35 +280,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<DistributionStockListVO> stockListInfo = distributionStockListClient.getStockListInfo(stockListEntity);
if (!stockListInfo.isEmpty()) {
detailEntityList.addAll(handleStockList(stockListInfo, taskQuest));
// stockListInfo.stream().forEach( li ->{
// QuestDetailEntity detailListEntity = new QuestDetailEntity();
// detailListEntity.setCreateTime(new Date());
// detailListEntity.setTenantId(user.getTenantId());
// detailListEntity.setCreateUser(user.getUserId());
// detailListEntity.setCreateDept(Long.valueOf(user.getDeptId()));
// detailListEntity.setIsDeleted(0);
// detailListEntity.setStatus(1);
// detailListEntity.setQuestId(taskQuest);
// detailListEntity.setOrderCode(li.getOrderCode());
// //盘点对象;1.定制品 2零担 3 库存品
// detailListEntity.setQuestTarget(3);
// detailListEntity.setWaybillNumber(li.getIncomingBatch());
// detailListEntity.setStockId(li.getId()); //库存品ID
// detailListEntity.setQuestStatus(0);
// detailListEntity.setStockNum(li.getQuantityStock());
// detailListEntity.setWarehouseId(li.getWarehouseId());
// detailListEntity.setPositionCode(li.getPositionCode());
// detailListEntity.setTrayCode(li.getTrayCode());
// detailListEntity.setTrayId(li.getTrayId());
// detailListEntity.setAllocationId(li.getAllocationId());
// detailListEntity.setIsNew(0);
//
// detailListEntity.setMaterialCode(li.getCargoNumber());
// detailListEntity.setMaterialName(li.getDescriptionGoods());
// detailListEntity.setMarketName(li.getMallName());
// detailListEntity.setIncomingBatch(li.getIncomingBatch());
// detailEntityList.add(detailListEntity);
// });
}
log.debug("全部包件数据=={}", detailEntityList.size());
if (!detailEntityList.isEmpty()) {
@ -313,26 +293,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<QuestDetailEntity> subList = detailEntityList.subList(startIndex, endIndex);
baseMapper.insertQuestDetail(questNum, subList);
}
// int totalSize = detailEntityList.size(); // 获取总数据量
// int batchSize = 1000; // 设置批处理的大小
// int xh = (int) Math.ceil( totalSize / batchSize);
// for (int i = 0; i < xh; i ++) {
// List<QuestDetailEntity> subList = new ArrayList<>();
// if(i == 0){
// subList = detailEntityList.subList(i, batchSize);
// baseMapper.insertQuestDetail(questNum, subList);
//
// }else{
// subList = detailEntityList.subList(batchSize, batchSize+1000);
// baseMapper.insertQuestDetail(questNum, subList);
// batchSize = batchSize+1000;
// }
// }
// int q = totalSize - (xh * batchSize);
// if(q > 0){
// baseMapper.insertQuestDetail(questNum,detailEntityList.subList(xh * batchSize, q));
// }
log.info("数量七千万===》》》" + xh);
}
@ -375,77 +335,102 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<QuestDetailEntity> detailEntityList = new ArrayList<>();
BladeUser user = AuthUtil.getUser();
//处理库位,托盘
stockArticleInfo.stream().forEach(i -> {
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(i.getOrderCode());
detailEntity.setOrderId(i.getId());
// detailEntity.setQuestType();
//盘点对象;1.定制品 2零担 3 库存品
detailEntity.setQuestTarget(2);
// detailEntity.setOrdePackageCode(i.getOrderPackageCode());
detailEntity.setWaybillNumber(i.getWaybillNumber());
// detailEntity.setOrderPackageId(i.getId());
detailEntity.setCategoryName(i.getDescriptionGoods());
// detailEntity.setStockId(i.getStockId()); //库存品ID
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(i.getMallName());
detailEntity.setIncomingBatch(i.getOrderCode());
detailEntity.setWarehouseId(i.getWarehouseId());
detailEntity.setIsNew(0);
detailEntity.setBrandName(i.getBrand());
//查询货位
QueryWrapper<WarehouseUpdownGoodsEntity> qw = new QueryWrapper<>();
qw.eq("warehouse_id", i.getWarehouseId());
qw.eq("association_id", i.getId());
qw.eq("incoming_batch", i.getOrderCode());
qw.eq("market_id", i.getMallId());
List<WarehouseUpdownGoodsEntity> updownGoodsList = warehouseUpdownGoodsMapper.selectList(qw);
if (!updownGoodsList.isEmpty()) {
updownGoodsList.stream().forEach(ii -> {
QuestDetailEntity qq = new QuestDetailEntity();
BeanUtil.copyProperties(detailEntity, qq);
qq.setId(getTaskID());
qq.setPositionCode(ii.getPositionCode());
qq.setAllocationId(String.valueOf(ii.getAllocationId()));
qq.setMaterialName(ii.getMarketName());
BasicdataTrayEntity trayByAllocationId = taryAllocationService.getTrayByAllocationId(ii.getAllocationId());
if (ObjectUtils.isNotNull(trayByAllocationId)) {
List<WarehouseTrayGoodsEntity> tray = chuLiKuCun(i, trayByAllocationId.getId());
if (!tray.isEmpty()) {
qq.setTrayCode(tray.get(0).getTrayCode());
qq.setTrayId(String.valueOf(tray.get(0).getTrayId()));
qq.setStockNum(ObjectUtils.isNotNull(tray.get(0).getNum()) ? tray.get(0).getNum() : 0);
}
}
qq.setStockNum(ObjectUtils.isNotNull(ii.getNum()) ? ii.getNum() : 0);
detailEntityList.add(qq);
});
} else {
List<WarehouseTrayGoodsEntity> warehouseTrayGoodsEntities = chuLiKuCun(i, null);
if (!warehouseTrayGoodsEntities.isEmpty()) {
warehouseTrayGoodsEntities.stream().forEach(ta -> {
QuestDetailEntity aa = new QuestDetailEntity();
BeanUtil.copyProperties(detailEntity, aa);
aa.setId(getTaskID());
aa.setTrayCode(ta.getTrayCode());
aa.setTrayId(String.valueOf(ta.getTrayId()));
aa.setStockNum(ObjectUtils.isNotNull(ta.getNum()) ? ta.getNum() : 0);
detailEntityList.add(aa);
});
}
for (DistributionStockArticleEntity stockArticleEntity : stockArticleInfo) {
Integer handQuantity = stockArticleEntity.getHandQuantity();
if(handQuantity == 0){
continue;
}
String orderCode = stockArticleEntity.getOrderCode();
Long orderId = stockArticleEntity.getId();
Long warehouseId = stockArticleEntity.getWarehouseId();
String waybillNumber = stockArticleEntity.getWaybillNumber();
//查询零担订单在哪些库位上
List<PositionVO> updownGoodsEntities = warehouseUpdownGoodsMapper.getUpdownGoodsByZeroOrderId(orderId,warehouseId);
Integer tnum = 0;
for (PositionVO updownGoodsEntity : updownGoodsEntities) {
Integer num = updownGoodsEntity.getNum();
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(orderCode);
detailEntity.setOrderId(orderId);
detailEntity.setHasData(0);
detailEntity.setQuestTarget(2);
detailEntity.setWaybillNumber(waybillNumber);
detailEntity.setCategoryName(stockArticleEntity.getDescriptionGoods());
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(stockArticleEntity.getMallName());
detailEntity.setWarehouseId(warehouseId);
detailEntity.setIsNew(0);
detailEntity.setStockNum(num);
detailEntity.setTrayId(updownGoodsEntity.getTrayId()+"");
detailEntity.setTrayCode(updownGoodsEntity.getTrayCode());
detailEntity.setAllocationId(updownGoodsEntity.getAllocationId()+"");
detailEntity.setPositionCode(updownGoodsEntity.getPositionCode());
detailEntityList.add(detailEntity);
tnum = tnum + num;
}
detailEntity.setStockNum(ObjectUtils.isNotNull(i.getHandQuantity()) ? i.getHandQuantity() : 0);
detailEntityList.add(detailEntity);
});
List<PositionVO> trayGoodsEntities = warehouseTrayGoodsMapper.getTrayGoodsByZeroOrderIdNoAllocationId(orderId,warehouseId);
for (PositionVO trayGoodsEntity : trayGoodsEntities) {
Integer num = trayGoodsEntity.getNum();
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(orderCode);
detailEntity.setOrderId(orderId);
detailEntity.setHasData(0);
detailEntity.setQuestTarget(2);
detailEntity.setWaybillNumber(waybillNumber);
detailEntity.setCategoryName(stockArticleEntity.getDescriptionGoods());
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(stockArticleEntity.getMallName());
detailEntity.setWarehouseId(warehouseId);
detailEntity.setStockNum(num);
detailEntity.setIsNew(0);
detailEntity.setTrayId(trayGoodsEntity.getTrayId()+"");
detailEntity.setTrayCode(trayGoodsEntity.getTrayCode());
detailEntityList.add(detailEntity);
tnum = tnum + num;
}
if(handQuantity-tnum > 0){
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(orderCode);
detailEntity.setOrderId(orderId);
detailEntity.setHasData(0);
detailEntity.setQuestTarget(2);
detailEntity.setWaybillNumber(waybillNumber);
detailEntity.setCategoryName(stockArticleEntity.getDescriptionGoods());
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(stockArticleEntity.getMallName());
detailEntity.setWarehouseId(warehouseId);
detailEntity.setStockNum(handQuantity-tnum);
detailEntity.setIsNew(0);
detailEntityList.add(detailEntity);
}
}
return detailEntityList;
}
@ -455,86 +440,110 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
public List<QuestDetailEntity> handleStockList(List<DistributionStockListVO> stockListInfo, Long taskQuest) {
List<QuestDetailEntity> detailEntityList = new ArrayList<>();
BladeUser user = AuthUtil.getUser();
//处理库位,托盘
stockListInfo.stream().forEach(i -> {
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(i.getOrderCode());
detailEntity.setOrderId(i.getId());
// detailEntity.setQuestType();
//盘点对象;1.定制品 2零担 3 库存品
detailEntity.setQuestTarget(3);
// detailEntity.setOrdePackageCode(i.getOrderPackageCode());
detailEntity.setWaybillNumber(i.getIncomingBatch());
// detailEntity.setOrderPackageId(i.getId());
detailEntity.setCategoryName(i.getDescriptionGoods());
detailEntity.setStockId(i.getId()); //库存品ID
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(i.getMallName());
detailEntity.setIncomingBatch(i.getOrderCode());
detailEntity.setWarehouseId(i.getWarehouseId());
detailEntity.setIsNew(0);
detailEntity.setBrandName(i.getBrandName());
//查询货位
QueryWrapper<WarehouseUpdownGoodsEntity> qw = new QueryWrapper<>();
qw.eq("warehouse_id", i.getWarehouseId());
qw.eq("association_id", i.getMaterialId());
qw.eq("incoming_batch", i.getIncomingBatch());
qw.eq("market_id", i.getMarketId());
List<WarehouseUpdownGoodsEntity> updownGoodsList = warehouseUpdownGoodsMapper.selectList(qw);
if (!updownGoodsList.isEmpty()) {
updownGoodsList.stream().forEach(ii -> {
QuestDetailEntity a = new QuestDetailEntity();
BeanUtil.copyProperties(detailEntity, a);
a.setId(getTaskID());
a.setPositionCode(ii.getPositionCode());
a.setAllocationId(String.valueOf(ii.getAllocationId()));
a.setMaterialName(ii.getMarketName());
BasicdataTrayEntity trayByAllocationId = taryAllocationService.getTrayByAllocationId(ii.getAllocationId());
if (ObjectUtils.isNotNull(trayByAllocationId)) {
List<WarehouseTrayGoodsEntity> tray = chuLiKuCunLing(i, trayByAllocationId.getId());
if (!tray.isEmpty()) {
a.setTrayCode(tray.get(0).getTrayCode());
a.setTrayId(String.valueOf(tray.get(0).getTrayId()));
a.setStockNum(ObjectUtils.isNotNull(tray.get(0).getNum()) ? tray.get(0).getNum() : 0);
}
}
a.setStockNum(ObjectUtils.isNotNull(ii.getNum()) ? ii.getNum() : 0);
detailEntityList.add(a);
});
} else {
List<WarehouseTrayGoodsEntity> warehouseTrayGoodsEntities = chuLiKuCunLing(i, null);
if (!warehouseTrayGoodsEntities.isEmpty()) {
warehouseTrayGoodsEntities.stream().forEach(ta -> {
QuestDetailEntity detailEntityTray = new QuestDetailEntity();
BeanUtil.copyProperties(detailEntity, detailEntityTray);
detailEntityTray.setId(getTaskID());
detailEntityTray.setTrayCode(ta.getTrayCode());
detailEntityTray.setTrayId(String.valueOf(ta.getTrayId()));
detailEntityTray.setStockNum(ObjectUtils.isNotNull(ta.getNum()) ? ta.getNum() : 0);
detailEntityList.add(detailEntityTray);
});
}
for (DistributionStockListVO distributionStockListVO : stockListInfo) {
Integer quantityStock = distributionStockListVO.getQuantityStock();
if(quantityStock == 0){
continue;
}
if (ObjectUtils.isNotNull(detailEntityList.isEmpty())) {
List<QuestDetailEntity> collect = detailEntityList.stream().filter(q -> q.getStockId().equals(i.getId())).collect(Collectors.toList());
if (!collect.isEmpty()) {
int sum = collect.stream().mapToInt(QuestDetailEntity::getStockNum).sum();
int i1 = i.getQuantityStock() - sum;
detailEntity.setStockNum(i1);
} else {
detailEntity.setStockNum(ObjectUtils.isNotNull(i.getQuantityStock()) ? i.getQuantityStock() : 0);
}
Long warehouseId = distributionStockListVO.getWarehouseId();
String incomingBatch = distributionStockListVO.getIncomingBatch();
String cargoNumber = distributionStockListVO.getCargoNumber();
Long marketId = distributionStockListVO.getMarketId();
Integer tnum = 0;
List<PositionVO> updownGoodsByStock = warehouseUpdownGoodsMapper.getUpdownGoodsByStock(marketId,cargoNumber,incomingBatch,warehouseId);
for (PositionVO positionVO : updownGoodsByStock) {
Integer num = positionVO.getNum();
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(distributionStockListVO.getOrderCode());
detailEntity.setHasData(0);
//盘点对象;1.定制品 2零担 3 库存品
detailEntity.setQuestTarget(3);
detailEntity.setStockNum(num);
detailEntity.setCategoryName(distributionStockListVO.getDescriptionGoods());
detailEntity.setStockId(distributionStockListVO.getId()); //库存品ID
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(distributionStockListVO.getMarketName());
detailEntity.setMaterialName(distributionStockListVO.getDescriptionGoods());
detailEntity.setMaterialCode(cargoNumber);
detailEntity.setIncomingBatch(incomingBatch);
detailEntity.setWarehouseId(warehouseId);
detailEntity.setIsNew(0);
detailEntity.setTrayId(positionVO.getTrayId()+"");
detailEntity.setTrayCode(positionVO.getTrayCode());
detailEntity.setAllocationId(positionVO.getAllocationId()+"");
detailEntity.setPositionCode(positionVO.getPositionCode());
detailEntityList.add(detailEntity);
tnum = tnum + num;
}
detailEntityList.add(detailEntity);
});
List<PositionVO> traynGoodsByStock = warehouseTrayGoodsMapper.getTrayGoodsByStockNoAllocationId(marketId,cargoNumber,incomingBatch,warehouseId);
for (PositionVO positionVO : traynGoodsByStock) {
Integer num = positionVO.getNum();
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(distributionStockListVO.getOrderCode());
detailEntity.setHasData(0);
//盘点对象;1.定制品 2零担 3 库存品
detailEntity.setQuestTarget(3);
detailEntity.setStockNum(num);
detailEntity.setCategoryName(distributionStockListVO.getDescriptionGoods());
detailEntity.setStockId(distributionStockListVO.getId()); //库存品ID
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(distributionStockListVO.getMarketName());
detailEntity.setMaterialName(distributionStockListVO.getDescriptionGoods());
detailEntity.setMaterialCode(cargoNumber);
detailEntity.setIncomingBatch(incomingBatch);
detailEntity.setWarehouseId(warehouseId);
detailEntity.setIsNew(0);
detailEntity.setTrayId(positionVO.getTrayId()+"");
detailEntity.setTrayCode(positionVO.getTrayCode());
detailEntityList.add(detailEntity);
tnum = tnum + num;
}
if(quantityStock-tnum > 0){
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setId(getTaskID());
detailEntity.setCreateTime(new Date());
detailEntity.setTenantId(user.getTenantId());
detailEntity.setCreateUser(user.getUserId());
detailEntity.setCreateDept(getDeptByMaxDept(user.getDeptId()));
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(distributionStockListVO.getOrderCode());
detailEntity.setHasData(0);
//盘点对象;1.定制品 2零担 3 库存品
detailEntity.setQuestTarget(3);
detailEntity.setStockNum(quantityStock-tnum);
detailEntity.setCategoryName(distributionStockListVO.getDescriptionGoods());
detailEntity.setStockId(distributionStockListVO.getId()); //库存品ID
detailEntity.setQuestStatus(0);
detailEntity.setMarketName(distributionStockListVO.getMarketName());
detailEntity.setMaterialName(distributionStockListVO.getDescriptionGoods());
detailEntity.setMaterialCode(cargoNumber);
detailEntity.setIncomingBatch(incomingBatch);
detailEntity.setWarehouseId(warehouseId);
detailEntity.setIsNew(0);
detailEntityList.add(detailEntity);
}
}
return detailEntityList;
}
@ -808,7 +817,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
if (i.getIsNew().equals(1)) {
//新增数据
Integer questTarget = i.getQuestTarget();
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(i, questDetail);
questDetail.setTenantId(user.getTenantId());
@ -816,9 +825,22 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setIsChange(1);
if(questTarget.equals(2)){
questDetail.setHasData(0);
}else{
String orderPackageCode = i.getOrderPackageCode();
if(StringUtil.isBlank(orderPackageCode)){
questDetail.setHasData(0);
}else{
questDetail.setHasData(1);
}
}
questDetail.setCreateUser(user.getUserId());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setInventoryTime(new Date());
questDetail.setInventoryUser(user.getUserId());
questDetail.setId(taskID);
questDetail.setWarehouseId(warehouseId);
@ -842,6 +864,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
if (ObjectUtils.isNotNull(questDetail1)) {
i.setId(questDetail1.getId());
taskID = questDetail1.getId();
}
}
//添加
@ -862,6 +885,20 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
QuestDetailEntity detailEntity = baseMapper.findEntityById(questNum,taskID);
if(!Objects.isNull(detailEntity)){
Integer isNew = detailEntity.getIsNew();
Integer questTarget = detailEntity.getQuestTarget();
Integer stockNum1 = detailEntity.getStockNum();
if(isNew.equals(1)){
questDetail.setIsChange(1);
}else{
if(!stockNum1.equals(stockNum)){
questDetail.setIsChange(1);
}
}
}
questDetail.setUpdateTime(new Date());
if (ObjectUtils.isNotNull(i.getTrayId())) {
questDetail.setTrayId(i.getTrayId());
@ -871,28 +908,32 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list);
} else {
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum + "_child", collect);
// List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum + "_child", childList);
}
}
//是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity();
if (ObjectUtils.isNotNull(i.getGroundingAllocationId())) {
if (ObjectUtils.isNotNull(i.getGroundingAllocationId()) || ObjectUtils.isNotNull(i.getNewTrayId()) ) {
//查询当前待更新货位是否包含已更新货位数据
QuestDetailEntity questDetail1 = new QuestDetailEntity();
questDetail1.setGroundingAllocationId(i.getGroundingAllocationId());
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1);
if (!questDetailEntities.isEmpty()) {
boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId()));
if (b) {
return Resp.scanFail("更新的货位,已有数据,无法上架更新!", "更新的货位,已有数据,无法上架更新!");
}
}
// List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1);
// if (!questDetailEntities.isEmpty()) {
// boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId()));
// if (b) {
// return Resp.scanFail("更新的货位,已有数据,无法上架更新!", "更新的货位,已有数据,无法上架更新!");
// }
// }
questDetail.setId(i.getId());
// questDetail.setGroundingAllocationId(Long.valueOf(i.getAllocationId()));
questDetail.setIsChangeAt(1);
questDetail.setNewTrayId(i.getNewTrayId());
questDetail.setNewTrayCode(i.getNewTrayCode());
questDetail.setGroundingAllocationId(i.getGroundingAllocationId());
questDetail.setGroundingPositionCode(i.getGroundingPositionCode());
questDetail.setInventoryTime(new Date());
questDetail.setInventoryUser(user.getUserId());
detailEntityList.add(questDetail);
}
@ -1071,7 +1112,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questContrastVO.setQuestTarget(2);
List<QuestDetailEntity> list1 = baseMapper.selectQuestDetailList(questDetailDTO.getQuestNum(), questContrastVO);
if (ObjectUtils.isNotNull(list1)) {
list1.stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderId)).forEach((k, v) -> {
list1.stream().filter(item -> !Objects.isNull(item.getOrderId())).collect(Collectors.groupingBy(QuestDetailEntity::getOrderId)).forEach((k, v) -> {
//查询订单信息
DistributionStockArticleEntity entityByStockArticle = distributionStockArticleClient.findEntityByStockArticleId(k);
@ -1402,13 +1443,18 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
throw new CustomerException(405, "未找到盘点任务信息");
}
Long warehouseId = taskQuestEntity.getWarehouseId();
String questStatus = taskQuestEntity.getQuestStatus();
if("3".equals(questStatus)){
log.warn("##########syncTaskData: 盘点任务未结束,不能同步 questNum={}", questNum);
throw new CustomerException(405, "盘点任务未结束");
}
//开启异步线程处理盘点数据
asyncDataService.syncTaskData(questNum, warehouseId);
asyncDataService.syncTaskData(questNum, warehouseId,AuthUtil.getTenantId(),AuthUtil.getUserId(),AuthUtil.getNickName(),Func.firstLong(AuthUtil.getDeptId()));
taskQuestEntity.setSyncDataStatus(1);
taskQuestEntity.setSyncUserId(AuthUtil.getUserId());
taskQuestEntity.setSyncUserName(AuthUtil.getUserName());
taskQuestEntity.setSyncUserName(AuthUtil.getNickName());
taskQuestEntity.setSyncTime(new Date());
updateById(taskQuestEntity);
}
@ -1487,7 +1533,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
if (taskSearchDTO.getTypeState().equals(1)) {
//有
if (questDetailEntity.getQuestTarget().equals(2) || ObjectUtils.isNull(questDetailEntity.getOrderPackageCode())) {
if (questDetailEntity.getHasData().equals(0)) {
continue;
}
//查询包件信息
@ -1500,7 +1546,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
} else {
//没有
if (questDetailEntity.getQuestTarget().equals(1) || ObjectUtils.isNotNull(questDetailEntity.getOrderPackageCode())) {
if (questDetailEntity.getHasData().equals(1) ) {
continue;
}
@ -1531,7 +1577,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
WarehouseGoodsAllocationEntity byId = warehouseGoodsAllocationService.getById(taskSearchDTO.getAllocationId());
if (ObjectUtils.isNotNull(byId)) {
TaskallocationVO taskallocationVO = new TaskallocationVO();
taskallocationVO.setAllocationId(taskSearchDTO.getAllocationId());
taskallocationVO.setAllocationId(taskSearchDTO.getAllocationId()+"");
taskallocationVO.setPositionCode(byId.getQrCode());
list.add(taskallocationVO);
}
@ -1744,50 +1790,39 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
*
* @return
*/
private List<TaskTrayVO> getTaskTrayInfo(List<QuestDetailEntity> list1) {
private TaskTrayVO getTaskTrayInfo(List<QuestDetailEntity> list1) {
// return baseMapper.selecttrayList(page,taskSearchDTO,collect);// 查询有没有当次盘点任务的托盘数据
List<TaskTrayVO> list = new ArrayList<>();
list1.stream().collect(Collectors.groupingBy(QuestDetailEntity::getTrayId))
.forEach((k, v) -> {
TaskTrayVO taskTrayVO = new TaskTrayVO();
taskTrayVO.setTrayId(Long.valueOf(k));
//查询托盘信息
List<BasicdataTrayEntity> trayEntityList = basicdataTrayClient.getTrayEntityList(k);
if (ObjectUtils.isNotNull(trayEntityList)) {
taskTrayVO.setTrayName(trayEntityList.get(0).getPalletName());
}
AtomicReference<Integer> num = new AtomicReference<>(0); //总数
AtomicReference<Integer> unTotal = new AtomicReference<>(0); //盘点数
List<QuestDetailVO> list2 = new ArrayList<>();
v.forEach(p -> {
taskTrayVO.setTrayCode(p.getTrayCode());
num.set(num.get() + p.getStockNum());
if (p.getQuestStatus().equals(1)) {
unTotal.set(unTotal.get() + p.getQuestStatus());
}
switch (p.getQuestTarget()) {
case 1:
taskTrayVO.setGoodsType("定制品");
break;
case 2:
taskTrayVO.setGoodsType("零担");
break;
case 3:
taskTrayVO.setGoodsType("库存品");
break;
}
QuestDetailVO questDetail = new QuestDetailVO();
BeanUtil.copyProperties(p, questDetail);
list2.add(questDetail);
});
taskTrayVO.setTotal(num.get());
taskTrayVO.setUnTotal(unTotal.get());
taskTrayVO.setList(list2);
list.add(taskTrayVO);
});
TaskTrayVO taskTrayVO = new TaskTrayVO();
return list;
QuestDetailEntity questDetailEntity = list1.get(0);
String trayId = questDetailEntity.getTrayId();
if(StringUtil.isBlank(trayId)){
trayId = questDetailEntity.getNewTrayId()+"";
}
taskTrayVO.setTrayId(Long.parseLong(trayId));
List<BasicdataTrayEntity> trayEntityList = basicdataTrayClient.getTrayEntityList(trayId);
if (ObjectUtils.isNotNull(trayEntityList)) {
taskTrayVO.setTrayName(trayEntityList.get(0).getPalletName());
taskTrayVO.setTrayCode(trayEntityList.get(0).getPalletCode());
}
Integer total = 0;
Integer unTotal = 0;
for (QuestDetailEntity entity : list1) {
Integer questStatus = entity.getQuestStatus();
Integer stockNum = entity.getStockNum();
total = total + stockNum;
if(questStatus.equals(1)){
unTotal = unTotal + stockNum;
}
}
taskTrayVO.setTotal(total);
taskTrayVO.setUnTotal(unTotal);
return taskTrayVO;
}
@ -1817,7 +1852,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
if (type.equals("1")) {
//有 定 库 有
if (p.getQuestTarget().equals(2) || ObjectUtils.isNull(p.getOrderPackageCode())) {//去除零担数据
if (p.getHasData().equals(0)) {//去除零担数据
continue;
}
//查询包件信息
@ -1826,16 +1861,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// continue;
// }
packagelistVO.setQuestDetailId(p.getId());
packagelistVO.setQuantity(p.getStockNum());
packagelistVO.setState(String.valueOf(p.getQuestTarget()));
packagelistVO.setOrderPackageCode(p.getOrderPackageCode());
} else {
// 没有 零 库 无
if (p.getQuestTarget().equals(1) || ObjectUtils.isNotNull(p.getOrderPackageCode())) { //去除订单数据 //去除包件不为空的数据
if (p.getHasData().equals(1)) { //去除订单数据 //去除包件不为空的数据
continue;
}
packagelistVO.setQuestDetailId(p.getId());
packagelistVO.setQuantity(p.getStockNum());
packagelistVO.setState(String.valueOf(p.getQuestTarget()));
}
//查询盘点过后的数据
@ -1914,6 +1947,21 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<QuestDetailEntity> questDetailList = getQuestDetailList(taskSearchDTO, myCurrentWarehouse.getId(), trayByTrayCode.getId());
for (QuestDetailEntity questDetailEntity : questDetailList) {
String trayId = questDetailEntity.getTrayId();
if(StringUtil.isBlank(trayId)){
questDetailEntity.setTrayId(questDetailEntity.getNewTrayId()+"");
questDetailEntity.setTrayCode(questDetailEntity.getNewTrayCode());
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(questDetailEntity.getNewTrayCode());
if(!Objects.isNull(trayEntity)){
questDetailEntity.setTrayName(trayEntity.getPalletName());
}
}
}
return R.data(getTaskTrayInfoOwn(taskSearchDTO, questDetailList, String.valueOf(taskSearchDTO.getTypeState()), myCurrentWarehouse.getId()));
}
@ -2634,7 +2682,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
if (taskSearchDTO.getTypeState().equals(1)) {
//有
if (questDetailEntity.getQuestTarget().equals(2) || ObjectUtils.isNull(questDetailEntity.getOrderPackageCode())) {
if (questDetailEntity.getHasData().equals(0)) {
continue;
}
//查询包件信息
@ -2647,7 +2695,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
} else {
//没有
if (questDetailEntity.getQuestTarget().equals(1) || ObjectUtils.isNotNull(questDetailEntity.getOrderPackageCode())) {
if (questDetailEntity.getHasData().equals(1)) {
continue;
}
}
@ -2922,6 +2970,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
} else {
QuestDetailChildEntity detailChildEntity = new QuestDetailChildEntity();
detailChildEntity.setQuestNum(num);
detailChildEntity.setCargoName(cargoName);
detailChildEntity.setId(questDetailChildEntity.getId());
return detailChildEntity;
}
@ -3333,6 +3382,16 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
@Override
public List<QuestDetailEntity> findIsChangeData(String questNum) {
return baseMapper.findIsChangeData(questNum);
}
@Override
public Integer findStockNum(Long questDetailId, String tableName) {
return baseMapper.findStockNum(questDetailId,tableName);
}
private String getQuestNum(String warehouseCode) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
// return "PDRW_" + warehouseCode + "_" + simpleDateFormat.format(new Date()) + String.format("%03d", new Random().nextInt(900) + 100);

44
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -426,7 +426,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
// @Transactional(rollbackFor = Exception.class)
@Override
public R orderScanOrderPackageCode(String trayType, String trayCode, String orderPackageCode,Long warehouseId) {
public R orderScanOrderPackageCode(String trayType, String trayCode, String orderPackageCode,Long warehouseId,String remark) {
//判断该包件是否已存在与其他托盘上
QueryWrapper<WarehouseTrayGoodsEntity> qw = new QueryWrapper<>();
@ -663,10 +663,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
// changeTotalNumByTrayTypeId(parcelListEntity,trayTypeEntity.getId(),1);//addSub 1加 2减
if(chuanFlag){
//存入包件与托盘绑定关系表
warehouseTrayGoodsService.saveEntityPackage(parcelListEntity,trayTypeEntity,"1","1","分拣打托:扫码分拣","1");
warehouseTrayGoodsService.saveEntityPackage(parcelListEntity,trayTypeEntity,"1","1",remark,"1");
}else{
//存入包件与托盘绑定关系表
warehouseTrayGoodsService.saveEntityPackage(parcelListEntity,trayTypeEntity,"0","1","分拣打托:扫码分拣","1");
warehouseTrayGoodsService.saveEntityPackage(parcelListEntity,trayTypeEntity,"0","1",remark,"1");
}
//添加上拖日志表
// warehouseTrayGoodsLogService.saveLogPackage(parcelListEntity,trayTypeEntity,"1","分拣打托:扫码分拣","1");
@ -1243,7 +1243,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Transactional(rollbackFor = Exception.class)
@Override
public R enterZeroOrderByTrayCode(String trayType,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId) {
public R enterZeroOrderByTrayCode(String trayType,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId,String remark) {
if(Objects.isNull(zeroList)){
log.warn("##############enterZeroOrderByTrayCode: 数据为空 zeroList={}",zeroList);
return R.fail(403,"数据为空");
@ -1329,10 +1329,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
// changeZeroTotalNumByTrayTypeId(stockArticleEntity, trayTypeEntity.getId(),num, 1);//addSub 1加 2减
if(flag){
//存入零担与托盘绑定关系表
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "1","1", "分拣打托:人工分拣", "1");
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "1","1", remark, "1");
}else{
//存入零担与托盘绑定关系表
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "0","1", "分拣打托:人工分拣", "1");
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "0","1", remark, "1");
}
//更新打托方式上的值
updateNumByTrayTypeId(trayTypeEntity);
@ -1352,7 +1352,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Transactional(rollbackFor = Exception.class)
@Override
public R enterZeroOrderByTrayCodeSync(String trayType,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId) {
public R enterZeroOrderByTrayCodeSync(String trayType,String trayCode, List<ZeroOrderVO> zeroList,Long warehouseId,String remark) {
if(Objects.isNull(zeroList)){
log.warn("##############enterZeroOrderByTrayCode: 数据为空 zeroList={}",zeroList);
return R.fail(403,"数据为空");
@ -1438,10 +1438,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
// changeZeroTotalNumByTrayTypeId(stockArticleEntity, trayTypeEntity.getId(),num, 1);//addSub 1加 2减
if(flag){
//存入零担与托盘绑定关系表
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "1","1", "分拣打托:人工分拣", "1");
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "1","1", remark, "1");
}else{
//存入零担与托盘绑定关系表
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "0","1", "分拣打托:人工分拣", "1");
warehouseTrayGoodsService.saveEntityZero(stockArticleEntity, trayTypeEntity,num, "0","1", remark, "1");
}
//更新打托方式上的值
updateNumByTrayTypeId(trayTypeEntity);
@ -1461,7 +1461,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
@Override
public R deleteZeroOrderByTrayCode(String orderCode, String trayCode,Long warehouseId) {
public R deleteZeroOrderByTrayCode(String orderCode, String trayCode,Long warehouseId,String remark) {
log.info("#########deleteZeroOrderByTrayCode: 删除对应的零担订单 orderCode={} trayCode={}", orderCode, trayCode);
//查询托盘信息
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
@ -1494,7 +1494,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
Long trayId = trayGoodsEntity.getTrayId();
//添加下托日志
warehouseTrayGoodsLogService.saveLogZero(stockArticleEntity,trayTypeEntity,num,"0","分拣打托:人工分拣","2");
warehouseTrayGoodsLogService.saveLogZero(stockArticleEntity,trayTypeEntity,num,"0",remark+"并解托","2");
//修改打托方式上的值
// changeZeroTotalNumByTrayTypeId(stockArticleEntity, trayTypeId,num, 1);//addSub 1加 2减
//解除绑定
@ -1839,7 +1839,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public R deleteStockByTrayGoodsId(Long trayGoodsId,Long warehouseId) {
public R deleteStockByTrayGoodsId(Long trayGoodsId,Long warehouseId,String remark) {
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getById(trayGoodsId);
if(Objects.isNull(trayGoodsEntity)){
@ -1899,7 +1899,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
//添加下托日志
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,materialCode,num,"0","分拣打托:有数据库存品分拣","2");
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,materialCode,num,"0",remark,"2");
updateNumByTrayTypeId(trayTypeEntity);
@ -2020,7 +2020,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num,String incomingBatch,Long warehouseId) {
public R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num,String incomingBatch,Long warehouseId,String remark) {
//查询托盘信息
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
@ -2125,7 +2125,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
}
// //添加上拖日志表
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,cargoNumber,num, "1", "分拣打托:库存品分拣", "1");
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,cargoNumber,num, "1", remark, "1");
updateNumByTrayTypeId(trayTypeEntity);
@ -2175,7 +2175,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public void updateEntityNumByTrayGoodsIdAndNumStock(Long trayGoodsId, Integer enterNum) {
public void updateEntityNumByTrayGoodsIdAndNumStock(Long trayGoodsId, Integer enterNum,String remark) {
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getById(trayGoodsId);
Long trayTypeId = trayGoodsEntity.getTrayTypeId();
Long materialId = trayGoodsEntity.getAssociationId();
@ -2187,7 +2187,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
warehouseTrayGoodsService.updateEntityStock(trayGoodsEntity,enterNum);
//添加下托日志 Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,Integer num, String bindingType, String remark, String palletizingType
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,materialCode,Math.abs(enterNum),"0","下架:库存品部分下架","2");
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,materialCode,Math.abs(enterNum),"0",remark+"部分","2");
updateNumByTrayTypeId(trayTypeEntity);
}
@ -2239,7 +2239,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public R trayToNull(String trayCode) {
public R trayToNull(String trayCode,String remark) {
//查询托盘信息
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
@ -2248,7 +2248,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
Long trayId = trayEntity.getId();
downTrayGoodsByTrayId(trayId,"托盘空置");
downTrayGoodsByTrayId(trayId,remark);
return R.success("空置成功");
}
@ -3118,18 +3118,18 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public R syncOldTrayData(String trayCode ,String trayType, List<String> orderPackageCodes, Long warehouseId) {
public R syncOldTrayData(String trayCode ,String trayType, List<String> orderPackageCodes, Long warehouseId,String remark) {
try{
//先空置托盘
trayToNull(trayCode);
trayToNull(trayCode,remark);
}catch (Exception e){
log.warn("##############syncOldTrayData: 空置失败");
}
//批量打托
for (String orderPackageCode : orderPackageCodes) {
orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId);
orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId,remark);
}
return R.success("打托成功");
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

@ -250,7 +250,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
}
if (Func.isNotEmpty(waitUpShelfPackageDTO)){
//存在需要进行下架操作的包件
R r = warehouseUpdownTypeService.downPackageOrDelTray(waitUpShelfPackageDTO, warehouseId);
R r = warehouseUpdownTypeService.downPackageOrDelTray(waitUpShelfPackageDTO, warehouseId,"备货下架解托");
if (200 !=r.getCode()){
//进行异常保证事务回滚
log.warn(method+"执行下架失败");

86
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -245,7 +245,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
downPackage(upShelfPackageList,wid);
downPackage(upShelfPackageList,wid,"系统包件下架");
}
}
@ -271,7 +271,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
downPackage(upShelfPackageList,wid);
downPackage(upShelfPackageList,wid,"系统包件下架");
}
R r = warehouseTrayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId);
int code1 = r.getCode();
@ -284,7 +284,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}else if(code == 4004){
log.info("####################orderStatusHandler: 包件打托方式不正确 orderPackageCode={} ",orderPackageCode);
//先去空置托盘再打托
warehouseTrayTypeService.trayToNull("T"+trayId);
// warehouseTrayTypeService.trayToNull("T"+trayId,"系统空置");
R r = warehouseTrayTypeService.orderScanOrderPackageCodeSync(newTrayType, "T" + trayId, orderPackageCode, newWarehouseId);
int code1 = r.getCode();
@ -304,7 +304,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
upShelfPackage(upShelfPackageList,allocationId,newWarehouseId);
upShelfPackage(upShelfPackageList,allocationId,newWarehouseId,"系统包件上架");
}
}
@ -341,7 +341,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
UpShelfPackageDTO upShelfPackageDTO = new UpShelfPackageDTO();
upShelfPackageDTO.setOrderPackageCode(orderPackageCode);
upShelfPackageList.add(upShelfPackageDTO);
downPackage(upShelfPackageList,warehouseId);
downPackage(upShelfPackageList,warehouseId,"备货包件下架");
List<UpShelfStockDTO> upShelfStockList = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
@ -350,7 +350,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
upShelfStockDTO.setMarketId(marketId);
upShelfStockDTO.setEnterNum(1);
upShelfStockList.add(upShelfStockDTO);
upShelfStockList(upShelfStockList,allocationId,warehouseId);
upShelfStockList(upShelfStockList,allocationId,warehouseId,"备货无数据库存品上架");
}
@ -824,7 +824,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R upShelfOrder(List<UpShelfOrderDTO> upShelfOrderList,Long allocationId,Long warehouseId) {
public R upShelfOrder(List<UpShelfOrderDTO> upShelfOrderList,Long allocationId,Long warehouseId,String remrk) {
int num = 0;
String trayCode = null;
//判断货位是否有托盘
@ -893,10 +893,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(StringUtil.hasLength(trayCode)){
//存入托盘信息
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId);
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId,remrk+"并上架");
}
//包件级别的上架
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId);
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId,remrk);
num = num + quantity;
}catch (CustomerException e){
@ -912,7 +912,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R upShelfPackage(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId) {
public R upShelfPackage(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId,String remark) {
int num = 0;
String trayCode = null;
String trayType = null;
@ -1011,10 +1011,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
// }
if(StringUtil.hasLength(trayCode)){
//存入托盘信息
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId);
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode,warehouseId,remark+"并打托");
}
//包件级别的上架
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId);
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId,remark);
num = num + quantity;
}catch (CustomerException e){
log.warn(e.message);
@ -1101,7 +1101,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
@Transactional(rollbackFor = Exception.class)
@Override
public R upShelfZeroOrder(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, Long allocationId,Long warehouseId) {
public R upShelfZeroOrder(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, Long allocationId,Long warehouseId,String remark) {
int num = 0;
String trayCode = null;
String trayType = null;
@ -1167,7 +1167,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
updownTypeEntity = createUpdownType("100",goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId);
}
//
bindingAllocationAndZeroOrderAndLog(upShelfZeroOrderList,updownTypeEntity);
bindingAllocationAndZeroOrderAndLog(upShelfZeroOrderList,updownTypeEntity,remark);
for (UpShelfZeroOrderDTO upShelfZeroOrderDTO:upShelfZeroOrderList){
num = num + upShelfZeroOrderDTO.getEnterNum();
updateZeroOrderGroundingStatus(upShelfZeroOrderDTO.getOrderCode(),warehouseId);
@ -1182,7 +1182,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
zeroOrderVO.setNum(upShelfZeroOrderDTO.getEnterNum());
zeroOrderVOList.add(zeroOrderVO);
}
R r = warehouseTrayTypeService.enterZeroOrderByTrayCode(trayType, trayCode, zeroOrderVOList,warehouseId);
R r = warehouseTrayTypeService.enterZeroOrderByTrayCode(trayType, trayCode, zeroOrderVOList,warehouseId,remark);
int code = r.getCode();
if(code != 200){
throw new CustomerException(code,r.getMsg());
@ -1245,7 +1245,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R upShelfStockList(List<UpShelfStockDTO> allList, Long allocationId,Long warehouseId) {
public R upShelfStockList(List<UpShelfStockDTO> allList, Long allocationId,Long warehouseId,String remark) {
int num = 0;
String trayCode = null;
String trayType = null;
@ -1323,7 +1323,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(Objects.isNull(updownTypeEntity)){
updownTypeEntity = createUpdownType("100",goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId);
}
Map<String,Object> map = bindingAllocationAndStockAndLog(upShelfStockList, updownTypeEntity);
Map<String,Object> map = bindingAllocationAndStockAndLog(upShelfStockList, updownTypeEntity,remark);
num = (Integer)map.get("allNum");
String s = (String) map.get("s");
@ -1332,7 +1332,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(!StringUtil.isBlank(trayCode)){
for (UpShelfStockDTO upShelfStockDTO:upShelfStockList){
R r = warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,upShelfStockDTO.getMaterialCode(),upShelfStockDTO.getMarketId(),upShelfStockDTO.getEnterNum(),upShelfStockDTO.getIncomingBatch(),warehouseId);
R r = warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,upShelfStockDTO.getMaterialCode(),upShelfStockDTO.getMarketId(),upShelfStockDTO.getEnterNum(),upShelfStockDTO.getIncomingBatch(),warehouseId,remark);
int code = r.getCode();
if(code != 200){
throw new CustomerException(code,r.getMsg());
@ -1400,7 +1400,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R downPackage(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId) {
public R downPackage(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId,String remark) {
int num = 0;
Set<String> orderSet = new TreeSet<>();
for (UpShelfPackageDTO upShelfPackageDTO:upShelfPackageList){
@ -1429,7 +1429,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
// BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(taryAllocationEntity)){
//有托盘,托盘下托
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"包件下架:同步下托",warehouseId);
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,remark+":同步下托",warehouseId);
}
Integer residue = warehouseUpdownGoodsService.deleteByUpdownGoodsId(updownGoodsId);
if(residue == 0){
@ -1442,7 +1442,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
warehouseTaryAllocationService.deleteById(taryAllocationEntity);
}
}
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity,parcelListEntity,"2",0,"包件下架:包件下架");
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity,parcelListEntity,"2",0,remark+":包件下架");
updatePackageGroundingStatus(orderPackageCode,"10",warehouseId);
updateUpdownTypeNum(updownTypeEntity);
orderSet.add(orderCode);
@ -1514,7 +1514,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
@Override
public R downPackageOrDelTray(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId) {
public R downPackageOrDelTray(List<UpShelfPackageDTO> upShelfPackageList,Long warehouseId,String remark) {
int num = 0;
Set<String> orderSet = new TreeSet<>();
for (UpShelfPackageDTO upShelfPackageDTO:upShelfPackageList){
@ -1535,7 +1535,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsEntityQueryWrapper);
if(!Objects.isNull(warehouseTrayGoodsEntity)){
//有托盘,托盘下托
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"包件解托",warehouseId);
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,remark,warehouseId);
}
continue;
}
@ -1553,7 +1553,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
// BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(taryAllocationEntity)){
//有托盘,托盘下托
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,"包件下架:同步下托",warehouseId);
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode,remark,warehouseId);
}
Integer residue = warehouseUpdownGoodsService.deleteByUpdownGoodsId(updownGoodsId);
if(residue == 0){
@ -1566,7 +1566,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
warehouseTaryAllocationService.deleteById(taryAllocationEntity);
}
}
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity,parcelListEntity,"2",0,"包件下架:包件下架");
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity,parcelListEntity,"2",0,remark);
updatePackageGroundingStatus(orderPackageCode,"10",warehouseId);
updateUpdownTypeNum(updownTypeEntity);
@ -1583,7 +1583,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList,Long warehouseId) {
public R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList,Long warehouseId,String remark) {
StringBuffer stringBuffer = new StringBuffer("下架零担订单成功");
boolean b =false;
Integer allNum = 0;
@ -1616,7 +1616,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(enterNum.equals(num)){
if(!Objects.isNull(trayEntity)){
//绑定了托盘
warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,trayEntity.getPalletCode(),warehouseId);
warehouseTrayTypeService.deleteZeroOrderByTrayCode(orderCode,trayEntity.getPalletCode(),warehouseId,remark+"并解托");
// //解除托盘与库位绑定
// warehouseTaryAllocationService.deleteByTrayIdAndAllocationId(trayEntity.getId(),allocationId);
@ -1630,7 +1630,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//修改库位状态为空闲
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId,"1");
}
saveUpdownGoodsLog(updownGoodsList,"2",0,"下架:零担下架",warehouseId);
saveUpdownGoodsLog(updownGoodsList,"2",0,remark,warehouseId);
updateUpdownTypeNum(updownTypeEntity);
}else{
if(!Objects.isNull(trayEntity)){
@ -1643,7 +1643,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
warehouseUpdownGoodsService.updeteNumByUpdownGoodsId(residue,updownGoodsId);
//存入日志
saveUpdownGoodsLogPart(updownGoodsList,enterNum,"2",0,"下架:零担部分下架",updownTypeEntity.getWarehouseId());
saveUpdownGoodsLogPart(updownGoodsList,enterNum,"2",0,remark+"部分",updownTypeEntity.getWarehouseId());
}
updateZeroOrderGroundingStatus(orderCode,warehouseId);
updateUpdownTypeNum(updownTypeEntity);
@ -1681,7 +1681,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R downStock(List<UpShelfStockDTO> upShelfStockList,Long warehouseId) {
public R downStock(List<UpShelfStockDTO> upShelfStockList,Long warehouseId,String remark) {
StringBuffer stringBuffer = new StringBuffer("下架库存品成功");
boolean b =false;
Integer allNum = 0;
@ -1734,7 +1734,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsQueryWrapper);
//绑定了托盘
warehouseTrayTypeService.deleteStockByTrayGoodsId(trayGoodsEntity.getId(),warehouseId);
warehouseTrayTypeService.deleteStockByTrayGoodsId(trayGoodsEntity.getId(),warehouseId,remark+"并解托");
}
//全部下架
@ -1747,7 +1747,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
saveUpdownGoodsLog(updownGoodsList,"2",0,"下架:库存品下架",updownTypeEntity.getWarehouseId());
saveUpdownGoodsLog(updownGoodsList,"2",0,remark,updownTypeEntity.getWarehouseId());
// updateUpdownTypeNum(updownTypeEntity);
}else{
if(!Objects.isNull(trayEntity)){
@ -1763,7 +1763,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
.eq("market_id",marketId);
WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsService.getOne(trayGoodsQueryWrapper);
//绑定了托盘
warehouseTrayTypeService.updateEntityNumByTrayGoodsIdAndNumStock(trayGoodsEntity.getId(),-enterNum);
warehouseTrayTypeService.updateEntityNumByTrayGoodsIdAndNumStock(trayGoodsEntity.getId(),-enterNum,remark+"并解托");
}
int residue = num - enterNum;
@ -1772,7 +1772,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
//存入日志
saveUpdownGoodsLogPart(updownGoodsList,enterNum,"2",0,"下架:库存品部分下架",updownTypeEntity.getWarehouseId());
saveUpdownGoodsLogPart(updownGoodsList,enterNum,"2",0,remark+"部分",updownTypeEntity.getWarehouseId());
}
updateUpdownTypeNum(updownTypeEntity);
allNum = allNum + enterNum;
@ -1930,13 +1930,13 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R moveAllocationPackageList(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId) {
public R moveAllocationPackageList(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId,Long warehouseId,String remark) {
//下架包件列表
downPackage(upShelfPackageList,warehouseId);
downPackage(upShelfPackageList,warehouseId,remark+"下架");
//上架新的库位
upShelfPackage(upShelfPackageList,allocationId,warehouseId);
upShelfPackage(upShelfPackageList,allocationId,warehouseId,remark+"上架");
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
return Resp.scanSuccess("移库成功","移库成功");
@ -2511,7 +2511,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
warehouseUpdownGoodsLogService.saveBatch(updownGoodsLogList);
}
private Map<String,Object> bindingAllocationAndStockAndLog(List<UpShelfStockDTO> upShelfStockList, WarehouseUpdownTypeEntity updownTypeEntity) {
private Map<String,Object> bindingAllocationAndStockAndLog(List<UpShelfStockDTO> upShelfStockList, WarehouseUpdownTypeEntity updownTypeEntity,String remark) {
List<WarehouseUpdownGoodsEntity> updownGoodsList = new ArrayList<>();
List<WarehouseUpdownGoodsEntity> updownGoodsLogList = new ArrayList<>();
StringBuffer stringBuffer = new StringBuffer();
@ -2597,7 +2597,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
warehouseUpdownGoodsService.saveOrUpdateBatch(updownGoodsList);
saveUpdownGoodsLog(updownGoodsLogList,"1",0,"扫描上架:库存品上架",updownTypeEntity.getWarehouseId());
saveUpdownGoodsLog(updownGoodsLogList,"1",0,remark,updownTypeEntity.getWarehouseId());
Map<String,Object> map = new HashMap<>();
map.put("allNum",allNum);
map.put("s",stringBuffer.toString());
@ -2653,7 +2653,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return updownZeroOrderVO;
}
private void bindingAllocationAndZeroOrderAndLog(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, WarehouseUpdownTypeEntity updownTypeEntity) {
private void bindingAllocationAndZeroOrderAndLog(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, WarehouseUpdownTypeEntity updownTypeEntity,String remark) {
List<WarehouseUpdownGoodsEntity> updownGoodsList = new ArrayList<>();
List<WarehouseUpdownGoodsEntity> updownGoodsLogList = new ArrayList<>();
for (UpShelfZeroOrderDTO upShelfZeroOrderDTO:upShelfZeroOrderList){
@ -2701,7 +2701,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
}
warehouseUpdownGoodsService.saveOrUpdateBatch(updownGoodsList);
saveUpdownGoodsLog(updownGoodsLogList,"1",0,"扫描上架:零担上架",updownTypeEntity.getWarehouseId());
saveUpdownGoodsLog(updownGoodsLogList,"1",0,remark,updownTypeEntity.getWarehouseId());
}
private R saveTrayGoodsToAllocation(WarehouseTrayTypeEntity trayTypeEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAreaEntity goodsAreaEntity,Long warehouseId) {
@ -2813,7 +2813,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
private void upShelfPackageNoTray(DistributionParcelListEntity parcelListEntity,BasicdataGoodsAllocationEntity goodsAllocationEntity,BasicdataGoodsShelfEntity goodsShelfEntity,BasicdataGoodsAreaEntity goodsAreaEntity,Long warehouseId) {
private void upShelfPackageNoTray(DistributionParcelListEntity parcelListEntity,BasicdataGoodsAllocationEntity goodsAllocationEntity,BasicdataGoodsShelfEntity goodsShelfEntity,BasicdataGoodsAreaEntity goodsAreaEntity,Long warehouseId,String remrk) {
log.info("###########upShelfPackageNoTray: 上架包件没有托盘 orderPackageCode={} allocationCode={}",parcelListEntity.getOrderPackageCode(),goodsAllocationEntity.getGoodsAllocationName());
//修改上架方式的数量
@ -2838,7 +2838,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//修改上架方式上的数据
// updateUpdownTypeNumPackage(updownTypeEntity,parcelListEntity,"1");
//货物和库位绑定
warehouseUpdownGoodsService.bindingAllocationAndPackage(updownTypeEntity,parcelListEntity,"1",0,"扫码上架:包件上架");
warehouseUpdownGoodsService.bindingAllocationAndPackage(updownTypeEntity,parcelListEntity,"1",0,remrk);
//修改包件的上架状态
// distributionParcelListClient.updateGroundingStatus(orderPackageCode, OrderPackageStatusConstant.yiruku.getValue());
updatePackageGroundingStatus(orderPackageCode,"20",warehouseId);

Loading…
Cancel
Save