diff --git a/coolstore-partner-model/src/main/java/com/cool/store/request/JoinIntentionRequest.java b/coolstore-partner-model/src/main/java/com/cool/store/request/JoinIntentionRequest.java index 48379092a..3cbf1795d 100644 --- a/coolstore-partner-model/src/main/java/com/cool/store/request/JoinIntentionRequest.java +++ b/coolstore-partner-model/src/main/java/com/cool/store/request/JoinIntentionRequest.java @@ -4,14 +4,18 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotBlank; + @Data @ApiModel("加盟意向Request") public class JoinIntentionRequest { @ApiModelProperty("线索信息表-线索id") + @NotBlank(message = "线索id不能为空") private Long lineId; @ApiModelProperty("用户信息表partnerId") + @NotBlank(message = "partnerId不能为空") private String partnerId; @ApiModelProperty("加盟身份 1个人加盟 2企业加盟") diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/JoinIntentionServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/JoinIntentionServiceImpl.java index 7d99df2ee..0ba52390f 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/JoinIntentionServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/JoinIntentionServiceImpl.java @@ -8,6 +8,7 @@ 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 lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -15,6 +16,7 @@ import javax.annotation.Resource; import java.util.Objects; @Service +@Slf4j public class JoinIntentionServiceImpl implements JoinIntentionService { @Resource @@ -33,6 +35,9 @@ public class JoinIntentionServiceImpl implements JoinIntentionService { if (submitStatus){ //更改线索流程子状态为【待审核】 LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId()); + if (Objects.isNull(lineInfoDO)){ + throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST); + } lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode()); lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO); } diff --git a/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniJoinIntentionController.java b/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniJoinIntentionController.java index 448c511c2..1a88ea612 100644 --- a/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniJoinIntentionController.java +++ b/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniJoinIntentionController.java @@ -8,10 +8,12 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.validation.Valid; @RestController @RequestMapping({"/mini/JoinIntention"}) @@ -24,7 +26,7 @@ public class MiniJoinIntentionController { @PostMapping(path = "/getOpenAreaList") @ApiOperation("填写加盟意向申请书") - public ResponseResult submit(JoinIntentionRequest request) { + public ResponseResult submit(@RequestBody @Valid JoinIntentionRequest request) { return ResponseResult.success(joinIntentionService.submit(request)); } }