|
|
|
@ -78,19 +78,30 @@ public class EtcCustomerController { |
|
|
|
|
@RequestMapping(value = "insertCustomer" , method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "新增客户基本信息") |
|
|
|
|
public ResponseData insertCustomer(@RequestBody EtcCustMsg etcCustMsg , HttpServletRequest request) { |
|
|
|
|
public ResponseData insertCustomer(@RequestBody JSONObject body , HttpServletRequest request) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
if (etcCustMsg == null |
|
|
|
|
|| etcCustMsg.getPhone() == null |
|
|
|
|
if (body == null |
|
|
|
|
|| body.getString("phone") == null |
|
|
|
|
|| body.getString("vehPlateNo") == null |
|
|
|
|
|| body.getInteger("vehPlateColor") == null |
|
|
|
|
) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject object = EtcService.checkVehPlateNo(body.getString("vehPlateNo") , body.getString("vehPlateColor")); |
|
|
|
|
|
|
|
|
|
if (!Objects.equals(object.getString("errCode"), "0")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EtcCustMsg etcCustMsg = new EtcCustMsg(); |
|
|
|
|
|
|
|
|
|
etcCustMsg.setUserId(userInfoModel.getSecUser().getId()); |
|
|
|
|
etcCustMsg.setPhone(body.getString("phone")); |
|
|
|
|
etcCustMsg.setUserName(userInfoModel.getSecUser().getUserName()); |
|
|
|
|
etcCustMsg.setCreateTime(new Date()); |
|
|
|
|
etcCustMsg.setUpdateTime(new Date()); |
|
|
|
@ -106,6 +117,18 @@ public class EtcCustomerController { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前用户已存在,请勿重复提交!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EtcCarMsg carMsg = new EtcCarMsg(); |
|
|
|
|
|
|
|
|
|
carMsg.setUpdateTime(new Date()); |
|
|
|
|
carMsg.setCreateTime(new Date()); |
|
|
|
|
carMsg.setUserId(userInfoModel.getSecUser().getId()); |
|
|
|
|
carMsg.setUserName(userInfoModel.getSecUser().getUserName()); |
|
|
|
|
carMsg.setVehStatus(11); |
|
|
|
|
carMsg.setVehPlateNo(body.getString("vehPlateNo")); |
|
|
|
|
carMsg.setVehPlateColor(body.getInteger("vehPlateColor")); |
|
|
|
|
|
|
|
|
|
etcCarMsgService.addEtcCar(carMsg); |
|
|
|
|
|
|
|
|
|
etcCustMsgService.insertEtcCust(etcCustMsg); |
|
|
|
|
return ResponseMsgUtil.success(etcCustMsg.getId()); |
|
|
|
|
|
|
|
|
@ -131,7 +154,7 @@ public class EtcCustomerController { |
|
|
|
|
@RequestMapping(value = "editCustomer" , method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "编辑客户基本信息") |
|
|
|
|
public ResponseData editCustomer(@RequestBody EtcCustMsg etcCustMsg , HttpServletRequest request) { |
|
|
|
|
public ResponseData editCustomer(@RequestBody EtcCustMsg etcCustMsg) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
if (etcCustMsg == null |
|
|
|
@ -232,7 +255,6 @@ public class EtcCustomerController { |
|
|
|
|
etcCarMsg.setUserName(userInfoModel.getSecUser().getUserName()); |
|
|
|
|
|
|
|
|
|
etcCarMsg.setUpdateTime(new Date()); |
|
|
|
|
etcCarMsg.setVehStatus(11); |
|
|
|
|
|
|
|
|
|
etcCarMsgService.insertEtcCar(etcCarMsg); |
|
|
|
|
return ResponseMsgUtil.success(etcCarMsg.getExt1()); |
|
|
|
@ -381,8 +403,6 @@ public class EtcCustomerController { |
|
|
|
|
public ResponseData queryActivateVehicleInfoPage() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject object = EtcService.queryActivateVehicleInfoPage(DateUtil.format(DateUtil.reduceDate(new Date() , 2) , "yyyy-MM-dd HH:mm:ss") , DateUtil.format(new Date() , "yyyy-MM-dd HH:mm:ss") ); |
|
|
|
|
|
|
|
|
|
if (Objects.equals(object.getString("errCode"), "0") && object.getJSONObject("result").getJSONArray("records") != null) { |
|
|
|
@ -396,6 +416,7 @@ public class EtcCustomerController { |
|
|
|
|
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(map); |
|
|
|
|
carMsg.setCardNo(jsonArray.getJSONObject(i).getString("cardNo")); |
|
|
|
|
carMsg.setObuNo(jsonArray.getJSONObject(i).getString("obuNo")); |
|
|
|
|
carMsg.setObuNo(jsonArray.getJSONObject(i).getString("obuNo")); |
|
|
|
|
|
|
|
|
|
etcCarMsgService.updateEtcCar(carMsg); |
|
|
|
|
|
|
|
|
|