Browse Source

维护指定ID的订单商场信息

master
汤建军 9 months ago
parent
commit
60e6456d49
  1. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  3. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java
  4. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  6. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  7. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  8. 64
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  9. 14
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java

8
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java

@ -88,4 +88,12 @@ public interface IBasicdataClientClient {
*/
@GetMapping(API_PREFIX+"/getMallById")
BasicdataClientEntity getMallById(Long mallId);
/**
* 根据名称查询客户
* @param consigneeUnit
* @return
*/
@GetMapping(API_PREFIX+"/getClientByName")
List<BasicdataClientEntity> getClientByName(String consigneeUnit);
}

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -151,4 +151,8 @@ public interface IDistributionStockArticleClient {
@GetMapping(API_PREFIX + "/updateAllOrderTotalNum")
void updateAllOrderTotalNum(@RequestParam String orderCode, @RequestParam Integer total);
@GetMapping(API_PREFIX + "/maintenanceOrderMall")
Boolean maintenanceOrderMall(@RequestParam String orderIds);
}

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java

@ -121,4 +121,13 @@ public class BasicdataClientClient implements IBasicdataClientClient {
return basicdataClientService.getById(mallId);
}
/**
* @param consigneeUnit
* @return
*/
@Override
public List<BasicdataClientEntity> getClientByName(String consigneeUnit) {
return basicdataClientService.list(Wrappers.<BasicdataClientEntity>query().lambda().eq(BasicdataClientEntity::getClientName,consigneeUnit));
}
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -311,4 +311,15 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
distributionStockArticleService.updateAllOrderTotalNum(orderCode,total);
}
/**
* @param orderIds
* @return
*/
@Override
public Boolean maintenanceOrderMall(String orderIds) {
return distributionStockArticleService.maintenanceOrderMall(orderIds);
}
}

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

@ -193,4 +193,6 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
IPage<DistributionSignforStockArticleVO> pageSignforListOwe(IPage<DistributionSignforStockArticleVO> page,@Param("param") DistributionStockArticleOweDTO stockArticleEntity);
void updateAllOrderTotalNum(@Param("orderCode") String orderCode, @Param("total") Integer total);
List<Map<String, Object>> selectAdvance(@Param("orderCode")String orderCode);
}

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

@ -1316,6 +1316,9 @@
GROUP BY
ldsa.id
</select>
<select id="selectAdvance" resultType="java.util.Map">
SELECT dealer_name,dealer_code FROM logpm_trunkline_advance WHERE order_code = #{orderCode}
</select>
<update id="updateAllOrderTotalNum">
update logpm_distribution_stock_article

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

@ -264,4 +264,11 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
* @return
*/
List<DistributionSignForStockArticleExcel> exportSignforDistributionStockArticleList(Map<String, Object> distributionStockArticle, IPage<DistributionSignforStockArticleVO> page);
/**
* 维护指定订单的商场信息
* @param orderIds
* @return
*/
Boolean maintenanceOrderMall(String orderIds);
}

64
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -28,7 +28,9 @@ import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
@ -138,6 +140,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
private final IUserClient userClient;
private final IDistributionLoadscanService distributionLoadscanService;
private final IDistributionOrderCustomerLogService distributionOrderCustomerLogService;
private final IBasicdataClientClient basicdataClientClient;
@Override
public IPage<DistributionStockArticleVO> selectDistributionStockArticlePage(IPage<DistributionStockArticleVO> page, DistributionStockArticleVO distributionStockArticle) {
@ -180,14 +183,14 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
list.forEach(li -> {
DistributionStockArticleVO distributionStockArticleVO = buildVo(li);
DistributionStockArticleExcel excel = new DistributionStockArticleExcel();
assert distributionStockArticleVO != null;
if (distributionStockArticleVO.getTotalNumber() != null &&
assert distributionStockArticleVO != null;
if (distributionStockArticleVO.getTotalNumber() != null &&
distributionStockArticleVO.getIncomingNum() != null) {
distributionStockArticleVO.setUnreceivedQuantity(
distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum()
);
}
excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero())?"是":"否");
excel.setIsZeroString("1".equals(distributionStockArticleVO.getIsZero()) ? "是" : "否");
BeanUtil.copyProperties(distributionStockArticleVO, excel);
excelList.add(excel);
});
@ -199,6 +202,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
/**
* 构建参数
*
* @param distributionStockArticle
* @return
*/
@ -1169,9 +1173,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
IPage<DistributionStockArticleEntity> stockArticleEntityList = baseMapper.selectAllDistributionOrder(page, stockArticleEntity);
List<DistributionStockArticleVO> stockArticleVOS = DistributionStockArticleNewWrapper.build().listVO(stockArticleEntityList.getRecords());
for (DistributionStockArticleVO stockArticleVO : stockArticleVOS) {
if (IsOrNoConstant.no.getValue().equals(stockArticleVO.getIsZero())){
if (IsOrNoConstant.no.getValue().equals(stockArticleVO.getIsZero())) {
stockArticleVO.setReservationNum(stockArticleVO.getHandQuantity());
}else {
} else {
List<DistributionParcelNumberVO> distributionParcelNumberVOS = distributionParcelNumberMapper.selectZeroPackage(stockArticleVO.getId());
// 零担查询当前操作计划可用数量
int reservationNum = distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getHandQuantity).sum() - distributionParcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getDeliveryQuantity).sum();
@ -2010,7 +2014,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
} else if (collect.size() == 1) {
stockArticleEntity.setWarehouseId(collect.get(0));
}
if (Func.isNotEmpty(currentWarehouse)){
if (Func.isNotEmpty(currentWarehouse)) {
stockArticleEntity.setWarehouseIdList(null);
stockArticleEntity.setWarehouseId(currentWarehouse.getId());
}
@ -2028,7 +2032,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
@Override
public void updateAllOrderTotalNum(String orderCode, Integer total) {
baseMapper.updateAllOrderTotalNum(orderCode,total);
baseMapper.updateAllOrderTotalNum(orderCode, total);
}
/**
@ -2078,7 +2082,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
} else if (collect.size() == 1) {
stockArticleEntity.setWarehouseId(collect.get(0));
}
if (Func.isNotEmpty(currentWarehouse)){
if (Func.isNotEmpty(currentWarehouse)) {
stockArticleEntity.setWarehouseIdList(null);
stockArticleEntity.setWarehouseId(currentWarehouse.getId());
}
@ -2098,6 +2102,50 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return signForStockArticleExcels;
}
/**
* @param orderIds
* @return
*/
@Override
public Boolean maintenanceOrderMall(String orderIds) {
List<DistributionStockArticleEntity> distributionStockArticleEntities = this.listByIds(Func.toLongList(orderIds));
List<DistributionStockArticleEntity> list = new ArrayList<>();
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) {
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setId(distributionStockArticleEntity.getId());
if (Func.isNotEmpty(distributionStockArticleEntity.getConsigneeUnit())) {
//查询客户
List<BasicdataClientEntity> clientByName = basicdataClientClient.getClientByName(distributionStockArticleEntity.getConsigneeUnit());
if (!clientByName.isEmpty()) {
BasicdataClientEntity basicdataClientEntity = clientByName.get(0);
stockArticleEntity.setMallId(basicdataClientEntity.getId());
stockArticleEntity.setMallName(basicdataClientEntity.getClientName());
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
} else {
List<Map<String, Object>> maps = baseMapper.selectAdvance(distributionStockArticleEntity.getOrderCode());
if (!maps.isEmpty()) {
String dealerName = (String) maps.get(0).get("dealer_name");
String dealerCode = (String) maps.get(0).get("dealer_code");
stockArticleEntity.setMallName(dealerName);
stockArticleEntity.setMallCode(dealerCode);
} else {
stockArticleEntity.setMallName(distributionStockArticleEntity.getConsigneeUnit());
}
}
list.add(stockArticleEntity);
} else {
}
}
boolean flag = this.updateBatchById(list);
log.info(">>>>>>>>>>>>>>>>>>>维护订单商场信息,:{}",flag);
return null;
}
@Override
public R findEditCustomerLog(Long orderId) {

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

@ -32,6 +32,20 @@ public class OrderDataRepair {
return ReturnT.SUCCESS;
}
/**
* 维护指定收货单位订单商场信息
* @param param
* @return
*/
@XxlJob("maintenanceOrderMall")
public ReturnT<String> maintenanceOrderMall(String param) {
log.info("####################OrderDataRepair.maintenanceOrderStatus: 维护订单状态 开始");
log.info("####################OrderDataRepair.param: param");
Boolean flag = distributionStockArticleClient.maintenanceOrderMall(param);
log.info("####################OrderDataRepair.maintenanceOrderStatus: 维护订单状态 完成");
return ReturnT.SUCCESS;
}
@XxlJob("repairOrderSignStatus")
public ReturnT<String> repairOrderSignStatus(String param) {

Loading…
Cancel
Save