Browse Source

添加工单添加记录

newStockUp
caoyizhong 1 year ago
parent
commit
9eded1d266
  1. 30
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersaleSurveyRecordEntity.java
  2. 10
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesCompletionRecordEntity.java
  3. 2
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesPersonResponsibleEntity.java
  4. 13
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  5. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersaleSurveyRecordController.java
  6. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersaleSurveyRecordService.java
  7. 24
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersaleSurveyRecordServiceImpl.java
  8. 85
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

30
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersaleSurveyRecordEntity.java

@ -90,6 +90,34 @@ public class AftersaleSurveyRecordEntity extends TenantEntity {
* 工单ID
*/
@ApiModelProperty(value = "工单ID")
private String workOrderId;
private Long workOrderId;
/**
* 处理结果
*/
@ApiModelProperty(value = "处理结果")
private String processingResults;
/**
* 跟进仓库名称
*/
@ApiModelProperty(value = "跟进仓库名称")
private String followWarehouseName;
/**
* 跟进仓库ID
*/
@ApiModelProperty(value = "跟进仓库ID")
private Long followWarehouseId;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
}

10
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesCompletionRecordEntity.java

@ -72,6 +72,16 @@ public class AftersalesCompletionRecordEntity extends TenantEntity {
*/
@ApiModelProperty(value = "原因")
private String reason;
/**
* 说明
*/
@ApiModelProperty(value = "说明")
private String explain;
/**
* 财务是否处理
*/
@ApiModelProperty(value = "财务是否处理")
private String accounting;
/**
* 金额
*/

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

@ -65,7 +65,7 @@ public class AftersalesPersonResponsibleEntity extends TenantEntity {
* 工单异常ID
*/
@ApiModelProperty(value = "工单异常ID")
private String wordOrderId;
private Long wordOrderId;
/**
* 责任人ID
*/

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

@ -251,5 +251,18 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
@ApiModelProperty(value = "客服经理标识")
@TableField(exist = false)
private String customerIdentification;
/**
* 仲裁原因
*/
@ApiModelProperty(value = "仲裁原因")
@TableField(exist = false)
private String reasonArbitration;
/**
* 标识 1订单 2 零担 3库存品
*/
@ApiModelProperty(value = "标识 1订单 2 零担 3库存品 ")
@TableField(exist = false)
private String identifying;
}

5
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersaleSurveyRecordController.java

@ -16,6 +16,7 @@
*/
package com.logpm.aftersales.controller;
import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -117,8 +118,8 @@ public class AftersaleSurveyRecordController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aftersaleSurveyRecord")
public R submit(@Valid @RequestBody AftersaleSurveyRecordEntity aftersaleSurveyRecord) {
return R.status(aftersaleSurveyRecordService.saveOrUpdate(aftersaleSurveyRecord));
public R submit(@Valid @RequestBody AftersaleSurveyRecordDTO aftersaleSurveyRecord) {
return R.status(aftersaleSurveyRecordService.saveOrUpdateOwn(aftersaleSurveyRecord));
}
/**

7
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersaleSurveyRecordService.java

@ -17,6 +17,7 @@
package com.logpm.aftersales.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import com.logpm.aftersales.vo.AftersaleSurveyRecordVO;
import com.logpm.aftersales.excel.AftersaleSurveyRecordExcel;
@ -49,4 +50,10 @@ public interface IAftersaleSurveyRecordService extends BaseService<AftersaleSurv
*/
List<AftersaleSurveyRecordExcel> exportAftersaleSurveyRecord(Wrapper<AftersaleSurveyRecordEntity> queryWrapper);
/**
* 添加或修改
* @param aftersaleSurveyRecord
* @return
*/
boolean saveOrUpdateOwn(AftersaleSurveyRecordDTO aftersaleSurveyRecord);
}

24
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersaleSurveyRecordServiceImpl.java

@ -16,11 +16,15 @@
*/
package com.logpm.aftersales.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import com.logpm.aftersales.vo.AftersaleSurveyRecordVO;
import com.logpm.aftersales.excel.AftersaleSurveyRecordExcel;
import com.logpm.aftersales.mapper.AftersaleSurveyRecordMapper;
import com.logpm.aftersales.service.IAftersaleSurveyRecordService;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -51,4 +55,24 @@ public class AftersaleSurveyRecordServiceImpl extends BaseServiceImpl<AftersaleS
return aftersaleSurveyRecordList;
}
/**
* 添加或修改信息
* @param aftersaleSurveyRecord
* @return
*/
@Override
public boolean saveOrUpdateOwn(AftersaleSurveyRecordDTO aftersaleSurveyRecord) {
if(ObjectUtils.isNotNull(aftersaleSurveyRecord.getId())){
//修改
return false;
}else{
//添加
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity();
BeanUtil.copyProperties(aftersaleSurveyRecord,aftersaleSurveyRecord);
baseMapper.insert(surveyRecordEntity);
return true;
}
}
}

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

@ -42,6 +42,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.aftersales.ProcessorTypesOfStatusConstant;
import org.springblade.common.constant.aftersales.WorkOrderStatusConstant;
import org.springblade.common.constant.aftersales.WorkOrderTypesOfStatusConstant;
import org.springblade.core.log.exception.ServiceException;
@ -264,6 +265,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
packageEntity.setProcessingStatus("1");//待处理
packageEntity.setWarehouseId(myCurrentWarehouse.getId());
list.add(packageEntity);
//添加记录
if(ProcessorTypesOfStatusConstant.chulifang.getValue().equals(i.getProcessingStatus())){
//处理方
AftersaleSurveyRecordDTO surveyRecordDTO = changName(aftersalesWorkOrder, user);
surveyRecordDTO.setWorkOrderId(aftersalesWorkOrder.getId());
surveyRecordDTO.setContent(aftersalesWorkOrder.getSurveyRecordDTO().getContent());//内容
surveyRecordDTO.setTypesOf("1");
surveyRecordDTO.setDifference("2");
surveyRecordDTO.setFollowWarehouseName(i.getBusinessName());
surveyRecordDTO.setFollowWarehouseId(i.getBusinessId());
aftersaleSurveyRecordService.saveOrUpdateOwn(surveyRecordDTO);
}
});
if(!list.isEmpty()){
aftersalesProcessorService.saveBatch(list);
@ -285,10 +300,67 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
}
//添加调查记录
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getSurveyRecordDTO())){
AftersaleSurveyRecordDTO surveyRecordDTO = changName(aftersalesWorkOrder, user);
AftersaleSurveyRecordEntity aftersaleSurveyRecord = new AftersaleSurveyRecordEntity();
BeanUtil.copyProperties(surveyRecordDTO,aftersaleSurveyRecord);
aftersaleSurveyRecord.setTypesOf("1");
aftersaleSurveyRecord.setDifference("1");
aftersaleSurveyRecord.setWorkOrderId(aftersalesWorkOrder.getId());
aftersaleSurveyRecordService.save(aftersaleSurveyRecord);
}
//添加责任人信息
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getPersonResponsibleDTO()) && !aftersalesWorkOrder.getPersonResponsibleDTO().isEmpty()){
List<AftersalesPersonResponsibleEntity> personResponsibleList = getAftersalesPersonResponsibleEntities(aftersalesWorkOrder);
if(!personResponsibleList.isEmpty()){
aftersalesPersonResponsibleService.saveBatch(personResponsibleList);
}
}
//添加完结受款方数据
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecipientEntities())){
completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities());
}
//添加完结赔款方数据
if(ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecordEntities())){
completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities());
}
return true;
}
/**
* 查询调查记录的部分信息
* @param aftersalesWorkOrder
* @param user
* @return
*/
private AftersaleSurveyRecordDTO changName(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user) {
AftersaleSurveyRecordDTO surveyRecordDTO = aftersalesWorkOrder.getSurveyRecordDTO();
surveyRecordDTO.setAddPeople(user.getUserName());
R<List<String>> deptNames = sysClient.getDeptNames(user.getDeptId());
if(ObjectUtils.isNotNull(deptNames)){
String collect = deptNames.getData().stream().collect(Collectors.joining(","));
surveyRecordDTO.setAddDepartment(collect);
}
return surveyRecordDTO;
}
return true;
//添加责任人信息
@NotNull
private static List<AftersalesPersonResponsibleEntity> getAftersalesPersonResponsibleEntities(AftersalesWorkOrderDTO aftersalesWorkOrder) {
List<AftersalesPersonResponsibleDTO> personResponsibleDTO = aftersalesWorkOrder.getPersonResponsibleDTO();
List<AftersalesPersonResponsibleEntity> personResponsibleList = new ArrayList<>();
personResponsibleDTO.forEach( i ->{
AftersalesPersonResponsibleEntity personResponsibleEntity = new AftersalesPersonResponsibleEntity();
BeanUtil.copyProperties(i , personResponsibleEntity);
personResponsibleEntity.setDifference("1");
personResponsibleEntity.setTypesOf("1");
personResponsibleEntity.setWordOrderId(aftersalesWorkOrder.getId());
personResponsibleList.add(personResponsibleEntity);
});
return personResponsibleList;
}
/**
@ -348,23 +420,22 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
throw new ServiceException("注意,注意!售后访问字典未配置!请配置!");
} else {
Optional<DictBiz> first = warehouseType.stream().filter(i -> {
if (i.getDictKey().equals(roleName)) {
if (i.getDictValue().equals(roleName)) {
return true;
}
return false;
}).findFirst();
if(first.isPresent()){
//存在
DictBiz dictBiz = first.get();
String dictValue = dictBiz.getDictValue();
String dictValue = first.get().getDictKey();
switch (dictValue){
case "1": //客服经理 查询全部待处理工单
aftersalesWorkOrder.put("customerIdentification", "1");
break;
case "2": // 营业部客服
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
aftersalesWorkOrder.put("businessId", myCurrentWarehouse.getId());
}else{
throw new ServiceException("请选择仓库!");
}
@ -378,7 +449,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//不存在
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
aftersalesWorkOrder.put("businessId", myCurrentWarehouse.getId());
}else{
throw new ServiceException("请选择仓库!");
}

Loading…
Cancel
Save