加盟意向-修改线索状态

This commit is contained in:
guohb
2024-03-22 15:18:13 +08:00
parent eac8231512
commit dc6f7abb8f
2 changed files with 18 additions and 4 deletions

View File

@@ -1,11 +1,15 @@
package com.cool.store.service.impl;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.JoinIntentionRequest;
import com.cool.store.service.JoinIntentionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Objects;
@@ -16,11 +20,22 @@ public class JoinIntentionServiceImpl implements JoinIntentionService {
@Resource
JoinIntentionMapper joinIntentionMapper;
@Resource
LineInfoMapper lineInfoMapper;
@Override
@Transactional
public boolean submit(JoinIntentionRequest request) {
if (Objects.isNull(request)){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
return joinIntentionMapper.insert(request);
boolean submitStatus = joinIntentionMapper.insert(request);
if (submitStatus){
//更改线索流程子状态为【待审核】
LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
}
return Boolean.TRUE;
}
}

View File

@@ -24,8 +24,7 @@ public class MiniJoinIntentionController {
@PostMapping(path = "/getOpenAreaList")
@ApiOperation("填写加盟意向申请书")
public ResponseResult submit(JoinIntentionRequest request) {
joinIntentionService.submit(request);
return ResponseResult.success();
public ResponseResult<Boolean> submit(JoinIntentionRequest request) {
return ResponseResult.success(joinIntentionService.submit(request));
}
}