Merge branch '2.0-dev' of http://gitea.dctpay.com/hurui/hai-server into 2.0-dev

2.0-dev
胡锐 7 months ago
commit ed151e7be3
  1. 35
      hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  4. 2
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  5. 8
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  6. 25
      hai-service/src/main/java/com/hai/config/EtcService.java
  7. 2
      hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java
  8. 6
      hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java
  9. 4
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  10. 32
      hai-user/src/main/java/com/web/controller/WechatController.java
  11. 2
      v1/src/main/java/com/v1/controller/WxMsgController.java

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -279,8 +279,6 @@ public class OrderPayController {
} }
} }
} else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) { } else if (store.getSourceType().equals(MerchantStoreSourceType.type2.getNumber())) {
// 查询支付配置 // 查询支付配置

@ -158,10 +158,10 @@ public class HighGasSchedule {
// gasService.getPayloAllStation(); // gasService.getPayloAllStation();
// } // }
@Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 // @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次
public void getDianAllStation() throws Exception { // public void getDianAllStation() throws Exception {
gasService.getDianAllStation(); // gasService.getDianAllStation();
} // }
@Scheduled(cron = "0 0 3 * * ?") // 每日凌晨00:00:7执行一次 @Scheduled(cron = "0 0 3 * * ?") // 每日凌晨00:00:7执行一次
public void deleteOilNo() { public void deleteOilNo() {

@ -387,6 +387,31 @@ public class EtcService {
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/queryActivateVehicleInfoPage" , map); return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/queryActivateVehicleInfoPage" , map);
} }
/**
* @Author Sum1Dream
* @Name checkVehPlateNo
* @Description // 车牌校验接口
* @Date 14:12 2024/4/13
* @Param activeStartTime
* @Param activeEndTime
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject checkVehPlateNo(String vehPlateNo , String vehPlateColor) 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("vehPlateColor" , vehPlateColor);
jsonObject.put("vehPlateNo" , vehPlateNo);
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/checkVehPlateNo" , map);
}
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Name convertToBase64 * @Name convertToBase64

@ -27,6 +27,8 @@ public interface EtcCarMsgService {
*/ */
void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception; void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception;
void addEtcCar(EtcCarMsg etcCarMsg) throws Exception;
void updateEtcCar(EtcCarMsg etcCarMsg); void updateEtcCar(EtcCarMsg etcCarMsg);
/** /**

@ -54,6 +54,7 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
contractOrder.setVehId(etcCarMsg.getVehId()); contractOrder.setVehId(etcCarMsg.getVehId());
contractOrder.setPayStatus(1); contractOrder.setPayStatus(1);
contractOrder.setStatus(1); contractOrder.setStatus(1);
contractOrder.setVehStatus(13);
contractOrder.setVehStatus(etcCarMsg.getVehStatus()); contractOrder.setVehStatus(etcCarMsg.getVehStatus());
contractOrder.setSignStatus(0); contractOrder.setSignStatus(0);
contractOrder.setBankSign(0); contractOrder.setBankSign(0);
@ -78,6 +79,11 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
} }
} }
@Override
public void addEtcCar(EtcCarMsg etcCarMsg) throws Exception {
etcCarMsgMapper.insert(etcCarMsg);
}
@Override @Override
public void updateEtcCar(EtcCarMsg etcCarMsg) { public void updateEtcCar(EtcCarMsg etcCarMsg) {
etcCarMsgMapper.updateByPrimaryKey(etcCarMsg); etcCarMsgMapper.updateByPrimaryKey(etcCarMsg);

@ -824,8 +824,8 @@ public class HighGasServiceImpl implements HighGasService {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("sourceType", 2); param.put("sourceType", 2);
param.put("regionId", "500000"); // param.put("regionId", "500000");
param.put("storeName", "壳牌"); // param.put("storeName", "壳牌");
param.put("status", 1); param.put("status", 1);
List<HighMerchantStore> merchantStoreList = merchantStoreService.getMerchantStoreList(param); List<HighMerchantStore> merchantStoreList = merchantStoreService.getMerchantStoreList(param);

@ -1,7 +1,12 @@
package com.web.controller; package com.web.controller;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.*; import com.hai.common.utils.*;
import com.hai.enum_type.LoginPlatform;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.HighUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -10,6 +15,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -18,6 +26,9 @@ import java.util.Map;
@Api(value = "微信授权") @Api(value = "微信授权")
public class WechatController { public class WechatController {
@Resource
private HighUserService userService;
@RequestMapping(value = "/getH5AccessToken", method = RequestMethod.GET) @RequestMapping(value = "/getH5AccessToken", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "【H5】获取AccessToken") @ApiOperation(value = "【H5】获取AccessToken")
@ -35,4 +46,25 @@ public class WechatController {
} }
} }
@RequestMapping(value = "/loginBySilence", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "【H5】根据手机号登录")
public ResponseData loginBySilence(@RequestParam(value = "phone", required = true) String phone ,
HttpServletRequest request, HttpServletResponse response) {
try {
// 客户端
LoginPlatform platform = LoginPlatform.getDataByType("H5");
if (platform == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端");
}
return ResponseMsgUtil.success(userService.loginAndRegister(platform, phone, null, new HashMap<>(), request, response));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
} }

@ -519,7 +519,7 @@ public class WxMsgController {
@RequestMapping(value = "/verifyWx", method = RequestMethod.GET) @RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "微信签名") @ApiOperation(value = "微信编译URL")
public ResponseData verifyWx(@RequestParam(value = "url", required = true) String url) { public ResponseData verifyWx(@RequestParam(value = "url", required = true) String url) {
try { try {

Loading…
Cancel
Save