Browse Source

修改工单申述

single_db
caoyizhong 1 year ago
parent
commit
3b9c9891c1
  1. 7
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAppealPeopleEntity.java
  2. 2
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesReplyingPartyEntity.java
  3. 11
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesAppealVO.java
  4. 32
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesAppealController.java
  5. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  6. 21
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml
  7. 12
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  8. 8
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAppealService.java
  9. 50
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAppealServiceImpl.java
  10. 71
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

7
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAppealPeopleEntity.java

@ -75,11 +75,16 @@ public class AftersalesAppealPeopleEntity extends TenantEntity {
* 实际责任人ID
*/
@ApiModelProperty(value = "实际责任人ID")
private String actualPersonId;
private Long actualPersonId;
/**
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private Long warehouseId;
/**
* 申述ID
*/
@ApiModelProperty(value = "申述ID")
private Long appealId;
}

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

@ -75,7 +75,7 @@ public class AftersalesReplyingPartyEntity extends TenantEntity {
* 处理人名称
*/
@ApiModelProperty(value = "处理人名称")
private Long processedByName;
private String processedByName;
/**
* 指派时间
*/

11
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesAppealVO.java

@ -17,10 +17,13 @@
package com.logpm.aftersales.vo;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesAppealPeopleEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 异常工单申述表 视图实体类
*
@ -39,6 +42,10 @@ public class AftersalesAppealVO extends AftersalesAppealEntity {
* 运单号
*/
private String waybillNumber;
/**
* 异常工单ID
*/
private Long workOrderId;
/**
* 订单自编号
*/
@ -58,5 +65,9 @@ public class AftersalesAppealVO extends AftersalesAppealEntity {
* 状态名称
*/
private String typesOfName;
/**
* 实际责任人数据
*/
private List<AftersalesAppealPeopleEntity> peopleEntityList;
}

32
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesAppealController.java

@ -16,7 +16,10 @@
*/
package com.logpm.aftersales.controller;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersalesAppealDTO;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.service.IAftersalesWorkOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -25,6 +28,8 @@ import lombok.AllArgsConstructor;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.aftersales.WorkOrderStatusConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -65,6 +70,7 @@ import javax.servlet.http.HttpServletResponse;
public class AftersalesAppealController extends BladeController {
private final IAftersalesAppealService aftersalesAppealService;
private final IAftersalesWorkOrderService aftersalesWorkOrderService;
/**
* 异常工单申述表 详情
@ -73,8 +79,11 @@ public class AftersalesAppealController extends BladeController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入aftersalesAppeal")
public R<AftersalesAppealVO> detail(AftersalesAppealEntity aftersalesAppeal) {
AftersalesAppealEntity detail = aftersalesAppealService.getOne(Condition.getQueryWrapper(aftersalesAppeal));
return R.data(AftersalesAppealWrapper.build().entityVO(detail));
if(ObjectUtils.isNull(aftersalesAppeal.getId())){
throw new ServiceException("申述ID不能为空!!");
}
AftersalesAppealVO detail = aftersalesAppealService.getOneOWn(Condition.getQueryWrapper(aftersalesAppeal));
return R.data(detail);
}
/**
* 异常工单申述表 分页
@ -94,6 +103,7 @@ public class AftersalesAppealController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页查询申述数据", notes = "传入aftersalesAppeal")
public R<IPage<AftersalesAppealVO>> getListAppeal(@ApiIgnore @RequestParam Map<String, Object> aftersalesAppeal, Query query) {
log.info("查询申述信息》》》{}",aftersalesAppeal);
IPage<AftersalesAppealVO> pages = aftersalesAppealService.getListAppeal(Condition.getPage(query), aftersalesAppeal);
return R.data(pages);
}
@ -127,10 +137,24 @@ public class AftersalesAppealController extends BladeController {
@ApiOperation(value = "修改", notes = "传入aftersalesAppeal")
public R update(@Valid @RequestBody AftersalesAppealEntity aftersalesAppeal) {
log.info("客服操作确定修改》》》》{}",aftersalesAppeal);
if(ObjectUtils.isNull(aftersalesAppeal.getId())){
throw new ServiceException("申述ID不能为空!!");
}
if(ObjectUtils.isNull(aftersalesAppeal.getWorkOrderId())){
throw new ServiceException("异常工单ID不能为空!!");
}
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())){
//取消订单申述
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesAppeal.getWorkOrderId());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yiwanjei.getValue());
aftersalesWorkOrderService.updateById(workOrderEntity);
}
return R.status(aftersalesAppealService.updateById(aftersalesAppeal));
}
@ -141,6 +165,10 @@ public class AftersalesAppealController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aftersalesAppeal")
public R submit(@Valid @RequestBody AftersalesAppealDTO aftersalesAppeal) {
log.info("异常工单申述表 新增或修改参数》》》{}",aftersalesAppeal.toString());
if(ObjectUtils.isNull(aftersalesAppeal.getWorkOrderId())){
throw new ServiceException("异常工单ID不能为空!!");
}
return R.status(aftersalesAppealService.saveOrUpdateOwn(aftersalesAppeal));
}

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

@ -465,7 +465,7 @@ public class AftersalesWorkOrderController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "处理方 仓库查询待处理的异常工单", notes = "传入aftersalesWorkOrder")
public R getPendingWorkOrder(AftersalesWorkOrderDTO aftersalesWorkOrder,Query query) {
log.info("工单创建或修改的数据{}",aftersalesWorkOrder.toString());
log.info("处理方 仓库查询待处理的异常工单{}",aftersalesWorkOrder.toString());
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.setWarehouseId(myCurrentWarehouse.getId());

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

@ -40,11 +40,24 @@
SELECT * FROM logpm_aftersales_appeal ${ew.customSqlSegment}
</select>
<select id="getListAppeal" resultType="com.logpm.aftersales.vo.AftersalesAppealVO">
select laa.appeal_people_name appealPeopleName,laa.claimant,lawo.work_order_number workOrderNumber,lawo.waybill_number waybillNumber,lawo.order_code orderCode,
lawo.work_order_type workOrderType,lawo.discovery_node discoveryNode,laa.types_of typesOf
from logpm_aftersales_appeal laa
LEFT JOIN logpm_aftersales_work_order lawo on lawo.id = laa.work_order_id
SELECT
laa.id ,
laa.appeal_people_name appealPeopleName,
laa.claimant,
lawo.work_order_number workOrderNumber,
lawo.waybill_number waybillNumber,
lawo.order_code orderCode,
lawo.work_order_type workOrderType,
lawo.discovery_node discoveryNode,
laa.types_of typesOf,
laa.work_order_id workOrderId
FROM
logpm_aftersales_appeal laa
LEFT JOIN logpm_aftersales_completion_record lacr on laa.work_order_id = lacr.work_order_id
LEFT JOIN logpm_aftersales_work_order lawo ON lawo.id = lacr.work_order_id
<where>
<if test="param.warehouseId != null and param.warehouseId != '' "> and lacr.warehouse_id = #{param.warehouseId } </if>
<if test="param.appealPeopleName != null and param.appealPeopleName != ''">and laa.appeal_people_name = #{param.appealPeopleName}</if>
<if test="param.claimant != null and param.claimant != ''">and laa.claimant = #{param.claimant}</if>
<if test="param.workOrderNumber != null and param.workOrderNumber != ''">and lawo.work_order_number = #{param.workOrderNumber}</if>

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

@ -53,7 +53,8 @@
<select id="pageListOwn" resultType="com.logpm.aftersales.entity.AftersalesWorkOrderEntity">
select DISTINCT lawo.id,lawo.work_order_type,lawo.discovery_node,lawo.work_order_number,lawo.waybill_number,lawo.order_code,lawo.train_number,lawo.first,
lawo.secondary,lawo.vehicle_route,lawo.deliver_goods_time,lawo.discovery_time,lawo.warehousing_time,lawo.waybill_mall,lawo.remarks,lawo.delivery_time,
lawo.delivery_driver,lawo.work_order_status,lawo.problem_description,lawo.responsible_person,lawo.processed_by,lawo.create_time
lawo.delivery_driver,lawo.work_order_status,lawo.problem_description,lawo.responsible_person,lawo.processed_by,lawo.create_time,
lawo.customer_service_name customerServiceName
from logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap on lawo.id = lap.work_order_id and lap.types_of = '2' and lap.conditions in (1,2)
<where>
@ -81,13 +82,14 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall = #{param.waybillMall } </if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' ">and lawo.work_order_status in( #{param.workOrderStatus }) </if>
<if test="param.customerServiceState != null and param.customerServiceState != '' "> and lawo.work_order_status = '40' and lawo.customer_service_id is null </if>
<if test="param.handleStatus!= null and param.handleStatus != '' ">and lawo.work_order_status in (21,30) </if>
<if test="param.customerServiceState != null and param.customerServiceState != '' "> and lawo.work_order_status in ('30','40') </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' and lap.business_id = #{param.warehouseId} </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">or lawo.work_order_status in (80,100) and lap.processing_status = '4' and lap.business_id = #{param.warehouseId} </if>
<if test="param.customerServiceId != null and param.customerServiceId != '' ">and lawo.customer_service_id = #{param.customerServiceId } </if>
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name = #{param.customerServiceName } </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' ">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus == null ">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
@ -137,7 +139,7 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
from logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law on lap.work_order_id = law.id
<where>
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2'
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and law.work_order_status = #{param.workOrderStatus}</if>
<if test="param.warehouseId != null and param.warehouseId != ''">and lap.business_id = #{param.warehouseId}</if>
</where>

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

@ -17,6 +17,7 @@
package com.logpm.aftersales.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.aftersales.dto.AftersalesAppealDTO;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.vo.AftersalesAppealVO;
@ -65,4 +66,11 @@ public interface IAftersalesAppealService extends BaseService<AftersalesAppealEn
* @return
*/
IPage<AftersalesAppealVO> getListAppeal(IPage<Object> page, Map<String, Object> aftersalesAppeal);
/**
* 查询申述详情
* @param queryWrapper
* @return
*/
AftersalesAppealVO getOneOWn(QueryWrapper<AftersalesAppealEntity> queryWrapper);
}

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

@ -18,17 +18,16 @@ package com.logpm.aftersales.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO;
import com.logpm.aftersales.dto.AftersalesAppealDTO;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesAppealPeopleEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.service.IAftersalesAppealPeopleService;
import com.logpm.aftersales.service.IAftersalesWorkOrderService;
import com.logpm.aftersales.vo.AftersalesAppealPeopleVO;
import com.logpm.aftersales.vo.AftersalesAppealVO;
import com.logpm.aftersales.excel.AftersalesAppealExcel;
import com.logpm.aftersales.mapper.AftersalesAppealMapper;
@ -40,7 +39,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.aftersales.WorkOrderStatusConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@ -50,6 +48,8 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -99,7 +99,8 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
if(ObjectUtils.isNull(myCurrentWarehouse)){
throw new ServiceException("请选择仓库!");
}
AftersalesAppealEntity aftersalesAppealEntity = new AftersalesAppealEntity();
BeanUtil.copyProperties(aftersalesAppeal,aftersalesAppealEntity);
if(ObjectUtils.isNotNull( aftersalesAppeal.getId())){
//修改
if(ObjectUtils.isNotNull( aftersalesAppeal.getPeopleEntityList()) ){
@ -108,14 +109,18 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
.eq(AftersalesAppealPeopleEntity::getWorkOrderId, aftersalesAppeal.getWorkOrderId())
);
List<Long> collect = list.stream().map(AftersalesAppealPeopleEntity::getId).collect(Collectors.toList());
aftersalesAppealPeopleService.deleteLogic(collect);
if(!collect.isEmpty()){
aftersalesAppealPeopleService.deleteLogic(collect);
}
}
baseMapper.updateById(aftersalesAppeal);
}else{
//新增
AftersalesAppealEntity aftersalesAppealEntity = new AftersalesAppealEntity();
BeanUtil.copyProperties(aftersalesAppeal,aftersalesAppealEntity);
aftersalesAppealEntity.setCreateUser(user.getUserId());
aftersalesAppealEntity.setCreateDept(Long.valueOf(user.getDeptId()));
aftersalesAppealEntity.setCreateTime(new Date());
aftersalesAppealEntity.setStatus(1);
aftersalesAppealEntity.setIsDeleted(0);
aftersalesAppealEntity.setClaimantUserId(user.getUserId());
aftersalesAppealEntity.setClaimant(user.getUserName());
aftersalesAppealEntity.setTypesOf("0");
@ -128,13 +133,15 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
aftersalesWorkOrderService.updateById(aftersalesWorkOrder);
//添加操作记录
aftersalesWorkOrderService.addSurveyRecord(aftersalesAppeal.getWorkOrderId(),"申述操作","3");
}
if(ObjectUtil.isNotNull( aftersalesAppeal.getPeopleEntityList())){
//添加实际收货人
aftersalesAppeal.getPeopleEntityList().forEach( i ->{
AftersalesAppealPeopleEntity aftersalesAppealPeople = new AftersalesAppealPeopleEntity();
BeanUtil.copyProperties(i,aftersalesAppealPeople);
if(ObjectUtils.isNotNull(aftersalesAppealEntity.getId())){
aftersalesAppealPeople.setAppealId(aftersalesAppealEntity.getId());
}
aftersalesAppealPeople.setWorkOrderId(aftersalesAppeal.getWorkOrderId());
aftersalesAppealPeopleService.save(aftersalesAppealPeople);
});
@ -152,6 +159,10 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
@Override
public IPage<AftersalesAppealVO> getListAppeal(IPage<Object> page, Map<String, Object> aftersalesAppeal) {
Condition.getQueryWrapper(aftersalesAppeal, AftersalesAppealEntity.class);
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesAppeal.put("warehouse_id",myCurrentWarehouse.getId());
}
AftersalesAppealDTO aftersalesAppealDTO = JSONObject.parseObject(JSONObject.toJSONString(aftersalesAppeal), AftersalesAppealDTO.class);
IPage<AftersalesAppealVO> iPage = baseMapper.getListAppeal(page,aftersalesAppealDTO);
iPage.getRecords().forEach( i ->{
@ -162,4 +173,23 @@ public class AftersalesAppealServiceImpl extends BaseServiceImpl<AftersalesAppea
return iPage;
}
/**
* 查询申述详情
*
* @param queryWrapper
* @return
*/
@Override
public AftersalesAppealVO getOneOWn(QueryWrapper<AftersalesAppealEntity> queryWrapper) {
AftersalesAppealVO aftersalesAppealVO = new AftersalesAppealVO();
AftersalesAppealEntity aftersalesAppealEntity = baseMapper.selectOne(queryWrapper);
BeanUtil.copyProperties(aftersalesAppealEntity,aftersalesAppealVO);
List<AftersalesAppealPeopleEntity> list = aftersalesAppealPeopleService.list(Wrappers.<AftersalesAppealPeopleEntity>query().lambda()
.eq(AftersalesAppealPeopleEntity::getAppealId, aftersalesAppealEntity.getId())
);
aftersalesAppealVO.setPeopleEntityList(list);
//查询实际责任人
return aftersalesAppealVO;
}
}

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

@ -309,6 +309,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersaleSurveyRecord.setTypesOf("1");
aftersaleSurveyRecord.setDifference("1");
aftersaleSurveyRecord.setWorkOrderId(aftersalesWorkOrder.getId());
aftersaleSurveyRecord.setProcessingResults(surveyRecordDTO.getContent());
aftersaleSurveyRecordService.save(aftersaleSurveyRecord);
}
//添加责任方 处理方
@ -586,6 +587,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus","30");
}
if(ObjectUtils.isNotNull(workOrderStatus) && workOrderStatus.equals(WorkOrderStatusConstant.yiwanjei.getValue())){
aftersalesWorkOrder.remove("workOrderStatus");
aftersalesWorkOrder.put("handleStatus","20");
}
// if( ObjectUtils.isNull(workOrderStatus)){
// aftersalesWorkOrder.put("handleStatus","10");
// }
break;
case "3": //职能客服 查询自己的待处理工单
if( ObjectUtils.isNotNull( workOrderStatus ) && "500".equals(workOrderStatus)){
@ -1221,12 +1230,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
one = list.stream().filter(i -> i.getBusinessId().equals(myCurrentWarehouse.getId()) && i.getBusinessName().equals(myCurrentWarehouse.getName())).findFirst();
one.ifPresent(aftersalesProcessorEntity -> surveyRecordEntity.setProcessorId(aftersalesProcessorEntity.getId()));
surveyRecordEntity.setAddDepartment(myCurrentWarehouse.getName());
surveyRecordEntity.setAddDepartment(myCurrentWarehouse.getDepartmentName());
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent());
}else{
log.info("客服回复!!!{}",user.getUserName());
surveyRecordEntity.setProcessorId(user.getUserId());
R<String> deptName = sysClient.getDeptName(Long.valueOf(user.getDeptId()));
surveyRecordEntity.setAddDepartment(deptName.getData());
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent());
}
//添加回复信息
surveyRecordEntity.setDifference("1");
@ -1250,6 +1261,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}else{
//添加或修改新的处理方
surveyRecordDTO.setId(surveyRecordEntity.getId());
surveyRecordDTO.setFollowWarehouseName(surveyRecordEntity.getFollowWarehouseName());
surveyRecordDTO.setFollowWarehouseId(surveyRecordEntity.getFollowWarehouseId());
chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO);
}
@ -1276,6 +1290,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//添加或修改新的处理方
chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO);
//修改处理方待回复信息
List<AftersalesReplyingPartyEntity> list1 = aftersalesReplyingPartyService.list(Wrappers.<AftersalesReplyingPartyEntity>query().lambda()
.eq(AftersalesReplyingPartyEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId())
.eq(AftersalesReplyingPartyEntity::getFollowWarehouseId, myCurrentWarehouse.getId())
.eq(AftersalesReplyingPartyEntity::getDifference, '1')
);
list1.forEach(i ->{
AftersalesReplyingPartyEntity replyingPartyEntity = new AftersalesReplyingPartyEntity();
replyingPartyEntity.setId(i.getId());
replyingPartyEntity.setDifference("2");
replyingPartyEntity.setProcessedById(user.getUserId());
replyingPartyEntity.setProcessedByName(user.getUserName());
aftersalesReplyingPartyService.updateById(replyingPartyEntity);
});
}
return true;
@ -1289,7 +1317,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
* @param list
* @param surveyRecordDTO
*/
private void chuLiFang(AftersalesWorkOrderDTO aftersalesWorkOrderDTO, BasicdataWarehouseEntity myCurrentWarehouse, BladeUser user, List<AftersalesProcessorEntity> list, AftersaleSurveyRecordDTO surveyRecordDTO) {
@Transactional(rollbackFor = Exception.class)
public void chuLiFang(AftersalesWorkOrderDTO aftersalesWorkOrderDTO, BasicdataWarehouseEntity myCurrentWarehouse, BladeUser user, List<AftersalesProcessorEntity> list, AftersaleSurveyRecordDTO surveyRecordDTO) {
if(!aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()){
aftersalesWorkOrderDTO.getProcessorEntityList().forEach( i ->{
Optional<AftersalesProcessorEntity> first = list.stream().filter(a -> a.getBusinessId().equals(i.getBusinessId())).findFirst();
@ -1307,7 +1336,18 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
//添加指定处理结果
//处理方
addSurveRecord(aftersalesWorkOrderDTO, user, i);
//判断是否新添加指派记录
AftersalesProcessorEntity one = aftersalesProcessorService.getOne(Wrappers.<AftersalesProcessorEntity>query().lambda()
.eq(AftersalesProcessorEntity::getBusinessId, i.getBusinessId())
.eq(AftersalesProcessorEntity::getWorkOrderId, i.getWorkOrderId())
.eq(AftersalesProcessorEntity::getProcessingStatus,"1")
.eq(AftersalesProcessorEntity::getTypesOf,"2")
);
if(ObjectUtils.isNull(one)){
//添操作记录
addSurveRecord(aftersalesWorkOrderDTO, user, i);
}
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
@ -1315,16 +1355,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}else{
//没有 全部
List<AftersalesProcessorEntity> collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList());
List<AftersalesProcessorEntity> collect = list.stream().filter(i -> "2".equals(i.getTypesOf())).collect(Collectors.toList());
//
//添加待回复信息
collect.forEach( i ->{
//修改处理方 处理状态
updateProcessor(ProcessorProcessingStatusStatusConstant.daichuli.getValue(),i);
//添加指定处理结果
addSurveRecord(aftersalesWorkOrderDTO, user, i);
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
if(!i.getBusinessId().toString().equals(myCurrentWarehouse.getId().toString())) {
//修改处理方 处理状态
updateProcessor(ProcessorProcessingStatusStatusConstant.daichuli.getValue(), i);
//添加指定处理结果
addSurveRecord(aftersalesWorkOrderDTO, user, i);
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO, i, surveyRecordDTO);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
}
});
}
@ -1460,6 +1504,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if(ObjectUtils.isNull(myCurrentWarehouse)){
throw new ServiceException("请选择仓库!");
}
//TODO 待处理!!
//查询是否必须回复
AftersalesProcessorEntity one = aftersalesProcessorService.getOne(Wrappers.<AftersalesProcessorEntity>query().lambda().
eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId())
@ -1703,7 +1750,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
int comparisonResult = reduce.compareTo(BigDecimal.ZERO);
if (comparisonResult > 0) {
//金额大于0
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.lipeijineweichu.getValue());
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue());
}else{
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue());
}

Loading…
Cancel
Save