Merge branch 'new-dev' into 2.0-dev

# Conflicts:
#	hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java
#	hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java
master
袁野 8 months ago
parent 935f495a1c
commit d752345fb2
  1. 113
      hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java
  2. 15
      hai-bweb/src/main/java/com/bweb/controller/Etc/OcrController.java
  3. 11
      hai-bweb/src/main/java/com/bweb/controller/FileUploadController.java
  4. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  5. 344
      hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java
  6. 8
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  7. 7
      hai-service/pom.xml
  8. 20
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  9. 3
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  10. 270
      hai-service/src/main/java/com/hai/config/EtcService.java
  11. 16
      hai-service/src/main/java/com/hai/config/WxMaConfiguration.java
  12. 5
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java
  13. 158
      hai-service/src/main/java/com/hai/dao/EtcContractOrderMapper.java
  14. 7
      hai-service/src/main/java/com/hai/dao/EtcContractOrderMapperExt.java
  15. 444
      hai-service/src/main/java/com/hai/dao/EtcContractOrderSqlProvider.java
  16. 369
      hai-service/src/main/java/com/hai/entity/EtcContractOrder.java
  17. 1533
      hai-service/src/main/java/com/hai/entity/EtcContractOrderExample.java
  18. 45
      hai-service/src/main/java/com/hai/enum_type/EtcProductEnum.java
  19. 43
      hai-service/src/main/java/com/hai/enum_type/EtcVarietyEnum.java
  20. 47
      hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java
  21. 3
      hai-service/src/main/java/com/hai/etc/EtcCustMsgService.java
  22. 103
      hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java
  23. 27
      hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java
  24. 17
      hai-service/src/main/java/com/hai/ocr/AliYunOcrService.java
  25. 1
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  26. 26
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  27. 40
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  28. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  29. 1
      hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java
  30. 1
      hai-service/src/main/java/com/hai/order/type/OrderProductType.java
  31. 1
      hai-service/src/main/java/com/hai/order/type/PlatformType.java
  32. 16
      hai-service/src/main/java/com/hai/order/utils/OrderUtil.java
  33. 18
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  34. 7
      hai-service/src/main/resources/dev/commonConfig.properties
  35. 5
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  36. 5
      hai-service/src/main/resources/prod/commonConfig.properties

@ -15,6 +15,7 @@ import com.hai.etc.EtcCarMsgService;
import com.hai.etc.EtcCustMsgService; import com.hai.etc.EtcCustMsgService;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.service.CommonService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -23,10 +24,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping(value="/etcCustomer") @RequestMapping(value="/etcCustomer")
@ -44,6 +42,9 @@ public class EtcCustomerController {
@Resource @Resource
private EtcCarMsgService etcCarMsgService; private EtcCarMsgService etcCarMsgService;
@Resource
private CommonService commonService;
@RequestMapping(value = "/getEtcCustList", method = RequestMethod.GET) @RequestMapping(value = "/getEtcCustList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询用户列表") @ApiOperation(value = "查询用户列表")
@ -56,7 +57,7 @@ public class EtcCustomerController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>(5); Map<String, Object> map = new HashMap<>();
map.put("userId", userInfoModel.getSecUser().getId()); map.put("userId", userInfoModel.getSecUser().getId());
map.put("custName", custName); map.put("custName", custName);
@ -92,8 +93,18 @@ public class EtcCustomerController {
etcCustMsg.setUpdateTime(new Date()); etcCustMsg.setUpdateTime(new Date());
etcCustMsg.setStatus(0); etcCustMsg.setStatus(0);
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("phone" , etcCustMsg.getPhone());
EtcCustMsg custMsg = etcCustMsgService.findEtcCustByMap(mapUser);
if (custMsg != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前用户已存在,请勿重复提交!");
}
etcCustMsgService.insertEtcCust(etcCustMsg); etcCustMsgService.insertEtcCust(etcCustMsg);
return ResponseMsgUtil.success("成功"); return ResponseMsgUtil.success(etcCustMsg.getId());
} catch (Exception e) { } catch (Exception e) {
log.error("BsMsgController --> insertMsg() error!", e); log.error("BsMsgController --> insertMsg() error!", e);
@ -121,6 +132,7 @@ public class EtcCustomerController {
try { try {
if (etcCustMsg == null if (etcCustMsg == null
|| etcCustMsg.getId() == null
|| etcCustMsg.getBankPhone() == null || etcCustMsg.getBankPhone() == null
|| etcCustMsg.getAccountNo() == null || etcCustMsg.getAccountNo() == null
|| etcCustMsg.getAddress() == null || etcCustMsg.getAddress() == null
@ -134,7 +146,26 @@ public class EtcCustomerController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("custIdNo" , etcCustMsg.getCustIdNo());
EtcCustMsg custMsgNo = etcCustMsgService.findEtcCustByMap(mapUser);
if (custMsgNo != null) {
if (!Objects.equals(custMsgNo.getId(), etcCustMsg.getId()) && Objects.equals(etcCustMsg.getCustIdNo(), custMsgNo.getCustIdNo())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "身份证号已经存在!");
}
}
EtcCustMsg custMsg = etcCustMsgService.findEtcCustById(etcCustMsg.getId());
etcCustMsg.setUserId(custMsg.getUserId());
etcCustMsg.setUserName(custMsg.getUserName());
etcCustMsg.setPhone(custMsg.getPhone());
etcCustMsg.setCustId(custMsg.getCustId());
etcCustMsg.setUpdateTime(new Date()); etcCustMsg.setUpdateTime(new Date());
etcCustMsg.setCreateTime(custMsg.getCreateTime());
etcCustMsgService.updateEtcCust(etcCustMsg); etcCustMsgService.updateEtcCust(etcCustMsg);
return ResponseMsgUtil.success("成功"); return ResponseMsgUtil.success("成功");
@ -147,7 +178,7 @@ public class EtcCustomerController {
@RequestMapping(value = "editCarMsg" , method = RequestMethod.POST) @RequestMapping(value = "editCarMsg" , method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "编辑基本信息") @ApiOperation(value = "编辑车辆信息")
public ResponseData editCarMsg(@RequestBody EtcCarMsg etcCarMsg , HttpServletRequest request) { public ResponseData editCarMsg(@RequestBody EtcCarMsg etcCarMsg , HttpServletRequest request) {
try { try {
@ -170,14 +201,38 @@ public class EtcCustomerController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
if (etcCarMsg.getId() != null) {
EtcCarMsg carMsg = etcCarMsgService.findEtcCarById(etcCarMsg.getId());
etcCarMsg.setCreateTime(carMsg.getCreateTime());
etcCarMsg.setVehId(carMsg.getVehId());
} else {
etcCarMsg.setCreateTime(new Date());
}
Map<String , Object> map = new HashMap<>();
map.put("vehPlateNo" , etcCarMsg.getVehPlateNo());
map.put("vehPlateColor" , etcCarMsg.getVehPlateColor());
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(map);
if (carMsg != null) {
etcCarMsg.setId(carMsg.getId());
}
// 查询车辆类型
SecDictionary carType = commonService.mappingSysCode("CAR_TYPE", etcCarMsg.getVehType());
etcCarMsg.setUserId(userInfoModel.getSecUser().getId()); etcCarMsg.setUserId(userInfoModel.getSecUser().getId());
etcCarMsg.setVehTypeName(carType.getCodeName());
etcCarMsg.setUserName(userInfoModel.getSecUser().getUserName()); etcCarMsg.setUserName(userInfoModel.getSecUser().getUserName());
etcCarMsg.setUpdateTime(new Date()); etcCarMsg.setUpdateTime(new Date());
etcCarMsg.setVehStatus(11); etcCarMsg.setVehStatus(11);
etcCarMsgService.insertEtcCar(etcCarMsg); etcCarMsgService.insertEtcCar(etcCarMsg);
return ResponseMsgUtil.success("成功"); return ResponseMsgUtil.success(etcCarMsg.getExt1());
} catch (Exception e) { } catch (Exception e) {
log.error("BsMsgController --> insertMsg() error!", e); log.error("BsMsgController --> insertMsg() error!", e);
@ -196,11 +251,28 @@ public class EtcCustomerController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>(5); Map<String, Object> map = new HashMap<>();
map.put("userId", userInfoModel.getSecUser().getId()); map.put("userId", userInfoModel.getSecUser().getId());
map.put("vehPlateNo", vehPlateNo); map.put("vehPlateNo", vehPlateNo);
List<EtcCarMsg> list = etcCarMsgService.getEtcCarList(map);
for (EtcCarMsg etcCarMsg :list) {
JSONObject car = EtcService.getVehStatus(etcCarMsg);
if (car.getString("errCode").equals("0")) {
if (car.getJSONObject("result").getInteger("vehStatus") == 11) {
etcCarMsg.setVehStatus(13);
} else {
etcCarMsg.setVehStatus(car.getJSONObject("result").getInteger("vehStatus"));
}
etcCarMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus"));
etcCarMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus"));
etcCarMsg.setExt2(car.getJSONObject("result").getString("docException"));
}
}
return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map)); return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map));
} catch (Exception e) { } catch (Exception e) {
@ -251,6 +323,9 @@ public class EtcCustomerController {
JSONObject object = EtcService.checkRealNameCode(etcCustMsg.getCustId() , verifyCode); JSONObject object = EtcService.checkRealNameCode(etcCustMsg.getCustId() , verifyCode);
if (object.getString("errCode").equals("0")) { if (object.getString("errCode").equals("0")) {
etcCustMsg.setStatus(2);
etcCustMsg.setUpdateTime(new Date());
etcCustMsgService.updateEtcCust(etcCustMsg);
return ResponseMsgUtil.success("请求成功!"); return ResponseMsgUtil.success("请求成功!");
} }
@ -262,6 +337,10 @@ public class EtcCustomerController {
} }
} }
@RequestMapping(value = "/findByCarMsg", method = RequestMethod.GET) @RequestMapping(value = "/findByCarMsg", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "根据id查询详情") @ApiOperation(value = "根据id查询详情")
@ -276,4 +355,20 @@ public class EtcCustomerController {
} }
} }
@RequestMapping(value = "/getVehStatus", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
public ResponseData getVehStatus(@RequestParam(value = "id", required = true) Long id) {
try {
EtcCarMsg carMsg = etcCarMsgService.findEtcCarById(id);
return ResponseMsgUtil.success(EtcService.getVehStatus(carMsg));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -25,9 +25,6 @@ public class OcrController {
private static Logger log = LoggerFactory.getLogger(OcrController.class); private static Logger log = LoggerFactory.getLogger(OcrController.class);
@Resource
private UserCenter userCenter;
@RequestMapping(value="/recognizeIdCard",method = RequestMethod.GET) @RequestMapping(value="/recognizeIdCard",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "身份证识别") @ApiOperation(value = "身份证识别")
@ -75,4 +72,16 @@ public class OcrController {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value="/recognizeVehicleLicense",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "行驶证识别")
public ResponseData recognizeVehicleLicense(@RequestParam(name = "url", required = true) String url) {
try {
return ResponseMsgUtil.success(AliYunOcrService.recognizeVehicleLicense(CommonSysConst.getSysConfig().getFilesystem()+ url));
} catch (Exception e) {
log.error("recognizeBusinessLicense error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -7,6 +7,7 @@ import com.hai.model.ResponseData;
import com.hai.service.FileUploadService; import com.hai.service.FileUploadService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import net.coobird.thumbnailator.Thumbnails;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -18,7 +19,9 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.*; import java.util.*;
@RestController @RestController
@ -69,6 +72,14 @@ public class FileUploadController {
out.write(file.getBytes()); out.write(file.getBytes());
out.flush(); out.flush();
fileNames.add(childPath + "/" + fileName); fileNames.add(childPath + "/" + fileName);
// 图片压缩
InputStream fis = new FileInputStream(destDirName + File.separator + fileName);
System.out.println("图片上传大小" + fis.available());
if (fis.available() > 500000) {
Thumbnails.of(new FileInputStream(destDirName + File.separator + fileName)).scale(0.5).toFile(new File(destDirName + File.separator + fileName));
}
System.out.println("图片上传日志" + childPath + "/" + fileName);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} finally { } finally {

File diff suppressed because one or more lines are too long

@ -0,0 +1,344 @@
package com.cweb.controller.Etc;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.EtcService;
import com.hai.entity.EtcCarMsg;
import com.hai.entity.EtcContractOrder;
import com.hai.entity.EtcCustMsg;
import com.hai.entity.SecDictionary;
import com.hai.etc.EtcCarMsgService;
import com.hai.etc.EtcCustMsgService;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@RestController
@RequestMapping(value="/etcCustomer")
@Api(value="etc客户信息")
public class EtcCustomerController {
Logger log = LoggerFactory.getLogger(EtcCustomerController.class);
@Resource
private UserCenter userCenter;
@Resource
private EtcCustMsgService etcCustMsgService;
@Resource
private EtcCarMsgService etcCarMsgService;
@RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询车辆列表")
public ResponseData getEtcCarList(
HttpServletRequest request
) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("phone" , userInfoModel.getHighUser().getPhone());
mapUser.put("status" , 2);
EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustByMap(mapUser);
if (etcCustMsg == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到任何车辆!");
}
Map<String, Object> map = new HashMap<>();
map.put("custId" , etcCustMsg.getCustId());
return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map));
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getEtcContractOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询合同订单列表")
public ResponseData getEtcContractOrderList(
@RequestParam(value = "signStatus", required = false) String signStatus, HttpServletRequest request
) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("phone" , userInfoModel.getHighUser().getPhone());
mapUser.put("status" , 2);
EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustByMap(mapUser);
if (etcCustMsg == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到合同!");
}
Map<String, Object> map = new HashMap<>();
map.put("custId" , etcCustMsg.getCustId());
map.put("signStatus" , signStatus);
map.put("status" , 1);
return ResponseMsgUtil.success(etcCarMsgService.getEtcContractOrderList(map));
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/findContractOrderById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询合同订单详情")
public ResponseData findContractOrderById(
@RequestParam(value = "id", required = false) Long id
) {
try {
return ResponseMsgUtil.success(etcCarMsgService.findContractOrderById(id));
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/sendSignVerifyCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "签约验证码发送接口")
public ResponseData sendSignVerifyCode(@RequestParam(value = "id", required = true) Long id) {
try {
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(id);
if (contractOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!");
}
JSONObject object = EtcService.sendSignVerifyCode(contractOrder.getCustId());
if (object.getString("errCode").equals("0")) {
return ResponseMsgUtil.success("请求成功!");
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/checkSignVerifyCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "签约验证码核验接口")
public ResponseData checkSignVerifyCode(@RequestParam(value = "id", required = true) Long id ,
@RequestParam(value = "signImg", required = true) String signImg ,
@RequestParam(value = "verifyCode", required = true) String verifyCode ) {
try {
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(id);
if (contractOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!");
}
contractOrder.setSignImg(signImg);
contractOrder.setUpdateTime(new Date());
etcCarMsgService.updateContractOrder(contractOrder);
JSONObject object = EtcService.checkSignVerifyCode(contractOrder.getCustId() , verifyCode);
if (object.getString("errCode").equals("0")) {
Map<String , Object> mapCar = new HashMap<>();
mapCar.put("vehId" , contractOrder.getVehId());
mapCar.put("custId" , contractOrder.getCustId());
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(mapCar);
carMsg.setSignStatus(1);
carMsg.setUpdateTime(new Date());
carMsg.setVehStatus(15);
etcCarMsgService.updateEtcCar(carMsg);
contractOrder.setSignStatus(1);
etcCarMsgService.updateContractOrder(contractOrder);
return ResponseMsgUtil.success("请求成功!");
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getSignContractTemplate", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取签约合同模板")
public ResponseData getSignContractTemplate(@RequestParam(value = "contractId", required = true) Long contractId ) {
try {
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId);
if (contractOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!");
}
JSONObject object = EtcService.getSignContractTemplate(contractOrder.getCustId() , contractOrder.getProductId() , contractOrder.getCardVarietyId());
if (object.getString("errCode").equals("0")) {
JSONObject jsonObject = (JSONObject) object.getJSONArray("result").get(0);
return ResponseMsgUtil.success(jsonObject.getString("url"));
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/checkNeedSign", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查看是否需要签约代扣")
public ResponseData checkNeedSign(@RequestParam(value = "contractId", required = true) Long contractId,
@RequestParam(value = "type", required = true) Integer type) {
try {
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId);
if (type == 1) {
JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId());
if (object.getString("errCode").equals("0")) {
return ResponseMsgUtil.success(object.getJSONObject("result"));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg"));
}
} else {
JSONObject object = EtcService.checkSignWithhold( contractOrder.getCustId());
if (object.getString("errCode").equals("0")) {
if (object.getJSONObject("result").getBoolean("isSign")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已签约");
}
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg"));
}
}
return ResponseMsgUtil.success(true);
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/sendSignWithholdCode", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "签约银行卡代扣发送验证码")
public ResponseData sendSignWithholdCode(@RequestBody JSONObject object, HttpServletRequest request) {
try {
if (object.getString("custId") == null ||
object.getString("cardNo") == null ||
object.getInteger("bankCardType") == null ||
object.getString("mobileNo") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信息不全!");
}
if (object.getInteger("bankCardType") == 2 ) {
if (object.getString("cardExpired") == null ||
object.getString("cardCvv2") == null ) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信用卡信息不全!");
}
}
JSONObject jsonObject = EtcService.sendSignWithholdCode(object);
if (jsonObject.getString("errCode").equals("0")) {
return ResponseMsgUtil.success(jsonObject.getJSONObject("result").getString("verifyCodeNo"));
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/signWithhold", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "签约银行卡代扣")
public ResponseData signWithhold(@RequestBody JSONObject object, HttpServletRequest request) {
try {
if (object.getString("custId") == null ||
object.getString("cardNo") == null ||
object.getInteger("bankCardType") == null ||
object.getString("bankName") == null ||
object.getString("verifyCodeNo") == null ||
object.getString("verifyCode") == null ||
object.getString("mobileNo") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信息不全!");
}
if (object.getInteger("bankCardType") == 2 ) {
if (object.getString("cardExpired") == null ||
object.getString("cardCvv2") == null ) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信用卡信息不全!");
}
}
JSONObject jsonObject = EtcService.signWithhold(object);
if (jsonObject.getString("errCode").equals("0")) {
return ResponseMsgUtil.success("请求成功");
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errMsg"));
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -150,7 +150,13 @@ public class OrderPayController {
} else { } else {
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MINI); // 黔印象小程序 weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MINI); // 黔印象小程序
} }
} else if (PlatformType.TYPE3.getNumber().equals(body.getInteger("platformType"))) {
if (openIdType != null && openIdType.equals(2)) {
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 黔印象公众号
} else { } else {
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_ZXJZ_MINI); // 黔印象小程序
}
}else {
if (openIdType != null && openIdType.equals(2)) { if (openIdType != null && openIdType.equals(2)) {
weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 商户号公众号 weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 商户号公众号
} else { } else {
@ -375,6 +381,8 @@ public class OrderPayController {
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE17.getNumber())) { } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE17.getNumber())) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
} else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE20.getNumber())) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195);
} else { } else {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1609882817); weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1609882817);
} }

@ -351,6 +351,7 @@
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
</dependency> </dependency>
<!-- 微信支付API v3--> <!-- 微信支付API v3-->
<dependency> <dependency>
<groupId>com.github.wechatpay-apiv3</groupId> <groupId>com.github.wechatpay-apiv3</groupId>
@ -358,11 +359,7 @@
<version>0.4.9</version> <version>0.4.9</version>
</dependency> </dependency>
<!-- 华为云sdk--> <!-- 华为云sdk-->
<dependency>
<groupId>com.huaweicloud.sdk</groupId>
<artifactId>huaweicloud-sdk-sis</artifactId>
<version>3.1.42</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>

@ -667,4 +667,24 @@ public class WxUtils {
} }
public static String generateSignByEtc(Map<String , Object> map , String key) throws Exception {
Set<String> keySet = map.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN) || k.equals("key")) {
continue;
}
if (map.get(k) != null) // 参数值为空,则不参与签名
{
sb.append(k).append("=").append(map.get(k)).append("&");
}
}
sb.append("key=").append(key);
return sb.toString();
}
} }

@ -132,6 +132,9 @@ public class CommonSysConfig {
private String wxQyxAppId; private String wxQyxAppId;
private String wxQyxAppSecret; private String wxQyxAppSecret;
private String wxZxjzAppId;
private String wxZxjzAppSecret;
private String wxH5AppId; private String wxH5AppId;
private String wxH5AppSecret; private String wxH5AppSecret;

@ -8,6 +8,10 @@ import com.hai.entity.EtcCustMsg;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
@ -33,27 +37,27 @@ public class EtcService {
*/ */
public static JSONObject submitCustInfo(EtcCustMsg etcCustMsg) throws Exception { public static JSONObject submitCustInfo(EtcCustMsg etcCustMsg) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(String.valueOf(System.currentTimeMillis())));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("custName" , etcCustMsg.getCustName()); jsonObject.put("custName" , etcCustMsg.getCustName());
jsonObject.put("custIdNo" , etcCustMsg.getCustIdNo()); jsonObject.put("custIdNo" , etcCustMsg.getCustIdNo());
jsonObject.put("accountNo" , etcCustMsg.getAccountNo()); jsonObject.put("accountNo" , etcCustMsg.getAccountNo());
jsonObject.put("bankName" , etcCustMsg.getBankName()); jsonObject.put("bankName" , etcCustMsg.getBankName());
jsonObject.put("address" , etcCustMsg.getAddress()); jsonObject.put("address" , etcCustMsg.getAddress());
jsonObject.put("phone" , etcCustMsg.getPhone()); jsonObject.put("phone" , etcCustMsg.getBankPhone());
jsonObject.put("custAgentIdFront" , convertToBase64(etcCustMsg.getCustAgentIdFront())); jsonObject.put("custAgentIdFront" , convertToBase64(etcCustMsg.getCustAgentIdFront()));
jsonObject.put("custAgentIdBack" , convertToBase64(etcCustMsg.getCustAgentIdBront())); jsonObject.put("custAgentIdBack" , convertToBase64(etcCustMsg.getCustAgentIdBront()));
jsonObject.put("bankCard" , convertToBase64(etcCustMsg.getCustAgentIdBront())); jsonObject.put("bankCard" , convertToBase64(etcCustMsg.getCustAgentIdBront()));
if (etcCustMsg.getCustId() != null) { if (etcCustMsg.getCustId() != null) {
jsonObject.put("custId" , etcCustMsg.getCustId()); jsonObject.put("custId" , etcCustMsg.getCustId());
} }
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/submitCustInfo" , map);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/submitCustInfo" , map);
} }
/** /**
@ -66,9 +70,9 @@ public class EtcService {
*/ */
public static JSONObject submitVehInfo(EtcCarMsg etcCarMsg) throws Exception { public static JSONObject submitVehInfo(EtcCarMsg etcCarMsg) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("productId" , etcCarMsg.getProductId()); jsonObject.put("productId" , etcCarMsg.getProductId());
jsonObject.put("custId" , etcCarMsg.getCustId()); jsonObject.put("custId" , etcCarMsg.getCustId());
@ -80,18 +84,21 @@ public class EtcService {
vehInfoListObject.put("vehPlateColor" , etcCarMsg.getVehPlateColor()); vehInfoListObject.put("vehPlateColor" , etcCarMsg.getVehPlateColor());
vehInfoListObject.put("vehType" , etcCarMsg.getVehType()); vehInfoListObject.put("vehType" , etcCarMsg.getVehType());
vehInfoListObject.put("wheelsNum" , etcCarMsg.getWheelsNum()); vehInfoListObject.put("wheelsNum" , etcCarMsg.getWheelsNum());
jsonObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro())); vehInfoListObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro()));
jsonObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro())); vehInfoListObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro()));
jsonObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto())); vehInfoListObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto()));
if (etcCarMsg.getVehId() != null) { if (etcCarMsg.getVehId() != null) {
jsonObject.put("vehId" , etcCarMsg.getVehId()); vehInfoListObject.put("vehId" , etcCarMsg.getVehId());
} }
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); vehInfoList.add(vehInfoListObject);
map.put("body" , jsonObject); jsonObject.put("vehInfoList" , vehInfoList);
map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/submitVehInfo" , map); return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/submitVehInfo" , map);
} }
@ -105,18 +112,18 @@ public class EtcService {
*/ */
public static JSONObject getVehStatus(EtcCarMsg etcCarMsg) throws Exception { public static JSONObject getVehStatus(EtcCarMsg etcCarMsg) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , etcCarMsg.getCustId()); jsonObject.put("custId" , etcCarMsg.getCustId());
jsonObject.put("vehId" , etcCarMsg.getVehId()); jsonObject.put("vehId" , etcCarMsg.getVehId());
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/getVehStatus" , map);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/getVehStatus" , map);
} }
/** /**
@ -129,17 +136,17 @@ public class EtcService {
*/ */
public static JSONObject sendRealNameCode(String custId) throws Exception { public static JSONObject sendRealNameCode(String custId) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId); jsonObject.put("custId" , custId);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/sendRealNameCode" , map);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/sendRealNameCode" , map);
} }
/** /**
@ -152,18 +159,18 @@ public class EtcService {
*/ */
public static JSONObject checkRealNameCode(String custId , String verifyCode) throws Exception { public static JSONObject checkRealNameCode(String custId , String verifyCode) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId); jsonObject.put("custId" , custId);
jsonObject.put("verifyCode" , verifyCode); jsonObject.put("verifyCode" , verifyCode);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/checkRealNameCode" , map);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkRealNameCode" , map);
} }
/** /**
@ -177,34 +184,182 @@ public class EtcService {
*/ */
public static JSONObject sendSignVerifyCode(String custId) throws Exception { public static JSONObject sendSignVerifyCode(String custId) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId); jsonObject.put("custId" , custId);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("body" , jsonObject);
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/sendSignVerifyCode" , map);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/sendSignVerifyCode" , map);
} }
/**
* @Author Sum1Dream
* @Name checkSignVerifyCode
* @Description // 签约验证码核验接口
* @Date 15:34 2024/3/28
* @Param custId
* @Param verifyCode
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject checkSignVerifyCode(String custId , String verifyCode) throws Exception { public static JSONObject checkSignVerifyCode(String custId , String verifyCode) throws Exception {
// 组装数据 // 组装数据
Map<String , Object> map = new HashMap<>(); JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", System.currentTimeMillis()); map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId); jsonObject.put("custId" , custId);
jsonObject.put("verifyCode" , verifyCode); jsonObject.put("verifyCode" , verifyCode);
String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkSignVerifyCode" , map);
}
map.put("body" , jsonObject); /**
* @Author Sum1Dream
* @Name getSignContractTemplate
* @Description // 获取合同模版
* @Date 14:31 2024/4/1
* @Param custId
* @Param productId
* @Param cardVarietyId
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject getSignContractTemplate(String custId , Integer productId , Integer cardVarietyId) throws Exception {
// 组装数据
JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId);
jsonObject.put("productId" , productId);
jsonObject.put("cardVarietyId" , cardVarietyId);
map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/getSignContractTemplate" , map);
}
/**
* @Author Sum1Dream
* @Name checkNeedSignWechatWithhold
* @Description //查看是否需要签约微信代扣
* @Date 14:31 2024/4/1
* @Param custId
* @Param productId
* @Param cardVarietyId
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject checkNeedSignWechatWithhold(Integer productId , Integer cardVarietyId) throws Exception {
// 组装数据
JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("productId" , productId);
jsonObject.put("cardVarietyId" , cardVarietyId);
map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/checkSignVerifyCode" , map);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkNeedSignWechatWithhold" , map);
}
/**
* @Author Sum1Dream
* @Name checkSignWithhold
* @Description // 是否已签约银行卡代扣
* @Date 14:42 2024/4/1
* @Param productId
* @Param cardVarietyId
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject checkSignWithhold(String custId) throws Exception {
// 组装数据
JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , custId);
map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkSignWithhold" , map);
}
/**
* @Author Sum1Dream
* @Name sendSignWithholdCode
* @Description // 签约银行卡代扣发送验证码
* @Date 14:45 2024/4/1
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject sendSignWithholdCode(JSONObject object) throws Exception {
// 组装数据
JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , object.getString("custId"));
jsonObject.put("cardNo" , object.getString("cardNo"));
jsonObject.put("mobileNo" , object.getString("mobileNo"));
jsonObject.put("idNo" , object.getString("idNo"));
jsonObject.put("holderName" , object.getString("holderName"));
jsonObject.put("cardExpired" , object.getString("cardExpired"));
jsonObject.put("cardCvv2" , object.getString("cardCvv2"));
map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/sendSignWithholdCode" , map);
}
/**
* @Author Sum1Dream
* @Name signWithhold
* @Description // 签约银行卡代扣
* @Date 14:52 2024/4/1
* @Param object
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject signWithhold(JSONObject object) throws Exception {
// 组装数据
JSONObject map = new JSONObject();
map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode());
map.put("timestamps", String.valueOf(System.currentTimeMillis()));
JSONObject jsonObject = new JSONObject();
jsonObject.put("custId" , object.getString("custId"));
jsonObject.put("bankCardType" , object.getInteger("bankCardType"));
jsonObject.put("bankName" , object.getString("bankName"));
jsonObject.put("cardNo" , object.getString("cardNo"));
jsonObject.put("mobileNo" , object.getString("mobileNo"));
jsonObject.put("idNo" , object.getString("idNo"));
jsonObject.put("holderName" , object.getString("holderName"));
jsonObject.put("cardExpired" , object.getString("cardExpired"));
jsonObject.put("cardCvv2" , object.getString("cardCvv2"));
jsonObject.put("verifyCodeNo" , object.getString("verifyCodeNo"));
jsonObject.put("verifyCode" , object.getString("verifyCode"));
map.put("body" , jsonObject.toJSONString());
String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey());
map.put("sign" , DigestUtils.md5Hex((sign).getBytes()));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/signWithhold" , map);
} }
/** /**
@ -215,16 +370,23 @@ public class EtcService {
* @Param imagePath * @Param imagePath
* @return java.lang.String * @return java.lang.String
*/ */
public static String convertToBase64(String imagePath) { public static String convertToBase64(String imagePath) throws IOException {
String base64Image = ""; // 读取图片文件到字节数组
try { Path path = new File(CommonSysConst.getSysConfig().getFileUrl() + imagePath).toPath();
Path path = Paths.get( CommonSysConst.getSysConfig().getFileUrl() + imagePath);
byte[] imageBytes = Files.readAllBytes(path); byte[] imageBytes = Files.readAllBytes(path);
base64Image = Base64.getEncoder().encodeToString(imageBytes);
} catch (Exception e) { // 将字节数组转换为Base64编码的字符串
e.printStackTrace(); String base64ImageString = Base64.getEncoder().encodeToString(imageBytes);
}
return base64Image; // 获取文件扩展名作为数据格式
String dataFormat = imagePath.substring(imagePath.lastIndexOf('.') + 1);
// 构建最终的Base64字符串,包含数据格式
String base64WithDataFormat = "data:image/" + dataFormat + ";base64," + base64ImageString;
return base64WithDataFormat;
} }

@ -12,6 +12,7 @@ public class WxMaConfiguration {
private static WxMaService maService; private static WxMaService maService;
private static WxMaService maQyxService; private static WxMaService maQyxService;
private static WxMaService maZxjzService;
public static WxMaService getMaService() { public static WxMaService getMaService() {
if (maService == null) { if (maService == null) {
@ -22,16 +23,18 @@ public class WxMaConfiguration {
} }
public static WxMaService getMaService(Integer type) { public static WxMaService getMaService(Integer type) {
if (maService == null || maQyxService == null) { if (maService == null || maQyxService == null || maZxjzService == null) {
throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!")); throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!"));
} }
// type 1:嗨森逛小程序参数 2:黔印象小程序参数 // type 1:嗨森逛小程序参数 2:黔印象小程序参数 3.智行九州
if (type == 1) { if (type == 1) {
return maService; return maService;
} else if (type == 2) {
return maQyxService;
} }
return maQyxService; return maZxjzService;
} }
@PostConstruct @PostConstruct
@ -49,6 +52,13 @@ public class WxMaConfiguration {
maQyxService = new WxMaServiceImpl(); maQyxService = new WxMaServiceImpl();
maQyxService.setWxMaConfig(qyxConfig); maQyxService.setWxMaConfig(qyxConfig);
WxMaDefaultConfigImpl zxjzConfig = new WxMaDefaultConfigImpl();
zxjzConfig.setAppid(CommonSysConst.getSysConfig().getWxZxjzAppId());
zxjzConfig.setSecret(CommonSysConst.getSysConfig().getWxZxjzAppSecret());
maZxjzService = new WxMaServiceImpl();
maZxjzService.setWxMaConfig(zxjzConfig);
} }
} }

@ -100,6 +100,11 @@ public class WxOrderConfig {
*/ */
public static final String APPID_QYX_MINI = "wx5e0cac96ea91c01f"; public static final String APPID_QYX_MINI = "wx5e0cac96ea91c01f";
/**
* 智行九州小程序APPID
*/
public static final String APPID_ZXJZ_MINI = "wxc872cb59b56681a7";
public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception { public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception {
Map<String,String> param = new HashMap<>(); Map<String,String> param = new HashMap<>();
param.put("appid", "wx637bd6f7314daa46"); param.put("appid", "wx637bd6f7314daa46");

@ -0,0 +1,158 @@
package com.hai.dao;
import com.hai.entity.EtcContractOrder;
import com.hai.entity.EtcContractOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface EtcContractOrderMapper extends EtcContractOrderMapperExt {
@SelectProvider(type=EtcContractOrderSqlProvider.class, method="countByExample")
long countByExample(EtcContractOrderExample example);
@DeleteProvider(type=EtcContractOrderSqlProvider.class, method="deleteByExample")
int deleteByExample(EtcContractOrderExample example);
@Delete({
"delete from etc_contract_order",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into etc_contract_order (phone, contract_no, ",
"cust_id, veh_id, product_id, ",
"card_variety_id, product_name, ",
"card_variety_name, sign_img, ",
"create_time, update_time, ",
"`status`, pay_status, ",
"sign_status, op_id, ",
"op_name, ext_1, ext_2, ",
"ext_3)",
"values (#{phone,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, ",
"#{custId,jdbcType=VARCHAR}, #{vehId,jdbcType=VARCHAR}, #{productId,jdbcType=INTEGER}, ",
"#{cardVarietyId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, ",
"#{cardVarietyName,jdbcType=VARCHAR}, #{signImg,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, ",
"#{signStatus,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, ",
"#{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(EtcContractOrder record);
@InsertProvider(type=EtcContractOrderSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(EtcContractOrder record);
@SelectProvider(type=EtcContractOrderSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="contract_no", property="contractNo", jdbcType=JdbcType.VARCHAR),
@Result(column="cust_id", property="custId", jdbcType=JdbcType.VARCHAR),
@Result(column="veh_id", property="vehId", jdbcType=JdbcType.VARCHAR),
@Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
@Result(column="card_variety_id", property="cardVarietyId", jdbcType=JdbcType.INTEGER),
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
@Result(column="card_variety_name", property="cardVarietyName", jdbcType=JdbcType.VARCHAR),
@Result(column="sign_img", property="signImg", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
@Result(column="sign_status", property="signStatus", jdbcType=JdbcType.INTEGER),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<EtcContractOrder> selectByExample(EtcContractOrderExample example);
@Select({
"select",
"id, phone, contract_no, cust_id, veh_id, product_id, card_variety_id, product_name, ",
"card_variety_name, sign_img, create_time, update_time, `status`, pay_status, ",
"sign_status, op_id, op_name, ext_1, ext_2, ext_3",
"from etc_contract_order",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="contract_no", property="contractNo", jdbcType=JdbcType.VARCHAR),
@Result(column="cust_id", property="custId", jdbcType=JdbcType.VARCHAR),
@Result(column="veh_id", property="vehId", jdbcType=JdbcType.VARCHAR),
@Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
@Result(column="card_variety_id", property="cardVarietyId", jdbcType=JdbcType.INTEGER),
@Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
@Result(column="card_variety_name", property="cardVarietyName", jdbcType=JdbcType.VARCHAR),
@Result(column="sign_img", property="signImg", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
@Result(column="sign_status", property="signStatus", jdbcType=JdbcType.INTEGER),
@Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT),
@Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
EtcContractOrder selectByPrimaryKey(Long id);
@UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") EtcContractOrder record, @Param("example") EtcContractOrderExample example);
@UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") EtcContractOrder record, @Param("example") EtcContractOrderExample example);
@UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(EtcContractOrder record);
@Update({
"update etc_contract_order",
"set phone = #{phone,jdbcType=VARCHAR},",
"contract_no = #{contractNo,jdbcType=VARCHAR},",
"cust_id = #{custId,jdbcType=VARCHAR},",
"veh_id = #{vehId,jdbcType=VARCHAR},",
"product_id = #{productId,jdbcType=INTEGER},",
"card_variety_id = #{cardVarietyId,jdbcType=INTEGER},",
"product_name = #{productName,jdbcType=VARCHAR},",
"card_variety_name = #{cardVarietyName,jdbcType=VARCHAR},",
"sign_img = #{signImg,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},",
"pay_status = #{payStatus,jdbcType=INTEGER},",
"sign_status = #{signStatus,jdbcType=INTEGER},",
"op_id = #{opId,jdbcType=BIGINT},",
"op_name = #{opName,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(EtcContractOrder record);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface EtcContractOrderMapperExt {
}

@ -0,0 +1,444 @@
package com.hai.dao;
import com.hai.entity.EtcContractOrder;
import com.hai.entity.EtcContractOrderExample.Criteria;
import com.hai.entity.EtcContractOrderExample.Criterion;
import com.hai.entity.EtcContractOrderExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class EtcContractOrderSqlProvider {
public String countByExample(EtcContractOrderExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("etc_contract_order");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(EtcContractOrderExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("etc_contract_order");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(EtcContractOrder record) {
SQL sql = new SQL();
sql.INSERT_INTO("etc_contract_order");
if (record.getPhone() != null) {
sql.VALUES("phone", "#{phone,jdbcType=VARCHAR}");
}
if (record.getContractNo() != null) {
sql.VALUES("contract_no", "#{contractNo,jdbcType=VARCHAR}");
}
if (record.getCustId() != null) {
sql.VALUES("cust_id", "#{custId,jdbcType=VARCHAR}");
}
if (record.getVehId() != null) {
sql.VALUES("veh_id", "#{vehId,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.VALUES("product_id", "#{productId,jdbcType=INTEGER}");
}
if (record.getCardVarietyId() != null) {
sql.VALUES("card_variety_id", "#{cardVarietyId,jdbcType=INTEGER}");
}
if (record.getProductName() != null) {
sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}");
}
if (record.getCardVarietyName() != null) {
sql.VALUES("card_variety_name", "#{cardVarietyName,jdbcType=VARCHAR}");
}
if (record.getSignImg() != null) {
sql.VALUES("sign_img", "#{signImg,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getPayStatus() != null) {
sql.VALUES("pay_status", "#{payStatus,jdbcType=INTEGER}");
}
if (record.getSignStatus() != null) {
sql.VALUES("sign_status", "#{signStatus,jdbcType=INTEGER}");
}
if (record.getOpId() != null) {
sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}");
}
if (record.getOpName() != null) {
sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(EtcContractOrderExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("phone");
sql.SELECT("contract_no");
sql.SELECT("cust_id");
sql.SELECT("veh_id");
sql.SELECT("product_id");
sql.SELECT("card_variety_id");
sql.SELECT("product_name");
sql.SELECT("card_variety_name");
sql.SELECT("sign_img");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("`status`");
sql.SELECT("pay_status");
sql.SELECT("sign_status");
sql.SELECT("op_id");
sql.SELECT("op_name");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("etc_contract_order");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
EtcContractOrder record = (EtcContractOrder) parameter.get("record");
EtcContractOrderExample example = (EtcContractOrderExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("etc_contract_order");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getPhone() != null) {
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}");
}
if (record.getContractNo() != null) {
sql.SET("contract_no = #{record.contractNo,jdbcType=VARCHAR}");
}
if (record.getCustId() != null) {
sql.SET("cust_id = #{record.custId,jdbcType=VARCHAR}");
}
if (record.getVehId() != null) {
sql.SET("veh_id = #{record.vehId,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{record.productId,jdbcType=INTEGER}");
}
if (record.getCardVarietyId() != null) {
sql.SET("card_variety_id = #{record.cardVarietyId,jdbcType=INTEGER}");
}
if (record.getProductName() != null) {
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}");
}
if (record.getCardVarietyName() != null) {
sql.SET("card_variety_name = #{record.cardVarietyName,jdbcType=VARCHAR}");
}
if (record.getSignImg() != null) {
sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getPayStatus() != null) {
sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}");
}
if (record.getSignStatus() != null) {
sql.SET("sign_status = #{record.signStatus,jdbcType=INTEGER}");
}
if (record.getOpId() != null) {
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}");
}
if (record.getOpName() != null) {
sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("etc_contract_order");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}");
sql.SET("contract_no = #{record.contractNo,jdbcType=VARCHAR}");
sql.SET("cust_id = #{record.custId,jdbcType=VARCHAR}");
sql.SET("veh_id = #{record.vehId,jdbcType=VARCHAR}");
sql.SET("product_id = #{record.productId,jdbcType=INTEGER}");
sql.SET("card_variety_id = #{record.cardVarietyId,jdbcType=INTEGER}");
sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}");
sql.SET("card_variety_name = #{record.cardVarietyName,jdbcType=VARCHAR}");
sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}");
sql.SET("sign_status = #{record.signStatus,jdbcType=INTEGER}");
sql.SET("op_id = #{record.opId,jdbcType=BIGINT}");
sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
EtcContractOrderExample example = (EtcContractOrderExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(EtcContractOrder record) {
SQL sql = new SQL();
sql.UPDATE("etc_contract_order");
if (record.getPhone() != null) {
sql.SET("phone = #{phone,jdbcType=VARCHAR}");
}
if (record.getContractNo() != null) {
sql.SET("contract_no = #{contractNo,jdbcType=VARCHAR}");
}
if (record.getCustId() != null) {
sql.SET("cust_id = #{custId,jdbcType=VARCHAR}");
}
if (record.getVehId() != null) {
sql.SET("veh_id = #{vehId,jdbcType=VARCHAR}");
}
if (record.getProductId() != null) {
sql.SET("product_id = #{productId,jdbcType=INTEGER}");
}
if (record.getCardVarietyId() != null) {
sql.SET("card_variety_id = #{cardVarietyId,jdbcType=INTEGER}");
}
if (record.getProductName() != null) {
sql.SET("product_name = #{productName,jdbcType=VARCHAR}");
}
if (record.getCardVarietyName() != null) {
sql.SET("card_variety_name = #{cardVarietyName,jdbcType=VARCHAR}");
}
if (record.getSignImg() != null) {
sql.SET("sign_img = #{signImg,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getPayStatus() != null) {
sql.SET("pay_status = #{payStatus,jdbcType=INTEGER}");
}
if (record.getSignStatus() != null) {
sql.SET("sign_status = #{signStatus,jdbcType=INTEGER}");
}
if (record.getOpId() != null) {
sql.SET("op_id = #{opId,jdbcType=BIGINT}");
}
if (record.getOpName() != null) {
sql.SET("op_name = #{opName,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, EtcContractOrderExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -0,0 +1,369 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* etc_contract_order
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class EtcContractOrder implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 客户手机号码
*/
private String phone;
/**
* 合同编码
*/
private String contractNo;
/**
* 用户信息ID
*/
private String custId;
/**
* 车辆id
*/
private String vehId;
/**
* 产品id
*/
private Integer productId;
/**
* 卡种id
*/
private Integer cardVarietyId;
/**
* 产品名称
*/
private String productName;
/**
* 卡种
*/
private String cardVarietyName;
/**
* 签名图片
*/
private String signImg;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态 0 删除 1正常
*/
private Integer status;
/**
* 支付状态1未支付2已支付
*/
private Integer payStatus;
/**
* 签约状态1已签约 0未签约
*/
private Integer signStatus;
/**
* 操作人
*/
private Long opId;
/**
* 操作人名称
*/
private String opName;
/**
* ext_1
*/
private String ext1;
/**
* ext_2
*/
private String ext2;
/**
* ext_3
*/
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getContractNo() {
return contractNo;
}
public void setContractNo(String contractNo) {
this.contractNo = contractNo;
}
public String getCustId() {
return custId;
}
public void setCustId(String custId) {
this.custId = custId;
}
public String getVehId() {
return vehId;
}
public void setVehId(String vehId) {
this.vehId = vehId;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getCardVarietyId() {
return cardVarietyId;
}
public void setCardVarietyId(Integer cardVarietyId) {
this.cardVarietyId = cardVarietyId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getCardVarietyName() {
return cardVarietyName;
}
public void setCardVarietyName(String cardVarietyName) {
this.cardVarietyName = cardVarietyName;
}
public String getSignImg() {
return signImg;
}
public void setSignImg(String signImg) {
this.signImg = signImg;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getPayStatus() {
return payStatus;
}
public void setPayStatus(Integer payStatus) {
this.payStatus = payStatus;
}
public Integer getSignStatus() {
return signStatus;
}
public void setSignStatus(Integer signStatus) {
this.signStatus = signStatus;
}
public Long getOpId() {
return opId;
}
public void setOpId(Long opId) {
this.opId = opId;
}
public String getOpName() {
return opName;
}
public void setOpName(String opName) {
this.opName = opName;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
EtcContractOrder other = (EtcContractOrder) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
&& (this.getContractNo() == null ? other.getContractNo() == null : this.getContractNo().equals(other.getContractNo()))
&& (this.getCustId() == null ? other.getCustId() == null : this.getCustId().equals(other.getCustId()))
&& (this.getVehId() == null ? other.getVehId() == null : this.getVehId().equals(other.getVehId()))
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
&& (this.getCardVarietyId() == null ? other.getCardVarietyId() == null : this.getCardVarietyId().equals(other.getCardVarietyId()))
&& (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
&& (this.getCardVarietyName() == null ? other.getCardVarietyName() == null : this.getCardVarietyName().equals(other.getCardVarietyName()))
&& (this.getSignImg() == null ? other.getSignImg() == null : this.getSignImg().equals(other.getSignImg()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus()))
&& (this.getSignStatus() == null ? other.getSignStatus() == null : this.getSignStatus().equals(other.getSignStatus()))
&& (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId()))
&& (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
result = prime * result + ((getContractNo() == null) ? 0 : getContractNo().hashCode());
result = prime * result + ((getCustId() == null) ? 0 : getCustId().hashCode());
result = prime * result + ((getVehId() == null) ? 0 : getVehId().hashCode());
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
result = prime * result + ((getCardVarietyId() == null) ? 0 : getCardVarietyId().hashCode());
result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
result = prime * result + ((getCardVarietyName() == null) ? 0 : getCardVarietyName().hashCode());
result = prime * result + ((getSignImg() == null) ? 0 : getSignImg().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode());
result = prime * result + ((getSignStatus() == null) ? 0 : getSignStatus().hashCode());
result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode());
result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", phone=").append(phone);
sb.append(", contractNo=").append(contractNo);
sb.append(", custId=").append(custId);
sb.append(", vehId=").append(vehId);
sb.append(", productId=").append(productId);
sb.append(", cardVarietyId=").append(cardVarietyId);
sb.append(", productName=").append(productName);
sb.append(", cardVarietyName=").append(cardVarietyName);
sb.append(", signImg=").append(signImg);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", status=").append(status);
sb.append(", payStatus=").append(payStatus);
sb.append(", signStatus=").append(signStatus);
sb.append(", opId=").append(opId);
sb.append(", opName=").append(opName);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,45 @@
package com.hai.enum_type;
import java.util.Objects;
public enum EtcProductEnum {
productName23(23, "e信通" ),
productName26(26, "e达通" ),
productName45(45, "阳光行S" ),
;
private Integer number;
private String name;
EtcProductEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static String getNameByType(Integer type) {
for (EtcProductEnum ele : values()) {
if (Objects.equals(type,ele.getNumber())) {
return ele.getName();
}
}
return null;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
}

@ -0,0 +1,43 @@
package com.hai.enum_type;
import java.util.Objects;
public enum EtcVarietyEnum {
varietyName2(2, "龙通卡" ),
varietyName6(6, "九州卡" ),
;
private Integer number;
private String name;
EtcVarietyEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static String getNameByType(Integer type) {
for (EtcVarietyEnum ele : values()) {
if (Objects.equals(type,ele.getNumber())) {
return ele.getName();
}
}
return null;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
}

@ -2,6 +2,7 @@ package com.hai.etc;
import com.hai.entity.BlxCarInfo; import com.hai.entity.BlxCarInfo;
import com.hai.entity.EtcCarMsg; import com.hai.entity.EtcCarMsg;
import com.hai.entity.EtcContractOrder;
import com.hai.entity.EtcCustMsg; import com.hai.entity.EtcCustMsg;
import java.util.List; import java.util.List;
@ -26,14 +27,6 @@ public interface EtcCarMsgService {
*/ */
void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception; void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception;
/**
* @Author Sum1Dream
* @Name updateCar
* @Description // 更新车辆信息
* @Date 11:29 2023/9/5
* @Param carInfo
* @return void
*/
void updateEtcCar(EtcCarMsg etcCarMsg); void updateEtcCar(EtcCarMsg etcCarMsg);
/** /**
@ -66,7 +59,45 @@ public interface EtcCarMsgService {
*/ */
EtcCarMsg findEtcCarById(Long id); EtcCarMsg findEtcCarById(Long id);
/**
* @Author Sum1Dream
* @Name insertContractOrder
* @Description // 新增
* @Date 10:30 2024/4/1
* @Param etcContractOrder
* @return com.hai.entity.EtcContractOrder
*/
void insertContractOrder(EtcContractOrder etcContractOrder);
/**
* @Author Sum1Dream
* @Name updateContractOrder
* @Description // 修改
* @Date 10:33 2024/4/1
* @Param etcContractOrder
* @return com.hai.entity.EtcContractOrder
*/
void updateContractOrder(EtcContractOrder etcContractOrder);
/**
* @Author Sum1Dream
* @Name getEtcContractOrderList
* @Description //TODO
* @Date 11:02 2024/4/1
* @Param map
* @return java.util.List<com.hai.entity.EtcCarMsg>
*/
List<EtcContractOrder> getEtcContractOrderList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name findContractOrderById
* @Description // 查询
* @Date 11:02 2024/4/1
* @Param id
* @return com.hai.entity.EtcCarMsg
*/
EtcContractOrder findContractOrderById(Long id);
} }

@ -65,4 +65,7 @@ public interface EtcCustMsgService {
EtcCustMsg findEtcCustById(Long id); EtcCustMsg findEtcCustById(Long id);
} }

@ -3,11 +3,12 @@ package com.hai.etc.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.config.EtcService; import com.hai.config.EtcService;
import com.hai.dao.EtcCarMsgMapper; import com.hai.dao.EtcCarMsgMapper;
import com.hai.entity.EtcCarMsg; import com.hai.dao.EtcContractOrderMapper;
import com.hai.entity.EtcCarMsgExample; import com.hai.entity.*;
import com.hai.entity.EtcCustMsg; import com.hai.enum_type.EtcProductEnum;
import com.hai.entity.EtcCustMsgExample; import com.hai.enum_type.EtcVarietyEnum;
import com.hai.etc.EtcCarMsgService; import com.hai.etc.EtcCarMsgService;
import com.hai.order.utils.OrderUtil;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -22,32 +23,56 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
@Resource @Resource
private EtcCarMsgMapper etcCarMsgMapper; private EtcCarMsgMapper etcCarMsgMapper;
@Resource
private EtcContractOrderMapper etcContractOrderMapper;
@Override @Override
public void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception { public void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception {
// 提交车辆审核 // 提交车辆审核
JSONObject jsonObject = EtcService.submitVehInfo(etcCarMsg); JSONObject jsonObject = EtcService.submitVehInfo(etcCarMsg);
if (jsonObject.getString("errCode").equals("0")) { if (jsonObject.getString("errCode").equals("0")) {
JSONObject object = (JSONObject) jsonObject.getJSONArray("result").get(0); JSONObject object = (JSONObject) jsonObject.getJSONArray("result").get(0);
etcCarMsg.setVehId(object.getString("custId")); etcCarMsg.setVehId(object.getString("vehId"));
JSONObject car = EtcService.getVehStatus(etcCarMsg); JSONObject car = EtcService.getVehStatus(etcCarMsg);
if (car.getString("errCode").equals("0")) { if (car.getString("errCode").equals("0")) {
etcCarMsg.setVehStatus(car.getJSONObject("result").getInteger("vehStatus"));
etcCarMsg.setVehStatus(13);
etcCarMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus")); etcCarMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus"));
etcCarMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus")); etcCarMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus"));
etcCarMsg.setExt2(car.getJSONObject("result").getString("docException"));
// 添加合同信息
EtcContractOrder contractOrder = new EtcContractOrder();
contractOrder.setContractNo(OrderUtil.generateContractNo());
contractOrder.setCreateTime(new Date());
contractOrder.setCustId(etcCarMsg.getCustId());
contractOrder.setProductId(etcCarMsg.getProductId());
contractOrder.setCardVarietyId(etcCarMsg.getCardVarietyId());
contractOrder.setProductName(EtcProductEnum.getNameByType(etcCarMsg.getProductId()));
contractOrder.setCardVarietyName(EtcVarietyEnum.getNameByType(etcCarMsg.getCardVarietyId()));
contractOrder.setVehId(etcCarMsg.getVehId());
contractOrder.setPayStatus(1);
contractOrder.setSignStatus(0);
insertContractOrder(contractOrder);
} }
etcCarMsg.setExt3(car.getString("errMsg")); etcCarMsg.setExt3(car.getString("errMsg"));
etcCarMsg.setExt2(car.toJSONString());
} }
etcCarMsg.setExt1(jsonObject.getString("errMsg")); etcCarMsg.setExt1(jsonObject.getString("errMsg"));
if (etcCarMsg.getId() != null) {
etcCarMsgMapper.updateByPrimaryKey(etcCarMsg);
} else {
etcCarMsgMapper.insert(etcCarMsg); etcCarMsgMapper.insert(etcCarMsg);
} }
}
@Override @Override
public void updateEtcCar(EtcCarMsg etcCarMsg) { public void updateEtcCar(EtcCarMsg etcCarMsg) {
etcCarMsgMapper.updateByPrimaryKey(etcCarMsg); etcCarMsgMapper.updateByPrimaryKey(etcCarMsg);
} }
@Override @Override
@ -61,6 +86,9 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
if (MapUtils.getString(map , "vehPlateNo") != null) { if (MapUtils.getString(map , "vehPlateNo") != null) {
criteria.andVehPlateNoEqualTo(MapUtils.getString(map , "vehPlateNo")); criteria.andVehPlateNoEqualTo(MapUtils.getString(map , "vehPlateNo"));
} }
if (MapUtils.getString(map , "custId") != null) {
criteria.andCustIdEqualTo(MapUtils.getString(map , "custId"));
}
return etcCarMsgMapper.selectByExample(example); return etcCarMsgMapper.selectByExample(example);
} }
@ -68,8 +96,30 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
@Override @Override
public EtcCarMsg findEtcCarByMap(Map<String, Object> map) { public EtcCarMsg findEtcCarByMap(Map<String, Object> map) {
EtcCustMsgExample example = new EtcCustMsgExample(); EtcCarMsgExample example = new EtcCarMsgExample();
EtcCustMsgExample.Criteria criteria = example.createCriteria(); EtcCarMsgExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
if (MapUtils.getString(map , "vehPlateNo") != null) {
criteria.andVehPlateNoEqualTo(MapUtils.getString(map , "vehPlateNo"));
}
if (MapUtils.getInteger(map , "vehPlateColor") != null) {
criteria.andVehPlateColorEqualTo(MapUtils.getInteger(map , "vehPlateColor"));
}
if (MapUtils.getString(map , "custId") != null) {
criteria.andCustIdEqualTo(MapUtils.getString(map , "custId"));
}
if (MapUtils.getString(map , "vehId") != null) {
criteria.andVehIdEqualTo(MapUtils.getString(map , "vehId"));
}
List<EtcCarMsg> list = etcCarMsgMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null; return null;
} }
@ -78,4 +128,37 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
public EtcCarMsg findEtcCarById(Long id) { public EtcCarMsg findEtcCarById(Long id) {
return etcCarMsgMapper.selectByPrimaryKey(id); return etcCarMsgMapper.selectByPrimaryKey(id);
} }
@Override
public void insertContractOrder(EtcContractOrder etcContractOrder) {
etcContractOrderMapper.insert(etcContractOrder);
}
@Override
public void updateContractOrder(EtcContractOrder etcContractOrder) {
etcContractOrderMapper.updateByPrimaryKey(etcContractOrder);
}
@Override
public List<EtcContractOrder> getEtcContractOrderList(Map<String, Object> map) {
EtcContractOrderExample example = new EtcContractOrderExample();
EtcContractOrderExample.Criteria criteria = example.createCriteria();
if (MapUtils.getString(map , "phone") != null) {
criteria.andPhoneEqualTo(MapUtils.getString(map , "phone"));
}
if (MapUtils.getInteger(map , "signStatus") != null) {
criteria.andSignStatusEqualTo(MapUtils.getInteger(map , "signStatus"));
}
if (MapUtils.getString(map , "custId") != null) {
criteria.andCustIdEqualTo(MapUtils.getString(map , "custId"));
}
return etcContractOrderMapper.selectByExample(example);
}
@Override
public EtcContractOrder findContractOrderById(Long id) {
return etcContractOrderMapper.selectByPrimaryKey(id);
}
} }

@ -1,5 +1,6 @@
package com.hai.etc.impl; package com.hai.etc.impl;
import com.alibaba.druid.sql.visitor.functions.If;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.config.EtcService; import com.hai.config.EtcService;
import com.hai.dao.EtcCustMsgMapper; import com.hai.dao.EtcCustMsgMapper;
@ -62,6 +63,32 @@ public class EtcCustMsgServiceImpl implements EtcCustMsgService {
@Override @Override
public EtcCustMsg findEtcCustByMap(Map<String, Object> map) { public EtcCustMsg findEtcCustByMap(Map<String, Object> map) {
EtcCustMsgExample example = new EtcCustMsgExample();
EtcCustMsgExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
if (MapUtils.getString(map , "custName") != null) {
criteria.andCustNameEqualTo(MapUtils.getString(map , "custName"));
}
if (MapUtils.getString(map , "phone") != null) {
criteria.andPhoneEqualTo(MapUtils.getString(map , "phone"));
}
if (MapUtils.getInteger(map , "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map , "status"));
}
if (MapUtils.getString(map , "custIdNo") != null) {
criteria.andCustIdNoEqualTo(MapUtils.getString(map , "custIdNo"));
}
List<EtcCustMsg> list = etcCustMsgMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null; return null;
} }

@ -94,4 +94,21 @@ public class AliYunOcrService {
} }
return null; return null;
} }
/**
* 行驶证识别
* @param url 访问地址
* @return
*/
public static RecognizeVehicleLicenseResponseBody recognizeVehicleLicense(String url) {
try {
Client client = createClient();
RecognizeVehicleLicenseRequest request = new RecognizeVehicleLicenseRequest().setUrl(url);
RecognizeVehicleLicenseResponse response = client.recognizeVehicleLicense(request);
return response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
} }

@ -140,5 +140,6 @@ public interface OrderCreateHandleService {
HighChildOrder petroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; HighChildOrder petroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
HighChildOrder cpPetroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; HighChildOrder cpPetroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
HighChildOrder etcUser(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
} }

@ -1326,4 +1326,30 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrder; return childOrder;
} }
@Override
public HighChildOrder etcUser(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception {
HighChildOrder childOrder = new HighChildOrder();
childOrder.setOrderNo(order.getOrderNo());
childOrder.setMemId(order.getMemId());
childOrder.setMemName(order.getMemName());
childOrder.setMemPhone(order.getMemPhone());
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo());
childOrder.setGoodsType(OrderChildGoodsType.TYPE20.getNumber());
childOrder.setGoodsId(createOrderChildModel.getGoodsId());
childOrder.setGoodsName("ETC用户办理");
childOrder.setGoodsSpecName("ETC用户办理");
childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice());
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
childOrder.setSaleCount(createOrderChildModel.getSaleCount());
childOrder.setGiveawayType(false);
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber());
childOrder.setTotalPrice(childOrder.getGoodsPrice());
childOrder.setTotalActualPrice(childOrder.getGoodsPrice());
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setPraiseStatus(0);
childOrder.setCreateTime(new Date());
return childOrder;
}
} }

@ -11,6 +11,8 @@ import com.hai.config.*;
import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.*; import com.hai.enum_type.*;
import com.hai.etc.EtcCarMsgService;
import com.hai.etc.EtcCustMsgService;
import com.hai.goods.service.GoodsOrderExtService; import com.hai.goods.service.GoodsOrderExtService;
import com.hai.goods.service.GoodsPresentService; import com.hai.goods.service.GoodsPresentService;
import com.hai.group.GroupCodeService; import com.hai.group.GroupCodeService;
@ -149,6 +151,14 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource @Resource
private HighGasOrderPushMapper highGasOrderPushMapper; private HighGasOrderPushMapper highGasOrderPushMapper;
@Resource
private HighDiscountPackageService highDiscountPackageService;
@Resource
private EtcCarMsgService etcCarMsgService;
@Resource
private SecConfigService secConfigService;
@Override @Override
@ -282,6 +292,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
petroCoupon(order , childOrder); petroCoupon(order , childOrder);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE19.getNumber())) { } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE19.getNumber())) {
cpPetroCoupon(order , childOrder); cpPetroCoupon(order , childOrder);
} else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) {
etcUser(order);
} }
} }
} }
@ -785,4 +797,32 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
} }
private void etcUser(HighOrder order) throws Exception {
EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(order.getHighChildOrderList().get(0).getGoodsId());
contractOrder.setPayStatus(2);
contractOrder.setUpdateTime(new Date());
etcCarMsgService.updateContractOrder(contractOrder);
Map<String , Object> mapCar = new HashMap<>();
mapCar.put("vehId" , contractOrder.getVehId());
mapCar.put("custId" , contractOrder.getCustId());
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(mapCar);
carMsg.setUpdateTime(new Date());
carMsg.setPayStatus(2);
etcCarMsgService.updateEtcCar(carMsg);
// 查询赠送优惠券
SecConfig secConfig = secConfigService.findByCodeType("GIVE_DISCOUNT_PACKAGE");
// 赠送优惠券
highDiscountPackageService.giveAway(Long.parseLong(secConfig.getCodeValue()) , order.getMemPhone() , 2 , order.getMemId().toString());
}
} }

@ -389,6 +389,12 @@ public class OrderServiceImpl implements OrderService {
order.setProductType(OrderProductType.PRODUCT_TYPE19.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE19.getNumber());
order.setSecUserId(childOrder.getId()); order.setSecUserId(childOrder.getId());
order.setTitle("重庆中石油卡券"); order.setTitle("重庆中石油卡券");
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.etcUser(order , child);
childOrderList.add(childOrder);
order.setProductType(OrderProductType.PRODUCT_TYPE20.getNumber());
order.setSecUserId(childOrder.getId());
order.setTitle("ETC用户办理");
} }
else { else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型");

@ -27,6 +27,7 @@ public enum OrderChildGoodsType {
TYPE17(17, "团购套餐"), TYPE17(17, "团购套餐"),
TYPE18(18, "中石油卡券"), TYPE18(18, "中石油卡券"),
TYPE19(19, "重庆中石油卡券"), TYPE19(19, "重庆中石油卡券"),
TYPE20(20, "ETC用户办理"),
; ;
private Integer number; private Integer number;

@ -30,6 +30,7 @@ public enum OrderProductType {
PRODUCT_TYPE17(17, "团购套餐" , "orderLogo/coupon.png", ""), PRODUCT_TYPE17(17, "团购套餐" , "orderLogo/coupon.png", ""),
PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"), PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"),
PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"), PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"),
PRODUCT_TYPE20(20, "ETC用户办理" , "orderLogo/coupon.png", "ETC_USER"),
PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"), PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"),
PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"), PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"),
; ;

@ -5,6 +5,7 @@ import java.util.Objects;
public enum PlatformType { public enum PlatformType {
TYPE1(1, "嗨森逛"), TYPE1(1, "嗨森逛"),
TYPE2(2, "黔印象"), TYPE2(2, "黔印象"),
TYPE3(3, "智行九州"),
; ;
private Integer number; private Integer number;

@ -62,6 +62,22 @@ public class OrderUtil {
} }
} }
/**
* 生成合同订单订单号
* @return
* @throws Exception
*/
public static String generateContractNo(){
try {
// 5位随机数 + 1位线程生成数
String randomNum = (new Random().nextInt(8999) + 1000) + IDGenerator.nextId(1);
// 生成订单号
return DateUtil.date2String(new Date(),"yyyyMMdd") + randomNum;
} catch (Exception e) {
return null;
}
}
/** /**
* 生成子订单号 * 生成子订单号
* @return * @return

@ -57,6 +57,9 @@ public class HighGasServiceImpl implements HighGasService {
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@Resource
private HighMerchantStoreService merchantStoreService;
@Override @Override
public void getJiaHaoYouAllStation() throws Exception { public void getJiaHaoYouAllStation() throws Exception {
HighMerchantModel merchant = highMerchantService.getDetailByKey("HF0801103821"); HighMerchantModel merchant = highMerchantService.getDetailByKey("HF0801103821");
@ -818,6 +821,21 @@ public class HighGasServiceImpl implements HighGasService {
gasOilPrice.setStatus(0); gasOilPrice.setStatus(0);
highGasOilPriceService.editGasOilPrice(gasOilPrice); highGasOilPriceService.editGasOilPrice(gasOilPrice);
} }
Map<String, Object> param = new HashMap<>();
param.put("sourceType", 2);
param.put("regionId", "500000");
param.put("storeName", "壳牌");
param.put("status", 1);
List<HighMerchantStore> merchantStoreList = merchantStoreService.getMerchantStoreList(param);
for (HighMerchantStore merchantStore : merchantStoreList) {
merchantStore.setUpdateTime(new Date());
merchantStore.setStatus(0);
merchantStoreService.updateMerchantStoreDetail(merchantStore);
}
} }

@ -122,8 +122,8 @@ unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c
#url #url
fileUrl=/home/project/hsg/filesystem/ fileUrl=/home/project/hsg/filesystem/
#fileUrl=/Volumes/work/filesystem/ #fileUrl=D:/work/img/
#
#wx #wx
wxAppId=wx8d49e2f83025229d wxAppId=wx8d49e2f83025229d
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
@ -131,6 +131,9 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxQyxAppId=wx5e0cac96ea91c01f wxQyxAppId=wx5e0cac96ea91c01f
wxQyxAppSecret=9889fff2283e249199a9f6afb32f6136 wxQyxAppSecret=9889fff2283e249199a9f6afb32f6136
wxZxjzAppId=wxc872cb59b56681a7
wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a
wxH5AppId=wxa075e8509802f826 wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -149,3 +149,8 @@ GzPetroUrl = http://140.143.82.223:1588/gz
GzPetroAppid = F0bdoJRwt GzPetroAppid = F0bdoJRwt
GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98
GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98
#NUODE
NdPostUrl = https://nuode.qianbao18.com/nuode-module-supplier/
NdOrgCode = 414a3d16-30f9-40d1-a2cd-b06066b38708
NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c

@ -154,3 +154,8 @@ GzPetroUrl = http://140.143.82.223:1588/gz
GzPetroAppid = F0bdoJRwt GzPetroAppid = F0bdoJRwt
GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98
GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98
#NUODE
NdPostUrl = https://nuode.qianbao18.com/nuode-module-supplier/
NdOrgCode = 414a3d16-30f9-40d1-a2cd-b06066b38708
NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c
Loading…
Cancel
Save