|
@@ -179,8 +179,23 @@ public class CaseController {
|
|
|
|
|
|
@PostMapping("/addOrUpdate")
|
|
|
public ResultData addOrUpdate(@RequestBody CaseParam param){
|
|
|
-
|
|
|
- caseService.addOrUpdate(param);
|
|
|
+ if(param.getCaseId() != null){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ JyUser jyUser = jyUserService.getBySysId(StpUtil.getLoginId());
|
|
|
+ if(jyUser == null){
|
|
|
+ throw new BusinessException(ResultCode.USER_NOT_EXIST);
|
|
|
+ }
|
|
|
+ Case caseEntity = new Case();
|
|
|
+ caseEntity.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
+ caseEntity.setPlatformId(jyUser.getPlatformId());
|
|
|
+ caseEntity.setUserName((String)StpUtil.getExtra("userName"));
|
|
|
+ caseEntity.setCaseTitle(param.getCaseTitle());
|
|
|
+ caseService.save(caseEntity);
|
|
|
+
|
|
|
+ for (CaseNumType caseNumType : param.getSceneNumParam()) {
|
|
|
+ caseNumService.add(caseEntity.getCaseId(),caseNumType);
|
|
|
+ }
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|