Browse Source

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

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
716973a48d
  1. 1
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderVO.java
  2. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java
  3. 24
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  4. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  5. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAppealServiceImpl.java
  6. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesReturnRecordServiceImpl.java
  7. 626
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  8. 24
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java
  9. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java
  10. 74
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  11. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java
  12. 27
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  13. 23
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java
  14. 2
      blade-service/logpm-business/src/main/java/com/logpm/business/aspect/ChangeAsyncAnnotationAspect.java
  15. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBusinessPreOrderAppController.java
  16. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java
  17. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/aspect/ChangeAsyncAnnotationAspect.java
  18. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  19. 50
      blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java
  20. 19
      blade-service/logpm-patch/src/main/java/com/logpm/patch/interceptor/LocalServerLoginAccountsInterceptor.java
  21. 8
      blade-service/logpm-patch/src/main/resources/application-dev.yml
  22. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/ChangeAsyncAnnotationAspect.java
  23. 107
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  24. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

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

@ -32,7 +32,6 @@ import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class AftersalesWorkOrderVO extends AftersalesWorkOrderEntity {
private static final long serialVersionUID = 1L;
/**
* 工单名称
*/

5
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java

@ -138,7 +138,6 @@ public class BasicdataClientEntity extends TenantEntity {
* 客户类型;1 C端 2 B端
*/
@ApiModelProperty(value = "客户类型;1 C端 2 B端")
@TableField(exist = false)
private Integer typeService;
/**
@ -206,13 +205,13 @@ public class BasicdataClientEntity extends TenantEntity {
* 合同开始时间
*/
@ApiModelProperty(value = "合同开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone = "GMT+8")
private Date contractStartTime;
/**
* 合同结束时间
*/
@ApiModelProperty(value = "合同结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone = "GMT+8")
private Date contractEntTime;
@ApiModelProperty(value = "默认付款方式 1现付 2到付 3月结 4回付 5内部结算 ")

24
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -123,18 +123,18 @@ public class AftersalesWorkOrderController extends BladeController {
public R<IPage<AftersalesWorkOrderVO>> getListOwn(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, Query query) {
log.info("异常工单查询参数》》》{}",aftersalesWorkOrder);
try{
IPage<AftersalesWorkOrderEntity> pages = aftersalesWorkOrderService.pageListOwn(aftersalesWorkOrder, Condition.getPage(query));
R<IPage<AftersalesWorkOrderVO>> data = R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNotNull(myCurrentWarehouse)){
data.getData().getRecords().forEach(item -> {
item.setTotalAmount(aftersalesCompletionRecordService.getTotalMoney(item,myCurrentWarehouse.getId()));
});
}else{
log.info("查询人不属于某个仓库");
}
return data;
IPage<AftersalesWorkOrderVO> pages = aftersalesWorkOrderService.pageListOwn(aftersalesWorkOrder, Condition.getPage(query));
// R<IPage<AftersalesWorkOrderVO>> data = R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if (ObjectUtils.isNotNull(myCurrentWarehouse)){
// data.getData().getRecords().forEach(item -> {
// item.setTotalAmount(aftersalesCompletionRecordService.getTotalMoney(item,myCurrentWarehouse.getId()));
// });
// }else{
// log.info("查询人不属于某个仓库");
// }
return R.data(pages);
}catch (Exception e){
log.error("工单查询系统异常》》》{}",e.getMessage());
return R.fail("系统异常!");

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -91,7 +91,7 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param page
* @return
*/
IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page);
IPage<AftersalesWorkOrderVO> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page);
/**
* 查询订单超时是否超时未处理

5
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAppealServiceImpl.java

@ -43,6 +43,7 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
@ -117,7 +118,7 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
}else{
//新增
aftersalesAppealEntity.setCreateUser(user.getUserId());
aftersalesAppealEntity.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesAppealEntity.setCreateDept(Func.firstLong(user.getDeptId()));
aftersalesAppealEntity.setCreateTime(new Date());
aftersalesAppealEntity.setStatus(1);
aftersalesAppealEntity.setIsDeleted(0);
@ -132,7 +133,7 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
aftersalesWorkOrder.setWorkOrderStatus(WorkOrderStatusConstant.shenshuzhong.getValue());
aftersalesWorkOrderService.updateById(aftersalesWorkOrder);
//添加操作记录
aftersalesWorkOrderService.addSurveyRecord(user,aftersalesAppeal.getWorkOrderId(),"申述操作","3");
aftersalesWorkOrderService.addSurveyRecord(user,aftersalesAppeal.getWorkOrderId(),"申述操作:"+aftersalesAppeal.getReason(),"3");
}
if(ObjectUtil.isNotNull( aftersalesAppeal.getPeopleEntityList())){
//添加实际收货人

8
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesReturnRecordServiceImpl.java

@ -260,7 +260,15 @@ public class AftersalesReturnRecordServiceImpl extends BaseServiceImpl<Aftersale
orderEntity.setId(workOrderId);
orderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue());
workOrderEntities.add(orderEntity);
//增加工单记录
aftersalesWorkOrderService.addSurveyRecord(AuthUtil.getUser(),workOrderId,aftersalesReturnRecord.getReasonReturn(),"3");
}
}
if(CollUtil.isNotEmpty(returnRecordEntities)){
this.saveBatch(returnRecordEntities);

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

@ -18,6 +18,7 @@ package com.logpm.aftersales.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -33,6 +34,7 @@ import com.logpm.aftersales.mapper.AftersalesCustomerMallMapper;
import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper;
import com.logpm.aftersales.service.*;
import com.logpm.aftersales.vo.*;
import com.logpm.aftersales.wrapper.AftersalesWorkOrderWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -97,17 +99,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
private final IBasicdataWarehouseClient warehouseClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
private final IAftersalesCustomerMallService aftersalesCustomerMallService;
private final AftersalesAppealMapper aftersalesAppealService;
private final ISysClient sysClient;
private final IUserClient userClient;
private final AftersalesCustomerMallMapper aftersalesCustomerMallMapper;
private final IUserSearchClient userSearchClient;
private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient;
// private final IAftersalesWorkOrderService aftersalesWorkOrderService;
@Override
public IPage<AftersalesWorkOrderVO> selectAftersalesWorkOrderPage(IPage<AftersalesWorkOrderVO> page, AftersalesWorkOrderVO aftersalesWorkOrder) {
return page.setRecords(baseMapper.selectAftersalesWorkOrderPage(page, aftersalesWorkOrder));
@ -328,7 +329,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// aftersalesWorkOrder.setInitiationIdentification("PC");
aftersalesWorkOrder.setCreateUser(user.getUserId());
aftersalesWorkOrder.setCreateTime(new Date());
aftersalesWorkOrder.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesWorkOrder.setCreateDept(Func.firstLong(user.getDeptId()));
aftersalesWorkOrder.setIsDeleted(0);
aftersalesWorkOrder.setWaybillNumber(aftersalesWorkOrder.getWaybillNumber());
aftersalesWorkOrder.setStatus(1);
@ -355,8 +356,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO()) && ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO().getCompensationMethod())) {
aftersalesWorkOrder.setWorkOrderStatus(WorkOrderStatusConstant.chulijeiguoyitianxei.getValue());
}
if (!Func.isEmpty(aftersalesWorkOrder.getVehicleRoute())){
if (aftersalesWorkOrder.getVehicleRoute().indexOf("&gt;")>0){
if (!Func.isEmpty(aftersalesWorkOrder.getVehicleRoute())) {
if (aftersalesWorkOrder.getVehicleRoute().indexOf("&gt;") > 0) {
String string = aftersalesWorkOrder.getVehicleRoute().replaceAll("&gt;", ">");
aftersalesWorkOrder.setVehicleRoute(string);
}
@ -366,7 +367,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} else {
//修改
// if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnPpackageEntityList())) {
//删除修改包件
//删除修改包件
// aftersalesAbnormalPackageService.deleteLogic(aftersalesWorkOrder.getUnPpackageEntityList());
// }
LambdaUpdateWrapper<AftersalesAbnormalPackageEntity> updateWrapper = Wrappers.<AftersalesAbnormalPackageEntity>lambdaUpdate()
@ -447,10 +448,10 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//添加包件信息
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getPackageEntityList())) {
List<AftersalesAbnormalPackageEntity> packageEntityList = aftersalesWorkOrder.getPackageEntityList();
if (!packageEntityList.isEmpty()){
if (!packageEntityList.isEmpty()) {
List<String> collect = packageEntityList.stream().filter(f -> Objects.isNull(f.getFirst())).map(AftersalesAbnormalPackageEntity::getPackageCode).collect(Collectors.toList());
if (!collect.isEmpty()){
throw new RuntimeException(collect.stream().collect(Collectors.joining(","))+"无一级品信息");
if (!collect.isEmpty()) {
throw new RuntimeException(collect.stream().collect(Collectors.joining(",")) + "无一级品信息");
}
}
//包件信息
@ -702,7 +703,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
BeanUtil.copyProperties(aftersaleSurveyRecordDTO, surveyRecordEntity);
surveyRecordEntity.setTypesOf("1");
surveyRecordEntity.setCreateUser(user.getUserId());
surveyRecordEntity.setCreateDept(Long.valueOf(user.getDeptId()));
surveyRecordEntity.setCreateDept(Func.firstLong(user.getDeptId()));
surveyRecordEntity.setCreateTime(new Date());
surveyRecordEntity.setStatus(1);
surveyRecordEntity.setIsDeleted(0);
@ -715,6 +716,171 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return true;
}
/**
* 查询异常完整数据集合
*
* @param aftersalesWorkOrder
* @param page
* @return
*/
// public IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page) {
// //查询用户角色信息
// BladeUser user = AuthUtil.getUser();
// String roleName = user.getRoleName();
//
// String tenantId = user.getTenantId();
// // 查询 状态条件
// //查询客服岗位
// List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits");
// if (warehouseType.isEmpty()) {
// throw new ServiceException("注意,注意!售后访问字典未配置!请配置!");
// } else {
// Optional<DictBiz> first = warehouseType.stream().filter(i -> {
// if (i.getDictValue().equals(roleName)) {
// return true;
// }
// return false;
// }).findFirst();
// Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus");
// if (first.isPresent()) {
// //存在
// String dictValue = first.get().getDictKey();
//
// switch (dictValue) {
// case "1": //客服经理 查询全部待处理工单
// //待处理
// if (ObjectUtils.isNotNull(workOrderStatus) && "500".equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "30");
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "80"); //55的待审核
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yichuli.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "60"); //55的待审核
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "10");
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daishenhe.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "40");
// } else if (ObjectUtils.isNull(workOrderStatus)) {
// aftersalesWorkOrder.put("customerIdentification", "1");
// }
// break;
// case "2": // 营业部客服
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
// aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
// } else {
// throw new ServiceException("请选择仓库!");
// }
// //已处理
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "30");
// }
// //待处理
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())) {
// aftersalesWorkOrder.put("handleStatus", "40");
// }
// //处理中
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())) {
// aftersalesWorkOrder.put("handleStatus", "50");
// }
// //已完结
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "20");
// }
// //全部
// if (ObjectUtils.isNotNull(workOrderStatus) && "1000".equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "10");
// }
//// if( ObjectUtils.isNull(workOrderStatus)){
//// aftersalesWorkOrder.put("handleStatus","10");
//// }
//
// break;
// case "3": //职能客服 查询自己的待处理工单
// if (ObjectUtils.isNotNull(workOrderStatus) && "500".equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "20");
// aftersalesWorkOrder.put("customerServiceId", user.getUserId());
// } 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");
// } else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("customerServiceState", "31"); // 待处理
// aftersalesWorkOrder.put("customerServiceId", user.getUserId());
// }
// break;
// }
// } else {
// //不存在
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
// aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
// } else {
// throw new ServiceException("请选择仓库!");
// }
// //已处理
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "30");
// }
// //待处理
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())) {
// aftersalesWorkOrder.put("handleStatus", "40");
// }
// //处理中
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())) {
// aftersalesWorkOrder.put("handleStatus", "50");
// }
// //已完结
// if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "20");
// }
// //全部
// if (ObjectUtils.isNotNull(workOrderStatus) && "1000".equals(workOrderStatus)) {
// aftersalesWorkOrder.remove("workOrderStatus");
// aftersalesWorkOrder.put("handleStatus", "10");
// }
// }
// }
// AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class);
// IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity);
//
//
// iPage.getRecords().forEach(i -> {
// if (ObjectUtils.isNotNull(i.getCustomerServiceId())) {
// R<List<User>> listR = userSearchClient.listByUser(String.valueOf(i.getCustomerServiceId()));
// if (ObjectUtils.isNotNull(listR.getData())) {
// listR.getData().forEach(a -> {
// long time = System.currentTimeMillis() / 1000; //当前时间
// if (ObjectUtils.isNotNull(a.getDownTime())) {
// long l = a.getDownTime().getTime() / 1000; //停用时间
// if (l <= time) {
// // 已停用
// i.setDepartStatus(true); //已离职
// }
// }
//
// });
//
// }
// }
// });
//
// return iPage;
// }
/**
* 查询异常完整数据集合
*
@ -723,162 +889,203 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
* @return
*/
@Override
public IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page) {
//查询用户角色信息
public IPage<AftersalesWorkOrderVO> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page) {
// 查询用户角色信息
BladeUser user = AuthUtil.getUser();
if (user == null) {
throw new ServiceException("用户信息获取失败");
}
String roleName = user.getRoleName();
String tenantId = user.getTenantId();
// 查询 状态条件
//查询客服岗位
// 查询 状态条件
List<DictBiz> warehouseType = DictBizCache.getList("after_sales_visits");
if (warehouseType.isEmpty()) {
throw new ServiceException("注意,注意!售后访问字典未配置!请配置!");
} else {
Optional<DictBiz> first = warehouseType.stream().filter(i -> {
if (i.getDictValue().equals(roleName)) {
return true;
}
return false;
}).findFirst();
Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus");
if (first.isPresent()) {
//存在
String dictValue = first.get().getDictKey();
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
switch (dictValue) {
case "1": //客服经理 查询全部待处理工单
//待处理
if (ObjectUtils.isNotNull(workOrderStatus) && "500".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "30");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "80"); //55的待审核
}else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "60"); //55的待审核
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "10");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daishenhe.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "40");
} else if (ObjectUtils.isNull(workOrderStatus)) {
aftersalesWorkOrder.put("customerIdentification", "1");
}
break;
case "2": // 营业部客服
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
} else {
throw new ServiceException("请选择仓库!");
}
//已处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "30");
}
//待处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())) {
aftersalesWorkOrder.put("handleStatus", "40");
}
//处理中
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())) {
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
//全部
if (ObjectUtils.isNotNull(workOrderStatus) && "1000".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "10");
}
// if( ObjectUtils.isNull(workOrderStatus)){
// aftersalesWorkOrder.put("handleStatus","10");
// }
if (Func.isEmpty(myCurrentWarehouse)) {
log.warn(">>>>myCurrentWarehouse {}",myCurrentWarehouse);
}
break;
case "3": //职能客服 查询自己的待处理工单
if (ObjectUtils.isNotNull(workOrderStatus) && "500".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "20");
aftersalesWorkOrder.put("customerServiceId", user.getUserId());
} 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");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "31"); // 待处理
aftersalesWorkOrder.put("customerServiceId", user.getUserId());
}
break;
}
} else {
//不存在
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
} else {
throw new ServiceException("请选择仓库!");
}
//已处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "30");
}
//待处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())) {
aftersalesWorkOrder.put("handleStatus", "40");
}
//处理中
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())) {
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
//全部
if (ObjectUtils.isNotNull(workOrderStatus) && "1000".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "10");
}
Optional<DictBiz> matchingDictBiz = warehouseType.stream()
.filter(i -> i.getDictValue().equals(roleName))
.findFirst();
Object workOrderStatus = aftersalesWorkOrder.get("workOrderStatus");
if (matchingDictBiz.isPresent()) {
String dictValue = matchingDictBiz.get().getDictKey();
switch (dictValue) {
case "1": // 客服经理
updateWorkOrderForManager(aftersalesWorkOrder, workOrderStatus);
break;
case "2": // 营业部客服
updateWorkOrderForSales(aftersalesWorkOrder, workOrderStatus);
break;
case "3": // 职能客服
updateWorkOrderForFunctional(aftersalesWorkOrder, workOrderStatus, user.getUserId());
break;
}
} else {
updateWorkOrderForOthers(aftersalesWorkOrder, workOrderStatus);
}
AftersalesWorkOrderEntity workOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesWorkOrderEntity.class);
IPage<AftersalesWorkOrderEntity> iPage = baseMapper.pageListOwn(page, workOrderEntity);
iPage.getRecords().forEach(i -> {
if (ObjectUtils.isNotNull(i.getCustomerServiceId())) {
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(i.getCustomerServiceId()));
if (ObjectUtils.isNotNull(listR.getData())) {
listR.getData().forEach(a -> {
long time = new Date().getTime() / 1000; //当前时间
if (ObjectUtils.isNotNull(a.getDownTime())) {
long l = a.getDownTime().getTime() / 1000; //停用时间
if (l <= time) {
// 已停用
i.setDepartStatus(true); //已离职
}
}
iPage.getRecords().forEach(i -> {});
});
// 需要判断当前作业仓库是否存在于责任方和处理方
// LambdaQueryWrapper<AftersalesProcessorEntity> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(AftersalesProcessorEntity::getWorkOrderId,)
// aftersalesProcessorService.list()
}
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage);
data.getRecords().forEach(i -> updateDepartStatus(i, user,myCurrentWarehouse));
// 需要判断当前作业仓库是否存在于责任方和处理方
// LambdaQueryWrapper<AftersalesProcessorEntity> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(AftersalesProcessorEntity::getWorkOrderId,)
// aftersalesProcessorService.list()
return data;
}
private void updateWorkOrderForManager(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus) {
// 对客服经理的工单状态更新逻辑
// 优化后的代码根据实际情况进行填充
//待处理
if (ObjectUtils.isNotNull(workOrderStatus) && "500".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "30");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "80"); //55的待审核
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "60"); //55的待审核
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.yiwanjei.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "10");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daishenhe.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "40");
} else if (ObjectUtils.isNull(workOrderStatus)) {
aftersalesWorkOrder.put("customerIdentification", "1");
}
}
private void updateWorkOrderForSales(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus) {
// 对营业部客服的工单状态更新逻辑
// 优化后的代码根据实际情况进行填充
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
} else {
throw new ServiceException("请选择仓库!");
}
//已处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "30");
}
//待处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())) {
aftersalesWorkOrder.put("handleStatus", "40");
}
//处理中
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())) {
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
//全部
if (ObjectUtils.isNotNull(workOrderStatus) && "1000".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "10");
}
}
private void updateWorkOrderForFunctional(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus, Long userId) {
// 对职能客服的工单状态更新逻辑
// 优化后的代码根据实际情况进行填充
if (ObjectUtils.isNotNull(workOrderStatus) && "500".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "20");
aftersalesWorkOrder.put("customerServiceId", userId);
} 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");
} else if (ObjectUtils.isNotNull(workOrderStatus) && WorkOrderStatusConstant.daichuli.getValue().equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("customerServiceState", "31"); // 待处理
aftersalesWorkOrder.put("customerServiceId", userId);
}
}
private void updateWorkOrderForOthers(Map<String, Object> aftersalesWorkOrder, Object workOrderStatus) {
// 对其他情况的工单状态更新逻辑
// 优化后的代码根据实际情况进行填充
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
} else {
throw new ServiceException("请选择仓库!");
}
//已处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yichuli.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "30");
}
//待处理
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.daichuli.getValue())) {
aftersalesWorkOrder.put("handleStatus", "40");
}
//处理中
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.chulizhong.getValue())) {
aftersalesWorkOrder.put("handleStatus", "50");
}
//已完结
if (ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "20");
}
//全部
if (ObjectUtils.isNotNull(workOrderStatus) && "1000".equals(workOrderStatus)) {
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus", "10");
}
}
private void updateDepartStatus(AftersalesWorkOrderVO workOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) {
if (ObjectUtils.isNotNull(workOrder.getCustomerServiceId())) {
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(workOrder.getCustomerServiceId()));
if (ObjectUtils.isNotNull(listR.getData())) {
long time = System.currentTimeMillis() / 1000;
listR.getData().forEach(a -> {
if (ObjectUtils.isNotNull(a.getDownTime()) && a.getDownTime().getTime() / 1000 <= time) {
workOrder.setDepartStatus(true);
}
});
}
});
}
workOrder.setTotalAmount(completionRecordService.getTotalMoney(workOrder,myCurrentWarehouse.getId()));
return iPage;
//
}
/**
* 查询工单超时未处理并添加超时记录
*/
@ -1147,7 +1354,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
* @return
*/
@Override
public AftersalesWorkOrderVO getProcessingResults(AftersalesWorkOrderDTO aftersalesWorkOrder) {
public AftersalesWorkOrderVO getProcessingResults(AftersalesWorkOrderDTO aftersalesWorkOrder) {
AftersalesWorkOrderVO aftersalesWorkOrderVO = new AftersalesWorkOrderVO();
AftersalesWorkOrderEntity workOrderEntity = baseMapper.selectById(aftersalesWorkOrder.getId());
@ -1165,14 +1372,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
List<AftersalesProcessorVO> processorVOS = new ArrayList<>();
if (!list.isEmpty()) {
Iterator<AftersalesProcessorEntity> iterator = list.iterator();
while (iterator.hasNext()){
while (iterator.hasNext()) {
AftersalesProcessorEntity next = iterator.next();
if (ProcessorProcessingStatusStatusConstant.daichuli.getValue().equals(next.getProcessingStatus())
|| ProcessorProcessingStatusStatusConstant.yichuli.getValue().equals(next.getProcessingStatus())){
|| ProcessorProcessingStatusStatusConstant.yichuli.getValue().equals(next.getProcessingStatus())) {
AftersalesProcessorVO processorVO = new AftersalesProcessorVO();
BeanUtil.copyProperties(next, processorVO);
processorVOS.add(processorVO);
}else {
} else {
iterator.remove();
}
}
@ -1201,8 +1408,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
mailIdStringBuilder.deleteCharAt(mailIdStringBuilder.length() - 1);
}
String modeByClientIdList = basicdataStoreBusinessClient.findModeByClientIdList(mailIdStringBuilder.toString());
if (modeByClientIdList != null && !modeByClientIdList.isEmpty() ) {
String[] split= modeByClientIdList.split(",");
if (modeByClientIdList != null && !modeByClientIdList.isEmpty()) {
String[] split = modeByClientIdList.split(",");
StringBuilder newString = new StringBuilder();
for (String s : split) {
newString.append(DictBizCache.getValue(DictBizConstant.BASIC_FREIGHT_TYPE, s));
@ -1224,7 +1431,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// aftersalesWorkOrderVO.setTypeServiceName(stringBu.toString());
// }
// }
}else {
} else {
log.info("暂未查询到合作信息");
}
@ -1263,16 +1470,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//todo 查询完结信息
AftersalesCompletionRecordEntity completionRecordEntity = new AftersalesCompletionRecordEntity();
AftersalesCompletionRecipientEntity completionRecipientEntity = new AftersalesCompletionRecipientEntity();
List<AftersalesCompletionRecordEntity> list4 = completionRecordService.list(Wrappers.<AftersalesCompletionRecordEntity>query().lambda()
.eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId())
);
if (Func.isNotEmpty(list4)){
list4.forEach(i->{
if (Func.isNotEmpty(list4)) {
list4.forEach(i -> {
BigDecimal bigDecimal = i.getMoney().setScale(2, BigDecimal.ROUND_FLOOR);
i.setMoney(bigDecimal);
});
@ -1328,7 +1532,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
BladeUser user = AuthUtil.getUser();
List<AftersalesWorkOrderEntity> list = new ArrayList<>();
data.stream().forEach(k -> {
data.forEach(k -> {
//查询工单数据是否存在
AftersalesWorkOrderEntity workOrder = baseMapper.selectOne(Wrappers.<AftersalesWorkOrderEntity>query().lambda()
.eq(AftersalesWorkOrderEntity::getWorkOrderNumber, k)
@ -1408,7 +1612,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
throw new ServiceException("注意,注意!客服人员字典未配置!请配置!");
} else {
List<String> stringList = new ArrayList<>();
warehouseType.stream().forEach(i -> {
warehouseType.forEach(i -> {
//查询这个角色ID
R<String> roleId = sysClient.getRoleIds(tenantId, i.getDictValue());
if (ObjectUtils.isNotNull(roleId.getData())) {
@ -1752,7 +1956,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//添加处理结果
AftersalesProcessingResultsDTO aftersalesProcessingResultsDTO = aftersalesWorkOrderDTO.getAftersalesProcessingResultsDTO();
aftersalesProcessingResultsDTO.setWorkOrderId(aftersalesWorkOrderDTO.getId());
aftersalesProcessingResultsDTO.setWorkOrderId(aftersalesWorkOrderDTO.getId());
aftersalesProcessingResultsService.ownSaveOrUpdate(aftersalesProcessingResultsDTO);
//修改异常工单处理信息!
@ -1830,7 +2034,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = new AftersaleSurveyRecordDTO();
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(aftersalesWorkOrderDTO, user);
aftersaleSurveyRecordDTO.setCreateUser(user.getUserId());
aftersaleSurveyRecordDTO.setCreateDept(Long.valueOf(user.getDeptId()));
aftersaleSurveyRecordDTO.setCreateDept(Func.firstLong(user.getDeptId()));
aftersaleSurveyRecordDTO.setCreateTime(new Date());
aftersaleSurveyRecordDTO.setStatus(1);
aftersaleSurveyRecordDTO.setIsDeleted(0);
@ -1974,7 +2178,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
surveyRecordEntity.setTenantId(user.getTenantId());
surveyRecordEntity.setCreateUser(user.getUserId());
surveyRecordEntity.setCreateDept(Long.valueOf(user.getDeptId()));
surveyRecordEntity.setCreateDept(Func.firstLong(user.getDeptId()));
surveyRecordEntity.setDifference(difference);
surveyRecordEntity.setTypesOf("1");
surveyRecordEntity.setWorkOrderId(workOrderId);
@ -2162,7 +2366,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//添加记录
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(aftersalesWorkOrderDTO, user);
aftersaleSurveyRecordDTO.setCreateUser(user.getUserId());
aftersaleSurveyRecordDTO.setCreateDept(Long.valueOf(user.getDeptId()));
aftersaleSurveyRecordDTO.setCreateDept(Func.firstLong(user.getDeptId()));
aftersaleSurveyRecordDTO.setCreateTime(new Date());
aftersaleSurveyRecordDTO.setStatus(1);
aftersaleSurveyRecordDTO.setIsDeleted(0);
@ -2231,6 +2435,35 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return true;
}
/**
* 修改申述状态数据
*
* @param aftersalesAppeal
* @return
*/
// @Override
// public boolean updateByIdAppel(AftersalesAppealEntity aftersalesAppeal) {
//
// BladeUser user = AuthUtil.getUser();
// aftersalesAppeal.setProcessedByName(user.getUserName());
// aftersalesAppeal.setProcessedById(user.getUserId());
// aftersalesAppeal.setProcessedDate(new Date());
// if (ObjectUtils.isNotNull(aftersalesAppeal.getTypesOf()) && "3".equals(aftersalesAppeal.getTypesOf()) || ObjectUtils.isNotNull(aftersalesAppeal.getTypesOf()) && "2".equals(aftersalesAppeal.getTypesOf())) {
// //取消订单申述
// AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
// workOrderEntity.setId(aftersalesAppeal.getWorkOrderId());
// workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
// baseMapper.updateById(workOrderEntity);
//
// if("2".equals(aftersalesAppeal.getTypesOf())){
// // 增加驳回记录信息
// addSurveyRecord(user,workOrderEntity.getId(),"申述驳回:"+aftersalesAppeal.getHandlingReason(),"3");
// }
//
// }
// return aftersalesAppealService.updateById(aftersalesAppeal) > 0;
// }
/**
* 修改申述状态数据
*
@ -2239,21 +2472,52 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
*/
@Override
public boolean updateByIdAppel(AftersalesAppealEntity aftersalesAppeal) {
// 安全性校验:确保用户信息不为空
BladeUser user = AuthUtil.getUser();
if (user == null) {
throw new RuntimeException("用户信息获取失败");
}
// 参数合法性校验:校验aftersalesAppeal不为空
if (aftersalesAppeal == null) {
throw new IllegalArgumentException("申诉信息不能为空");
}
// 参数合法性校验:校验申诉类型不为空且为预期值
String typesOf = aftersalesAppeal.getTypesOf();
if (!ObjectUtils.isNotNull(typesOf) || !("2".equals(typesOf) || "3".equals(typesOf))) {
throw new IllegalArgumentException("无效的申诉类型");
}
// 设置处理人信息和处理时间
aftersalesAppeal.setProcessedByName(user.getUserName());
aftersalesAppeal.setProcessedById(user.getUserId());
aftersalesAppeal.setProcessedDate(new Date());
if (ObjectUtils.isNotNull(aftersalesAppeal.getTypesOf()) && "3".equals(aftersalesAppeal.getTypesOf()) || ObjectUtils.isNotNull(aftersalesAppeal.getTypesOf()) && "2".equals(aftersalesAppeal.getTypesOf())) {
//取消订单申述
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesAppeal.getWorkOrderId());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
baseMapper.updateById(workOrderEntity);
try {
if ("3".equals(typesOf) || "2".equals(typesOf)) {
// 根据不同的申诉类型进行订单状态更新和申述记录添加
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesAppeal.getWorkOrderId());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
baseMapper.updateById(workOrderEntity);
if ("2".equals(typesOf)) {
// 添加驳回记录信息
String recordDesc = "申述驳回:" + aftersalesAppeal.getHandlingReason();
addSurveyRecord(user, workOrderEntity.getId(), recordDesc, "3");
}
}
// 更新申诉信息
return aftersalesAppealService.updateById(aftersalesAppeal) > 0;
} catch (Exception e) {
log.error("处理申诉信息时发生异常", e);
// 异常处理:记录日志或抛出自定义异常
throw new RuntimeException("处理申诉信息时发生异常", e);
}
return aftersalesAppealService.updateById(aftersalesAppeal) > 0;
}
/**
* 修改结束仲裁
*
@ -2306,7 +2570,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
surveyRecordDTO.setTypesOf("1");
surveyRecordDTO.setDifference("2");
surveyRecordDTO.setCreateUser(user.getUserId());
surveyRecordDTO.setCreateDept(Long.valueOf(user.getDeptId()));
surveyRecordDTO.setCreateDept(Func.firstLong(user.getDeptId()));
surveyRecordDTO.setCreateTime(new Date());
surveyRecordDTO.setStatus(1);
surveyRecordDTO.setIsDeleted(0);
@ -2353,29 +2617,21 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
for (AftersalesWorkOrderEntity orderByOrderPackageCodeAndWarehouseIdAndOtherNodex : workOrderByOrderPackageCodeAndWarehouseIdAndOtherNodex) {
// 更新这个异常工单下面的包件
aftersalesAbnormalPackageMapper.updateAftersalesAbnormalPackageByWorkOrderIdAndPackCodeAndOtherNodex(orderByOrderPackageCodeAndWarehouseIdAndOtherNodex.getId(),orderPackageCode, packageFinish);
aftersalesAbnormalPackageMapper.updateAftersalesAbnormalPackageByWorkOrderIdAndPackCodeAndOtherNodex(orderByOrderPackageCodeAndWarehouseIdAndOtherNodex.getId(), orderPackageCode, packageFinish);
orderByOrderPackageCodeAndWarehouseIdAndOtherNodex.setPackageFinish(packageFinish);
baseMapper.updateById(orderByOrderPackageCodeAndWarehouseIdAndOtherNodex);
}
}
@Override
public AftersalesWorkOrderListExcelDTO exportAftersalesWorkOrderList() {
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
List<Long> warehouseListIds = null;
if (!warehouseList.isEmpty()){
warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
if (!warehouseList.isEmpty()) {
warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
AftersalesWorkOrderListExcelDTO aftersalesWorkOrderListExcelDTO = new AftersalesWorkOrderListExcelDTO();
List<AftersalesWorkOrderExcel> allAftersalesWorkOrderExcels = baseMapper.selectAllAftersalesWorkOrderList(warehouseListIds);

24
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java

@ -16,6 +16,7 @@
*/
package com.logpm.basicdata.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -106,7 +107,8 @@ public class BasicdataClientController extends BladeController {
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入basicdataClient")
public R<IPage<BasicdataClientEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataClient, Query query) {
public R<IPage<BasicdataClientVO>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataClient, Query query) {
Object o = basicdataClient.get("contractStartTime");
Object o1 = basicdataClient.get("contractEntTime");
Object o2 = basicdataClient.get("pid");
@ -134,7 +136,8 @@ public class BasicdataClientController extends BladeController {
i.setTypeServiceBusiness(list);
//查询客户绑定第一位联系人
List<BasicdataStoreContactEntity> listed = basicdataStoreContactService.list(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, i.getId()));
.eq(BasicdataStoreContactEntity::getShopId, i.getId())
.eq(BasicdataStoreContactEntity::getDefaultType, true));
if (Func.isNotEmpty(listed)) {
List<BasicdataStoreContactEntity> collect = listed.stream().filter(f -> Func.isEmpty(f.getCreateTime())).collect(Collectors.toList());
if (Func.isNotEmpty(collect)){
@ -165,14 +168,19 @@ public class BasicdataClientController extends BladeController {
}
}
//处理客户的配送类型
});
// if(!i.getCreateUser().equals(null)){
// R<User> userR = userClient.userInfoById(i.getCreateUser());
// i.setCreateUserName(userR.getData().getName());
// }
});
return R.data(pages);
IPage<BasicdataClientVO> basicdataClientVOIPage = basicdataClientService.pageList(Condition.getPage(query), basicdataClient);
if (!basicdataClientVOIPage.getRecords().isEmpty()) {
for (BasicdataClientVO record : basicdataClientVOIPage.getRecords()) {
List<BasicdataStoreBusinessEntity> list = basicdataStoreBusinessService.list(Wrappers.<BasicdataStoreBusinessEntity>query().lambda()
.eq(BasicdataStoreBusinessEntity::getClientId, record.getId()));
record.setTypeServiceBusiness(list);
}
}
return R.data(basicdataClientVOIPage);
}
/**

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.java

@ -27,6 +27,7 @@ import org.apache.ibatis.annotations.Param;
import org.springblade.common.model.dto.NameDTO;
import java.util.List;
import java.util.Map;
/**
* 基础客户表 Mapper 接口
@ -61,4 +62,13 @@ public interface BasicdataClientMapper extends BaseMapper<BasicdataClientEntity>
List<NameDTO> findNameByIds(@Param("sendOrgIds") List<Long> sendOrgIds);
BasicdataClientVO findEntityVoById(@Param("clientId") Long clientId);
/**
*
* @param page
* @param basicdataClient
* @return
*/
IPage<BasicdataClientVO> pageList(IPage<BasicdataClientVO> page,@Param("param") Map<String, Object> basicdataClient);
}

74
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -96,5 +96,79 @@
left join logpm_basicdata_store_contact lbsc on lbsc.shop_id = lbc.id
where lbc.id = #{clientId}
</select>
<select id="pageList" resultType="com.logpm.basicdata.vo.BasicdataClientVO">
SELECT
lbc.id,
lbc.client_name,
lbc. client_type,
lbc.client_code,
lbc. linkman,
lbc. phone,
lbc. type_service,
lbc. blade_region_province_id,
lbc. blade_region_city_id,
lbc. blade_region_area_id,
lbc. detailedly,
lbc. cargo_control,
CASE lbc.type_service
WHEN 1 THEN '商配'
WHEN 2 THEN '市配'
WHEN 3 THEN '自提'
WHEN 4 THEN '三方中转'
END typeServiceName,
lbhc.file_name,
DATE_FORMAT(lbc.contract_start_time, '%Y-%m-%d') AS contractStartTime,
DATE_FORMAT(lbc.contract_ent_time, '%Y-%m-%d') AS contractEntTime,
t.aaa AS brandName
FROM
logpm_basicdata_client AS lbc
LEFT JOIN logpm_basicdata_historical_contract AS lbhc ON lbc.id = lbhc.client_id
LEFT JOIN (
SELECT
lbcc.id,
GROUP_CONCAT( lbsbb.brand_name ) AS aaa
FROM
logpm_basicdata_client lbcc
LEFT JOIN logpm_basicdata_store_brand lbsbb ON lbcc.id = lbsbb.client_id
GROUP BY
lbcc.id
) AS t ON t.id = lbc.id
<where>
lbc.is_deleted = 0
<if test="param.clientName != null and param.clientName != ''">
AND lbc.client_name LIKE CONCAT('%', #{param.clientName}, '%')
</if>
<if test="param.clientCode != null and param.clientCode != ''">
AND lbc.client_code LIKE CONCAT('%', #{param.clientCode}, '%')
</if>
<if test="param.linkman != null and param.linkman != ''">
AND lbc.linkman LIKE CONCAT('%', #{param.linkman}, '%')
</if>
<if test="param.phone != null and param.phone != ''">
AND lbc.phone LIKE CONCAT('%', #{param.phone}, '%')
</if>
<if test="param.clientType != null and param.clientType != ''">
AND lbc.client_type = #{param.clientType}
</if>
<if test="param.contractStartTime != null and param.contractStartTime != ''">
AND DATE_FORMAT(lbc.contract_start_time,, '%Y-%m-%d') > DATE_FORMAT(#{param.contractStartTime}, '%Y-%m-%d')
</if>
<if test="param.contractEntTime != null and param.contractEntTime != ''">
AND DATE_FORMAT(lbc.contract_ent_time,, '%Y-%m-%d') &lt; DATE_FORMAT(#{param.contractEntTime}, '%Y-%m-%d')
</if>
<if test="param.brandName != null and param.brandName != ''">
AND t.aaa LIKE CONCAT('%', #{param.brandName}, '%')
</if>
<if test="param.stratTimeDate != null and param.stratTimeDate != '' and param.endTimeDate != null and param.endTimeDate != ''">
AND lbc.contract_start_time >= DATE_FORMAT(#{param.stratTimeDate}, '%Y-%m-%d')
AND lbc.contract_ent_time &lt;= DATE_FORMAT(#{param.endTimeDate}, '%Y-%m-%d')
</if>
</where>
GROUP BY
lbc.id
ORDER BY
lbc.create_time
DESC
</select>
</mapper>

11
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java

@ -28,6 +28,7 @@ import org.springblade.core.mp.base.BaseService;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;
/**
* 基础客户表 服务类
@ -100,4 +101,14 @@ public interface IBasicdataClientService extends BaseService<BasicdataClientEnti
List<NameDTO> findNameByIds(List<Long> sendOrgIds);
BasicdataClientVO findEntityVoById(Long clientId);
/**
* 客户列表查询
* @param page
* @param basicdataClient
* @return
*/
IPage<BasicdataClientVO> pageList(IPage<BasicdataClientVO> page, Map<String, Object> basicdataClient);
}

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

@ -65,13 +65,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import static org.springblade.common.constant.DictBizConstant.OPEN_ORDER_PAY_WAY;
@ -128,9 +122,11 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
public boolean ownSaveOrUpdate(BasicdataClientEntity basicdataClient) throws NoSuchAlgorithmException {
//添加客户端的历史合同的数据
if (ObjectUtils.isNotNull(basicdataClient.getId())) {
if (!Objects.isNull(basicdataClient.getBusinessType())){
basicdataClient.setTypeService(Integer.parseInt(basicdataClient.getBusinessType()));
}
//修改
this.updateById(basicdataClient);
// List<BasicdataStoreBusinessEntity> typeServiceBusiness = basicdataClient.getTypeServiceBusiness();
List<BasicdataStoreBusinessEntity> list = basicdataStoreBusinessService.list(Wrappers.<BasicdataStoreBusinessEntity>query().lambda()
.eq(BasicdataStoreBusinessEntity::getClientId, basicdataClient.getId())
);
@ -178,9 +174,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
} else {
String linkman = basicdataClient.getLinkman();
String phone = basicdataClient.getPhone();
basicdataClient.setLinkman(null);
basicdataClient.setPhone(null);
basicdataClient.setLinkman(linkman);
basicdataClient.setPhone(phone);
basicdataClient.setCargoControl(false);
if (!Objects.isNull(basicdataClient.getBusinessType())){
basicdataClient.setTypeService(Integer.parseInt(basicdataClient.getBusinessType()));
}
if (ObjectUtils.isNull(basicdataClient.getPid())) {
basicdataClient.setPid(0L);
}
@ -232,7 +231,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
basicdataTripartiteMall.setTripartiteMall(basicdataClient.getTripartiteMall());
basicdataTripartiteMall.setClientId(basicdataClient.getId());
basicdataTripartiteMallService.save(basicdataTripartiteMall);
}
}
if (ObjectUtils.isNull(basicdataClient.getId())) {
@ -646,4 +644,11 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return baseMapper.findEntityVoById(clientId);
}
@Override
public IPage<BasicdataClientVO> pageList(IPage<BasicdataClientVO> page, Map<String, Object> basicdataClient) {
return baseMapper.pageList(page,basicdataClient);
}
}

23
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreContactServiceImpl.java

@ -19,13 +19,17 @@ package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.excel.BasicdataStoreContactExcel;
import com.logpm.basicdata.mapper.BasicdataStoreContactMapper;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataStoreContactService;
import com.logpm.basicdata.vo.BasicdataStoreContactVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.List;
@ -41,6 +45,11 @@ import java.util.stream.Collectors;
@Slf4j
public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataStoreContactMapper, BasicdataStoreContactEntity> implements IBasicdataStoreContactService {
@Autowired
@Lazy
private IBasicdataClientService basicdataClientService;
@Override
public IPage<BasicdataStoreContactVO> selectBasicdataStoreContactPage(IPage<BasicdataStoreContactVO> page, BasicdataStoreContactVO basicdataStoreContact) {
return page.setRecords(baseMapper.selectBasicdataStoreContactPage(page, basicdataStoreContact));
@ -62,6 +71,13 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
List<BasicdataStoreContactEntity> storeContactEntities = baseMapper.selectList(Wrappers.<BasicdataStoreContactEntity>query().lambda()
.eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId())
);
if (!basicdataStoreContact.getDefaultType()){
boolean flag = storeContactEntities.stream().filter(f->!f.getId().equals(basicdataStoreContact.getId())).allMatch(b -> b.getDefaultType().equals(false));
if (flag){
throw new RuntimeException("商场必须存在一个默认联系人");
}
}
List<Long> ids = storeContactEntities.stream().filter(f -> !f.getId().equals(basicdataStoreContact.getId())).map(BasicdataStoreContactEntity::getId).collect(Collectors.toList());
if (!ids.isEmpty()) {
this.update(Wrappers.<BasicdataStoreContactEntity>update().lambda()
@ -69,8 +85,13 @@ public class BasicdataStoreContactServiceImpl extends BaseServiceImpl<BasicdataS
.set(BasicdataStoreContactEntity::getDefaultType,false)
);
}
//修改客户的展示联系人为默认联系人
basicdataClientService.update(Wrappers.<BasicdataClientEntity>update().lambda()
.eq(BasicdataClientEntity::getId,basicdataStoreContact.getShopId())
.set(BasicdataClientEntity::getLinkman,basicdataStoreContact.getLinkman())
.set(BasicdataClientEntity::getPhone,basicdataStoreContact.getPhone())
);
this.updateById(basicdataStoreContact);
return true;
}catch (Exception e){
log.info("报错信息:{}",e.getMessage());

2
blade-service/logpm-business/src/main/java/com/logpm/business/aspect/ChangeAsyncAnnotationAspect.java

@ -78,7 +78,7 @@ public class ChangeAsyncAnnotationAspect {
data = bladeRedis.get(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account);
if (Objects.isNull(data)) {
data = mockLoginService.mockToken(tenantId, account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 3200L);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 25919900L);
redisLockClient.unLock("local_server_user" + tenantId, LockType.FAIR);
}
}

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

@ -40,7 +40,7 @@ public class DistributionBusinessPreOrderAppController {
@ResponseBody
@PostMapping("/scanOrderPackageCode")
@ApiOperationSupport(order = 1)
public Resp scanOrderPackageCode(@RequestBody BusinessSanDTO businessSanDTO){
public R scanOrderPackageCode(@RequestBody BusinessSanDTO businessSanDTO){
Resp resp = null;
try {

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java

@ -194,7 +194,7 @@ public class DistributionSignforAppController {
*/
@PostMapping("/positioning")
@ApiOperationSupport(order = 2)
public Resp positioning(@Valid @RequestBody DistributionSignforEntity distributionSignfor) {
public R positioning(@Valid @RequestBody DistributionSignforEntity distributionSignfor) {
Resp msg = distributionSignforService.positioning(distributionSignfor);
return msg;
}
@ -205,7 +205,7 @@ public class DistributionSignforAppController {
*/
@PostMapping("/signingMessage")
@ApiOperationSupport(order = 2)
public Resp signingMessage(@Valid @RequestBody DistributionSignforEntity distributionSignfor) {
public R signingMessage(@Valid @RequestBody DistributionSignforEntity distributionSignfor) {
Resp msg = distributionSignforService.positioning(distributionSignfor);
return msg;
}

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

@ -80,7 +80,7 @@ public class ChangeAsyncAnnotationAspect {
data = bladeRedis.get(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account);
if (Objects.isNull(data)) {
data = mockLoginService.mockToken(tenantId, account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 3200L);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 25919900L);
redisLockClient.unLock("local_server_user" + tenantId, LockType.FAIR);
}
}

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

@ -877,7 +877,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
// distributionParcelListService.updateById(parcelListEntity);
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
log.info("#########!!!!!!!!!!!!!!!!!--------- 77777777777 distributionDeliverySelfEntity={}", distributionDeliverySelfEntity);
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) {
@ -3217,6 +3217,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//新增订单
List<DistributionParcelListDTO> packageListInfo = s.getPackageListInfo();
if (Func.isNotEmpty(packageListInfo)) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
@ -3239,6 +3243,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
logs.add(js);
});
} else {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
@ -3361,8 +3369,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(packageListInfo)) {
packageListInfo.forEach(p -> {
if (Func.isEmpty(oldPackageList.get(p.getId()))) {
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对司机完成签收订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
}
//为该订单新增了包件
@ -6089,11 +6101,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("###########查询配送任务异常,deliveyId:{}", deliveryId);
return false;
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Func.isEmpty(reservationEntity)) {
log.error("###########查询预约任务异常,reservationId:{}", reservationId);
return false;
}
if (conditions != 1) {
log.error("###########包件类型错误,conditions:{}", conditions);
return false;
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("###########retentionDeliveryReservationPackage未授权,warehouse:{}", myCurrentWarehouse);
return false;
}
List<JSONObject> aaa =new ArrayList<>();
//订制品
//需要对该配送任务下的该包件进行取消状态标识
int row = distributionReservationMapper.cancelReservationPackage(reservationId, orderPackageId);
@ -6116,6 +6138,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
int a = distributionSignforMapper.deductionLoadingPacjageNum(loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId(), loadscanEntity.getLoadedNub());
//维护订单状态
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), parcelListEntity.getWarehouseId());
//增加滞留信息
String content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getScanUser()+"取消配车,取消方式:滞留扫描,取消计划,配送车次号:"+loadscanEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.CANCEL_DISTRIBUTION.getCode());
aaa.add(js);
}
if (!aaa.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}
//进行了一条包件任务的取消,此时就应该对预约、配送任务进行数量的维护
distributionAsyncService.checkRetentionReservationAndDeliveryInfo(reservationId, deliveryId);

50
blade-service/logpm-factory/src/test/java/com/logpm/factory/TestService.java

File diff suppressed because one or more lines are too long

19
blade-service/logpm-patch/src/main/java/com/logpm/patch/interceptor/LocalServerLoginAccountsInterceptor.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.wrapper.CustomHttpServletRequestWrapper;
@ -37,6 +38,8 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
private final Environment environment;
private final RedisLockClient redisLockClient;
private final MockLoginService mockLoginService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws CustomerException {
@ -50,20 +53,8 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
if(flag){
data =bladeRedis.get(CacheNames.LOCAL_SERVER_USER+account);
if(Objects.isNull(data)){
String url = "http://"+ LauncherConstant.loginAddr(Objects.requireNonNull(environment.getActiveProfiles()[0]))+"/blade-auth/oauth/token";
HttpRequest urlRequest = HttpRequest.post(url);
urlRequest.header("Authorization", "Basic c2FiZXI6c2FiZXJfc2VjcmV0");
urlRequest.header("Tenant-Id", "627683");
Map<String, Object> params = new HashMap<>();
params.put("grant_type", "local_server");
params.put("scope", "all");
params.put("username", account);
params.put("tenantId", "627683");
HttpResponse execute = urlRequest.form(params).execute();
String body = execute.body();
data = JSONObject.parseObject(body);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,3200L);
data = mockLoginService.mockToken("627683",account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER+account,data,25919900L);
redisLockClient.unLock("local_server_user", LockType.FAIR);
}
}

8
blade-service/logpm-patch/src/main/resources/application-dev.yml

@ -60,12 +60,12 @@ spring:
url: ${blade.datasource.patch.master.url}
username: ${blade.datasource.patch.master.username}
password: ${blade.datasource.patch.master.password}
slave:
627683:
druid:
#独立校验配置
validation-query: select 1
#oracle校验
#validation-query: select 1 from dual
url: ${blade.datasource.patch.slave.url}
username: ${blade.datasource.patch.slave.username}
password: ${blade.datasource.patch.slave.password}
url: ${blade.datasource.patch.627683.url}
username: ${blade.datasource.patch.627683.username}
password: ${blade.datasource.patch.627683.password}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/aspect/ChangeAsyncAnnotationAspect.java

@ -78,7 +78,7 @@ public class ChangeAsyncAnnotationAspect {
data = bladeRedis.get(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account);
if (Objects.isNull(data)) {
data = mockLoginService.mockToken(tenantId, account);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 3200L);
bladeRedis.setEx(CacheNames.LOCAL_SERVER_USER + tenantId + ":" + account, data, 25919900L);
redisLockClient.unLock("local_server_user" + tenantId, LockType.FAIR);
}
}

107
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -1,11 +1,16 @@
package com.logpm.warehouse.api;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.warehouse.dto.TrayTypeDTO;
import com.logpm.warehouse.dto.ZeroOrderVO;
import com.logpm.warehouse.service.IWarehouseTaryAllocationService;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
import com.logpm.warehouse.vo.OrderDetailVO;
import com.logpm.warehouse.vo.TrayTypeDataListVO;
@ -23,10 +28,7 @@ import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
@Log4j2
@RestController
@ -37,6 +39,8 @@ public class WarehouseTrayTypeApiController {
private final IWarehouseTrayTypeService warehouseTrayTypeService;
private final IBasicdataWarehouseClient warehouseClient;
private final IWarehouseTaryAllocationService taryAllocationService;
private final IBasicdataTrayClient trayClient;
//----------------------订单分拣--------------------------------
@ResponseBody
@ -1337,6 +1341,101 @@ public class WarehouseTrayTypeApiController {
}
}
@ResponseBody
@PostMapping("/batchSyncOldTrayTypeInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "批量同步老系统托盘数据", notes = "传入trayTypeDTO")
public R batchSyncOldTrayTypeInfo(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########batchSyncOldTrayTypeInfo: ";
log.info(method + "移托包件 trayTypeDTO={}", trayTypeDTO);
String trayCodeStr = trayTypeDTO.getTrayCode();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(StringUtil.isBlank(trayCodeStr)){
log.warn(method+"托盘码不能为空 trayCodeStr={}",trayCodeStr);
return R.fail(403,"托盘码不能为空");
}
List<String> trayCodes = new ArrayList<>();
if(trayCodeStr.contains(",")){
String[] split = trayCodeStr.split(",");
trayCodes.addAll(Arrays.asList(split));
}else{
trayCodes.add(trayCodeStr);
}
for (String trayCode : trayCodes) {
log.info(method+"当前同步的托盘 trayCode={}",trayCode);
BasicdataTrayEntity trayEntity = trayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
log.warn(method+"托盘信息不存在 trayCode={}",trayCode);
continue;
}
Long trayId = trayEntity.getId();
Long allcationId = taryAllocationService.getAllocationIdByTrayId(trayId);
if(!Objects.isNull(allcationId)){
log.warn(method+"托盘已上架 trayCode={}",trayCode);
continue;
}
R trayData = warehouseTrayTypeService.findTrayData(trayCode, myCurrentWarehouse.getId());
int total = 0;
Object data = trayData.getData();
if(!Objects.isNull(data)){
String s = JSONObject.toJSONString(data);
JSONObject jsonObject = JSONObject.parseObject(s);
JSONArray packageList = jsonObject.getJSONArray("packageList");
JSONArray zeroOrderList = jsonObject.getJSONArray("zeroOrderList");
JSONArray stockOrderList = jsonObject.getJSONArray("stockOrderList");
int packageSize = packageList.size();
int zeroSize = zeroOrderList.size();
int stockSize = stockOrderList.size();
total = packageSize+zeroSize+stockSize;
}
R syncOldTrayData = warehouseTrayTypeService.findSyncOldTrayData(trayCode, myCurrentWarehouse.getId());
Object data1 = syncOldTrayData.getData();
if(!Objects.isNull(data1)){
String s1 = JSONObject.toJSONString(data1);
JSONObject jsonObject1 = JSONObject.parseObject(s1);
JSONArray packageList1 = jsonObject1.getJSONArray("packageList");
String trayType1 = jsonObject1.getString("trayType");
String trayCode1 = jsonObject1.getString("trayCode");
int size = packageList1.size();
if(total >= size){
log.warn(method+"新系统打托数量大于等于老系统 trayCode={} 不同步",trayCode);
continue;
}
List<String> orderPackageCodes = new ArrayList<>();
for (int i = 0; i < size; i++){
JSONObject jsonObject2 = packageList1.getJSONObject(i);
orderPackageCodes.add(jsonObject2.getString("orderPackageCode"));
}
if(!orderPackageCodes.isEmpty()){
warehouseTrayTypeService.syncOldTrayData(trayCode1,trayType1,orderPackageCodes,myCurrentWarehouse.getId(),"同步老系统打托");
}
}
}
return R.success("处理完成");
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -247,7 +247,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setCreateUser(user.getUserId());
Long deptId = getDeptByMaxDept(user.getDeptId());
Long deptId = Func.firstLong(user.getDeptId());
detailEntity.setCreateDept(deptId);
detailEntity.setIsDeleted(0);
detailEntity.setStatus(1);
@ -2089,7 +2089,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
break;
case "4": //4库存品
questDetail.setCreateUser(user.getUserId());
questDetail.setCreateDept(Long.parseLong(user.getDeptId().split(",")[0]));
questDetail.setCreateDept(Func.firstLong(user.getDeptId()));
questDetail.setStatus(1);
questDetail.setIsDeleted(0);
Date date = new Date();

Loading…
Cancel
Save