Browse Source

Merge branch 'dev' into pre-production

chenglong
汤建军 12 months ago
parent
commit
e4d7a37393
  1. 20
      blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java
  2. 18
      blade-biz-common/src/main/java/org/springblade/common/node/DeliveryNode.java
  3. 26
      blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java
  4. 35
      blade-biz-common/src/main/java/org/springblade/common/node/StockUpNode.java
  5. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java
  6. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml
  7. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  8. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  9. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  10. 76
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  11. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

20
blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java

@ -2,11 +2,11 @@ package org.springblade.common.node;
public enum BillLadingNode {
chuangjianchenggong("创建成功","10"),
qianshouzhong("签收中","20"),
qianshouwancheng("签收完成","20"),
chuangjianchenggong("创建成功"),
qianshouzhong("签收中"),
qianshouwancheng("签收完成"),
yiwancheng("已完成","30");
yiwancheng("已完成");
/**
@ -16,11 +16,11 @@ public enum BillLadingNode {
/**
*
*/
private String value;
// private String value;
BillLadingNode(String name, String value) {
BillLadingNode(String name) {
this.name = name;
this.value = value;
// this.value = value;
}
@ -28,7 +28,7 @@ public enum BillLadingNode {
return name;
}
public String getValue() {
return value;
}
// public String getValue() {
// return value;
// }
}

18
blade-biz-common/src/main/java/org/springblade/common/node/DeliveryNode.java

@ -2,9 +2,9 @@ package org.springblade.common.node;
public enum DeliveryNode {
chuangjianchenggong("创建成功","10"),
peisongzhong("配送中","20"),
yiwancheng("已完成","30");
chuangjianchenggong("创建成功"),
peisongzhong("配送中"),
yiwancheng("已完成");
/**
@ -14,11 +14,11 @@ public enum DeliveryNode {
/**
*
*/
private String value;
// private String value;
DeliveryNode(String name, String value) {
DeliveryNode(String name) {
this.name = name;
this.value = value;
// this.value = value;
}
@ -26,7 +26,7 @@ public enum DeliveryNode {
return name;
}
public String getValue() {
return value;
}
// public String getValue() {
// return value;
// }
}

26
blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java

@ -2,13 +2,13 @@ package org.springblade.common.node;
public enum ReservationNode {
chuangjianchenggong("创建成功","10"),
peisongchuangjian("配送创建","20"),
zhuangchezhong("装车中","30"),
zhuangchewancheng("装车完成","40"),
qianshouzhong("签收中","50"),
qianshouwancheng("签收完成","60"),
fuhewancheng("复核完成","70");
chuangjianchenggong("创建成功"),
peisongchuangjian("配送创建"),
zhuangchezhong("装车中"),
zhuangchewancheng("装车完成"),
qianshouzhong("签收中"),
qianshouwancheng("签收完成"),
fuhewancheng("复核完成");
/**
@ -18,11 +18,11 @@ public enum ReservationNode {
/**
*
*/
private String value;
// private String value;
ReservationNode(String name, String value) {
ReservationNode(String name) {
this.name = name;
this.value = value;
// this.value = value;
}
@ -30,7 +30,7 @@ public enum ReservationNode {
return name;
}
public String getValue() {
return value;
}
// public String getValue() {
// return value;
// }
}

35
blade-biz-common/src/main/java/org/springblade/common/node/StockUpNode.java

@ -0,0 +1,35 @@
package org.springblade.common.node;
public enum StockUpNode {
chuangjianchenggong("创建成功"),
yizhipai("已指派"),
beihuozhong("备货中"),
yiwancheng("已完成");
/**
* 状态
*/
private String name;
/**
*
*/
// private String value;
StockUpNode(String name) {
this.name = name;
// this.value = value;
}
public String getName() {
return name;
}
// public String getValue() {
// return value;
// }
}

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

@ -85,4 +85,11 @@ public interface DistributionStockMapper extends BaseMapper<DistributionStockEnt
DistributionStockAllocationVO selectAllocation(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId,@Param("parcelListId") Long parcelListId);
DistributionStockAllocationVO selectSelfAllocation(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId,@Param("parcelListId") Long parcelListId);
/**
* 查询备货任务已扫描数量
* @param id
* @return
*/
Integer selectStockNumByStockupId(@Param("stockUpId") Long stockUpId);
}

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

@ -108,6 +108,9 @@
where lds.bill_lading_id = #{reservationId} and lds.stockup_id = #{stockupId} and lds.parcel_list_id = #{parcelListId}
LIMIT 1
</select>
<select id="selectStockNumByStockupId" resultType="java.lang.Integer">
SELECT IF(sum(stock_quantity) is null,0,sum(stock_quantity)) FROM logpm_distribution_stock WHERE stockup_id =#{stockUpId} AND is_deleted = 0
</select>
</mapper>

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

@ -255,4 +255,19 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
* @return
*/
List<DistributionStockupPackageListDetailExcel> exportStockUptInventoryDetail(@Param("ids")List<Long> list);
/**
* 根据备货编码查询出备货任务信息
* @param id
* @param searchCode
* @return
*/
DistributionStockupEntity selectStockUpByStockUpCode(@Param("warehouseId") Long warehouseId,@Param("stockupCode") String stockupCode);
/**
* 查询备货任务计划备货数量
* @param id
* @return
*/
Integer selectStockUpPlanNum(@Param("stockUpId") Long stockUpId);
}

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

@ -1234,5 +1234,22 @@
#{id}
</foreach>
</select>
<select id="selectStockUpByStockUpCode"
resultType="com.logpm.distribution.entity.DistributionStockupEntity">
SELECT * FROM logpm_distribution_stockup WHERE warehouse_id = #{warehouseId} AND stockup_code = #{stockupCode}
</select>
<select id="selectStockUpPlanNum" resultType="java.lang.Integer">
SELECT
CASE type_service
WHEN '3' THEN ( SELECT (IF(SUM(lddd.quantity) is null,0,SUM(lddd.quantity))+ IF(SUM(ldbp.packet_number) is null ,0,SUM(ldbp.packet_number))) FROM logpm_distribution_stockup_info AS ldsi
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl
ON ldsi.reservation_id = ldbl.id
LEFT JOIN logpm_distrilbution_bill_package AS ldbp ON ldbl.id = ldbp.bill_lading_id
LEFT JOIN logpm_distribution_delivery_details AS lddd ON ldbl.id = lddd.bill_lading_id
WHERE ldsi.stockup_id = #{stockUpId})
ELSE (SELECT SUM((IF(ldr.reservation_num is null,0,ldr.reservation_num) + IF(ldr.reservation_stock_list_num is null,0,ldr.reservation_stock_list_num))) FROM logpm_distribution_stockup_info AS ldsi LEFT JOIN logpm_distribution_reservation AS ldr ON ldsi.reservation_id = ldr.id WHERE ldsi.stockup_id = #{stockUpId} )
END num
FROM logpm_distribution_stockup WHERE id = #{stockUpId}
</select>
</mapper>

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

@ -284,4 +284,12 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
* @return
*/
List<DistributionStockupPackageListDetailExcel> exportStockUptDetail(List<Long> list);
/**
* 根据备货编码查询备货任务
* @param searchCode
* @return
*/
DistributionStockupEntity selectStockUpByStockUpCode(String searchCode);
}

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

@ -64,10 +64,12 @@ 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;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.node.BillLadingNode;
import org.springblade.common.node.DeliveryNode;
import org.springblade.common.node.ReservationNode;
import org.springblade.common.node.StockUpNode;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.FileUtil;
@ -194,6 +196,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Lazy
private IDistributionBillLadingScanService distributionBillLadingScanService;
@Autowired
@Lazy
private IDistributionStockupService distributionStockupService;
@Autowired
@Lazy
private DistributionStockupMapper distributionStockupMapper;
@Autowired
private RabbitTemplate rabbitTemplate;
@Autowired
@ -817,12 +825,72 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
nodeVos = handleBillLading(distrilbutionBillLadingEntity);
break;
case 4:
//包条码查询
//备货任务查询
DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectStockUpByStockUpCode(searchCode);
if (Func.isEmpty(distributionStockupEntity)){
return R.fail("未查询到备货任务信息,请查看搜索类型是否匹配");
}
nodeVos = handleStockUp(distributionStockupEntity);
break;
}
return R.data(nodeVos);
}
private List<DeliveryNodeVo> handleStockUp(DistributionStockupEntity distributionStockupEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {
StringBuilder sb = new StringBuilder();
DeliveryNodeVo startStockUpNodeVo = new DeliveryNodeVo();
startStockUpNodeVo.setTime(distributionStockupEntity.getCreateTime());
startStockUpNodeVo.setNodeName(StockUpNode.chuangjianchenggong.getName());
startStockUpNodeVo.setNodeUserName(userClient.userInfoById(distributionStockupEntity.getCreateUser()).getData().getName());
//查询备货任务数量
Integer stockUpPlanNum = distributionStockupMapper.selectStockUpPlanNum(distributionStockupEntity.getId());
startStockUpNodeVo.setNodeInfo("计划备货"+stockUpPlanNum+"件;");
nodeVos.add(startStockUpNodeVo);
if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())){
DeliveryNodeVo assignStockUpNodeVo = new DeliveryNodeVo();
assignStockUpNodeVo.setNodeName(StockUpNode.yizhipai.getName());
assignStockUpNodeVo.setTime(distributionStockupEntity.getAssignTime());
assignStockUpNodeVo.setNodeInfo("指派"+distributionStockupEntity.getLoaderName()+"计划备货"+stockUpPlanNum+"件;");
assignStockUpNodeVo.setNodeUserName(userClient.userInfoById(distributionStockupEntity.getCreateUser()).getData().getName());
nodeVos.add(assignStockUpNodeVo);
}
//查询是否存在备货扫描的数据
Integer stockupNum = distributionStockMapper.selectStockNumByStockupId(distributionStockupEntity.getId());
if (stockupNum > 0){
DeliveryNodeVo middleStockUpNodeVo = new DeliveryNodeVo();
middleStockUpNodeVo.setNodeName(StockUpNode.beihuozhong.getName());
//查询备货扫描列表
List<DistributionStockEntity> distributionStockEntities = distributionStockMapper.selectList(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getStockupId, distributionStockupEntity.getId())
);
List<Long> userId = distributionStockEntities.stream().map(DistributionStockEntity::getCreateUser).distinct().collect(Collectors.toList());
List<String> scanUser = new ArrayList<>();
for (Long id : userId) {
R<User> userR = userClient.userInfoById(id);
if (Func.isNotEmpty(userR)){
scanUser.add(userR.getData().getName());
}
}
middleStockUpNodeVo.setNodeUserName(String.join(",", scanUser));
List<Date> collect = distributionStockEntities.stream().map(DistributionStockEntity::getCreateTime).distinct().collect(Collectors.toList());
middleStockUpNodeVo.setTime(Collections.max(collect));
if (stockupNum == stockUpPlanNum){
middleStockUpNodeVo.setNodeName(StockUpNode.yiwancheng.getName());
}
middleStockUpNodeVo.setNodeInfo("计划备货"+stockUpPlanNum+"件;"+"备货"+stockupNum+"件;");
nodeVos.add(middleStockUpNodeVo);
}
}catch (Exception e){
throw new RuntimeException(e);
}
return nodeVos;
}
private List<DeliveryNodeVo> handleBillLading(DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {
@ -838,7 +906,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询自提扫描数量
Integer loadingNum = distrilbutionBillLadingMapper.selectBillLadingLoading(distrilbutionBillLadingEntity.getId());
if (loadingNum>0){
StringBuilder sb = new StringBuilder();
//存在装车环境,进行数量的比对
DeliveryNodeVo middleBillLadingNodeVo = new DeliveryNodeVo();
middleBillLadingNodeVo.setNodeName(BillLadingNode.qianshouzhong.getName());
@ -849,6 +916,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionBillLadingScanEntity> distributionBillLadingScanEntityList = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId,distrilbutionBillLadingEntity.getId())
);
List<String> userName = new ArrayList<>();
if (Func.isNotEmpty(distributionBillLadingScanEntityList)){
List<Long> userIds = distributionBillLadingScanEntityList.stream().map(DistributionBillLadingScanEntity::getCreateUser).collect(Collectors.toList());
if (Func.isNotEmpty(userIds)){
@ -856,7 +924,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
for (Long userId : userIds) {
R<User> userR = userClient.userInfoById(userId);
if (Func.isNotEmpty(userR)){
sb.append(userR.getData().getName()+",");
userName.add(userR.getData().getName()+",");
}
}
}
@ -864,7 +932,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<Date> collect = distributionBillLadingScanEntityList.stream().map(DistributionBillLadingScanEntity::getCreateTime).distinct().collect(Collectors.toList());
Date max = Collections.max(collect);
middleBillLadingNodeVo.setTime(max);
middleBillLadingNodeVo.setNodeUserName(sb.delete(sb.length()-1, sb.length()).toString());
middleBillLadingNodeVo.setNodeUserName(String.join(",",userName));
middleBillLadingNodeVo.setNodeInfo("计划自提"+billLadingNum+"件,"+"装车"+loadingNum+"件");
nodeVos.add(middleBillLadingNodeVo);
}

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

@ -3299,4 +3299,19 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
return detail;
}
/**
* @param searchCode
* @return
*/
@Override
public DistributionStockupEntity selectStockUpByStockUpCode(String searchCode) {
String method = "##############DistributionStockupServiceImpl.selectByBillLadingCode,";
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error(method+ "当前库房为空");
return null;
}
return baseMapper.selectStockUpByStockUpCode(myCurrentWarehouse.getId(),searchCode);
}
}

Loading…
Cancel
Save