Browse Source

fix:

增加系统自动创建工单 存在于异常立碑72小时后
dist.1.3.0
pref_mail@163.com 11 months ago
parent
commit
fc74c78d17
  1. 2
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java
  2. 1
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalRecordEntity.java
  3. 5
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  4. 10
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesWorkOrderClient.java
  5. 7
      blade-service/logpm-aftersales/pom.xml
  6. 15
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesWorkOrderClient.java
  7. 213
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java
  8. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.java
  9. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.xml
  10. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  11. 14
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  12. 11
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  13. 42
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

2
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java

@ -143,4 +143,6 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity {
@ApiModelProperty(value = "关联工单ID") @ApiModelProperty(value = "关联工单ID")
private Long relatedWorkOrdersId; private Long relatedWorkOrdersId;
private Integer packageFinish;
} }

1
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalRecordEntity.java

@ -97,4 +97,5 @@ public class AftersalesAbnormalRecordEntity extends TenantEntity {
private Integer associationType; private Integer associationType;
} }

5
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -293,6 +293,11 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
* 离职状态 * 离职状态
*/ */
private boolean departStatus; private boolean departStatus;
private Integer packageFinish;
/** /**
* 金额总和 * 金额总和
*/ */

10
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesWorkOrderClient.java

@ -36,6 +36,7 @@ public interface IAftersalesWorkOrderClient {
String API_PREFIX = "/work/client"; String API_PREFIX = "/work/client";
String TOP = API_PREFIX + "/top"; String TOP = API_PREFIX + "/top";
String UPDATEWORKORDERSTATUS = API_PREFIX + "/updateWorkOrderStatus";
/** /**
* 获取客服异常工单列表 * 获取客服异常工单列表
@ -47,4 +48,13 @@ public interface IAftersalesWorkOrderClient {
@GetMapping(TOP) @GetMapping(TOP)
BladePage<AftersalesWorkOrderEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); BladePage<AftersalesWorkOrderEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 修改异常工单上的数据
* @param orderPackageCode 包件码
* @param packageFinish 目前默认传 1
* @return
*/
@GetMapping(UPDATEWORKORDERSTATUS)
Boolean updateWorkOrderStatus(@RequestParam("warehouseId") Long warehouseId,@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("packageFinish") Integer packageFinish);
} }

7
blade-service/logpm-aftersales/pom.xml

@ -83,6 +83,13 @@
<version>3.2.0.RELEASE</version> <version>3.2.0.RELEASE</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-warehouse-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>

15
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesWorkOrderClient.java

@ -17,6 +17,7 @@
package com.logpm.aftersales.feign; package com.logpm.aftersales.feign;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.aftersales.service.IAftersalesAbnormalPackageService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -40,6 +41,8 @@ public class AftersalesWorkOrderClient implements IAftersalesWorkOrderClient {
private final IAftersalesWorkOrderService aftersalesWorkOrderService; private final IAftersalesWorkOrderService aftersalesWorkOrderService;
private final IAftersalesAbnormalPackageService aftersalesAbnormalPackageService;
@Override @Override
@GetMapping(TOP) @GetMapping(TOP)
public BladePage<AftersalesWorkOrderEntity> top(Integer current, Integer size) { public BladePage<AftersalesWorkOrderEntity> top(Integer current, Integer size) {
@ -50,4 +53,16 @@ public class AftersalesWorkOrderClient implements IAftersalesWorkOrderClient {
return BladePage.of(page); return BladePage.of(page);
} }
@Override
@GetMapping(UPDATEWORKORDERSTATUS)
public Boolean updateWorkOrderStatus(Long warehouseId ,String orderPackageCode, Integer packageFinish) {
// 需要根据包件码和卸车作业节点找到异常工单的ID 0-F0BU 0-F0BO
aftersalesWorkOrderService.updateWorkOrderPackagFinish(warehouseId,orderPackageCode,packageFinish);
return null;
}
} }

213
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java

@ -1,14 +1,40 @@
package com.logpm.aftersales.jobhandler; package com.logpm.aftersales.jobhandler;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.aftersales.dto.AftersalesPersonResponsibleDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.AftersalesAbnormalPackageEntity;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import com.logpm.aftersales.entity.AftersalesProcessorEntity;
import com.logpm.aftersales.service.IAftersalesAbnormalRecordService;
import com.logpm.aftersales.service.IAftersalesWorkOrderService; import com.logpm.aftersales.service.IAftersalesWorkOrderService;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.feign.ITrunklineCarsLoadClient;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDeptClient;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.*;
/** /**
* @author 12702 * @author 12702
*/ */
@ -19,18 +45,199 @@ public class AftersalesXxlJob {
private final IAftersalesWorkOrderService aftersalesWorkOrderService; private final IAftersalesWorkOrderService aftersalesWorkOrderService;
private final IAftersalesAbnormalRecordService aftersalesAbnormalRecordService;
private final IUserClient userClient;
private final ISysClient sysClient;
private final IDeptClient deptClient;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IWarehouseWaybillClient wallBillOrderService;
private final ITrunklineCarsLoadClient trunklineCarsLoadClient;
@XxlJob("syncWarehouseToNew") @XxlJob("syncWarehouseToNew")
public ReturnT<String> getIsItTimeout(String param) throws Exception { public ReturnT<String> getIsItTimeout(String param) throws Exception {
logger.info("查询处理超时的数据>>>>>>>>{}",param); logger.info("查询处理超时的数据>>>>>>>>{}", param);
aftersalesWorkOrderService.getIsItTimeout(); aftersalesWorkOrderService.getIsItTimeout();
return ReturnT.SUCCESS; return ReturnT.SUCCESS;
} }
@XxlJob("modifyClaimStatus") @XxlJob("modifyClaimStatus")
public ReturnT<String> updateModifyClaimStatus(String param) throws Exception { public ReturnT<String> updateModifyClaimStatus(String param) throws Exception {
logger.info("修改预账单工单是否可以申述>>>>>>>>{}",param); logger.info("修改预账单工单是否可以申述>>>>>>>>{}", param);
aftersalesWorkOrderService.updateModifyClaimStatus(); aftersalesWorkOrderService.updateModifyClaimStatus();
return ReturnT.SUCCESS; return ReturnT.SUCCESS;
} }
/**
* 根据异常列表创建异常工单
*
* @param param
* @return
* @throws Exception
*/
@XxlJob("autoCreateWorkOrder")
public ReturnT<String> autoCreateWorkOrder(String param) throws Exception {
LambdaQueryWrapper<AftersalesAbnormalRecordEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AftersalesAbnormalRecordEntity::getAbnormalType, 4);
queryWrapper.eq(AftersalesAbnormalRecordEntity::getAbnormalStatus, 0);
queryWrapper.eq(AftersalesAbnormalRecordEntity::getSendOrderStatus, 0);
//当前时间 减少72个小时
queryWrapper.lt(AftersalesAbnormalRecordEntity::getCreateTime, new Date(System.currentTimeMillis() - 72 * 60 * 60 * 1000L));
List<AftersalesAbnormalRecordEntity> list = aftersalesAbnormalRecordService.list(queryWrapper);
for (AftersalesAbnormalRecordEntity aftersalesAbnormalRecordEntity : list) {
// 创建异常工单
logger.info("创建异常工单>>>>>>>>{}", aftersalesAbnormalRecordEntity);
AftersalesWorkOrderDTO aftersalesWorkOrder = BeanUtil.copy(aftersalesAbnormalRecordEntity, AftersalesWorkOrderDTO.class);
aftersalesWorkOrder.setId(null);
// 构建创建异常工单VO
BladeUser bladeUser = new BladeUser();
bladeUser.setUserId(aftersalesAbnormalRecordEntity.getCreateUser());
R<User> userR = userClient.userInfoById(bladeUser.getUserId());
if (userR.isSuccess()) {
if (userR.getData() != null) {
bladeUser.setUserName(userR.getData().getRealName());
}
}
bladeUser.setTenantId(aftersalesAbnormalRecordEntity.getTenantId());
bladeUser.setDeptId(aftersalesAbnormalRecordEntity.getCreateDept() + "");
BasicdataWarehouseEntity basicdataWarehouseEntity = new BasicdataWarehouseEntity();
basicdataWarehouseEntity.setId(aftersalesAbnormalRecordEntity.getUpWarehouseId());
basicdataWarehouseEntity.setName(aftersalesAbnormalRecordEntity.getUpWarehouseName());
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(basicdataWarehouseEntity.getId());
if (ObjectUtil.isNotEmpty(warehouseEntity)) {
basicdataWarehouseEntity.setCode(warehouseEntity.getCode());
}
// 完善数据
List<AftersalesAbnormalPackageEntity> packageEntityList = new ArrayList<>();
AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity = new AftersalesAbnormalPackageEntity();
aftersalesAbnormalPackageEntity.setPackageCode(aftersalesAbnormalRecordEntity.getOrderPackageCode());
aftersalesAbnormalPackageEntity.setWaybillNumber(aftersalesAbnormalRecordEntity.getWaybillNo());
aftersalesAbnormalPackageEntity.setOrderCode(aftersalesAbnormalRecordEntity.getOrderCode());
packageEntityList.add(aftersalesAbnormalPackageEntity);
aftersalesWorkOrder.setPackageEntityList(packageEntityList);
TrunklineCarsLoadEntity entityByCarsNo = trunklineCarsLoadClient.findEntityByCarsNo(aftersalesAbnormalRecordEntity.getCarsNo());
aftersalesWorkOrder.setTrainNumber(aftersalesAbnormalRecordEntity.getCarsNo());
if (ObjectUtil.isNotEmpty(entityByCarsNo)) {
aftersalesWorkOrder.setVehicleRoute(entityByCarsNo.getCarsLineName());
}
aftersalesWorkOrder.setInitiationIdentification("PC");
aftersalesWorkOrder.setWorkOrderType("2");
aftersalesWorkOrder.setDiscoveryNode("3");
aftersalesWorkOrder.setWaybillNumber(aftersalesAbnormalRecordEntity.getWaybillNo());
aftersalesWorkOrder.setOrderCode(aftersalesAbnormalRecordEntity.getOrderCode());
WarehouseWaybillEntity byWaybillNo = wallBillOrderService.findByWaybillNo(aftersalesWorkOrder.getWorkOrderNumber());
if (byWaybillNo != null) {
aftersalesWorkOrder.setWaybillMall(byWaybillNo.getConsignee());
}
// 添加责任方
// 默认为干线创建运输的始发仓的仓库
List<AftersalesProcessorEntity> processorEntityList = new ArrayList<>();
AftersalesProcessorEntity aftersalesProcessorEntity = new AftersalesProcessorEntity();
aftersalesProcessorEntity.setWarehouseId(entityByCarsNo.getStartWarehouseId());
//责任方
aftersalesProcessorEntity.setTypesOf("1");
processorEntityList.add(aftersalesProcessorEntity);
aftersalesWorkOrder.setProcessorEntityList(processorEntityList);
//责任人
List<AftersalesPersonResponsibleDTO> personResponsibleDTO = new ArrayList<>();
AftersalesPersonResponsibleDTO aftersalesPersonResponsibleDTO = new AftersalesPersonResponsibleDTO();
aftersalesPersonResponsibleDTO.setTypesOf("1");
// 需要获取到仓库的负责人
Map<String, Object> wareManagerUser = findWareManagerUser(bladeUser.getTenantId(), warehouseEntity.getDepartment());
if (wareManagerUser != null) {
aftersalesPersonResponsibleDTO.setPersonResponsibleId(wareManagerUser.get("userId").toString());
aftersalesPersonResponsibleDTO.setPersonResponsibleName(wareManagerUser.get("userName").toString());
}
warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(aftersalesProcessorEntity.getWarehouseId());
aftersalesPersonResponsibleDTO.setResponsibilityRatio("100");
aftersalesPersonResponsibleDTO.setTypesOf("1");
aftersalesPersonResponsibleDTO.setDifference("1");
aftersalesPersonResponsibleDTO.setBusinessId(warehouseEntity.getId());
aftersalesPersonResponsibleDTO.setBusinessName(warehouseEntity.getName());
personResponsibleDTO.add(aftersalesPersonResponsibleDTO);
aftersalesWorkOrder.setPersonResponsibleDTO(personResponsibleDTO);
aftersalesWorkOrderService.extractedSaveAndUpdate(aftersalesWorkOrder, bladeUser, basicdataWarehouseEntity);
// 更新状态
aftersalesAbnormalRecordEntity.setSendOrderStatus(1);
aftersalesAbnormalRecordService.updateById(aftersalesAbnormalRecordEntity);
}
return ReturnT.SUCCESS;
}
private Map<String, Object> findWareManagerUser(String teandId, Long deptId) {
Map<String, Object> map = null;
R<List<User>> listR = userClient.userInfoByDept(teandId, deptId);
Long userId = null;
String userName = null;
if (listR.isSuccess()) {
Dept dept = deptClient.findEntityById(deptId);
List<User> data = listR.getData();
R<String> roleIs;
if (dept.getDeptCategory() == 4) {
// 获取仓库经理ID
roleIs = sysClient.getRoleIds(teandId, "仓库经理");
} else if (dept.getDeptCategory() == 5) {
roleIs = sysClient.getRoleIds(teandId, "总部职能");
} else {
roleIs = new R<>();
roleIs.setSuccess(false);
}
if (roleIs.isSuccess()) {
String roleId = roleIs.getData();
for (User datum : data) {
if (datum.getRoleId().contains(roleId)) {
userId = datum.getId();
userName = datum.getRealName();
map = new HashMap<>();
map.put("userId", userId);
map.put("userName", userName);
}
}
}
}
return map;
}
} }

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

@ -61,4 +61,6 @@ public interface AftersalesAbnormalPackageMapper extends BaseMapper<AftersalesAb
List<AftersalesAbnormalPackageVO> getAbnormalPackage(@Param("param") AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity); List<AftersalesAbnormalPackageVO> getAbnormalPackage(@Param("param") AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity);
List<AftersalesTrunklineVO> getTrunklines(@Param("orderPackageCode") String orderPackageCode); List<AftersalesTrunklineVO> getTrunklines(@Param("orderPackageCode") String orderPackageCode);
List<AftersalesDeliverVO> getDeliver(@Param("orderPackageCode") String orderPackageCode); List<AftersalesDeliverVO> getDeliver(@Param("orderPackageCode") String orderPackageCode);
void updateAftersalesAbnormalPackageByWorkOrderIdAndPackCodeAndOtherNodex(@Param("workId") Long workId,@Param("orderPackageCode") String orderPackageCode, @Param("packageFinish") Integer packageFinish);
} }

3
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalPackageMapper.xml

@ -25,6 +25,9 @@
<result column="package_image" property="packageImage"/> <result column="package_image" property="packageImage"/>
<result column="types_of" property="typesOf"/> <result column="types_of" property="typesOf"/>
</resultMap> </resultMap>
<update id="updateAftersalesAbnormalPackageByWorkOrderIdAndPackCodeAndOtherNodex">
update logpm_aftersales_abnormal_package set package_finish = #{packageFinish} where work_order_id = #{workId} and package_code = #{orderPackageCode}
</update>
<select id="selectAftersalesAbnormalPackagePage" resultMap="aftersalesAbnormalPackageResultMap"> <select id="selectAftersalesAbnormalPackagePage" resultMap="aftersalesAbnormalPackageResultMap">

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

@ -96,4 +96,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
* @return * @return
*/ */
String getAbnormalPackage(@Param("orderCode") String orderCode); String getAbnormalPackage(@Param("orderCode") String orderCode);
List<AftersalesWorkOrderEntity> findWorkOrderByOrderPackageCodeAndWarehouseIdAndOtherNodex(@Param("warehouseId") Long warehouseId, @Param("orderPackageCode") String orderPackageCode,
@Param("workOrderType")int workOrderType, @Param("discoveryNode")int discoveryNode);
} }

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

@ -422,6 +422,20 @@
WHERE ldpl.is_deleted = 0 WHERE ldpl.is_deleted = 0
AND ldpl.order_package_code = #{orderCode} AND ldpl.order_package_code = #{orderCode}
</select> </select>
<select id="findWorkOrderByOrderPackageCodeAndWarehouseIdAndOtherNodex"
resultType="com.logpm.aftersales.entity.AftersalesWorkOrderEntity">
SELECT
lawo.*
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_abnormal_package laap on laap.work_order_id=lawo.id
WHERE
laap.package_code = #{orderPackageCode}
AND lawo.warehouse_id = #{warehouseId}
AND lawo.discovery_node = #{discoveryNode}
AND lawo.work_order_type = #{workOrderType}
AND lawo.is_deleted = 0;
</select>
<update id="updateFinanceTime"> <update id="updateFinanceTime">

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

@ -25,6 +25,7 @@ import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO; import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -65,6 +66,8 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
*/ */
boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder); boolean saveOrUpdateOwn(AftersalesWorkOrderDTO aftersalesWorkOrder);
boolean extractedSaveAndUpdate(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse);
/** /**
* 查询待处理的异常工单数据 * 查询待处理的异常工单数据
* @param aftersalesWorkOrder * @param aftersalesWorkOrder
@ -284,4 +287,12 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
R updateFinanceTime(String ids, Date entryTime,String operator); R updateFinanceTime(String ids, Date entryTime,String operator);
/**
* 更新包件的干线卸车标识
* @param warehouseId
* @param orderPackageCode
* @param packageFinish
*/
void updateWorkOrderPackagFinish(Long warehouseId, String orderPackageCode, Integer packageFinish);
} }

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

@ -18,7 +18,6 @@ package com.logpm.aftersales.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -30,17 +29,16 @@ import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO;
import com.logpm.aftersales.dto.AftersalesPersonResponsibleDTO; import com.logpm.aftersales.dto.AftersalesPersonResponsibleDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO; import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.entity.*; import com.logpm.aftersales.entity.*;
import com.logpm.aftersales.mapper.AftersalesAbnormalPackageMapper;
import com.logpm.aftersales.mapper.AftersalesAppealMapper; import com.logpm.aftersales.mapper.AftersalesAppealMapper;
import com.logpm.aftersales.mapper.AftersalesCustomerMallMapper; import com.logpm.aftersales.mapper.AftersalesCustomerMallMapper;
import com.logpm.aftersales.service.*; import com.logpm.aftersales.service.*;
import com.logpm.aftersales.vo.*; import com.logpm.aftersales.vo.*;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper; import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient; import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.feign.IDistributionDeliveryListClient; import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.vo.DistributionDeliveryListVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -50,11 +48,9 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DictTimeoutEnum; import org.springblade.common.constant.DictTimeoutEnum;
import org.springblade.common.constant.aftersales.*; import org.springblade.common.constant.aftersales.*;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
@ -62,7 +58,6 @@ import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User; import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserSearchClient; import org.springblade.system.feign.IUserSearchClient;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -90,6 +85,7 @@ import java.util.stream.Collectors;
public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWorkOrderMapper, AftersalesWorkOrderEntity> implements IAftersalesWorkOrderService { public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWorkOrderMapper, AftersalesWorkOrderEntity> implements IAftersalesWorkOrderService {
private final IAftersalesAbnormalPackageService aftersalesAbnormalPackageService; private final IAftersalesAbnormalPackageService aftersalesAbnormalPackageService;
private final AftersalesAbnormalPackageMapper aftersalesAbnormalPackageMapper;
private final IAftersalesDecreaseImageService aftersalesDecreaseImageService; private final IAftersalesDecreaseImageService aftersalesDecreaseImageService;
private final IAftersalesProcessorService aftersalesProcessorService; private final IAftersalesProcessorService aftersalesProcessorService;
private final IAftersalesCompletionRecordService completionRecordService; private final IAftersalesCompletionRecordService completionRecordService;
@ -323,6 +319,11 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
throw new ServiceException("请选择仓库!!"); throw new ServiceException("请选择仓库!!");
} }
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
return this.extractedSaveAndUpdate(aftersalesWorkOrder, user, myCurrentWarehouse);
}
@Override
public boolean extractedSaveAndUpdate(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) {
if (ObjectUtils.isNull(aftersalesWorkOrder.getId())) { if (ObjectUtils.isNull(aftersalesWorkOrder.getId())) {
//新增 //新增
// aftersalesWorkOrder.setInitiationIdentification("PC"); // aftersalesWorkOrder.setInitiationIdentification("PC");
@ -2279,10 +2280,39 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
@Override @Override
public R updateFinanceTime(String ids, Date entryTime, String operator) { public R updateFinanceTime(String ids, Date entryTime, String operator) {
String[] split = ids.split(","); String[] split = ids.split(",");
for (String id : split) { for (String id : split) {
baseMapper.updateFinanceTime(id, entryTime, operator); baseMapper.updateFinanceTime(id, entryTime, operator);
} }
return R.success("操作成功"); return R.success("操作成功");
}
@Override
public void updateWorkOrderPackagFinish(Long warehouseId, String orderPackageCode, Integer packageFinish) {
// 查询处当前的异常工单
List<AftersalesWorkOrderEntity> workOrderByOrderPackageCodeAndWarehouseIdAndOtherNodex = baseMapper.findWorkOrderByOrderPackageCodeAndWarehouseIdAndOtherNodex(warehouseId, orderPackageCode, 2, 3);
// 对异常工单进行标识
for (AftersalesWorkOrderEntity orderByOrderPackageCodeAndWarehouseIdAndOtherNodex : workOrderByOrderPackageCodeAndWarehouseIdAndOtherNodex) {
// 更新这个异常工单下面的包件
aftersalesAbnormalPackageMapper.updateAftersalesAbnormalPackageByWorkOrderIdAndPackCodeAndOtherNodex(orderByOrderPackageCodeAndWarehouseIdAndOtherNodex.getId(),orderPackageCode, packageFinish);
orderByOrderPackageCodeAndWarehouseIdAndOtherNodex.setPackageFinish(packageFinish);
baseMapper.updateById(orderByOrderPackageCodeAndWarehouseIdAndOtherNodex);
}
} }
} }

Loading…
Cancel
Save