|
|
|
@ -17,12 +17,10 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import java.text.DateFormat; |
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -61,15 +59,16 @@ public class CrmsCompanyPersonalController { |
|
|
|
|
@PostMapping("/insertCompanyPersonal") |
|
|
|
|
@ApiOperation(value = "新增个人/企业关联人") |
|
|
|
|
public ResponseResult insertCompanyPersonal(@RequestBody @Valid CrmsCompanyPersonal crmsCompanyPersonal) { |
|
|
|
|
String dateStr = crmsCompanyPersonal.getRegisteredTime().toString(); |
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
Date d = null; |
|
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
String format = sdf.format(crmsCompanyPersonal.getRegisteredTime()); |
|
|
|
|
Date parse = null; |
|
|
|
|
try { |
|
|
|
|
d = sdf.parse(dateStr); |
|
|
|
|
parse = sdf.parse(format); |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
crmsCompanyPersonal.setRegisteredTime(d); |
|
|
|
|
|
|
|
|
|
crmsCompanyPersonal.setRegisteredTime(parse); |
|
|
|
|
boolean result = crmsCompanyPersonalService.save(crmsCompanyPersonal); |
|
|
|
|
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); |
|
|
|
|
crmsCustomerRelated.setRelatedId(crmsCompanyPersonal.getId().intValue());//关联人Id
|
|
|
|
@ -95,6 +94,15 @@ public class CrmsCompanyPersonalController { |
|
|
|
|
@PostMapping("/updateCompanyPersonal") |
|
|
|
|
@ApiOperation(value = "编辑个人/企业关联人") |
|
|
|
|
public ResponseResult updateCompanyPersonal(@RequestBody CrmsCompanyPersonal crmsCompanyPersonal){ |
|
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
String format = sdf.format(crmsCompanyPersonal.getRegisteredTime()); |
|
|
|
|
Date parse = null; |
|
|
|
|
try { |
|
|
|
|
parse = sdf.parse(format); |
|
|
|
|
} catch (ParseException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
crmsCompanyPersonal.setRegisteredTime(parse); |
|
|
|
|
boolean result = crmsCompanyPersonalService.updateById(crmsCompanyPersonal); |
|
|
|
|
return result ? ResponseResult.SUCCESS(crmsCompanyPersonal) : ResponseResult.FAIL(); |
|
|
|
|
} |
|
|
|
|