|
|
|
|
@ -9,9 +9,9 @@ import org.dromara.common.core.enums.BusinessStatusEnum;
|
|
|
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
@ -25,6 +25,7 @@ import org.dromara.oa.erp.domain.vo.ErpAfterSalesLaborCostsVo;
|
|
|
|
|
import org.dromara.oa.erp.domain.vo.ErpAfterSalesMaterialCostsVo;
|
|
|
|
|
import org.dromara.oa.erp.service.IErpAfterSalesLaborCostsService;
|
|
|
|
|
import org.dromara.oa.erp.service.IErpAfterSalesMaterialCostsService;
|
|
|
|
|
import org.dromara.system.api.RemoteCodeRuleService;
|
|
|
|
|
import org.dromara.workflow.api.RemoteWorkflowService;
|
|
|
|
|
import org.dromara.workflow.api.domain.RemoteStartProcess;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@ -38,8 +39,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import org.springframework.context.event.EventListener;
|
|
|
|
|
import org.dromara.workflow.api.event.ProcessEvent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
@ -61,6 +60,9 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
@DubboReference(timeout = 30000)
|
|
|
|
|
private RemoteWorkflowService remoteWorkflowService;
|
|
|
|
|
|
|
|
|
|
@DubboReference()
|
|
|
|
|
private RemoteCodeRuleService remoteCodeRuleService;
|
|
|
|
|
|
|
|
|
|
private final IErpAfterSalesLaborCostsService laborCostsService;
|
|
|
|
|
private final IErpAfterSalesMaterialCostsService materialCostsService;
|
|
|
|
|
|
|
|
|
|
@ -71,41 +73,42 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
* @return 项目售后信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public ErpAfterSalesVo queryById(Long afterSalesId){
|
|
|
|
|
public ErpAfterSalesVo queryById(Long afterSalesId) {
|
|
|
|
|
ErpAfterSalesVo vo = baseMapper.selectVoById(afterSalesId);
|
|
|
|
|
|
|
|
|
|
if (vo != null) {
|
|
|
|
|
List<ErpAfterSalesLaborCosts> laborEntities = laborCostsService.list(
|
|
|
|
|
new LambdaQueryWrapper<ErpAfterSalesLaborCosts>()
|
|
|
|
|
.eq(ErpAfterSalesLaborCosts::getAfterSalesId, afterSalesId)
|
|
|
|
|
);
|
|
|
|
|
List<ErpAfterSalesLaborCostsVo> laborVos = MapstructUtils.convert(laborEntities, ErpAfterSalesLaborCostsVo.class);
|
|
|
|
|
new LambdaQueryWrapper<ErpAfterSalesLaborCosts>()
|
|
|
|
|
.eq(ErpAfterSalesLaborCosts::getAfterSalesId, afterSalesId));
|
|
|
|
|
List<ErpAfterSalesLaborCostsVo> laborVos = MapstructUtils.convert(laborEntities,
|
|
|
|
|
ErpAfterSalesLaborCostsVo.class);
|
|
|
|
|
vo.setLaborCostsList(laborVos);
|
|
|
|
|
|
|
|
|
|
List<ErpAfterSalesMaterialCosts> materialEntities = materialCostsService.list(
|
|
|
|
|
new LambdaQueryWrapper<ErpAfterSalesMaterialCosts>()
|
|
|
|
|
.eq(ErpAfterSalesMaterialCosts::getAfterSalesId, afterSalesId)
|
|
|
|
|
);
|
|
|
|
|
List<ErpAfterSalesMaterialCostsVo> materialVos = MapstructUtils.convert(materialEntities, ErpAfterSalesMaterialCostsVo.class);
|
|
|
|
|
new LambdaQueryWrapper<ErpAfterSalesMaterialCosts>()
|
|
|
|
|
.eq(ErpAfterSalesMaterialCosts::getAfterSalesId, afterSalesId));
|
|
|
|
|
List<ErpAfterSalesMaterialCostsVo> materialVos = MapstructUtils.convert(materialEntities,
|
|
|
|
|
ErpAfterSalesMaterialCostsVo.class);
|
|
|
|
|
vo.setMaterialCostsList(materialVos);
|
|
|
|
|
}
|
|
|
|
|
return vo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询项目售后信息列表
|
|
|
|
|
*
|
|
|
|
|
* @param bo 查询条件
|
|
|
|
|
* @param pageQuery 分页参数
|
|
|
|
|
* @return 项目售后信息分页列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<ErpAfterSalesVo> queryPageList(ErpAfterSalesBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<ErpAfterSales> lqw = buildQueryWrapper(bo);
|
|
|
|
|
// Page<ErpAfterSalesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
|
Page<ErpAfterSalesVo> result = baseMapper.selectCustomVoPage(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询项目售后信息列表
|
|
|
|
|
*
|
|
|
|
|
* @param bo 查询条件
|
|
|
|
|
* @param pageQuery 分页参数
|
|
|
|
|
* @return 项目售后信息分页列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<ErpAfterSalesVo> queryPageList(ErpAfterSalesBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<ErpAfterSales> lqw = buildQueryWrapper(bo);
|
|
|
|
|
// Page<ErpAfterSalesVo> result = baseMapper.selectVoPage(pageQuery.build(),
|
|
|
|
|
// lqw);
|
|
|
|
|
Page<ErpAfterSalesVo> result = baseMapper.selectCustomVoPage(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询符合条件的项目售后信息列表
|
|
|
|
|
@ -116,40 +119,48 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
@Override
|
|
|
|
|
public List<ErpAfterSalesVo> queryList(ErpAfterSalesBo bo) {
|
|
|
|
|
MPJLambdaWrapper<ErpAfterSales> lqw = buildQueryWrapper(bo);
|
|
|
|
|
// return baseMapper.selectVoList(lqw);
|
|
|
|
|
// return baseMapper.selectVoList(lqw);
|
|
|
|
|
return baseMapper.selectCustomVoList(lqw);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private MPJLambdaWrapper<ErpAfterSales> buildQueryWrapper(ErpAfterSalesBo bo) {
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
MPJLambdaWrapper<ErpAfterSales> lqw = JoinWrappers.lambda(ErpAfterSales.class)
|
|
|
|
|
.selectAll(ErpAfterSales.class)
|
|
|
|
|
.eq(ErpAfterSales::getDelFlag, "0")
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesCode()), ErpAfterSales::getAfterSalesCode, bo.getAfterSalesCode())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesSubject()), ErpAfterSales::getAfterSalesSubject, bo.getAfterSalesSubject())
|
|
|
|
|
.eq(bo.getProjectId() != null, ErpAfterSales::getProjectId, bo.getProjectId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getProjectCode()), ErpAfterSales::getProjectCode, bo.getProjectCode())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getProjectName()), ErpAfterSales::getProjectName, bo.getProjectName())
|
|
|
|
|
.eq(bo.getCustomerId() != null, ErpAfterSales::getCustomerId, bo.getCustomerId())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getCustomerName()), ErpAfterSales::getCustomerName, bo.getCustomerName())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getContactPerson()), ErpAfterSales::getContactPerson, bo.getContactPerson())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getContactPhone()), ErpAfterSales::getContactPhone, bo.getContactPhone())
|
|
|
|
|
.eq(bo.getAfterSalesDate() != null, ErpAfterSales::getAfterSalesDate, bo.getAfterSalesDate())
|
|
|
|
|
.eq(bo.getContractId() != null, ErpAfterSales::getContractId, bo.getContractId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getContractCode()), ErpAfterSales::getContractCode, bo.getContractCode())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesType()), ErpAfterSales::getAfterSalesType, bo.getAfterSalesType())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getStakeholderId()), ErpAfterSales::getStakeholderId, bo.getStakeholderId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getHandlerId()), ErpAfterSales::getHandlerId, bo.getHandlerId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getProblemDescription()), ErpAfterSales::getProblemDescription, bo.getProblemDescription())
|
|
|
|
|
.eq(bo.getTotalWorkHours() != null, ErpAfterSales::getTotalWorkHours, bo.getTotalWorkHours())
|
|
|
|
|
.eq(bo.getTotalCost() != null, ErpAfterSales::getTotalCost, bo.getTotalCost())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getSolveStatus()), ErpAfterSales::getSolveStatus, bo.getSolveStatus())
|
|
|
|
|
.eq(bo.getCompletionDate() != null, ErpAfterSales::getCompletionDate, bo.getCompletionDate())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getProcessingResult()), ErpAfterSales::getProcessingResult, bo.getProcessingResult())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesStatus()), ErpAfterSales::getAfterSalesStatus, bo.getAfterSalesStatus())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getFlowStatus()), ErpAfterSales::getFlowStatus, bo.getFlowStatus())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ErpAfterSales::getActiveFlag, bo.getActiveFlag())
|
|
|
|
|
;
|
|
|
|
|
.selectAll(ErpAfterSales.class)
|
|
|
|
|
.eq(ErpAfterSales::getDelFlag, "0")
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesCode()), ErpAfterSales::getAfterSalesCode,
|
|
|
|
|
bo.getAfterSalesCode())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesSubject()), ErpAfterSales::getAfterSalesSubject,
|
|
|
|
|
bo.getAfterSalesSubject())
|
|
|
|
|
.eq(bo.getProjectId() != null, ErpAfterSales::getProjectId, bo.getProjectId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getProjectCode()), ErpAfterSales::getProjectCode, bo.getProjectCode())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getProjectName()), ErpAfterSales::getProjectName, bo.getProjectName())
|
|
|
|
|
.eq(bo.getCustomerId() != null, ErpAfterSales::getCustomerId, bo.getCustomerId())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getCustomerName()), ErpAfterSales::getCustomerName,
|
|
|
|
|
bo.getCustomerName())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getContactPerson()), ErpAfterSales::getContactPerson,
|
|
|
|
|
bo.getContactPerson())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getContactPhone()), ErpAfterSales::getContactPhone, bo.getContactPhone())
|
|
|
|
|
.eq(bo.getAfterSalesDate() != null, ErpAfterSales::getAfterSalesDate, bo.getAfterSalesDate())
|
|
|
|
|
.eq(bo.getContractId() != null, ErpAfterSales::getContractId, bo.getContractId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getContractCode()), ErpAfterSales::getContractCode, bo.getContractCode())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesType()), ErpAfterSales::getAfterSalesType,
|
|
|
|
|
bo.getAfterSalesType())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getStakeholderId()), ErpAfterSales::getStakeholderId,
|
|
|
|
|
bo.getStakeholderId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getHandlerId()), ErpAfterSales::getHandlerId, bo.getHandlerId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getProblemDescription()), ErpAfterSales::getProblemDescription,
|
|
|
|
|
bo.getProblemDescription())
|
|
|
|
|
.eq(bo.getTotalWorkHours() != null, ErpAfterSales::getTotalWorkHours, bo.getTotalWorkHours())
|
|
|
|
|
.eq(bo.getTotalCost() != null, ErpAfterSales::getTotalCost, bo.getTotalCost())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getSolveStatus()), ErpAfterSales::getSolveStatus, bo.getSolveStatus())
|
|
|
|
|
.eq(bo.getCompletionDate() != null, ErpAfterSales::getCompletionDate, bo.getCompletionDate())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getProcessingResult()), ErpAfterSales::getProcessingResult,
|
|
|
|
|
bo.getProcessingResult())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAfterSalesStatus()), ErpAfterSales::getAfterSalesStatus,
|
|
|
|
|
bo.getAfterSalesStatus())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getFlowStatus()), ErpAfterSales::getFlowStatus, bo.getFlowStatus())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ErpAfterSales::getActiveFlag, bo.getActiveFlag());
|
|
|
|
|
return lqw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -165,6 +176,11 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
ErpAfterSales add = MapstructUtils.convert(bo, ErpAfterSales.class);
|
|
|
|
|
|
|
|
|
|
validEntityBeforeSave(add);
|
|
|
|
|
// 自动生成售后编号
|
|
|
|
|
if (StringUtils.isBlank(add.getAfterSalesCode())) {
|
|
|
|
|
String afterSalesCode = remoteCodeRuleService.selectCodeRuleCode("1012");
|
|
|
|
|
add.setAfterSalesCode(afterSalesCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
|
|
|
bo.setAfterSalesId(add.getAfterSalesId()); // 将生成的 ID 回填给 BO
|
|
|
|
|
@ -174,14 +190,16 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
|
|
|
|
|
List<ErpAfterSalesLaborCostsBo> laborBoList = bo.getLaborCostsList();
|
|
|
|
|
if (CollUtil.isNotEmpty(laborBoList)) {
|
|
|
|
|
List<ErpAfterSalesLaborCosts> laborList = MapstructUtils.convert(laborBoList, ErpAfterSalesLaborCosts.class);
|
|
|
|
|
List<ErpAfterSalesLaborCosts> laborList = MapstructUtils.convert(laborBoList,
|
|
|
|
|
ErpAfterSalesLaborCosts.class);
|
|
|
|
|
laborList.forEach(item -> item.setAfterSalesId(afterSalesId));
|
|
|
|
|
laborCostsService.saveBatch(laborList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<ErpAfterSalesMaterialCostsBo> materialBoList = bo.getMaterialCostsList();
|
|
|
|
|
if (CollUtil.isNotEmpty(materialBoList)) {
|
|
|
|
|
List<ErpAfterSalesMaterialCosts> materialList = MapstructUtils.convert(materialBoList, ErpAfterSalesMaterialCosts.class);
|
|
|
|
|
List<ErpAfterSalesMaterialCosts> materialList = MapstructUtils.convert(materialBoList,
|
|
|
|
|
ErpAfterSalesMaterialCosts.class);
|
|
|
|
|
materialList.forEach(item -> item.setAfterSalesId(afterSalesId));
|
|
|
|
|
materialCostsService.saveBatch(materialList);
|
|
|
|
|
}
|
|
|
|
|
@ -205,15 +223,16 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
if (row > 0) {
|
|
|
|
|
Long afterSalesId = bo.getAfterSalesId();
|
|
|
|
|
|
|
|
|
|
// ================== 处理人员费用 ==================
|
|
|
|
|
// ================== 处理人员费用 ==================
|
|
|
|
|
// 先删除旧的
|
|
|
|
|
laborCostsService.remove(new LambdaQueryWrapper<ErpAfterSalesLaborCosts>()
|
|
|
|
|
.eq(ErpAfterSalesLaborCosts::getAfterSalesId, afterSalesId));
|
|
|
|
|
.eq(ErpAfterSalesLaborCosts::getAfterSalesId, afterSalesId));
|
|
|
|
|
|
|
|
|
|
// 后新增新的
|
|
|
|
|
List<ErpAfterSalesLaborCostsBo> laborBoList = bo.getLaborCostsList();
|
|
|
|
|
if (CollUtil.isNotEmpty(laborBoList)) {
|
|
|
|
|
List<ErpAfterSalesLaborCosts> laborList = MapstructUtils.convert(laborBoList, ErpAfterSalesLaborCosts.class);
|
|
|
|
|
List<ErpAfterSalesLaborCosts> laborList = MapstructUtils.convert(laborBoList,
|
|
|
|
|
ErpAfterSalesLaborCosts.class);
|
|
|
|
|
|
|
|
|
|
// 遍历列表,清空 ID
|
|
|
|
|
laborList.forEach(item -> {
|
|
|
|
|
@ -224,13 +243,14 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
laborCostsService.saveBatch(laborList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ================== 处理材料费用 ==================
|
|
|
|
|
// ================== 处理材料费用 ==================
|
|
|
|
|
materialCostsService.remove(new LambdaQueryWrapper<ErpAfterSalesMaterialCosts>()
|
|
|
|
|
.eq(ErpAfterSalesMaterialCosts::getAfterSalesId, afterSalesId));
|
|
|
|
|
.eq(ErpAfterSalesMaterialCosts::getAfterSalesId, afterSalesId));
|
|
|
|
|
|
|
|
|
|
List<ErpAfterSalesMaterialCostsBo> materialBoList = bo.getMaterialCostsList();
|
|
|
|
|
if (CollUtil.isNotEmpty(materialBoList)) {
|
|
|
|
|
List<ErpAfterSalesMaterialCosts> materialList = MapstructUtils.convert(materialBoList, ErpAfterSalesMaterialCosts.class);
|
|
|
|
|
List<ErpAfterSalesMaterialCosts> materialList = MapstructUtils.convert(materialBoList,
|
|
|
|
|
ErpAfterSalesMaterialCosts.class);
|
|
|
|
|
|
|
|
|
|
materialList.forEach(item -> {
|
|
|
|
|
item.setMaterialCostsId(null);
|
|
|
|
|
@ -246,8 +266,8 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
/**
|
|
|
|
|
* 保存前的数据校验
|
|
|
|
|
*/
|
|
|
|
|
private void validEntityBeforeSave(ErpAfterSales entity){
|
|
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
|
private void validEntityBeforeSave(ErpAfterSales entity) {
|
|
|
|
|
// TODO 做一些数据校验,如唯一约束
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -259,8 +279,8 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
|
if(isValid){
|
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
if (isValid) {
|
|
|
|
|
// TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
}
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|
}
|
|
|
|
|
@ -324,7 +344,7 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
TenantHelper.dynamic(processEvent.getTenantId(), () -> {
|
|
|
|
|
log.info("【售后流程监听】开始处理: key={}, status={}", processEvent.getFlowCode(), processEvent.getStatus());
|
|
|
|
|
|
|
|
|
|
// 根据 BusinessId 查询出当前的售后单
|
|
|
|
|
// 根据 BusinessId 查询出当前的售后单
|
|
|
|
|
Long afterSalesId = Convert.toLong(processEvent.getBusinessId());
|
|
|
|
|
ErpAfterSales afterSales = baseMapper.selectById(afterSalesId);
|
|
|
|
|
|
|
|
|
|
@ -333,10 +353,10 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 同步流程状态 (flow_status)
|
|
|
|
|
// 同步流程状态 (flow_status)
|
|
|
|
|
afterSales.setFlowStatus(processEvent.getStatus());
|
|
|
|
|
|
|
|
|
|
// 根据流程状态,更新业务状态 (after_sales_status)
|
|
|
|
|
// 根据流程状态,更新业务状态 (after_sales_status)
|
|
|
|
|
String status = processEvent.getStatus();
|
|
|
|
|
|
|
|
|
|
// A. 审批中
|
|
|
|
|
@ -349,12 +369,12 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
}
|
|
|
|
|
// C. 驳回 (Back) 或 撤销 (Cancel)
|
|
|
|
|
else if (BusinessStatusEnum.BACK.getStatus().equals(status)
|
|
|
|
|
|| BusinessStatusEnum.CANCEL.getStatus().equals(status)) {
|
|
|
|
|
|| BusinessStatusEnum.CANCEL.getStatus().equals(status)) {
|
|
|
|
|
afterSales.setAfterSalesStatus("0");
|
|
|
|
|
}
|
|
|
|
|
// D. 作废 (Invalid) 或 终止 (Termination)
|
|
|
|
|
else if (BusinessStatusEnum.INVALID.getStatus().equals(status)
|
|
|
|
|
|| BusinessStatusEnum.TERMINATION.getStatus().equals(status)) {
|
|
|
|
|
|| BusinessStatusEnum.TERMINATION.getStatus().equals(status)) {
|
|
|
|
|
afterSales.setAfterSalesStatus("0");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -363,5 +383,4 @@ public class ErpAfterSalesServiceImpl implements IErpAfterSalesService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|