Compare commits

...

2 Commits

  1. 63
      hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java
  2. 14
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java
  3. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java
  5. 3
      hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java
  6. 1
      hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java
  7. 1
      hai-service/src/main/java/com/hai/openApi/config/PriceComputeConfig.java
  8. 11
      hai-service/src/main/java/com/hai/openApi/service/ApiOrderService.java
  9. 5
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java
  10. 1
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  11. 2
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  12. 76
      v1/src/main/java/com/v1/controller/business/DiscountController.java
  13. 132
      v1/src/main/java/com/v1/controller/orderController.java

@ -488,6 +488,69 @@ public class EtcCustomerController {
}
}
@RequestMapping(value = "/getEtcContractOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "更新合同状态")
public ResponseData getEtcContractOrderList() {
try {
Map<String , Object> map = new HashMap<>();
map.put("vehStatus" , 15);
List<EtcContractOrder> list = etcCarMsgService.getEtcContractOrderList(map);
for(EtcContractOrder contractOrder : list ) {
if (contractOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到合同!");
}
// 查询车辆信息
Map<String , Object> mapCar = new HashMap<>();
mapCar.put("vehId" , contractOrder.getVehId());
mapCar.put("custId" , contractOrder.getCustId());
EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(mapCar);
if (carMsg == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到信息!");
}
// 查询车辆状态
JSONObject car = EtcService.getVehStatus(carMsg);
if (car.getString("errCode").equals("0")) {
carMsg.setVehStatus(car.getJSONObject("result").getInteger("vehStatus"));
carMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus"));
carMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus"));
contractOrder.setVehStatus(carMsg.getVehStatus());
etcCarMsgService.updateEtcCar(carMsg);
}
// 查询微信签约代扣信息
JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId() , contractOrder.getVehId());
if (object.getString("errCode").equals("0")) {
contractOrder.setWechatSign(object.getJSONObject("result").getBoolean("alreadySignFlag")? 1:0);
contractOrder.setNeedSignWechat(object.getJSONObject("result").getBoolean("needSignFlag")? 1:0);
contractOrder.setAppid(object.getJSONObject("result").getString("appId"));
contractOrder.setJumpPath(object.getJSONObject("result").getString("path"));
}
// 查询银行签约代扣
JSONObject objectBank = EtcService.checkSignWithhold( contractOrder.getCustId());
if (objectBank.getString("errCode").equals("0")) {
contractOrder.setBankSign(objectBank.getJSONObject("result").getBoolean("isSign")? 1:0);
}
etcCarMsgService.updateContractOrder(contractOrder);
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("BsMsgController --> getMsgByList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -257,13 +257,13 @@ public class HighDiscountPackageController {
}
}
if (highDiscountPackage.getUsingAttribution() != null) {
HighDiscountPackage highDiscountPackage1 = highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue());
if (highDiscountPackage1 != null && highDiscountPackage1.getId() != highDiscountPackage.getId()) {
log.error("highCouponPackage -> updateCouponPackageInfo() error!","专属优惠券已存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "专属优惠券已存在");
}
}
// if (highDiscountPackage.getUsingAttribution() != null) {
// HighDiscountPackage highDiscountPackage1 = highDiscountPackageService.getCallExclusive(highDiscountPackage.getUsingAttribution() , userInfoModel.getBsCompany().getId().intValue());
// if (highDiscountPackage1 != null && highDiscountPackage1.getId() != highDiscountPackage.getId()) {
// log.error("highCouponPackage -> updateCouponPackageInfo() error!","专属优惠券已存在");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "专属优惠券已存在");
// }
// }
highDiscountPackage.setStatus(3);
highDiscountPackage.setUpdatedTime(new Date());

File diff suppressed because one or more lines are too long

@ -186,6 +186,8 @@ public class EtcCustomerController {
}
}
@RequestMapping(value = "/sendSignVerifyCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "签约验证码发送接口")

@ -186,6 +186,9 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService {
if (MapUtils.getString(map , "custId") != null) {
criteria.andCustIdEqualTo(MapUtils.getString(map , "custId"));
}
if (MapUtils.getInteger(map , "vehStatus") != null) {
criteria.andVehStatusEqualTo(MapUtils.getInteger(map , "vehStatus"));
}
return etcContractOrderMapper.selectByExample(example);
}

@ -62,7 +62,6 @@ public class EtcCustMsgServiceImpl implements EtcCustMsgService {
if (MapUtils.getString(map , "phone") != null) {
criteria.andPhoneEqualTo(MapUtils.getString(map , "phone"));
}
criteria.andStatusNotEqualTo(0);
example.setOrderByClause("create_time desc");

@ -69,6 +69,7 @@ public class PriceComputeConfig {
apiAmountRecordService.insertAmountRecord(apiAmountRecord);
return true;
}

@ -58,6 +58,17 @@ public interface ApiOrderService {
*/
ApiOrder findByOrderNo(String mchOrderNo , String orderNo);
/**
* @Author Sum1Dream
* @Name createOrder
* @Description // 创建订单
* @Date 17:44 2023/2/28
* @Param [object]
* @Return void
*/
void updateOrder(ApiOrder apiOrder) throws Exception;
/**
* @Author Sum1Dream
* @Name refund

@ -419,6 +419,11 @@ public class ApiOrderServiceImpl implements ApiOrderService {
return null;
}
@Override
public void updateOrder(ApiOrder apiOrder) throws Exception {
apiOrderMapper.updateByPrimaryKey(apiOrder);
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void refund(String orderNo) {

@ -832,6 +832,7 @@ public class HighGasServiceImpl implements HighGasService {
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);

@ -791,7 +791,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
object.put("orderNo" , childOrder.getOrderNo());
JSONObject jsonObject = RechargeConfig.checkOrderByJn(object);
childOrder.setExt3("畅停查询"+ jsonObject);
childOrder.setExt3("简牛查询"+ jsonObject);
if (jsonObject.getJSONObject("data") != null) {
JSONObject objectData= jsonObject.getJSONObject("data");
// // 10充值中 20充值完成 -10 充值失败

@ -1,12 +1,15 @@
package com.v1.controller.business;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.ApiKfcStores;
import com.hai.entity.ApiMerchants;
import com.hai.config.QianZhuConfig;
import com.hai.entity.*;
import com.hai.model.ResponseData;
import com.hai.openApi.config.PriceComputeConfig;
import com.hai.openApi.service.ApiMchProductService;
@ -18,13 +21,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -48,6 +49,12 @@ public class DiscountController {
@Resource
private HighDiscountPackageService highDiscountPackageService;
@Resource
private HighUserService highUserService;
@Resource
private HighDiscountUserRelService highDiscountUserRelService;
@RequestMapping(value = "/presentDiscount", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "赠送优惠券")
@ -84,11 +91,6 @@ public class DiscountController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
}
if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE2.getApiCode(), object.getString("merchId"))) {
log.error("getAllCities error!", "当前帐户无权限查询!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");
}
Map<String , Object> map = new HashMap<>();
map.put("apiKey" , apiMerchants.getApiKey());
map.put("packageId" , object.getString("packageId"));
@ -111,4 +113,56 @@ public class DiscountController {
}
}
@RequestMapping(value = "/getDiscountPackage", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询可用优惠券包")
public ResponseData getDiscountPackage(@RequestParam(name = "type", required = true) Integer type , HttpServletRequest request) {
try {
Map<String, Object> map = new HashMap<>();
map.put("usingAttribution", type);
map.put("status" , 1);
List<JSONObject> list = new ArrayList<>();
List<HighDiscountPackage> discountPackages = highDiscountPackageService.getDiscountPackageList(map);
for (HighDiscountPackage discountPackage : discountPackages) {
JSONObject object = new JSONObject();
object.put("packageDetail" , highDiscountPackageService.findDiscountPackageById(discountPackage.getId()));
object.put("discountPackage" , discountPackage);
list.add(object);
}
return ResponseMsgUtil.success(list);
} catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getUserDiscountList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户优惠券")
public ResponseData getUserDiscountList(@RequestParam(name = "phone", required = true) String phone , HttpServletRequest request) {
try {
HighUser user = highUserService.findByPhone(phone);
if (user == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "用户不存在!");
}
Map<String,Object> map = new HashMap<>();
map.put("userId", user.getId());
return ResponseMsgUtil.success(highDiscountUserRelService.getDiscountList(map));
} catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,10 +1,12 @@
package com.v1.controller;
import com.alibaba.fastjson.JSONArray;
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.utils.ResponseMsgUtil;
import com.hai.config.QianZhuConfig;
import com.hai.config.WxOrderConfig;
import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiOrder;
@ -12,6 +14,7 @@ import com.hai.entity.ApiProductConfig;
import com.hai.entity.HighOrder;
import com.hai.model.OrderRefundModel;
import com.hai.model.ResponseData;
import com.hai.model.ThirdPartyModel;
import com.hai.openApi.service.ApiOrderService;
import com.hai.order.model.RefundPriceModel;
import com.hai.order.service.OrderService;
@ -27,15 +30,15 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.sound.midi.Soundbank;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@ -83,11 +86,11 @@ public class orderController {
} else {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
//
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
if (
StringUtils.isBlank(object.getString("productType")) ||
@ -210,10 +213,10 @@ public class orderController {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
if (
StringUtils.isBlank(object.getString("mchOrderNo")) ||
@ -276,11 +279,11 @@ public class orderController {
} else {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
//
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
if (
StringUtils.isBlank(object.getString("mchOrderNo")) ||
@ -330,10 +333,10 @@ public class orderController {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
if (
StringUtils.isBlank(object.getString("mchOrderNo")) ||
@ -403,10 +406,10 @@ public class orderController {
ip = request.getHeader("x-forwarded-for");
}
if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
}
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
if (
StringUtils.isBlank(object.getString("paySerialNo")) ||
@ -449,4 +452,81 @@ public class orderController {
}
@RequestMapping(value = "/getThirdOrderByOrderNo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询第三方订单详情")
public ResponseData getThirdOrderByOrderNo(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo , HttpServletRequest request) {
try {
String ip = "";
// 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
if (request.getHeader("x-forwarded-for") == null) {
ip = request.getRemoteAddr();
} else {
ip = request.getHeader("x-forwarded-for");
}
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
ApiOrder apiOrder = apiOrderService.findByOrderNo(mchOrderNo , null);
HighOrder order = highOrderService.getOrderByOrderNo(apiOrder.getOrderNo());
JSONObject object;
List<Map<String, Object>> list = new ArrayList<>();
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) {
object = QianZhuConfig.getKfcOrderByOrderNo(order.getHighChildOrderList().get(0).getChannelOrderNo());
if (object.getBoolean("success")) {
if (object.getJSONObject("data").getString("ticket") != null) {
String[] s = object.getJSONObject("data").getString("ticket").split(",");
for (String s1 : s) {
Map<String , Object> map = new HashMap<>();
String[] childString = s1.split("\\|");
map.put("code" , childString[0]);
list.add(map);
}
}
} else {
log.error("getThirdOrderByOrderId error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message"));
}
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
object = QianZhuConfig.starbucksOrderByOrderNo(order.getHighChildOrderList().get(0).getChannelOrderNo());
if (object.getBoolean("success")) {
JSONArray jsonObject = object.getJSONObject("data").getJSONArray("orderItems");
for (Object a : jsonObject) {
JSONObject orderItem = (JSONObject) a;
Map<String , Object> map = new HashMap<>();
map.put("code" , orderItem.getString("code"));
list.add(map);
}
}else {
log.error("getThirdOrderByOrderId error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message"));
}
}
return ResponseMsgUtil.success(list);
} catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

Loading…
Cancel
Save