Browse Source

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

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
255a573b11
  1. 6
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java
  2. 12
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesCompletionRecordMapper.xml
  3. 1
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  4. 61
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  5. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  7. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  8. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

6
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java

@ -100,4 +100,10 @@ public class AftersalesWorkOrderVO extends AftersalesWorkOrderEntity {
private String ids;
private String typeServiceName;
/**
* 是否能申述
* 0 不能 1 可以申述
*/
private Integer canRepresentations;
}

12
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesCompletionRecordMapper.xml

@ -36,8 +36,16 @@
SELECT * FROM logpm_aftersales_completion_record ${ew.customSqlSegment}
</select>
<select id="getTotalMoney" resultType="java.lang.String">
SELECT SUM(money) AS money FROM logpm_aftersales_completion_record where work_order_id = #{param.id} and
is_deleted = 0 and warehouse_id = #{warehouseId}
SELECT SUM(money) AS money FROM logpm_aftersales_completion_record where
is_deleted = 0
<if test="#{param.id}!=null">
and work_order_id = #{param.id}
</if>
<if test="#{warehouseId} !=null">
and warehouse_id = #{warehouseId}
</if>
</select>
</mapper>

1
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -54,7 +54,6 @@
<select id="pageListOwn" resultType="com.logpm.aftersales.entity.AftersalesWorkOrderEntity">
SELECT DISTINCT
lawo.id,
lawo.work_order_type,

61
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -934,22 +934,29 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class);
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity);
iPage.getRecords().forEach(i -> {});
// 获取售后工单的ID 集合
List<Long> workOrderIds = iPage.getRecords().stream().map(AftersalesWorkOrderEntity::getId).collect(Collectors.toList());
// 需要判断当前作业仓库是否存在于责任方和处理方
// LambdaQueryWrapper<AftersalesProcessorEntity> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(AftersalesProcessorEntity::getWorkOrderId,)
// aftersalesProcessorService.list()
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage);
// 查询收款方
LambdaQueryWrapper<AftersalesCompletionRecipientEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(AftersalesCompletionRecipientEntity::getWorkOrderId,workOrderIds);
List<AftersalesCompletionRecipientEntity> list = completionRecipientService.list(queryWrapper);
// 收款方分组
Map<Long, List<AftersalesCompletionRecipientEntity>> collect = list.stream().collect(Collectors.groupingBy(AftersalesCompletionRecipientEntity::getWorkOrderId));
// 查询赔款方
LambdaQueryWrapper<AftersalesCompletionRecordEntity> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.in(AftersalesCompletionRecordEntity::getWorkOrderId,workOrderIds);
List<AftersalesCompletionRecordEntity> list1 = completionRecordService.list(queryWrapper1);
// 赔款方付款分组
Map<Long, List<AftersalesCompletionRecordEntity>> collect1 = list1.stream().collect(Collectors.groupingBy(AftersalesCompletionRecordEntity::getWorkOrderId));
data.getRecords().forEach(i -> updateDepartStatus(i, user,myCurrentWarehouse));
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage);
data.getRecords().forEach(i -> updateDepartStatus(i, user,myCurrentWarehouse,collect,collect1));
// 需要判断当前作业仓库是否存在于责任方和处理方
// LambdaQueryWrapper<AftersalesProcessorEntity> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(AftersalesProcessorEntity::getWorkOrderId,)
// aftersalesProcessorService.list()
return data;
@ -1068,7 +1075,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
}
private void updateDepartStatus(AftersalesWorkOrderVO workOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) {
private void updateDepartStatus(AftersalesWorkOrderVO workOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse
,Map<Long, List<AftersalesCompletionRecipientEntity>> collect, Map<Long, List<AftersalesCompletionRecordEntity>> collect1
) {
if (ObjectUtils.isNotNull(workOrder.getCustomerServiceId())) {
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(workOrder.getCustomerServiceId()));
if (ObjectUtils.isNotNull(listR.getData())) {
@ -1080,9 +1089,33 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
});
}
}
workOrder.setTotalAmount(completionRecordService.getTotalMoney(workOrder,myCurrentWarehouse.getId()));
Long id =null;
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
id=myCurrentWarehouse.getId();
}
workOrder.setTotalAmount(completionRecordService.getTotalMoney(workOrder,id));
if(myCurrentWarehouse!=null){
List<AftersalesCompletionRecipientEntity> aftersalesCompletionRecipientEntities = collect.get(workOrder.getId());
if(ObjectUtils.isNotNull(aftersalesCompletionRecipientEntities)){
for (AftersalesCompletionRecipientEntity aftersalesProcessorEntity : aftersalesCompletionRecipientEntities) {
if(myCurrentWarehouse.getId().equals(aftersalesProcessorEntity.getWarehouseId())){
workOrder.setCanRepresentations(1);
break;
}
}
}
List<AftersalesCompletionRecordEntity> aftersalesCompletionRecipientEntities1 = collect1.get(workOrder.getId());
if(ObjectUtils.isNotNull(aftersalesCompletionRecipientEntities1)){
for (AftersalesCompletionRecordEntity aftersalesCompletionRecipientEntity : aftersalesCompletionRecipientEntities1) {
if(myCurrentWarehouse.getId().equals(aftersalesCompletionRecipientEntity.getWarehouseId())){
workOrder.setCanRepresentations(1);
break;
}
}
}
}
//
}

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

@ -163,7 +163,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (!stringList.isEmpty()) {
basicdataStoreBusinessService.deleteLogic(stringList);
}
}
for (String s : basicdataClient.getTypeServiceList()) {
//添加服务类型

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

@ -316,7 +316,7 @@ public interface IDistributionAsyncService {
* 释放当前客户能够进行资源释放的包件包含库存品
* @param reservationId
*/
void releaseSource(Long reservationId,Long warehouseId);
void releaseSource(Long reservationId,BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber);
/**
* 进行干线日志保存

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

@ -75,15 +75,8 @@ import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.trunkline.dto.AddWaybillTrackDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity;
import com.logpm.trunkline.feign.*;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehousePackageTrackLogClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
@ -120,7 +113,6 @@ import org.springblade.common.constant.signing.SignforStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -129,20 +121,17 @@ import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Tenant;
import org.springblade.system.feign.ISysClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@ -1739,7 +1728,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
@Transactional
@LogpmAsync("asyncExecutor")
public void releaseSource(Long reservationId, Long warehouseId) {
public void releaseSource(Long reservationId, BasicdataWarehouseEntity warehouse,BladeUser user,String trainNumber) {
String method = "##########################DistributionAsyncServiceImpl.releaseSource";
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId);
StringBuilder builder = new StringBuilder();
@ -1747,10 +1736,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
//存在订单
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelListEntities)) {
List<Long> packageIds = distributionParcelListEntities.stream()
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.map(DistributionParcelListEntity::getId)
.collect(Collectors.toList());
if (Func.isNotEmpty(packageIds)) {
//对包件进行批量的修改
//将这些包件恢复到初始状态
@ -1758,7 +1749,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
//维护这些进行包件对应的订单
String orderCodes = distributionParcelListEntities.stream()
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
&& !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.map(DistributionParcelListEntity::getOrderCode)
.distinct().collect(Collectors.joining(","));
log.info(method + "维护订制品订单:{}", orderCodes);
@ -1768,9 +1760,25 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
if(!packageIds.isEmpty() && reservationId!=null){
//完成对该客户下此包件任务的取消
int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds);
}
List<JSONObject> aaa = new ArrayList<>();
distributionParcelListEntities.forEach(k->{
if (k.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())
&& k.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){
String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"完成复核,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CLERK_REVIEW.getCode());
aaa.add(js);
}else {
String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"复核取消计划无操作包件,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode());
aaa.add(js);
}
});
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
//维护预约订单状态
}
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelNumberDTOS)) {
@ -1799,8 +1807,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds);
}
}
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouseId);
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouseId);
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId());
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouse.getId());
}
//存在库存品信息
@ -3011,4 +3019,23 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}

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

@ -630,6 +630,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.info("复核签收装车数和签收数不一致,装车数:{},签收数:{}", loadingNum,signNum);
return R.fail("存在装车还未签收数据!!!");
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distributionSignfor.getTrainNumber());
if (Func.isEmpty(deliveryListEntity)) {
log.error("文员复核查询配送计划失败,deliveryId:{}", distributionSignfor.getTrainNumber());
return R.fail("操作失败,请核对计划信息!!!");
}
BladeUser user = AuthUtil.getUser();
distributionSignfor.setExamineUserId(user.getUserId());
distributionSignfor.setSigningStatus(SignforStatusConstant.yiqianshou.getValue());
@ -649,7 +654,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag) {
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse.getId());
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse,AuthUtil.getUser(),deliveryListEntity.getTrainNumber());
}
return R.success("操作成功");
}

Loading…
Cancel
Save