Browse Source

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

single_db
pref_mail@163.com 10 months ago
parent
commit
9b0a37f37e
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java
  2. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesProcessingResultsDTO.java
  3. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java
  4. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml
  5. 14
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  6. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesProcessingResultsServiceImpl.java
  7. 68
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  8. 2
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java
  9. 174
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java
  10. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  11. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  13. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  14. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  15. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java
  16. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.xml

2
blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java

@ -199,6 +199,8 @@ public class FileUtil extends TimerTask {
while ((n = in.read(buff)) >= 0) {
out.write(buff, 0, n);
}
out.close();
in.close();
}

3
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesProcessingResultsDTO.java

@ -37,6 +37,7 @@ public class AftersalesProcessingResultsDTO extends AftersalesProcessingResult
* 处理结果类型
*/
private List<AftersalesProcessingMoneyEntity> processingMoneyEntityList;
//删除ID
private List<Long> assignList;
}

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java

@ -81,6 +81,15 @@ public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity {
* 工单指派 ID
*/
private List<Long> assignList;
/**
* 赔款方删除集合
*/
private List<Long> assignListRecord;
/**
* 受款方删除集合
*/
private List<Long> assignListRecipient;
/**
* 处理结果

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml

@ -40,7 +40,7 @@
SELECT * FROM logpm_aftersales_appeal ${ew.customSqlSegment}
</select>
<select id="getListAppeal" resultType="com.logpm.aftersales.vo.AftersalesAppealVO">
SELECT
SELECT DISTINCT
laa.id ,
laa.appeal_people_name appealPeopleName,
laa.claimant,

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

@ -57,6 +57,7 @@
lawo.customer_service_name customerServiceName,lawo.warehouse_id warehouseId,lawo.brand_name brandName
from logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap on lawo.id = lap.work_order_id and lap.types_of = '2' and lap.conditions in (1,2)
LEFT JOIN logpm_aftersales_completion_record lacr on lacr.work_order_id = lawo.id and lacr.is_deleted = '0'
<where>
lawo.is_deleted = 0
<if test="param.id != null and param.id != '' ">and lawo.id = #{param.id } </if>
@ -83,12 +84,13 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall = #{param.waybillMall } </if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if>
<if test="param.customerServiceState != null and param.customerServiceState == 30 "> and lawo.work_order_status in ('30','40') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 20 "> and lawo.work_order_status in ('30') </if>
<if test="param.customerServiceState != null and param.customerServiceState == 10 "> and lawo.work_order_status in ('80','100') </if>
<if test="param.customerServiceId != null and param.customerServiceId != '' ">and lawo.customer_service_id = #{param.customerServiceId } </if>
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name = #{param.customerServiceName } </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' ">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
@ -103,15 +105,15 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
</if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' and lap.business_id = #{param.warehouseId} </if>
<!-- <if test="param.handleStatus!= null and param.handleStatus == 10 ">and lawo.warehouse_id = #{param.warehouseId} </if>-->
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lacr.warehouse_id=#{param.warehouseId} </if>
<if test="param.handleStatus != null "> or 1=1 </if>
<if test="param.warehouseId != null and param.warehouseId != '' "> and lap.business_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20 "> and lap.business_id = #{param.warehouseId} </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<!-- <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' </if>-->
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10','20' ) and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30,40) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lacr.warehouse_id=#{param.warehouseId} </if>
ORDER BY lawo.create_time DESC
</where>

6
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesProcessingResultsServiceImpl.java

@ -121,8 +121,10 @@ public class AftersalesProcessingResultsServiceImpl extends BaseServiceImpl<Afte
}
});
}
if(ObjectUtil.isNotNull(aftersalesProcessingResults.getAssignList()) && ObjectUtil.isNotNull( aftersalesProcessingResults.getAssignList().get(0)) ){
//删除
aftersalesProcessingMoneyService.deleteLogic(aftersalesProcessingResults.getAssignList());
}
}
return true;

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

@ -577,7 +577,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","30");
}else if(ObjectUtils.isNotNull( workOrderStatus ) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","10");
}else if( ObjectUtils.isNull( workOrderStatus ) ){
aftersalesWorkOrder.put("customerIdentification", "1");
@ -621,11 +621,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
case "3": //职能客服 查询自己的待处理工单
if( ObjectUtils.isNotNull( workOrderStatus ) && "500".equals(workOrderStatus)){
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","30");
aftersalesWorkOrder.put("customerServiceState","20");
aftersalesWorkOrder.put("customerServiceId",user.getUserId());
}else{
}else if(ObjectUtils.isNull(workOrderStatus)){
aftersalesWorkOrder.put("customerIdentification", "1");
}
}else if( ObjectUtils.isNotNull( workOrderStatus ) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus) ){
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState","10");
}
break;
}
}else{
@ -938,7 +941,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
);
//需要待回复的处理方
List<AftersalesProcessorVO> processorVOS = list.stream().map( i ->{
if(i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.daichuli.getValue())){
if(i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.daichuli.getValue()) || i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.yichuli.getValue())){
AftersalesProcessorVO processorVO = new AftersalesProcessorVO();
BeanUtil.copyProperties(i,processorVO);
return processorVO;
@ -1494,11 +1497,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
});
}else{
Optional<AftersalesProcessorEntity> first = list.stream().filter(i -> i.getBusinessId().equals(myCurrentWarehouse.getId()) && i.getBusinessName().equals(myCurrentWarehouse.getName())).findFirst();
//有包含的处理方
if(first.isPresent()){
AftersalesProcessorEntity processor = new AftersalesProcessorEntity();
processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.tijiaofang.getValue());
processor.setId(first.get().getId());
aftersalesProcessorService.updateById(processor);
}else{
//没有 修改为回复的状态
list.stream().forEach( i ->{
AftersalesProcessorEntity processor = new AftersalesProcessorEntity();
processor.setId(i.getId());
if(i.getProcessingStatus().equals(ProcessorProcessingStatusStatusConstant.daichuli.getValue())){
processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.weihuifuyichuli.getValue());
aftersalesProcessorService.updateById(processor);
}
});
}
@ -1682,42 +1697,47 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//异常工单完结处理结果赔款方
if(!aftersalesWorkOrder.getCompletionRecordEntities().isEmpty()){
//删除全部赔付方信息
List<AftersalesCompletionRecordEntity> list = completionRecordService.list(Wrappers.<AftersalesCompletionRecordEntity>query().lambda()
.eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId())
);
List<Long> collect = list.stream().map(AftersalesCompletionRecordEntity::getId).collect(Collectors.toList());
if(!collect.isEmpty()){
completionRecordService.deleteLogic(collect);
aftersalesWorkOrder.getCompletionRecordEntities().forEach(r ->{
if(ObjectUtils.isNotNull(r.getId())){
completionRecordService.updateById(r);
}else{
completionRecordService.save(r);
}
});
if(ObjectUtils.isNotNull( aftersalesWorkOrder.getAssignListRecord()) ){
completionRecordService.deleteLogic(aftersalesWorkOrder.getAssignListRecord());
}
completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities());
}
//异常工单完结处理结果受款方
if(!aftersalesWorkOrder.getCompletionRecipientEntities().isEmpty()){
List<AftersalesCompletionRecipientEntity> list = completionRecipientService.list(Wrappers.<AftersalesCompletionRecipientEntity>query().lambda()
.eq(AftersalesCompletionRecipientEntity::getWorkOrderId, aftersalesWorkOrder.getId())
);
List<Long> collect = list.stream().map(AftersalesCompletionRecipientEntity::getId).collect(Collectors.toList());
if(!collect.isEmpty()){
completionRecipientService.deleteLogic(collect);
aftersalesWorkOrder.getCompletionRecipientEntities().forEach(r ->{
if(ObjectUtils.isNotNull( r.getId()) ){
//修改
completionRecipientService.updateById(r);
}else{
//新增
completionRecipientService.save(r);
}
});
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getAssignListRecipient())){
//删除
completionRecipientService.deleteLogic(aftersalesWorkOrder.getAssignListRecipient());
}
completionRecipientService.saveBatch(aftersalesWorkOrder.getCompletionRecipientEntities());
}
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getReasonArbitration())){
workOrderEntity.setId(aftersalesWorkOrder.getId());
workOrderEntity.setReasonArbitration(aftersalesWorkOrder.getReasonArbitration());
}
//修改工单状态
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getTypesOf())){
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
return baseMapper.updateById(workOrderEntity) > 0;
} else {
return true;
}
return baseMapper.updateById(workOrderEntity) > 0;
}
/**

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

@ -72,9 +72,11 @@ public class BasicMaterialServiceImpl extends BaseServiceImpl<BasicMaterialMappe
@Override
@Transactional(rollbackFor = Exception.class)
public void importMaterial(List<BasicMaterialExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}",data);
ArrayList<BasicMaterialEntity> arrayList = new ArrayList<>();
for (BasicMaterialExcel datum : data) {
if(ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getProductCode())){
//去重
List<BasicMaterialEntity> basicMaterialEntities = baseMapper.selectList(new QueryWrapper<BasicMaterialEntity>().lambda()

174
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

@ -34,29 +34,24 @@ import com.logpm.basicdata.service.IBasicdataVehicleService;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.driver.DriverTypeStatusConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.alibaba.fastjson.JSONPatch.OperationType.copy;
/**
* 司机信息表 服务实现类
*
@ -68,9 +63,9 @@ import static com.alibaba.fastjson.JSONPatch.OperationType.copy;
@Slf4j
public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataDriverArteryMapper, BasicdataDriverArteryEntity> implements IBasicdataDriverArteryService {
private final BasicdataVehicleMapper basicdataVehicleMapper;
private final BasicdataVehicleMapper basicdataVehicleMapper;
private final IBasicdataVehicleService basicdataVehicleService;
private final IBasicdataVehicleService basicdataVehicleService;
private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper;
@ -103,18 +98,18 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
public Integer updateVehicle(BasicdataDriverArteryDTO basicdataDriverArtery) {
//删除原有绑定关系
int delete = basicdataDrivermiddleMapper.delete(new QueryWrapper<BasicdataDrivermiddleEntity>().lambda().eq(BasicdataDrivermiddleEntity::getDriverId, basicdataDriverArtery.getId()));
if (basicdataDriverArtery.getBindVehicles().equals(""))return delete;
if (basicdataDriverArtery.getBindVehicles().equals("")) return delete;
//新增现有的数据
//if (delete>0){
List<String> bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindVehicles.forEach(e->{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId());
basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
List<String> bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindVehicles.forEach(e -> {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId());
basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
//}
return delete;
}
@ -127,23 +122,23 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
@Override
public List<BasicdataDriverArteryVO> getDriverList() {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("################getDriverList 无当前登录人仓库信息:{}",myCurrentWarehouse);
if (Func.isEmpty(myCurrentWarehouse)) {
log.error("################getDriverList 无当前登录人仓库信息:{}", myCurrentWarehouse);
return null;
}
log.info("################ getDriverList 仓库信息:{}",myCurrentWarehouse);
log.info("################ getDriverList 仓库信息:{}", myCurrentWarehouse);
ArrayList<BasicdataDriverArteryVO> basicdataDriverArteryVOS = new ArrayList<>();
List<BasicdataDriverArteryEntity> list = this.list();
log.info("################getDriverList list:{}",list);
log.info("################getDriverList list:{}", list);
//Stream<BasicdataDriverArteryEntity> basicdataDriverArteryEntityStream = list.stream().filter(l -> l.getWarehouseId().contains(myCurrentWarehouse.getId().toString()));
Stream<BasicdataDriverArteryEntity> basicdataDriverArteryEntityStream = list.stream().filter(l -> Func.isNotEmpty(l.getWarehouseId()) && l.getWarehouseId().contains(myCurrentWarehouse.getId().toString()));
if (Func.isNotEmpty(basicdataDriverArteryEntityStream)){
basicdataDriverArteryEntityStream.forEach(l->{
if (Func.isNotEmpty(basicdataDriverArteryEntityStream)) {
basicdataDriverArteryEntityStream.forEach(l -> {
BasicdataDriverArteryVO driverArteryVO = Func.copy(l, BasicdataDriverArteryVO.class);
List<Long> vehicleIds = basicdataDrivermiddleService.list(Wrappers.<BasicdataDrivermiddleEntity>query().lambda()
.eq(BasicdataDrivermiddleEntity::getDriverId, l.getId())).stream().filter(f -> Func.isNotEmpty(f.getBrandId())).map(BasicdataDrivermiddleEntity::getBrandId).collect(Collectors.toList());
if (Func.isNotEmpty(vehicleIds)){
driverArteryVO.setVehicleVOList(basicdataVehicleService.list(Wrappers.<BasicdataVehicleEntity>query().lambda().in(BasicdataVehicleEntity::getId,vehicleIds)));
if (Func.isNotEmpty(vehicleIds)) {
driverArteryVO.setVehicleVOList(basicdataVehicleService.list(Wrappers.<BasicdataVehicleEntity>query().lambda().in(BasicdataVehicleEntity::getId, vehicleIds)));
}
basicdataDriverArteryVOS.add(driverArteryVO);
});
@ -157,89 +152,100 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
* @param data
*/
@Override
public void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}",data);
@Transactional
public void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}", data);
outerLoop:
for (BasicdataDriverArteryImproterExcel datum : data) {
List<BasicdataDrivermiddleEntity> driverMiddleEntity = new ArrayList<>();
//检查数据是否为空
if (ObjectUtils.isEmpty(datum.getPhone())|| ObjectUtils.isEmpty(datum.getName())|| ObjectUtils.isEmpty(datum.getWarehouseName())|| ObjectUtils.isEmpty(datum.getCarrierName())) {
try {
List<BasicdataDrivermiddleEntity> driverMiddleEntity = new ArrayList<>();
//检查数据是否为空
if (ObjectUtils.isEmpty(datum.getPhone()) || ObjectUtils.isEmpty(datum.getName()) || ObjectUtils.isEmpty(datum.getWarehouseName()) || ObjectUtils.isEmpty(datum.getCarrierName())) {
// log.error("必填数据不能为空");
// continue;
throw new ServiceException("用户"+datum.getName() +"必填数据不能为空!");
}
if(!ObjectUtils.isEmpty(datum.getPhone())){
R<User> userR = userClient.userInfoByPhone("627683", datum.getPhone());
if (userR.getData() == null){
throw new ServiceException("必填数据不能为空!");
}
if (!ObjectUtils.isEmpty(datum.getPhone())) {
R<User> userR = userClient.userInfoByPhone("627683", datum.getPhone());
if (userR.getData() == null) {
// log.error("未找到用户");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到用户!");
}else {
datum.setUserId(userR.getData().getId());
throw new ServiceException("未找到用户!");
} else {
datum.setUserId(userR.getData().getId());
}
}
}
if (!ObjectUtils.isEmpty(datum.getBindVehicle())){
String[] car = datum.getBindVehicle().split(",");
for (String s : car) {
List<BasicdataVehicleEntity> carListByName = basicdataVehicleService.findCarListByName(s);
if (!ObjectUtils.isEmpty(datum.getBindVehicle())) {
String[] car = datum.getBindVehicle().split(",");
for (String s : car) {
List<BasicdataVehicleEntity> carListByName = basicdataVehicleService.findCarListByName(s);
if (carListByName.isEmpty()){
if (carListByName.isEmpty()) {
// log.error("未找到可绑定的车辆");
throw new ServiceException("用户"+datum.getName() +"未找到可绑定的车辆!");
}else{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId());
driverMiddleEntity.add(basicdataDrivermiddleEntity);
throw new ServiceException("未找到可绑定的车辆!");
} else {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId());
driverMiddleEntity.add(basicdataDrivermiddleEntity);
}
}
}
}
if (!ObjectUtils.isEmpty(datum.getCarrierName())){
//找到数据库内的承运商
List<BasicdataCarrierEntity> basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.<BasicdataCarrierEntity>lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName,datum.getCarrierName()));
if (!ObjectUtils.isEmpty(datum.getCarrierName())) {
//找到数据库内的承运商
List<BasicdataCarrierEntity> basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.<BasicdataCarrierEntity>lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName()));
if (ObjectUtils.isEmpty(basicdataCarrierEntities)){
if (ObjectUtils.isEmpty(basicdataCarrierEntities)) {
// log.error("未找到承运商");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到承运商!");
}else{
datum.setCarrierId(basicdataCarrierEntities.get(0).getId());
throw new ServiceException("未找到承运商!");
} else {
datum.setCarrierId(basicdataCarrierEntities.get(0).getId());
}
}
}
if (!ObjectUtils.isEmpty(datum.getWarehouseName())){
//在数据库找到仓库名字对应
BasicdataWarehouseEntity byName = warehouseClient.findByName(datum.getWarehouseName());
if (ObjectUtils.isEmpty(byName)){
if (!ObjectUtils.isEmpty(datum.getWarehouseName())) {
//在数据库找到仓库名字对应
BasicdataWarehouseEntity byName = warehouseClient.findByName(datum.getWarehouseName());
if (ObjectUtils.isEmpty(byName)) {
// log.error("未找到仓库");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到仓库!");
}else{
datum.setWarehouseId(String.valueOf(byName.getId()));
throw new ServiceException("未找到仓库!");
} else {
datum.setWarehouseId(String.valueOf(byName.getId()));
}
}
}
//根据手机号去重 如果有手机号相同 就删除老数据
if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) {
List<BasicdataDriverArteryEntity> basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper<BasicdataDriverArteryEntity>().lambda()
.eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone()));
if (!basicdataVehicleEntities.isEmpty()){
basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone());
//根据手机号去重 如果有手机号相同 就删除老数据
if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) {
List<BasicdataDriverArteryEntity> basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper<BasicdataDriverArteryEntity>().lambda()
.eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone()));
if (!basicdataVehicleEntities.isEmpty()) {
basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone());
}
}
}
BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class);
//连接到前端后取消注释
BladeUser user = AuthUtil.getUser();
copy.setTenantId(user.getTenantId());// 租户号
copy.setUserId(user.getUserId()); // 创建人
copy.setUpdateUser(user.getUserId());// 更新人
log.info("复制后>>>>>>>>>>>>{}",copy);
BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class);
//连接到前端后取消注释
BladeUser user = AuthUtil.getUser();
copy.setTenantId(user.getTenantId());// 租户号
copy.setUserId(user.getUserId()); // 创建人
copy.setUpdateUser(user.getUserId());// 更新人
log.info("复制后>>>>>>>>>>>>{}", copy);
this.save(copy);
//车辆和司机绑定关系
for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) {
basicdataDrivermiddleEntity.setDriverId(copy.getId());
basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity);
for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) {
basicdataDrivermiddleEntity.setDriverId(copy.getId());
basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity);
}
} catch (DataAccessException e) {
throw new ServiceException("用户" + datum.getName() + "数据长度异常");
} catch (ServiceException e) {
throw new ServiceException("用户" + datum.getName() + e.getMessage());
} catch (Exception e) {
throw new RuntimeException("用户" + datum.getName() + "数据错误" + e.getMessage());
}
}
}

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

@ -301,4 +301,12 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return
*/
DistributionSignforEntity getByReservationId(@Param("reservationId") Long id);
/**
* 查询配送任务下任务
* @param id
* @param k
* @return
*/
DistributionSignforEntity selectByDeliveryIdAndMallName(@Param("reservationId")Long deliveryId,@Param("mallName") String mallName);
}

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

@ -1226,4 +1226,8 @@
<select id="getByReservationId" resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor WHERE reservation_id = #{reservationId}
</select>
<select id="selectByDeliveryIdAndMallName"
resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE lds.delivery_id = #{deliveryId} AND ldr.mall_mame = #{mallName}
</select>
</mapper>

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

@ -155,7 +155,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
List<DisStockListDetailVO> selectDistributionAppDeliverywrapIn( DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/**
* 修改配送任务
* 修改商配配送任务
* @param deliveryListDTO
* @return
*/

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

@ -2964,6 +2964,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
stockupInfoEntity.setStockUpType("1");
distributionStockupInfoService.save(stockupInfoEntity);
} else {
//通过配送任务查询该客户的信息是否完成审核,如果审核了则视为一个新客户
DistributionSignforEntity signforEntity = distributionSignforMapper.selectByDeliveryIdAndMallName(deliveryListEntity.getId(),k);
if (Func.isNotEmpty(signforEntity)){
if (Func.isNotEmpty(oldClient.get(k)) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
//拦截
log.error("###################商配配送对完成复核进行订单追加操作失败");
log.error("###################配送ID:{}",deliveryListEntity.getId());
log.error("###################客户名称:{}",k);
throw new RuntimeException(k+"此客户已完成签收");
}
}
//根据配送计划和运单号查询出该预约
// DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntityId, k);

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

@ -2317,7 +2317,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setReservationNum(packageTotal.get());
this.updateById(reservationEntity);
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum());
inventoryNub.getAndAdd(reservationEntity.getReservationStockListNum());
if (Func.isNotEmpty(reservationEntity.getReservationStockListNum())){
inventoryNub.getAndAdd(reservationEntity.getReservationStockListNum());
}
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setReservationId(reservationEntity.getId());
distributionSignforEntity.setTrainNumber(trainNumberMa);

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
public class DistributionDatarepair {
private final ISyncDistributionParcelListService distributionParcelListService;
// private final ISyncDistributionParcelListService distributionParcelListService;
/**
* 预约状态修复
* @param param

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.xml

@ -12,7 +12,7 @@
ldsa.mall_name = COALESCE(lbc.client_name, ldsa.mall_name),
ldsa.type_service = COALESCE(lbsb.type_service, ldsa.type_service),
ldsa.consignee_unit = #{mallName}
WHERE ldsa.id = #{stockArticleId};
WHERE ldsa.id = #{stockArticleId} and ldsa.is_deleted = 0;
</update>
<update id="syncServiceTypeByWarehouseName">

Loading…
Cancel
Save