Browse Source

Merge branch 'dev' into pre-production

chenglong
zhenghaoyu 12 months ago
parent
commit
866e6a048f
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 8
      blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  3. 32
      blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java
  4. 36
      blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java
  5. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  7. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  8. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  9. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  10. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  11. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  12. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java
  13. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  14. 164
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  15. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  16. 40
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java
  17. 16
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java
  18. 21
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml
  19. 9
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java
  20. 28
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java

4
blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@ -45,7 +45,7 @@ public interface LauncherConstant {
/**
* nacos dev 地址
*/
String NACOS_DEV_ADDR = "192.168.10.46:8848";
String NACOS_DEV_ADDR = "192.168.2.100:8848";
/**
@ -77,7 +77,7 @@ public interface LauncherConstant {
/**
* seata dev 地址
*/
String SEATA_DEV_ADDR = "192.168.10.46:8091";
String SEATA_DEV_ADDR = "192.168.2.100:8091";
/**

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

@ -41,10 +41,10 @@ public class LauncherServiceImpl implements LauncherService {
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(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.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));

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

@ -0,0 +1,32 @@
package org.springblade.common.node;
public enum BillLadingNode {
chuangjianchenggong("创建成功","10"),
qianshouzhong("签收中","20"),
yiwancheng("已完成","30");
/**
* 状态
*/
private String name;
/**
*
*/
private String value;
BillLadingNode(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public String getValue() {
return value;
}
}

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

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

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

@ -357,4 +357,12 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
IPage<DistributionReservationInventoryPackageVO> selectInvenToryPackageByReservationInfo(@Param("param") Map<String, Object> reservationPackageDTO,IPage<DistributionReservationInventoryPackageVO> page);
List<DistributionParcelListEntity> getReservationPackageNew(@Param("param")Map<String, Object> distributionDeliveryInfoDTO);
/**
* 根据预约单号查询预约
* @param warehouseCode
* @param searchCode
* @return
*/
DistributionReservationEntity selectByReservationCode(@Param("warehouseId") Long warehouseId,@Param("reservationCode") String reservationCode);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -1693,4 +1693,8 @@
</if>
</select>
<select id="selectByReservationCode"
resultType="com.logpm.distribution.entity.DistributionReservationEntity">
SELECT * FROM logpm_distribution_reservation WHERE reservation_code = #{reservationCode} AND warehouse_id = #{warehouseId}
</select>
</mapper>

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

@ -319,5 +319,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* 查询配送单关联预约
* @param deliveryId
*/
List<DistributionReservationEntity> selectReservationByDeliveryId(Long deliveryId);
List<DistributionReservationEntity> selectReservationByDeliveryId(@Param("deliveryId") Long deliveryId);
DistributionSignforEntity selectByReservationId(@Param("reservationId") Long reservationId);
}

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

@ -1286,4 +1286,7 @@
AND ldr.is_deleted = 0
AND lds.is_deleted = 0
</select>
<select id="selectByReservationId" resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor WHERE reservation_id = #{reservationId}
</select>
</mapper>

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

@ -112,4 +112,19 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
List<DistributionParcelListEntity> selectBillLadingPackage(@Param("ids")List<Long> ids);
List<DistributionDeliveryDetailsEntity> selectBillLadingInventory(@Param("ids")List<Long> ids);
/**
* 根据自提单号查询自提单
* @param id
* @param searchCode
* @return
*/
DistrilbutionBillLadingEntity selectByBillLadingCode(@Param("warehouseId") Long id,@Param("pickupBatch") String pickupBatch);
/**
* 查询自提单计划件数
* @param id
* @return
*/
Integer selectBillLadingPlanNum(@Param("billLadingId") Long billLadingId);
}

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

@ -470,6 +470,16 @@
#{id}
</foreach>
</select>
<select id="selectByBillLadingCode"
resultType="com.logpm.distribution.entity.DistrilbutionBillLadingEntity">
SELECT * FROM logpm_distribution_bill_lading WHERE warehouse_id = #{warehouseId} AND pickup_batch=#{pickupBatch} AND is_deleted = 0
</select>
<select id="selectBillLadingPlanNum" resultType="java.lang.Integer">
SELECT(
IF((SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 3) IS NULL,0,(SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 3))
+
IF((SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = #{billLadingId} AND inventory_status != 3) IS NULL ,0,(SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = #{billLadingId} AND inventory_status != 3) ) )
</select>
</mapper>

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

@ -220,8 +220,6 @@ public interface IDistributionReservationService extends BaseService<Distributio
/**
* 查询预约订单的包件信息
* @param orderId
* @param reservationId
* @return
*/
R getReservationPackageListByOrderId(Map<String,Object> packageDTO,IPage<DistributionReservationOrderPackageVO> page);
@ -271,4 +269,10 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
void maintenanceReservationNum(Long reservationId);
/**
* 根据预约单号查询预约
* @param searchCode
* @return
*/
DistributionReservationEntity selectByReservationCode(String searchCode);
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java

@ -221,4 +221,18 @@ public interface IDistrilbutionBillLadingService extends BaseService<Distrilbuti
* @return
*/
R cancelBillLoding(String billLodingIds);
/**
* 根据自提单号查询自提
* @param searchCode
* @return
*/
DistrilbutionBillLadingEntity selectByBillLadingCode(String searchCode);
/**
* 查询自提单计划件数
* @param id
* @return
*/
Integer selectBillLadingPlanNum(Long id);
}

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

@ -3523,7 +3523,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
boolean signStatus = false;
if (Func.isNotEmpty(distributionParcelListEntities)){
loadStatus = distributionParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
signStatus = distributionParcelListEntities.stream().anyMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
signStatus = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
}
if (Func.isNotEmpty(disStockListDetailEntities)){
@ -3663,4 +3663,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
/**
* @param searchCode
* @return
*/
@Override
public DistributionReservationEntity selectByReservationCode(String searchCode) {
String method = "#################类DistributionReservationServiceImpl执行方法selectByReservationCode,";
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error(method+"查询预约失败:{}",searchCode);
return null;
}
return baseMapper.selectByReservationCode(myCurrentWarehouse.getId(),searchCode);
}
}

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

@ -64,7 +64,9 @@ import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.signing.SignforDriverSigningStatusConstant;
import org.springblade.common.constant.signing.SignforStatusConstant;
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.serviceConstant.ServiceConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.FileUtil;
@ -181,6 +183,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Lazy
private IDistributionReservationService distributionReservationService;
@Autowired
@Lazy
private IDistrilbutionBillLadingService distrilbutionBillLadingService;
@Autowired
private RabbitTemplate rabbitTemplate;
@Autowired
@ -786,10 +791,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//进行数据组装
break;
case 2:
DistributionReservationEntity reservationEntity = distributionReservationService.selectByReservationCode(searchCode);
if (Func.isEmpty(reservationEntity)){
return R.fail("未查询到预约单信息,请查看搜索类型是否匹配");
}
//解析配送节点
nodeVos = handleReservationNode(reservationEntity);
//预约单查询
break;
case 3:
//订单自编号查询
//自提单号
DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = distrilbutionBillLadingService.selectByBillLadingCode(searchCode);
if (Func.isEmpty(distrilbutionBillLadingEntity)){
return R.fail("未查询到自提单信息,请查看搜索类型是否匹配");
}
//解析配送节点
nodeVos = handleBillLading(distrilbutionBillLadingEntity);
break;
case 4:
//包条码查询
@ -798,6 +815,151 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.data(nodeVos);
}
private List<DeliveryNodeVo> handleBillLading(DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {
DeliveryNodeVo billLadingNodeVo = new DeliveryNodeVo();
billLadingNodeVo.setTime(distrilbutionBillLadingEntity.getCreateTime());
billLadingNodeVo.setNodeName(BillLadingNode.chuangjianchenggong.getName());
String name = userClient.userInfoById(distrilbutionBillLadingEntity.getCreateUser()).getData().getName();
billLadingNodeVo.setNodeUserName(name);
//查询自提的自提数量
Integer billLadingNum = distrilbutionBillLadingService.selectBillLadingPlanNum(distrilbutionBillLadingEntity.getId());
billLadingNodeVo.setNodeInfo("计划自提"+billLadingNum+"件");
nodeVos.add(billLadingNodeVo);
//查询自提扫描数量
}catch (Exception e){
}
return nodeVos;
}
private List<DeliveryNodeVo> handleReservationNode(DistributionReservationEntity reservationEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
DeliveryNodeVo reservationNodeVo = new DeliveryNodeVo();
int projectNum = reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum();
reservationNodeVo.setTime(reservationEntity.getCreateTime());
String name = userClient.userInfoById(reservationEntity.getCreateUser()).getData().getName();
reservationNodeVo.setNodeUserName(name);
reservationNodeVo.setNodeName(ReservationNode.chuangjianchenggong.getName());
reservationNodeVo.setNodeInfo("计划配送"+projectNum+"件");
nodeVos.add(reservationNodeVo);
//查询装车
Integer loadingNum = distributionLoadscanMapper.selectLoadingNumByReservationId(reservationEntity.getId());
if (loadingNum > 0){
DeliveryNodeVo middleReservationNodeVo = new DeliveryNodeVo();
middleReservationNodeVo.setNodeName(ReservationNode.zhuangchezhong.getName());
//查询预约装车操作人有那些
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanMapper.selectList(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, reservationEntity.getId())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<String> scanUser = new ArrayList<>();
List<String> loadingTime = new ArrayList<>();
if (Func.isNotEmpty(loadscanEntityList)){
List<String> packageScanUser = loadscanEntityList.stream().map(DistributionLoadscanEntity::getScanUser).collect(Collectors.toList());
scanUser.addAll(packageScanUser);
List<String> packagheLoadingTime = loadscanEntityList.stream().map(DistributionLoadscanEntity::getScanTime).collect(Collectors.toList());
loadingTime.addAll(packagheLoadingTime);
}
List<DistributionLoadscaninvnEntity> inventoryLoading = distributionLoadscaninvnMapper.selectList(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getReservationId, reservationEntity.getId())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(inventoryLoading)){
List<String> InventoryScanUser = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getScanUser).collect(Collectors.toList());
scanUser.addAll(InventoryScanUser);
List<String> inventoryLoadingTime = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getScanTime).collect(Collectors.toList());
loadingTime.addAll(inventoryLoadingTime);
}
if (Func.isNotEmpty(scanUser)){
String scanUsers = scanUser.stream().distinct().collect(Collectors.joining(","));
middleReservationNodeVo.setNodeUserName(scanUsers);
}
if (Func.isNotEmpty(loadingTime)){
String max = Collections.max(loadingTime);
middleReservationNodeVo.setTime(sdf.parse(max));
}
if (reservationEntity.getLoadingStatus().equals(ReservationLoadingStatusConstant.yizhuangche.getValue())){
middleReservationNodeVo.setNodeName(ReservationNode.zhuangchewancheng.getName());
}
middleReservationNodeVo.setNodeInfo("计划配送"+projectNum+"件"+"装车"+loadingNum+"件");
nodeVos.add(middleReservationNodeVo);
}
Integer signingNum = distributionLoadscanMapper.selectSigningNumByReservationId(reservationEntity.getId());
if (signingNum>0){
DeliveryNodeVo endReservationNodeVo = new DeliveryNodeVo();
endReservationNodeVo.setNodeName(ReservationNode.qianshouzhong.getName());
//查询预约装车操作人有那些
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanMapper.selectList(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, reservationEntity.getId())
.eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<String> scanUser = new ArrayList<>();
List<String> signTime = new ArrayList<>();
if (Func.isNotEmpty(loadscanEntityList)){
List<String> packageScanUser = loadscanEntityList.stream().map(DistributionLoadscanEntity::getScanUser).collect(Collectors.toList());
scanUser.addAll(packageScanUser);
List<String> packagheSignTimeTime = loadscanEntityList.stream().map(DistributionLoadscanEntity::getSigningTime).collect(Collectors.toList());
signTime.addAll(packagheSignTimeTime);
}
List<DistributionLoadscaninvnEntity> inventoryLoading = distributionLoadscaninvnMapper.selectList(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getReservationId, reservationEntity.getId())
.eq(DistributionLoadscaninvnEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(inventoryLoading)){
List<String> inventoryScanUser = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getScanUser).collect(Collectors.toList());
scanUser.addAll(inventoryScanUser);
List<String> inventorySignTimeTime = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getSigningTime).collect(Collectors.toList());
signTime.addAll(inventorySignTimeTime);
}
if (Func.isNotEmpty(scanUser)){
String scanUsers = scanUser.stream().distinct().collect(Collectors.joining(","));
endReservationNodeVo.setNodeUserName(scanUsers);
}
if (Func.isNotEmpty(signTime)){
String max = Collections.max(signTime);
endReservationNodeVo.setTime(sdf.parse(max));
}
if (reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())){
endReservationNodeVo.setNodeName(ReservationNode.qianshouwancheng.getName());
}
endReservationNodeVo.setNodeInfo("计划配送"+projectNum+"件;"+"装车"+loadingNum+"件;"+"签收"+signingNum+"件");
nodeVos.add(endReservationNodeVo);
}
//查询此预约是否完成复核
DistributionSignforEntity signforEntity = distributionSignforMapper.selectByReservationId(reservationEntity.getId());
if (Func.isNotEmpty(signforEntity)){
if (signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
DeliveryNodeVo signReservationNodeVo = new DeliveryNodeVo();
signReservationNodeVo.setTime(sdf.parse(signforEntity.getSigningTime()));
signReservationNodeVo.setNodeUserName(signforEntity.getExamineUserName());
signReservationNodeVo.setNodeName(ReservationNode.fuhewancheng.getName());
signReservationNodeVo.setNodeInfo("计划配送"+projectNum+"件;"+"装车"+loadingNum+"件;"+"签收"+signingNum+"件");
nodeVos.add(signReservationNodeVo);
}
}
}catch (Exception e){
throw new RuntimeException(e);
}
return nodeVos;
}
private List<DeliveryNodeVo> handleDeliveryNode(DistributionDeliveryListEntity deliveryListEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {

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

@ -685,6 +685,29 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return R.status(false);
}
/**
* @param searchCode
* @return
*/
@Override
public DistrilbutionBillLadingEntity selectByBillLadingCode(String searchCode) {
String method = "##########类DistrilbutionBi().selectByBillLadingCode,";
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return null;
}
return baseMapper.selectByBillLadingCode( myCurrentWarehouse.getId(),searchCode);
}
/**
* @param id
* @return
*/
@Override
public Integer selectBillLadingPlanNum(Long id) {
return baseMapper.selectBillLadingPlanNum(id);
}
@Transactional
private Integer cancelBillLodingPackage(List<Long> ids) {
String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,";

40
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java

@ -0,0 +1,40 @@
package com.logpm.patch.jobhandle;
import com.logpm.patch.service.IOrderDataService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@AllArgsConstructor
@Component
public class OrderDataRepair {
private final IOrderDataService orderDataService;
@XxlJob("repairOrderSignStatus")
public ReturnT<String> repairOrderSignStatus(String param) {
log.info("####################repairOrderSignStatus: 修复订单签收状态 开始");
//查询所有包件已入库并且已签收的订单状态不为已签收的数据修复状态
List<Long> ls = orderDataService.findAllNoSignStatusOrder();
for (Long orderId : ls) {
try{
log.info("#############repairOrderSignStatus: 当前处理的订单id为{}",orderId);
orderDataService.updateOrderStatusByOrderId(orderId,"80");
}catch (Exception e){
log.error("##############repairOrderSignStatus: 处理订单id为{}的订单失败",orderId);
continue;
}
}
log.info("####################repairOrderSignStatus: 修复订单签收状态 完成");
return ReturnT.SUCCESS;
}
}

16
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java

@ -0,0 +1,16 @@
package com.logpm.patch.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface OrderDataMapper {
List<Long> findAllNoSignStatusOrder();
void updateOrderStatusByOrderId(@Param("orderId") Long orderId, @Param("orderStatus") String orderStatus);
}

21
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.patch.mapper.OrderDataMapper">
<select id="findAllNoSignStatusOrder" resultType="Long">
SELECT id
FROM
logpm_distribution_stock_article
WHERE
hand_quantity = 0
AND order_status != '80'
AND total_number = ( SELECT COUNT( 1 ) FROM logpm_distribution_parcel_list WHERE stock_article_id = logpm_distribution_stock_article.id AND order_package_status = '70')
</select>
<update id="updateOrderStatusByOrderId" >
update logpm_distribution_stock_article
set order_status = #{orderStatus}
where id = #{orderId}
</update>
</mapper>

9
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java

@ -0,0 +1,9 @@
package com.logpm.patch.service;
import java.util.List;
public interface IOrderDataService {
List<Long> findAllNoSignStatusOrder();
void updateOrderStatusByOrderId(Long orderId, String orderStatus);
}

28
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java

@ -0,0 +1,28 @@
package com.logpm.patch.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.logpm.patch.mapper.OrderDataMapper;
import com.logpm.patch.service.IOrderDataService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class OrderDataServiceImpl implements IOrderDataService {
private final OrderDataMapper orderDataMapper;
@Override
public List<Long> findAllNoSignStatusOrder() {
return orderDataMapper.findAllNoSignStatusOrder();
}
@Override
public void updateOrderStatusByOrderId(Long orderId, String orderStatus) {
orderDataMapper.updateOrderStatusByOrderId(orderId,orderStatus);
}
}
Loading…
Cancel
Save