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 bd6790acfa
commit a7c82de2c4
  1. 75
      hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  3. 1
      hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java
  4. 3
      hai-order/src/main/java/com/web/controller/OrderPayNotifyController.java
  5. 101
      hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java
  6. 2
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  7. 27
      hai-service/src/main/java/com/hai/config/EtcService.java
  8. 52
      hai-service/src/main/java/com/hai/enum_type/CarTypeEnum.java
  9. 14
      hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java
  10. 1
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java
  11. 7
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  12. 6
      hai-service/src/main/resources/dev/commonConfig.properties

@ -1,5 +1,6 @@
package com.bweb.controller.Etc; package com.bweb.controller.Etc;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -8,9 +9,11 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject; import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.EtcService; import com.hai.config.EtcService;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.CarTypeEnum;
import com.hai.etc.EtcCarMsgService; 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;
@ -371,4 +374,76 @@ public class EtcCustomerController {
} }
} }
@RequestMapping(value = "/getVehStatusByList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "getVehStatusByList")
public ResponseData getVehStatusByList() {
try {
Map<String , Object> map = new HashMap<>();
map.put("status" , "11,12,13,15");
List<EtcCarMsg> list = etcCarMsgService.getEtcCarList(map);
List<JSONObject> data = new ArrayList<>();
for (EtcCarMsg carMsg : list) {
JSONObject object = EtcService.getVehStatus(carMsg);
if (Objects.equals(object.getString("errCode"), "0") && object.getJSONObject("result") != null) {
carMsg.setVehStatus(object.getJSONObject("result").getInteger("vehStatus"));
carMsg.setUpdateTime(object.getJSONObject("result").getDate("activeTime"));
}
etcCarMsgService.updateEtcCar(carMsg);
object.put("carMsg" , carMsg);
data.add(object);
}
return ResponseMsgUtil.success(data);
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/queryActivateVehicleInfoPage", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "queryActivateVehicleInfoPage")
public ResponseData queryActivateVehicleInfoPage() {
try {
JSONObject object = EtcService.queryActivateVehicleInfoPage(DateUtil.format(DateUtil.reduceDate(new Date() , 2) , "yyyy-MM-dd HH:mm:ss") , DateUtil.format(new Date() , "yyyy-MM-dd HH:mm:ss") );
if (Objects.equals(object.getString("errCode"), "0") && object.getJSONObject("result").getJSONArray("records") != null) {
JSONArray jsonArray = object.getJSONObject("result").getJSONArray("records");
for (int i = 0; i < jsonArray.size(); i++) {
Map<String , Object> map = new HashMap<>();
map.put("vehPlateNo" , jsonArray.getJSONObject(i).getString("vehPlateNo"));
map.put("vehPlateColor" , CarTypeEnum.getNameByName(jsonArray.getJSONObject(i).getString("vehPlateColor")));
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(map);
carMsg.setCardNo(jsonArray.getJSONObject(i).getString("cardNo"));
carMsg.setObuNo(jsonArray.getJSONObject(i).getString("obuNo"));
etcCarMsgService.updateEtcCar(carMsg);
}
}
return ResponseMsgUtil.success(object);
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

File diff suppressed because one or more lines are too long

@ -193,6 +193,7 @@ public class EtcCustomerController {
etcCarMsgService.updateEtcCar(carMsg); etcCarMsgService.updateEtcCar(carMsg);
contractOrder.setSignStatus(1); contractOrder.setSignStatus(1);
contractOrder.setExt3(object.toJSONString());
etcCarMsgService.updateContractOrder(contractOrder); etcCarMsgService.updateContractOrder(contractOrder);
return ResponseMsgUtil.success("请求成功!"); return ResponseMsgUtil.success("请求成功!");

@ -42,9 +42,6 @@ public class OrderPayNotifyController {
private static final Logger log = LoggerFactory.getLogger(OrderPayNotifyController.class); private static final Logger log = LoggerFactory.getLogger(OrderPayNotifyController.class);
@Resource
private NotifyService notifyService;
@Resource @Resource
private OrderService orderService; private OrderService orderService;

@ -0,0 +1,101 @@
package com.hai.schedule;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.EtcService;
import com.hai.entity.EtcCarMsg;
import com.hai.entity.OutRechargeOrder;
import com.hai.enum_type.CarTypeEnum;
import com.hai.etc.EtcCarMsgService;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.impl.OutRechargeOrderServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.util.*;
/**
* @serviceName HighRechargeOrderSchedule.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 充值订单定时任务
* @createTime 09:57 2023/1/13
**/
@Configuration
public class EtcSchedule {
private static final Logger log = LoggerFactory.getLogger(OutRechargeOrderServiceImpl.class);
@Resource
private EtcCarMsgService etcCarMsgService;
/**
* @return void
* @Author Sum1Dream
* @name cancelOrder.java
* @Description // 定时发起
* @Date 14:18 2022/5/31
* @Param []
*/
@Scheduled(cron = "0 0/10 * * * ?") //每10分钟执行一次
public void getEtcCarList() {
try {
Map<String , Object> map = new HashMap<>();
map.put("status" , "11,12,13,15");
List<EtcCarMsg> list = etcCarMsgService.getEtcCarList(map);
for (EtcCarMsg carMsg : list) {
JSONObject object = EtcService.getVehStatus(carMsg);
if (Objects.equals(object.getString("errCode"), "0") && object.getJSONObject("result") != null) {
carMsg.setVehStatus(object.getJSONObject("result").getInteger("vehStatus"));
carMsg.setUpdateTime(object.getJSONObject("result").getDate("activeTime"));
}
etcCarMsgService.updateEtcCar(carMsg);
}
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
}
}
@Scheduled(cron = "0 0/60 * * * ?") //每60分钟执行一次
public void etcCarMsg() {
try {
JSONObject object = EtcService.queryActivateVehicleInfoPage(DateUtil.format(DateUtil.reduceDate(new Date() , 2) , "yyyy-MM-dd HH:mm:ss") , DateUtil.format(new Date() , "yyyy-MM-dd HH:mm:ss") );
if (Objects.equals(object.getString("errCode"), "0") && object.getJSONObject("result").getJSONArray("records") != null) {
JSONArray jsonArray = object.getJSONObject("result").getJSONArray("records");
for (int i = 0; i < jsonArray.size(); i++) {
Map<String , Object> map = new HashMap<>();
map.put("vehPlateNo" , jsonArray.getJSONObject(i).getString("vehPlateNo"));
map.put("vehPlateColor" , CarTypeEnum.getNameByName(jsonArray.getJSONObject(i).getString("vehPlateColor")));
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(map);
carMsg.setCardNo(jsonArray.getJSONObject(i).getString("cardNo"));
carMsg.setObuNo(jsonArray.getJSONObject(i).getString("obuNo"));
etcCarMsgService.updateEtcCar(carMsg);
}
}
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
}
}
}

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

@ -360,6 +360,33 @@ public class EtcService {
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/signWithhold" , map); return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/signWithhold" , map);
} }
/**
* @Author Sum1Dream
* @Name queryActivateVehicleInfoPage
* @Description // 查询已经激活车辆
* @Date 14:12 2024/4/13
* @Param activeStartTime
* @Param activeEndTime
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject queryActivateVehicleInfoPage(String activeStartTime , String activeEndTime) 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("page" , 1);
jsonObject.put("limit" , 100000);
jsonObject.put("activeStartTime" , activeStartTime);
jsonObject.put("activeEndTime" , activeEndTime);
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/queryActivateVehicleInfoPage" , map);
}
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Name convertToBase64 * @Name convertToBase64

@ -0,0 +1,52 @@
package com.hai.enum_type;
import java.util.Objects;
public enum CarTypeEnum {
CarType0(0 , "蓝;"),
CarType1(1 , "黄"),
CarType2(2 , "黑"),
CarType3(3 , "白"),
CarType4(4 , "渐变绿"),
CarType5(5 , "黄绿双拼"),
CarType6(6 ,"蓝白渐变"),
;
private Integer type;
private String name;
CarTypeEnum(int type , String name) {
this.type = type;
this.name = name;
}
public static String getNameByType(Integer type) {
for (CarTypeEnum ele : values()) {
if(Objects.equals(type,ele.getType())) return ele.getName();
}
return null;
}
public static Integer getNameByName(String name) {
for (CarTypeEnum ele : values()) {
if(Objects.equals(name,ele.getName())) return ele.getType();
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -13,6 +13,7 @@ import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -53,6 +54,8 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
contractOrder.setVehId(etcCarMsg.getVehId()); contractOrder.setVehId(etcCarMsg.getVehId());
contractOrder.setPayStatus(1); contractOrder.setPayStatus(1);
contractOrder.setSignStatus(0); contractOrder.setSignStatus(0);
contractOrder.setOpId(etcCarMsg.getUserId());
contractOrder.setOpName(etcCarMsg.getUserName());
insertContractOrder(contractOrder); insertContractOrder(contractOrder);
@ -86,9 +89,20 @@ 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.getInteger(map , "vehPlateColor") != null) {
criteria.andVehPlateColorEqualTo(MapUtils.getInteger(map , "vehPlateColor"));
}
if (MapUtils.getString(map , "custId") != null) { if (MapUtils.getString(map , "custId") != null) {
criteria.andCustIdEqualTo(MapUtils.getString(map , "custId")); criteria.andCustIdEqualTo(MapUtils.getString(map , "custId"));
} }
if (MapUtils.getString(map , "status") != null) {
String[] strings = MapUtils.getString(map, "status").split(",");
List<Integer> statusList = new ArrayList<>();
for (String i : strings) {
statusList.add(Integer.parseInt(i));
}
criteria.andVehStatusIn(statusList);
}
return etcCarMsgMapper.selectByExample(example); return etcCarMsgMapper.selectByExample(example);
} }

@ -329,7 +329,6 @@ public class ApiOrderServiceImpl implements ApiOrderService {
@Override @Override
@Transactional(rollbackFor=Exception.class,propagation= Propagation.REQUIRES_NEW , timeout = 30)
public ApiOrder payOrder(JSONObject object) throws Exception{ public ApiOrder payOrder(JSONObject object) throws Exception{
ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId")); ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));

@ -371,6 +371,13 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
} }
// 查询油站 // 查询油站
HighMerchantStore store = storeService.getDetailById(createOrderChild.getGoodsId()); HighMerchantStore store = storeService.getDetailById(createOrderChild.getGoodsId());
if (secConfigService.isConfig("ONLINE_REFUEL" , store.getSourceType().toString())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前油站不可用!");
}
if (store == null) { if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油站");
} }

@ -172,9 +172,9 @@ EtcPublicKey = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMyQb5gR1rweB5oHKqRPJtJjLQK
EtcPrivateKey = MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAO8+KWh/OmBahFk7TWOEjPl13BT5NdlbGvQ/311Yua6CQqul9w1DIR2TwFUUh/Bko/eVoLROfF2XVjHbw2bImTdJ7y9C3511HI59YPNzqyql0DHjLxbH0VW92eUgk8mG09wtrUMu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s/3kCQQD+xqRAQSb/TROlqJdO91y6z9v0PO2GLmokqYg444rKYZKhDE0tdJeLU/sfK8SMg5+SlwdQm4nlo8EDJ/w2CEn3AkEA8GRqVkKgIuH413/a6+luYDjlf30WY7Mi1sm3QPSZ6+eH35UwsL6mdX6mjRpUN9Hez6FMfE7s3XOldoPVMzR1XQJBAOa2VTkGhtz8HEWQZOySXfuhjSogHmu7Dk2C5CO4Eg/wycpjDGSUR0NZWnfAt60S6GbjszEQmJBGeNt10xPO78MCQQCWXwnRaZ3IFDhXfQfRWFSN5ilQ5UszFGQvnUB/ZkI+ObdZmXY6qRdxGcdPLnAN9r78fDZe7/Pk1qljCDY98IuVAkEAnSeO/221gDhL1wnbUhGuX1yo8f5Eo/wDTW5cBxXFGZeexhB8I4jnEV4E/xmikkb3jDFvmrnFk+XUtDqkrvicRQ==
#NUODE #NUODE
NdPostUrl = http://nuode-test.yuetong18.cn/nuode-module-supplier/ NdPostUrl = https://nuode.qianbao18.com/nuode-module-supplier/
NdOrgCode = 19181483-91e9-4e13-9236-fb917ed9529d NdOrgCode = 414a3d16-30f9-40d1-a2cd-b06066b38708
NdKey= 5df3f620-e269-458d-9556-87e26d30256a NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c
#Sph #Sph
SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry SphPostUrl = https://api.coupon.shuangpenghui.com//business/entry

Loading…
Cancel
Save