Browse Source

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

# Conflicts:
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
master
zhaoqiaobo 10 months ago
parent
commit
4afe1e9476
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/cache/CacheNames.java
  2. 44
      blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeShowConstant.java
  3. 68
      blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeTypeConstant.java
  4. 11
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java
  5. 4
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicTenantCodeClient.java
  6. 28
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/TableSetVo.java
  7. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java
  8. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  9. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforStockArticleVO.java
  10. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java
  11. 50
      blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/CommonFrontTableController.java
  12. 5
      blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicTenantCodeClient.java
  13. 2
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicTenantCodeService.java
  14. 27
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicTenantCodeServiceImpl.java
  15. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java
  16. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  17. 31
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  18. 33
      blade-service/logpm-business/src/main/java/com/logpm/business/receiver/BusinessInOrderDataQueueHandler.java
  19. 8
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessPreOrderService.java
  20. 45
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  21. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  22. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  23. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  24. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  25. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java
  26. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java
  27. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  28. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  29. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  30. 1381
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  31. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  32. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  33. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  34. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  35. 57
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  36. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  37. 255
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  38. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  39. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

5
blade-biz-common/src/main/java/org/springblade/common/cache/CacheNames.java vendored

@ -83,4 +83,9 @@ public interface CacheNames {
* 模拟登录缓存对象
*/
String LOCAL_SERVER_USER = "logpm:user:local:user:";
/**
* 模拟登录缓存对象
*/
String USER_TABLE_SET = "user:table:set:";
}

44
blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeShowConstant.java

@ -0,0 +1,44 @@
package org.springblade.common.constant.basiccode;
import lombok.Data;
/**
* 租户编码姐
* 类型码表
*/
public enum BasicCodeShowConstant {
/**
* 二维码
*/
QR_CODE("qr_code",1),
/**
* 条形码
*/
BAR_CODE("bar_code",2);
/**
* 状态
*/
private String name;
/**
*
*/
private Integer value;
BasicCodeShowConstant(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}

68
blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeTypeConstant.java

@ -0,0 +1,68 @@
package org.springblade.common.constant.basiccode;
/**
* 租户编码姐
* 类型码表
*/
public enum BasicCodeTypeConstant {
waybill_code("运单码","1"),
ORDER_CODE("订单码","2"),
ORDER_PACKAGE_CODE("包件码","3"),
// 仓库码
WAREHOUSE_CODE("仓库码","4"),
// 货区码
AREA_CODE("货区码","5"),
// 货架码
SHELF_CODE("货架码","6"),
// 货位码
POSITION_CODE("货位码","7"),
// 托盘码
TRAY_CODE("托盘码","8"),
// 客户编码
CLIENT_CODE("客户编码","9"),
// 提货单 配载计划 三方中转 直发商家签收单
// 提货单码
PICKUP_CODE("提货单码","10"),
// 配载计划码
ALLOCATION_CODE("配载计划码","11"),
// 三方中转码
THIRD_TRANSFER_CODE("三方中转码","12"),
// 直发商家签收单码
DIRECT_SIGN_CODE("直发商家签收单码","13"),
//配送计划 自提单 预约单 备货码
DELIVERY_PLAN_CODE("配送计划码","20"),
// 自提单码
PICKUP_ORDER_CODE("自提单码","21"),
// 预约单码
APPOINTMENT_CODE("预约单码","22"),
// 备货码
STOCK_CODE("备货码","23");
/**
* 状态
*/
private String name;
/**
*
*/
private String value;
BasicCodeTypeConstant(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public String getValue() {
return value;
}
}

11
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java

@ -39,13 +39,7 @@ import java.io.Serializable;
public class BasicTenantCodeEntity extends TenantEntity implements Serializable{
private static final long serialVersionUID = 1L;
// /**
// * 主键
// */
// @JsonSerialize(using = ToStringSerializer.class)
// @ApiModelProperty(value = "主键")
// @TableId(value = "id", type = IdType.ASSIGN_ID)
// private Long id;
/**
* 编码类型
@ -53,7 +47,7 @@ public class BasicTenantCodeEntity extends TenantEntity implements Serializable
@JsonSerialize(using = ToStringSerializer.class)
@ApiModelProperty(value = "编码类型")
@TableField(value = "code_type")
private Integer codeType;
private String codeType;
/**
* 编码展示类型
@ -63,7 +57,6 @@ public class BasicTenantCodeEntity extends TenantEntity implements Serializable
@TableField(value = "show_type")
private Integer showType;
// private Integer isDeleted;
/***
* 编码

4
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicTenantCodeClient.java

@ -64,5 +64,9 @@ public interface IBasicTenantCodeClient {
*/
@GetMapping(TOP+"/shelfCode")
String shelfCode(@RequestParam String tenantId,@RequestParam String codeType);
@GetMapping(TOP+"/findBasicTenantCodeByCodeAndShowType")
BasicTenantCodeEntity findBasicTenantCodeByCodeAndShowType(@RequestParam("codeType") String codeType,@RequestParam("showType")Integer showType);
}

28
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/vo/TableSetVo.java

@ -0,0 +1,28 @@
package com.logpm.basic.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 前端页面 表格字段保存对象
*/
@Data
@ApiModel(value = "TableSetVo", description = "表格设置对象")
public class TableSetVo implements Serializable {
/**
* 表格key
*/
@ApiModelProperty(value = "表格key")
private String tableKey;
/**
* 表格表头设置内容
*/
@ApiModelProperty(value = "表格设置内容")
private String tableSetCongig;
}

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillLadingEntity.java

@ -83,6 +83,12 @@ public class DistrilbutionBillLadingEntity extends TenantEntity {
@ApiModelProperty(value = "提货人")
private String consignee;
/**
* 收货单位
*/
@ApiModelProperty(value = "收货单位")
private String consigneeUnit;
@ApiModelProperty(value = "提货人电话")
private String consigneePhone;
/**

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java

@ -61,6 +61,8 @@ public interface IDistributionReservationClient {
*/
@GetMapping(TOP+"/getReservationList")
List<DistributionReservationEntity> getReservationList(@RequestParam("reservationIds") String reservationIds);
@GetMapping(TOP+"/getReservationByCodeAndWarehouseId")
DistributionReservationEntity getReservationByCodeAndWarehouseId(@RequestParam("reservationCode") String reservationCode,@RequestParam("warehouseId") String warehouseId);
/**

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforStockArticleVO.java

@ -266,6 +266,18 @@ public class DistributionSignforStockArticleVO implements Serializable {
@ApiModelProperty(value = "签收时间")
private Date signinTime;
/**
* 签收ID
*/
@ApiModelProperty(value = "签收ID")
private Long signforId;
/**
* 配送ID
*/
@ApiModelProperty(value = "配送ID")
private Long deliveryId;
/**
* 创建时间

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java

@ -134,6 +134,8 @@ public class DistributionAppDeliveryListVO extends DistributionDeliveryListEntit
/**
* 预约客户数据
*/

50
blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/CommonFrontTableController.java

@ -0,0 +1,50 @@
package com.logpm.basic.controller;
import com.logpm.basic.vo.TableSetVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.cache.CacheNames;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@RestController
@Slf4j
@AllArgsConstructor
@RequestMapping("/commonTable")
@Api(value = "自定义表格内容", tags = "自定义表格内容")
public class CommonFrontTableController extends BladeController {
private final BladeRedis bladeRedis;
@PostMapping("/saveTableSeting")
@ApiOperation(value = "保存表格配置", notes = "传入tableSetVo")
public R saveTableSeting(@RequestBody TableSetVo tableSetVo){
try {
String key = CacheNames.tenantKey(AuthUtil.getTenantId(),CacheNames.USER_TABLE_SET+tableSetVo.getTableKey(),AuthUtil.getUserId().toString());
bladeRedis.setEx(key, tableSetVo.getTableSetCongig(),3*30*24*60*60L);
return R.success("保存成功");
} catch (Exception e) {
log.error("saveTableSeting",e);
return R.fail("保存失败");
}
}
@GetMapping ("/getTableSeting")
@ApiOperation(value = "获取表格配置", notes = "tableKey")
public R getTableSeting(@RequestParam("tableKey") String tableKey){
String key = CacheNames.tenantKey(AuthUtil.getTenantId(),CacheNames.USER_TABLE_SET+tableKey,AuthUtil.getUserId().toString());
Object o = bladeRedis.get(key);
return R.data(o);
}
}

5
blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicTenantCodeClient.java

@ -67,5 +67,8 @@ public class BasicTenantCodeClient implements IBasicTenantCodeClient {
return shelfCode;
}
@Override
public BasicTenantCodeEntity findBasicTenantCodeByCodeAndShowType(String codeType, Integer showType) {
return basicTenantCodeService.findBasicTenantCodeByCodeAndShowType(codeType,showType);
}
}

2
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicTenantCodeService.java

@ -68,4 +68,6 @@ public interface IBasicTenantCodeService extends BaseService<BasicTenantCodeEnti
BasicTenantCodeEntity gerOne(Long id);
String shelfCode(String tenantId,String codeType);
BasicTenantCodeEntity findBasicTenantCodeByCodeAndShowType(String codeType, Integer showType);
}

27
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicTenantCodeServiceImpl.java

@ -17,6 +17,7 @@
package com.logpm.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.excel.BasicTenantCodeExcel;
@ -42,11 +43,10 @@ import java.util.Map;
@AllArgsConstructor
public class BasicTenantCodeServiceImpl extends BaseServiceImpl<BasicTenantCodeMapper, BasicTenantCodeEntity> implements IBasicTenantCodeService {
private BasicTenantCodeMapper basicTenantCodeMapper;
@Override
public IPage<BasicTenantCodeEntity> list(Map<String, Object> basicTenantCode, IPage<BasicTenantCodeEntity> page) {
IPage<BasicTenantCodeEntity> basicTenantCodeEntityIPage = basicTenantCodeMapper.selectTenantCodeList(page,basicTenantCode);
IPage<BasicTenantCodeEntity> basicTenantCodeEntityIPage = baseMapper.selectTenantCodeList(page,basicTenantCode);
return basicTenantCodeEntityIPage;
}
@ -54,7 +54,7 @@ public class BasicTenantCodeServiceImpl extends BaseServiceImpl<BasicTenantCodeM
public BasicTenantCodeEntity gerOne(Long id) {
BasicTenantCodeEntity basicTenantCodeEntity = new BasicTenantCodeEntity();
if (id!=null){
basicTenantCodeEntity = basicTenantCodeMapper.selectTenantCodeDetail(id);
basicTenantCodeEntity = baseMapper.selectTenantCodeDetail(id);
}
return basicTenantCodeEntity;
}
@ -64,7 +64,7 @@ public class BasicTenantCodeServiceImpl extends BaseServiceImpl<BasicTenantCodeM
Map<String,String> map = new HashMap<>();
map.put("tenantId",tenantId);
map.put("codeType",codeType);
String shelfCode = basicTenantCodeMapper.shelfCode(map);
String shelfCode = baseMapper.shelfCode(map);
return shelfCode;
}
@ -83,14 +83,23 @@ public class BasicTenantCodeServiceImpl extends BaseServiceImpl<BasicTenantCodeM
return basicTenantCodeList;
}
@Override
public BasicTenantCodeEntity findBasicTenantCodeByCodeAndShowType(String codeType, Integer showType) {
BasicTenantCodeEntity basicTenantCodeEntity = baseMapper.selectOne(new QueryWrapper<BasicTenantCodeEntity>().eq("code_type", codeType).eq("show_type", showType).eq("is_deleted",0));
return basicTenantCodeEntity;
}
@Override
public boolean save(BasicTenantCodeEntity entity) {
String code = entity.getCode();
Integer codeType = entity.getCodeType();
if (Func.isBlank(code)){
code = "DA--00"+codeType;
entity.setCode(code);
}
String codeType = entity.getCodeType();
// if (Func.isBlank(code)){
// code = "DA--00"+codeType;
// entity.setCode(code);
// }
return super.save(entity);
}
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java

@ -75,6 +75,6 @@ public interface BasicdataClientMapper extends BaseMapper<BasicdataClientEntity>
* 查询规则生成的客户编码列表
* @return
*/
List<String> getFinallyClientCode();
List<String> getFinallyClientCode(@Param("tenantCode")String tenantCode);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -169,7 +169,7 @@
DESC
</select>
<select id="getFinallyClientCode" resultType="java.lang.String">
SELECT client_code FROM `logpm_basicdata_client` WHERE is_deleted = 0 AND client_code LIKE 'HT00%' AND LENGTH(client_code) = 9 ORDER BY client_code DESC
SELECT client_code FROM `logpm_basicdata_client` WHERE is_deleted = 0 AND client_code LIKE CONCAT(#{tenantCode},'%') AND LENGTH(client_code) = 9 AND is_deleted = 0 ORDER BY client_code DESC
</select>
</mapper>

31
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -26,6 +26,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataHistoricalContractEntity;
@ -51,6 +53,8 @@ import com.logpm.basicdata.vo.ClientInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.basiccode.BasicCodeShowConstant;
import org.springblade.common.constant.basiccode.BasicCodeTypeConstant;
import org.springblade.common.model.dto.NameDTO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -101,6 +105,10 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
private IBasicdataWarehouseService warehouseService;
// private final IBasicdataClientUserService basicdataClientUserService;
@Autowired
private IBasicTenantCodeClient basicTenantCodeClient;
@Autowired
private IUserClient userClient;
@ -669,15 +677,30 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
@Override
public String getFinallyClientCode() {
String tenantCode ="HT";
BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.CLIENT_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
if (ObjectUtils.isNull(basicTenantCodeByCodeAndShowType)) {
log.error("获取货区码失败");
}else{
tenantCode = basicTenantCodeByCodeAndShowType.getCode();
}
String finaClientCode = redis.get(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId());
if (StringUtils.isBlank(finaClientCode)) {
List<String> str = baseMapper.getFinallyClientCode();
finaClientCode = str.get(0);
List<String> str = baseMapper.getFinallyClientCode(tenantCode);
if(!str.isEmpty()){
finaClientCode = str.get(0);
}else{
finaClientCode =tenantCode+"0000000";
}
redis.set(RedisKeyConstant.FINAL_CLIENT_CODE + AuthUtil.getTenantId(), finaClientCode);
}
String num = finaClientCode.replaceAll("HT", "");
String num = finaClientCode.replaceAll(tenantCode, "");
int anInt = Integer.parseInt(num) + 1;
return "HT00" + anInt;
String formattedNum = String.format("%07d", anInt);
return tenantCode + formattedNum;
}
@Override

33
blade-service/logpm-business/src/main/java/com/logpm/business/receiver/BusinessInOrderDataQueueHandler.java

@ -1,16 +1,23 @@
package com.logpm.business.receiver;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.feign.IDistributionReservationClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
@ -23,7 +30,8 @@ import java.util.Map;
public class BusinessInOrderDataQueueHandler {
private final IBusinessPreOrderService businessPreOrderService;
private final IDistributionReservationClient distributionReservationClient;
private final ISysClient sysClient;
@RabbitHandler
public void businessInOrderDataHandler(Map map, Message message, Channel channel) {
// 获取
@ -35,7 +43,9 @@ public class BusinessInOrderDataQueueHandler {
String vehicleName = o.getString("vehicleName");
String driverName = o.getString("driverName");
String userName = o.getString("userName");
// 当前作业仓库
Long warehouseId = o.getLong("warehouseId");
// 作业
String tenantId = o.getString("tenantId");
//验证参数是否为null或者空串
@ -59,9 +69,26 @@ public class BusinessInOrderDataQueueHandler {
log.error("driverName is null");
return;
}
// 判断目标租户
DistributionReservationEntity reservationByCodeAndWarehouseId = distributionReservationClient.getReservationByCodeAndWarehouseId(reservationCode, warehouseId.toString());
// 判断是否存在租户
R<List<Tenant>> tenantList = sysClient.getTenantList();
Tenant tenant = null;
if (tenantList.isSuccess()) {
List<Tenant> data = tenantList.getData();
for (Tenant datum : data) {
if (datum.getTenantType() == 2 && datum.getTenantName().equals(reservationByCodeAndWarehouseId.getMallName().trim())) {
tenant = datum;
break;
}
}
}
if(!ObjectUtil.isEmpty(tenant)){
// 如果师傅签收 以师傅签收的车次为准
businessPreOrderService.scanOrderPackageCodeByMaster(orderPackageCode, reservationCode, distrCarNumber, vehicleName, driverName, userName, warehouseId,tenant.getTenantId(),tenant.getTenantName(),tenantId);
}
// 如果师傅签收 以师傅签收的车次为准
businessPreOrderService.scanOrderPackageCodeByMaster(orderPackageCode, reservationCode, distrCarNumber, vehicleName, driverName, userName, warehouseId, tenantId);
}

8
blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessPreOrderService.java

@ -10,6 +10,7 @@ import com.logpm.trunkline.dto.InComingDTO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Tenant;
import java.util.List;
import java.util.Map;
@ -88,8 +89,9 @@ public interface IBusinessPreOrderService extends BaseService<BusinessPreOrderEn
* @param driverName 司机名称
* @param vehicleName 车牌号码
* @param warehouseId 当前作业仓库ID
* @param tenantId 当前作业的租户
* @param tenantId 目标租户
* @param userName 作业用户
* @param sourceTenantId 来源租户
* @return
*/
R scanOrderPackageCodeByMaster(String orderPackageCode,
@ -99,7 +101,9 @@ public interface IBusinessPreOrderService extends BaseService<BusinessPreOrderEn
String driverName,
String userName,
Long warehouseId,
String tenantId
String tenantId,
String tenantName,
String sourceTenantId
);
}

45
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -23,6 +23,7 @@ import com.logpm.trunkline.feign.IInComingClient;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import lombok.AllArgsConstructor;
import org.jetbrains.annotations.Nullable;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.exception.CustomerException;
@ -169,13 +170,12 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
private R inOrderWarehourseByFeign(BusinessSanDTO businessSanDTO) {
InComingDTO inComingDTO = new InComingDTO();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
inComingDTO.setOrderPackageCode(businessSanDTO.getOrderPackageCode());
inComingDTO.setIncomingType(IncomingTypeEnum.LINE_INCOMING.getCode());
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
inComingDTO.setTrayCode(businessSanDTO.getTrayCode());
inComingDTO.setTrayType(businessSanDTO.getTrayType());
inComingDTO.setWarehouseName(myCurrentWarehouse.getName());
inComingDTO.setWarehouseName(businessSanDTO.getWarehouseName());
inComingDTO.setWarehouseId(businessSanDTO.getWarehouseId());
R r = inComingClient.incomingPackageByTaryCode(inComingDTO);
return r;
@ -187,6 +187,9 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
try {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
businessSanDTO.setWarehouseId(myCurrentWarehouse.getId());
businessSanDTO.setWarehouseName(myCurrentWarehouse.getName());
String orderPackageCode = businessSanDTO.getOrderPackageCode();
String distrCarNumber = businessSanDTO.getDistrCarNumber();
@ -466,6 +469,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
@ChangeAsync
@Override
public R scanOrderPackageCodeByMaster(String orderPackageCode,
String reservationCode,
@ -474,7 +478,16 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
String driverName,
String userName,
Long warehouseId,
String tenantId) {
String tenantId,
String tenantName,
String sourceTenantId) {
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.findByName(tenantName + "仓");
if(ObjectUtils.isNull(warehouseEntity)){
return R.fail("仓库信息不存在");
}
// 判断当前的包条码是否和当前作业的车次相同
LambdaQueryWrapper<BusinessPreOrderEntity> queryWrapper1 = new LambdaQueryWrapper<>();
@ -484,14 +497,22 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
BusinessPreOrderEntity data =null;
if (list1.isEmpty()) {
// 新增改车次的预入库信息
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
data = BeanUtil.copy(byPacketBarCodeAndWarehouseId, BusinessPreOrderEntity.class);
TrunklineAdvanceDetailEntity entityByOrderPackageCode = trunklineAdvanceDetailClient.findEntityByOrderPackageCode(orderPackageCode);
data = BeanUtil.copy(entityByOrderPackageCode, BusinessPreOrderEntity.class);
data.setWaybillNumber(entityByOrderPackageCode.getWaybillNo());
data.setFirsts(entityByOrderPackageCode.getFirstPackName());
data.setSecond(entityByOrderPackageCode.getSecondPackName());
data.setThirdProduct(entityByOrderPackageCode.getThirdPackName());
data.setBrandName(entityByOrderPackageCode.getBrand());
data.setConditions(1);
data.setInWarehouse(0);
data.setDriverName(driverName);
data.setVehicleName(vehicleName);
data.setDistrCarNumber(distrCarNumber);
data.setFromTenantId(tenantId);
data.setFromTenantId(sourceTenantId);
data.setOperationStatus(0);
data.setInWarehouse(1);
data.setId(null);
data.setTenantId(null);
data.setReservationCode(reservationCode);
@ -513,9 +534,15 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
// 通过目标租户确认 目标租户对应的仓库
BusinessSanDTO businessSanDTO = new BusinessSanDTO();
businessSanDTO.setOrderPackageCode(data.getOrderPackageCode());
R r = inOrderWarehourse(businessSanDTO);
businessSanDTO.setDistrCarNumber(distrCarNumber);
businessSanDTO.setInWarehouseException(0);
businessSanDTO.setWarehouseName(warehouseEntity.getName());
businessSanDTO.setWarehouseId(warehouseEntity.getId());
R r = inOrderWarehourseByFeign(businessSanDTO);
return r;
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java

@ -137,7 +137,13 @@ public class DistributionDeliveryAppController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
R msg = null;
try{
msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
}catch (Exception e){
e.printStackTrace();
}
return msg;
}

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

@ -423,8 +423,8 @@ public class DistributionDeliveryListController extends BladeController {
@GetMapping("/judgmentOrderRemove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "判断是否可以在商配计划中移除", notes = "customArgs")
public R<Boolean> judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam Long orderId) {
boolean result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderId);
public R<Boolean> judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam String orderIds) {
boolean result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderIds);
return R.data(result);
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -111,6 +111,7 @@ public class DistributionReservationController extends BladeController {
List<Long> ids = Func.toLongList(",", excludeId);
lambda.notIn(DistributionReservationEntity::getId,ids);
}
lambda.orderByDesc(DistributionReservationEntity::getCreateTime);
IPage<DistributionReservationEntity> pages = reservationService.page(Condition.getPage(query),lambda );
pages.getRecords().forEach(i ->{
R<User> userR = userClient.userInfoById(i.getCreateUser());

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -387,6 +387,8 @@ public class DistributionStockArticleController extends BladeController {
BeanUtil.copy(oldStockArticle,newStockArticle);
String consigneePerson = stockArticleEntity.getConsigneePerson();
String customerName = stockArticleEntity.getCustomerName();
String mallName = stockArticleEntity.getMallName();
String consigneeUnit = stockArticleEntity.getConsigneeUnit();
if(StringUtil.isNotBlank(consigneePerson)){
newStockArticle.setConsigneePerson(consigneePerson);
newStockArticle.setConsigneeMobile(stockArticleEntity.getConsigneeMobile());
@ -396,8 +398,8 @@ public class DistributionStockArticleController extends BladeController {
newStockArticle.setCustomerTelephone(stockArticleEntity.getCustomerTelephone());
newStockArticle.setCustomerAddress(stockArticleEntity.getCustomerAddress());
}else {
newStockArticle.setMallName(customerName);
newStockArticle.setConsigneeUnit(customerName);
newStockArticle.setMallName(mallName);
newStockArticle.setConsigneeUnit(consigneeUnit);
}
String content = oldStockArticle.compareCustomerInfo(newStockArticle);
if(StringUtil.isNotBlank(content)){

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java

@ -74,10 +74,6 @@ public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity {
* 运单号
*/
private String waybillNumber;
/**
* 收货单位
*/
private String consigneeUnit;
/**
* 收货人
*/
@ -152,7 +148,6 @@ public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity {
*/
private String stockupCode;
/**
* 库存品
*/

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java

@ -60,6 +60,11 @@ public class DistributionReservationClient implements IDistributionReservationCl
return reservationService.getRetentionReservationList(reservationIds);
}
@Override
public DistributionReservationEntity getReservationByCodeAndWarehouseId(String reservationCode, String warehouseId) {
return reservationService.selectByReservationCode(reservationCode);
}
/**
* @param warehouseId
* @return

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -562,7 +562,7 @@
<select id="selectAppcustomListPage" resultType="com.logpm.distribution.vo.app.DistributionAppReservationVO">
SELECT DISTINCT
ldr.id id,
ldr.consignee consignee,
GROUP_CONCAT(DISTINCT CONCAT(ldr.receiving_unit,'(',ldr.consignee),')') AS consignee,
<!-- COALESCE ( lds.loaded_number + lds.loadedin_number, 0 ) loadingNub,-->
COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) reservationNum,
(

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1046,7 +1046,8 @@
(SELECT COALESCE(sum(lds.loaded_number+lds.loadedin_number), 0) FROM logpm_distribution_signfor lds WHERE
lddl.id = lds.delivery_id) scannedNumber,
(
select GROUP_CONCAT(ldr.consignee)
select
group_concat(CONCAT(ldr.mall_name ,'(',ldr.consignee,')'))
from logpm_distribution_reservation ldr
where ldr.id in
(select lds.reservation_id

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

@ -543,7 +543,7 @@
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
LEFT JOIN logpm_warehouse_tray lwt on lwtg.tray_id = lwt.id
<where>
ldsi.stockup_id =#{id} and ldpl.order_package_code is not null and ldsi.stock_status != 4
ldsi.stockup_id =#{id} and ldpl.order_package_code is not null and ldsi.stock_status != 4 AND ldrp.packet_bar_status != 2
</where>
</select>
<select id="getPageVOList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">

1381
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

File diff suppressed because it is too large Load Diff

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -458,6 +458,9 @@
<if test=" param.orderCodeNumLike != '' and param.orderCodeNumLike != null ">and ldsa.order_code like
concat('%',#{param.orderCodeNumLike},'%')
</if>
<if test=" param.brand != '' and param.brand != null ">and ldsa.brand like
concat(#{param.brand},'%')
</if>
<if test=" param.reservation != '' and param.reservation != null ">
and ldsa.reservation_status in (10,20) and ldpl.order_package_reservation_status = 10
</if>
@ -1492,7 +1495,9 @@
lds.sjsigning_time AS sjsigningTime,
lddl.train_number AS trainNumber,
lddl.vehicle_name AS vehicleName,
lddl.driver_name AS driverName
lddl.driver_name AS driverName,
lds.id AS signforId,
lds.delivery_id AS deliveryId
FROM
logpm_distribution_reservation_stockarticle AS ldrs
LEFT JOIN logpm_distribution_reservation AS ldr ON ldrs.reservation_id = ldr.id

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -1020,6 +1020,7 @@
ldsi.stockup_id = #{ id }
AND ldsi.is_deleted = 0
AND ldsi.stock_status != 4
AND ldrs.stock_article_status != 2
</where>
</select>

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

@ -461,6 +461,7 @@
lad.`conditions` `conditions`,
lad.Pick_up_plate pickUpPlate,
lad.consignee consignee,
lad.consignee_unit consigneeUnit,
lad.create_time,
lad.pick_up_time,
lad.stock_article_id stockArticleId

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

@ -401,7 +401,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param orderId
* @return
*/
boolean judgmentOrderRemove(Long deliveryId, Long orderId);
boolean judgmentOrderRemove(Long deliveryId, String orderIds);
/**
* 维护配送任务的配送数量

57
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -577,6 +577,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
// synchronized
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//查询该包件是否能够从库存品包件表中查到
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
@ -642,6 +644,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(parcelList)) {
return Resp.scanFail("系统无编码", "系统无编码");
}
if (parcelList.getConditions().equals(2)) {
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
}
if (!Objects.isNull(parcelList)) {
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(parcelList.getOrderPackageStatus())) {
return Resp.scanFail("包件已签收", "包件已签收");
@ -787,21 +792,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查看是否存在满足条件的预约单
reservationEntities = reservationEntities.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
boolean flag = reservationEntityList.stream().anyMatch(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId()));
//存在多个,操作人指定具体客户即可
if (!reservationEntities.isEmpty() && reservationEntities.size() == 1) {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
log.info("异常装车未指定客户");
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
if ( reservationEntities.size() == 1 && flag) {
return R.fail(5000, "异常装车");
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
if (parcelListEntity.getConditions() == 2) {
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
} else {
if (flag){
if (reservationEntities.isEmpty()){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
}else {
return Resp.scanFail("窜货", "窜货");
}
}
@ -810,15 +811,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查询是否满足商配异常装车
boolean flag = reservationEntities.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (flag){
boolean flag = reservationEntityList.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (reservationEntities.size() == 1 && flag){
return R.fail(5000, "异常装车");
}else {
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
if (flag){
if (reservationEntities.isEmpty()){
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
}else {
return Resp.scanFail("窜货", "窜货");
}
}
} else {
@ -2438,19 +2442,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
reservationStockarticleEntityList.forEach(rs -> {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(rs.getStockArticleId());
DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(stockArticleEntity);
// if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//// List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda().eq(DistributionReservationPackageEntity::getReservationId, rs.getReservationId()).eq(DistributionReservationPackageEntity::getStockArticleId, stockArticleEntity.getId()).ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
//// if (Func.isNotEmpty(reservationPackageEntityList)) {
//// ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>();
//// reservationPackageEntityList.forEach(rp -> {
//// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(rp.getParceListId());
//// DistributionParcelListVO distributionParcelListVO = DistributionParcelListWrapper.build().entityVO(parcelListEntity);
//// distributionParcelListVOS.add(distributionParcelListVO);
//// });
//// distributionStockArticleVO.setPackageList(distributionParcelListVOS);
//// distributionStockArticleVO.setParcelListVOS(DistributionParcelListWrapper.build().listVO(distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, rs.getStockArticleId()))));
//// }
// }
distributionStockArticleVO.setReservationNum(rs.getReservationNum());
distributionStockArticleVOS.add(distributionStockArticleVO);
});
@ -4589,7 +4580,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
// 推送数据
return Resp.scanFail("发车成功", builder.toString());
return Resp.scanSuccess("发车成功", builder.toString());
}
@Override
@ -7011,14 +7002,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public boolean judgmentOrderRemove(Long deliveryId, Long orderId) {
public boolean judgmentOrderRemove(Long deliveryId, String orderIds) {
List<Long> list = Func.toLongList(orderIds);
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.in(DistributionLoadscanEntity::getOrderId, list)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(loadscanEntityList)) {
Map<Long, DistributionLoadscanEntity> loadingOrderMap = loadscanEntityList.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getOrderId, Function.identity(), (k1, k2) -> k2));
return !Func.isNotEmpty(loadingOrderMap.get(orderId));
return false;
}
return true;
}
@ -7209,6 +7201,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("该任务已完结!", "该任务已完结!");
}
String loadingId = distrilbutionloadingscanDTO.getLoadingId();
Boolean b = false;
if ("1".equals(distributionDeliveryListEntity.getKind())) {
b = distributionDeliverySelfService.update(new UpdateWrapper<DistributionDeliverySelfEntity>().lambda()

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

@ -2589,7 +2589,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//查询备货任务
DistributionStockupEntity stockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntities.get(0).getStockupId());
if (Func.isNotEmpty(stockupEntity)) {
if (stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue())) {
//查询此备货任务有多少
List<DistributionStockupInfoEntity> entityList = distributionStockupInfoService.list(Wrappers.<DistributionStockupInfoEntity>query().lambda()
.eq(DistributionStockupInfoEntity::getStockupId, stockupEntity.getId())
.ne(DistributionStockupInfoEntity::getStockStatus, "4")
);
if (stockupEntity.getAssignStatus().equals(StockAssignStatusConstant.weizhipai.getValue()) && entityList.size() == 1) {
//物理删除关于预约的所有信息
distributionReservationStocklistMapper.deleteReservationStocklist(reservationEntity.getId());
distributionReservationPackageMapper.deleteReservationPackage(reservationEntity.getId());

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

@ -18,6 +18,8 @@ package com.logpm.distribution.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -34,97 +36,18 @@ import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataDriverArteryClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.DistributionAddvalueDTO;
import com.logpm.distribution.dto.DistributionDeliverySelfDTO;
import com.logpm.distribution.dto.DistributionNumberDetailDTO;
import com.logpm.distribution.dto.DistributionParcelNumberDTO;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.DistributionSignforExcelDTO;
import com.logpm.distribution.dto.DistrilbutionAppsignforDTO;
import com.logpm.distribution.dto.*;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionAddvaluePackageEntity;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionLoadscaninvnEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionReservationPackageEntity;
import com.logpm.distribution.entity.DistributionReservationStockarticleEntity;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.distribution.entity.DistributionSignPrintEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity;
import com.logpm.distribution.excel.DistributionSignforExcel;
import com.logpm.distribution.excel.DistributionSignforInventoryExcel;
import com.logpm.distribution.excel.DistributionSignforOrderExcel;
import com.logpm.distribution.excel.DistributionSignforOwnExcel;
import com.logpm.distribution.excel.DistributionSignforPackageExcel;
import com.logpm.distribution.mapper.DistributionAddvalueMapper;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper;
import com.logpm.distribution.mapper.DistributionDeliverySelfMapper;
import com.logpm.distribution.mapper.DistributionDeliveryTripartiteMapper;
import com.logpm.distribution.mapper.DistributionLoadscanMapper;
import com.logpm.distribution.mapper.DistributionLoadscaninvnMapper;
import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.mapper.DistributionSignforMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.mapper.DistributionStockMapper;
import com.logpm.distribution.mapper.DistributionStockupMapper;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.IDisStockListDetailService;
import com.logpm.distribution.service.IDistributionAddvaluePackageService;
import com.logpm.distribution.service.IDistributionAddvalueService;
import com.logpm.distribution.service.IDistributionAsyncService;
import com.logpm.distribution.service.IDistributionBillLadingScanService;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionLoadscanAbnormalService;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionReservationPackageService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionReservationStockarticleService;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService;
import com.logpm.distribution.service.IDistributionSignPrintService;
import com.logpm.distribution.service.IDistributionSignforService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionStockupService;
import com.logpm.distribution.service.IDistrilbutionBillLadingService;
import com.logpm.distribution.vo.DeliveryNodeVo;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO;
import com.logpm.distribution.vo.DistributionAddvalueVO;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.vo.DistributionLoadscanAbnormalVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionSignPrintVO;
import com.logpm.distribution.vo.DistributionSignforStockListVO;
import com.logpm.distribution.vo.DistributionSignforVO;
import com.logpm.distribution.vo.DistributionSignforsnmbVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.SignforPageCountVO;
import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO;
import com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO;
import com.logpm.distribution.vo.app.DistributionAppPackageDetailVO;
import com.logpm.distribution.vo.app.DistributionAppParcelListVO;
import com.logpm.distribution.vo.app.DistributionAppSignforVO;
import com.logpm.distribution.vo.app.DistributionAppStockArticleVO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.*;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionParcelListAppWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import com.logpm.oldproject.dto.SignPushDataDTO;
import com.logpm.oldproject.dto.SignPushDataUnitDTO;
@ -151,16 +74,8 @@ import org.springblade.common.constant.loading.LoadScanSigningStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant;
import org.springblade.common.constant.loading.LoadingIsInsertConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant;
import org.springblade.common.constant.reservation.ReservationStatusConstant;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.signing.SignforDriverSigningStatusConstant;
import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
@ -200,15 +115,7 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
@ -2502,6 +2409,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "配送任务错误");
}
//查询是否完成复核
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
);
if (Objects.isNull(signforEntity)){
//查询签收信息错误
log.error("签收扫描查询签收表信息错误reservationId:{}",distrilbutionloadingscanDTO.getReservationId());
return R.fail(403, "配送任务错误");
}
if (SignforStatusConstant.yiqianshou.getValue().equals(signforEntity.getSigningStatus())){
return Resp.scanFail("此任务已完成复核", "此任务已完成复核");
}
List<Long> packageLockIds = new ArrayList<>();
try {
@ -2763,6 +2685,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
// 推送
sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(),
deliveryListEntity.getTrainNumber(),deliveryListEntity.getVehicleName(),deliveryListEntity.getDriverName(),
AuthUtil.getUserName(),myCurrentWarehouse.getId(),AuthUtil.getTenantId());
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes);
} catch (Exception e) {
log.error(">>>>> 签收异常报错", e);
@ -2770,6 +2700,49 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
/**
*
* @param orderPackageCode
* @param reservationCode
* @param distrCarNumber
* @param vehicleName
* @param driverName
* @param userName
* @param warehouseId
* @param tenantId 当前的租户
*
*/
private void sendMessage(String orderPackageCode,
String reservationCode,
String distrCarNumber,
String vehicleName,
String driverName,
String userName,
Long warehouseId,
String tenantId
){
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderPackageCode",orderPackageCode);
jsonObject.put("reservationCode",reservationCode);
jsonObject.put("distrCarNumber",distrCarNumber);
jsonObject.put("vehicleName",vehicleName);
jsonObject.put("driverName",driverName);
jsonObject.put("userName",userName);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("tenantId",tenantId);
// 发送入库消息
Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID());
mapState.put("createTime", System.currentTimeMillis());
Map<String, Object> map = new HashMap<>();
map.put("messageData", jsonObject);
rabbitTemplate.convertAndSend(RabbitConstant.BUSINESS_IN_CONVERSION_DATA_EXCHANGE, RabbitConstant.BUSINESS_IN_CONVERSION_DATA_ROUTING, map);
} catch (Exception e) {
log.error("签收商家推送:{}", e);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public R signforPC(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
@ -3803,8 +3776,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionAppStockArticleVO> getAppDeliveryorderListPage(DistributionAppDeliveryListDTO distributionDeliveryList) {
List<DistributionAppStockArticleVO> orderVos = new ArrayList<>();
if (Func.isEmpty(distributionDeliveryList.getReservationId())) {
log.error("参数缺失reservationId:{}", distributionDeliveryList.getReservationId());
return orderVos;
}
//查询该客户装车
@ -3830,32 +3805,40 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Map<Long, List<DistributionReservationStockarticleEntity>> reservationOrderMap = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));
Map<Long, List<DistributionLoadscanEntity>> loadingOrderMap = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
List<DistributionAppStockArticleVO> orderVos = new ArrayList<>();
if (Func.isNotEmpty(orderIds)) {
orderIds = orderIds.stream().distinct().collect(Collectors.toList());
for (Long orderId : orderIds) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
DistributionAppStockArticleVO distributionAppStockArticleVO = Func.copy(stockArticleEntity, DistributionAppStockArticleVO.class);
distributionAppStockArticleVO.setTotalNumber(stockArticleEntity.getTotalNumber());
distributionAppStockArticleVO.setStockArticleId(stockArticleEntity.getId());
distributionAppStockArticleVO.setLoadingNub(0);
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds);
List<DistributionReservationStockarticleEntity> reservationOrders = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionDeliveryList.getReservationId())
.in(DistributionReservationStockarticleEntity::getStockArticleId, orderIds)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) {
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
DistributionAppStockArticleVO distributionAppStockArticleVO = Func.copy(distributionStockArticleEntity, DistributionAppStockArticleVO.class);
assert distributionAppStockArticleVO != null;
distributionAppStockArticleVO.setLoadingNub(0);
distributionAppStockArticleVO.setSignforNub(0);
distributionAppStockArticleVO.setReservationNum(0);
//查询预约该订单计划数量
DistributionReservationStockarticleEntity reservationOrder = distributionReservationStockarticleService.getOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionDeliveryList.getReservationId())
.eq(DistributionReservationStockarticleEntity::getStockArticleId, orderId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
DistributionReservationStockarticleEntity reservationOrder = findReservationOrders(reservationOrders, distributionStockArticleEntity.getId());
if (Func.isNotEmpty(reservationOrder)) {
distributionAppStockArticleVO.setReservationNum(reservationOrder.getReservationNum());
}
if (stockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
if (distributionStockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
//判断此订单是是否是异常装车
if (Func.isEmpty(reservationOrderMap.get(orderId))) {
if (Func.isEmpty(reservationOrderMap.get(distributionStockArticleEntity.getId()))) {
//不存在计划之中的订单装车
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(orderId);
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(distributionStockArticleEntity.getId());
List<Long> abnormalPackageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(abnormalPackageIds);
List<DistributionAppParcelListVO> distributionAppParcelListVOS = DistributionParcelListAppWrapper.build().listVO(distributionParcelListEntities);
@ -3877,7 +3860,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询此预约该订单下的包件信息
List<DistributionReservationPackageEntity> reservationPackage = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, distributionDeliveryList.getReservationId())
.eq(DistributionReservationPackageEntity::getStockArticleId, orderId)
.eq(DistributionReservationPackageEntity::getStockArticleId, distributionStockArticleEntity.getId())
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
List<Long> packageIds = new ArrayList<>();
@ -3887,8 +3870,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Map<Long, DistributionLoadscanEntity> collect = null;
if (Func.isNotEmpty(loadingOrderMap.get(orderId))) {
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(orderId);
if (Func.isNotEmpty(loadingOrderMap.get(distributionStockArticleEntity.getId()))) {
List<DistributionLoadscanEntity> loadscanEntityList = loadingOrderMap.get(distributionStockArticleEntity.getId());
List<Long> loadingPackageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
packageIds.addAll(loadingPackageIds);
collect = loadscanEntityList.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));
@ -3900,11 +3883,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionAppParcelListVO> packageVOS = new ArrayList<>();
if (Func.isNotEmpty(packageIds)) {
packageIds = packageIds.stream().distinct().collect(Collectors.toList());
for (Long packageId : packageIds) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
List<DistributionParcelListEntity> parcelListEntitys = distributionParcelListService.listByIds(packageIds);
for (DistributionParcelListEntity parcelListEntity : parcelListEntitys) {
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
DistributionAppParcelListVO distributionAppParcelListVO = DistributionParcelListAppWrapper.build().entityVO(parcelListEntity);
if (Func.isNotEmpty(collect)) {
DistributionLoadscanEntity distributionLoadscanEntity = collect.get(packageId);
DistributionLoadscanEntity distributionLoadscanEntity = collect.get(parcelListEntity.getId());
if (Func.isNotEmpty(distributionLoadscanEntity)) {
distributionAppParcelListVO.setMaterialName(parcelListEntity.getMaterialName());
if (distributionLoadscanEntity.getIsAbnormalLoading().equals(2)) {
@ -3931,16 +3916,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, distributionDeliveryList.getReservationId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, orderId)
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionStockArticleEntity.getId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(reservationZeroPackageEntityList)) {
int reservationTotal = reservationZeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum();
distributionAppStockArticleVO.setReservationNum(reservationTotal);
List<DistributionParcelNumberVO> parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(orderId, Long.parseLong(distributionDeliveryList.getReservationId()));
List<DistributionParcelNumberVO> parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(distributionStockArticleEntity.getId(), Long.parseLong(distributionDeliveryList.getReservationId()));
distributionAppStockArticleVO.setSignforNub(0);
if (Func.isNotEmpty(parcelNumberVOS)) {
parcelNumberVOS.forEach(p -> {
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distributionDeliveryList.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, orderId).eq(DistributionLoadscanEntity::getPackageId, p.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distributionDeliveryList.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, distributionStockArticleEntity.getId()).eq(DistributionLoadscanEntity::getPackageId, p.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
p.setLoadingNum(0);
p.setSigningNum(0);
if (Func.isNotEmpty(loadscanEntity)) {
@ -3965,6 +3950,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
/**
* 寻找预约单中订单
* @param reservationOrders
* @param id
* @return
*/
private DistributionReservationStockarticleEntity findReservationOrders(List<DistributionReservationStockarticleEntity> reservationOrders , Long id) {
return reservationOrders.stream().filter(f -> f.getStockArticleId().equals(id)).findFirst().orElse(null);
}
// Map<Long, List<DistributionLoadscanEntity>> orderMap = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
// List<DistributionAppStockArticleVO> distributionAppStockArticleVOS = new ArrayList<>();

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

@ -310,8 +310,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//商 市
return baseMapper.pageList(page, distributionStockupEntity);
}
}
@Override

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

@ -479,7 +479,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (!list1.isEmpty()) {
deliveryDetails.setStockStatus("2");
}
}
distributionDeliveryDetailsService.updateById(deliveryDetails);
}
@ -493,8 +492,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
deliveryDetails.setStockStatus("1");
distributionDeliveryDetailsService.save(deliveryDetails);
distributionAsyncService.getInventoryNumUpdate(deliveryDetails.getStockListId(), deliveryDetails.getQuantity(), 1);
//增加
List<DisStockListDetailEntity> disStockListDetailEntities = new ArrayList<>();
for (int i1 = 0; i1 < deliveryDetails.getQuantity(); i1++) {
@ -2300,7 +2297,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
for (DistrilbutionBillLadingAppVO vo : records) {
//有可能存在多个订单所以需要拆分
String stockArticleId = vo.getStockArticleId();
Integer orderNum = 0; //订单总数
Integer planNum = 0; //预约数量
Integer signedNum = 0; //签收数量
@ -2400,7 +2396,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
Map<String,Object> map = new HashMap<>();
map.put("orderPackageCode",p.getOrderPackageCode());
map.put("isSign",p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
map.put("category",p.getSecond());
map.put("thirdProduct",p.getThirdProduct());
map.put("fisrt",p.getThirdProduct());
map.put("second",p.getSecond());
map.put("materiel",p.getMaterialName());
map.put("orderId",p.getStockArticleId());
map.put("num",p.getQuantity());
mapList.add(map);

Loading…
Cancel
Save