|
|
|
@ -61,6 +61,8 @@ public class CrmsCompanyPersonalController { |
|
|
|
|
@PostMapping("/insertCompanyPersonal") |
|
|
|
|
@ApiOperation(value = "新增个人/企业关联人") |
|
|
|
|
public ResponseResult insertCompanyPersonal(@RequestBody @Valid CrmsCompanyPersonalReq personal) { |
|
|
|
|
CrmsCompanyPersonal crmsCompanyPersonal = new CrmsCompanyPersonal(); |
|
|
|
|
if(personal.getRegisteredTime() !=null){ |
|
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
Date parse = null; |
|
|
|
|
try { |
|
|
|
@ -68,9 +70,12 @@ public class CrmsCompanyPersonalController { |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
CrmsCompanyPersonal crmsCompanyPersonal = new CrmsCompanyPersonal(); |
|
|
|
|
BeanUtils.copyProperties(personal,crmsCompanyPersonal); |
|
|
|
|
crmsCompanyPersonal.setRegisteredTime(parse); |
|
|
|
|
}else{ |
|
|
|
|
BeanUtils.copyProperties(personal,crmsCompanyPersonal); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean result = crmsCompanyPersonalService.save(crmsCompanyPersonal); |
|
|
|
|
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); |
|
|
|
|
crmsCustomerRelated.setRelatedId(crmsCompanyPersonal.getId().intValue());//关联人Id
|
|
|
|
@ -96,6 +101,8 @@ public class CrmsCompanyPersonalController { |
|
|
|
|
@PostMapping("/updateCompanyPersonal") |
|
|
|
|
@ApiOperation(value = "编辑个人/企业关联人") |
|
|
|
|
public ResponseResult updateCompanyPersonal(@RequestBody CrmsCompanyPersonalReq personal){ |
|
|
|
|
CrmsCompanyPersonal crmsCompanyPersonal = new CrmsCompanyPersonal(); |
|
|
|
|
if(personal.getRegisteredTime() !=null){ |
|
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
Date parse = null; |
|
|
|
|
try { |
|
|
|
@ -103,9 +110,11 @@ public class CrmsCompanyPersonalController { |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
CrmsCompanyPersonal crmsCompanyPersonal = new CrmsCompanyPersonal(); |
|
|
|
|
BeanUtils.copyProperties(personal,crmsCompanyPersonal); |
|
|
|
|
crmsCompanyPersonal.setRegisteredTime(parse); |
|
|
|
|
}else{ |
|
|
|
|
BeanUtils.copyProperties(personal,crmsCompanyPersonal); |
|
|
|
|
} |
|
|
|
|
boolean result = crmsCompanyPersonalService.updateById(crmsCompanyPersonal); |
|
|
|
|
return result ? ResponseResult.SUCCESS(crmsCompanyPersonal) : ResponseResult.FAIL(); |
|
|
|
|
} |
|
|
|
|