diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index acc0bf4e..5f342889 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -86,7 +86,7 @@ public class HighGasController { BigDecimal account = new BigDecimal("0"); // 查询商户余额 - HighMerchantAccount merchantAccount = merchantAccountService.getStoreAccountDetail(userInfoModel.getMerchant().getId()); + HighMerchantAccount merchantAccount = merchantAccountService.getMerAccountDetail(userInfoModel.getMerchant().getId()); if (merchantAccount != null) { account = merchantAccount.getAmounts(); } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java index 34a4231a..88e2f516 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerAmountController.java @@ -8,14 +8,12 @@ import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighMerchantAccount; import com.hai.entity.HighMerchantStoreAccount; import com.hai.enum_type.MerStoreAmountSourceTypeEnum; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; -import com.hai.service.HighCompanyTwoPwdService; -import com.hai.service.HighMerchantAccountService; -import com.hai.service.HighMerchantStoreAccountRecordService; -import com.hai.service.HighMerchantStoreAccountService; +import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -39,6 +37,9 @@ public class HighMerAmountController { @Resource private HighMerchantAccountService merchantAccountService; + @Resource + private HighMerchantAccountMarketingService accountMarketingService; + @Resource private UserCenter userCenter; @@ -54,18 +55,30 @@ public class HighMerAmountController { if (userInfoModel.getBsCompany() == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); } - if (body.getLong("merId") == null || body.getBigDecimal("amount") == null) { + if (body.getLong("merId") == null || body.getBigDecimal("amount") == null || body.getBoolean("marketingStatus") == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } if (body.getBigDecimal("amount").compareTo(new BigDecimal("0")) == -1) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "充值金额不能小于0"); } + if (body.getBoolean("marketingStatus").equals(true) + && body.getInteger("marketingType") == null + && body.getBigDecimal("marketingPrice") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + Map map = new HashMap<>(); map.put("sourceType", MerStoreAmountSourceTypeEnum.type1.getType()); map.put("sourceContent", "充值额度:" + body.getBigDecimal("amount") + " 元"); map.put("opUserId", userInfoModel.getSecUser().getId()); map.put("opUserName", userInfoModel.getSecUser().getUserName()); - merchantAccountService.recharge(body.getLong("merId"), body.getBigDecimal("amount"), map); + + Map marketingParam = new HashMap<>(); + marketingParam.put("marketingStatus", body.getBoolean("marketingStatus")); + marketingParam.put("marketingType", body.getInteger("marketingType")); + marketingParam.put("marketingPrice", body.getBigDecimal("marketingPrice")); + marketingParam.put("marketingOilNoData", body.getJSONArray("marketingOilNoData")); + merchantAccountService.recharge(body.getLong("merId"), body.getBigDecimal("amount"), marketingParam, map); return ResponseMsgUtil.success("操作成功"); @@ -79,4 +92,43 @@ public class HighMerAmountController { } } + @RequestMapping(value = "/getMerAccount", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户账户") + public ResponseData getMerAccount(@RequestParam(name = "merId", required = true) Long merId) { + try { + + BigDecimal account = new BigDecimal("0"); + // 查询商户余额 + HighMerchantAccount merchantAccount = merchantAccountService.getMerAccountDetail(merId); + if (merchantAccount != null) { + account = merchantAccount.getAmounts(); + } + Map param = new HashMap<>(); + param.put("amount", account.subtract(merchantAccountService.countMerGasOilAmount(merId))); + param.put("oilNoReliefPrice", accountMarketingService.getDetailByMerAndType(merId, 3)); + + return ResponseMsgUtil.success(param); + + } catch (Exception e) { + log.error("HighCompanyAmountController --> recharge() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getMerAccountMarketing", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户账户营销信息") + public ResponseData getMerAccountMarketing(@RequestParam(name = "merId", required = true) Long merId, + @RequestParam(name = "type", required = true) Integer type) { + try { + + return ResponseMsgUtil.success(accountMarketingService.getDetailByMerAndType(merId, type)); + + } catch (Exception e) { + log.error("HighCompanyAmountController --> getMerAccountMarketing() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantAccountRecordController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantAccountRecordController.java new file mode 100644 index 00000000..357d297b --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantAccountRecordController.java @@ -0,0 +1,95 @@ +package com.bweb.controller; + +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.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighMerchant; +import com.hai.enum_type.MerStoreAmountSourceTypeEnum; +import com.hai.enum_type.UserObjectTypeEnum; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.HighMerchantAccountRecordService; +import com.hai.service.HighMerchantService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DeadlockLoserDataAccessException; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping(value = "/merAccountRecord") +@Api(value = "商户门店接口") +public class HighMerchantAccountRecordController { + + private static Logger log = LoggerFactory.getLogger(HighMerchantAccountRecordController.class); + + @Resource + private HighMerchantAccountRecordService merchantAccountRecordService; + + @Resource + private HighMerchantService merchantService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/getRecordList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询记录列表") + public synchronized ResponseData getRecordList(@RequestParam(name = "merId", required = false) Long merId, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + Map param = new HashMap<>(); + if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) { + param.put("merId", merId); + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) { + + if (merId == null) { + Map merMap = new HashMap<>(); + merMap.put("companyId", userInfoModel.getBsCompany().getId()); + List merchantList = merchantService.getMerchantList(merMap); + + List merIdList = new ArrayList<>(); + for (HighMerchant merchant : merchantList) { + merIdList.add(merchant.getId()); + } + param.put("merIdList", merIdList); + } else { + param.put("merId", merId); + } + + } else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type2.getType())) { + param.put("merId", userInfoModel.getMerchant().getId()); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, ""); + } + param.put("type", 1); + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(merchantAccountRecordService.getRecordList(param))); + + } catch (Exception e) { + log.error("HighCompanyAmountController --> recharge() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index c4c18314..1f5711fa 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ -package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongConfig; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighOilCardService oilCardService; @Resource private ApiProductService apiProductService; @Resource private BsRechargeCodeService rechargeCodeService; @Resource private OutRechargePriceService rechargePriceService; @RequestMapping(value = "/kfcRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "KFC退款") public ResponseData kfcRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { OrderRefundModel orderRefundModel = null; if (StringUtils.isNotBlank(orderNo)) { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 if (order != null && order.getOrderStatus() == 2) { orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), "1609882817", order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); highOrderService.updateOrder(order); return ResponseMsgUtil.success(orderRefundModel); } } } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/consumption",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡重新发起充值") public ResponseData consumption( @RequestParam(name = "orderNo", required = false) String orderNo ) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderNo(orderNo); String goodsDesc = "重新充值"; String tranDesc = order.getRechargeContent() + "重新充值" + order.getPayRealPrice() + "元"; String instCode = "11101527"; String businessType = "hisen_consume"; String orderNoPost = "AGAIN" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNoPost, order.getLaborUnionCard(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc); JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray("records"); // // String s = "HFR1"; // String s1 = "AGAIN1"; // // List list = new ArrayList<>(); // // // for (Object data : array) { // JSONObject dataObject = (JSONObject) data; // if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { // list.add(dataObject); // } // return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { String remark = "订单" + highOrder.getOrderNo() + "退款积分:" + highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(); highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId() , remark); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStarbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新星巴克商品") public ResponseData getStarbucksProducts(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200); JSONObject object = jsonObject.getJSONObject("data"); JSONArray array = object.getJSONArray("items"); for (Object data : array) { JSONObject dataObject = (JSONObject) data; ApiStarbucksProducts starbucksProducts = apiProductService.findStarbucksProductsByGoodsId(dataObject.getLong("id")); if (dataObject.getInteger("shelfStatus") == 5) { if (starbucksProducts == null) { starbucksProducts = new ApiStarbucksProducts(); } starbucksProducts.setCategoryName(dataObject.getString("categoryName")); starbucksProducts.setCream(dataObject.getString("cream")); starbucksProducts.setCupSize(dataObject.getString("cupSize")); starbucksProducts.setDefaultImage(dataObject.getString("defaultImage")); starbucksProducts.setDes(dataObject.getString("des")); starbucksProducts.setEspresso(dataObject.getString("espresso")); starbucksProducts.setMarketGrandePrice(dataObject.getBigDecimal("marketGrandePrice")); starbucksProducts.setMarketTallPrice(dataObject.getBigDecimal("marketTallPrice")); starbucksProducts.setMarketVentiPrice(dataObject.getBigDecimal("marketVentiPrice")); starbucksProducts.setSalesGrandePrice(dataObject.getBigDecimal("salesGrandePrice")); starbucksProducts.setSalesTallPrice(dataObject.getBigDecimal("salesTallPrice")); starbucksProducts.setSalesVentiPrice(dataObject.getBigDecimal("salesVentiPrice")); starbucksProducts.setMilk(dataObject.getString("milk")); starbucksProducts.setMilkBubble(dataObject.getString("milkBubble")); starbucksProducts.setName(dataObject.getString("name")); starbucksProducts.setTemperature(dataObject.getString("temperature")); if (starbucksProducts.getId() == null) { starbucksProducts.setCreateTime(new Date()); starbucksProducts.setOperatorId(9999L); starbucksProducts.setOperatorName("系统生成"); starbucksProducts.setStatus(100); starbucksProducts.setGoodsId(dataObject.getLong("id")); apiProductService.insertStarbucksProducts(starbucksProducts); } else { starbucksProducts.setUpdateTime(new Date()); apiProductService.updateStarbucksProducts(starbucksProducts); } } } return ResponseMsgUtil.success("商品生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData getKfcStore(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getKfcStore(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; Map mapStore = new HashMap<>(); mapStore.put("storeCode" , dataObject.getString("storeCode")); ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore); if (apiKfcStores == null) { apiKfcStores = new ApiKfcStores(); } apiKfcStores.setProvinceCode(dataObject.getString("provinceCode")); apiKfcStores.setProvinceName(dataObject.getString("provinceName")); apiKfcStores.setCityCode(dataObject.getString("cityCode")); apiKfcStores.setCityName(dataObject.getString("cityName")); apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter")); apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId")); apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode")); apiKfcStores.setStoreName(dataObject.getString("storeName")); apiKfcStores.setStoreCode(dataObject.getString("storeCode")); apiKfcStores.setLon(dataObject.getString("lon")); apiKfcStores.setLat(dataObject.getString("lat")); apiKfcStores.setAddress(dataObject.getString("address")); apiKfcStores.setStartTime(dataObject.getString("startTime")); apiKfcStores.setEndTime(dataObject.getString("endTime")); apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus")); apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus")); if (apiKfcStores.getId() == null) { apiKfcStores.setCreateTime(new Date()); apiKfcStores.setOperatorId(9999L); apiKfcStores.setOperatorName("系统生成"); apiKfcStores.setStatus(100); apiProductService.insertKfcStore(apiKfcStores); } else { apiKfcStores.setUpdateTime(new Date()); apiProductService.updateKfcStore(apiKfcStores); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "插入城市") public ResponseData insertCity(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getAllCities(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; ApiCity apiCity = new ApiCity(); apiCity.setCityInitial(dataObject.getString("cityInitial")); apiCity.setCityCode(dataObject.getString("cityCode")); apiCity.setCityName(dataObject.getString("cityName")); apiCity.setProvinceCode(dataObject.getString("provinceCode")); apiCity.setProvinceName(dataObject.getString("provinceName")); apiCity.setCreateTime(new Date()); apiCity.setUpdateTime(new Date()); apiCity.setOperatorId(9999L); apiCity.setOperatorName("系统生成"); apiCity.setStatus(100); apiProductService.insertCity(apiCity); } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/updatePrice", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新价格") public ResponseData updatePrice() { try { List list = rechargePriceService.getListRechargePrice(new HashMap<>()); for (OutRechargePrice rechargePrice : list) { BsRechargeCode rechargeCode = new BsRechargeCode(); if (rechargePrice.getGoodsId() != null) { rechargeCode.setStatus(100); rechargeCode.setUpdateTime(new Date()); rechargeCode.setCreateTime(new Date()); rechargeCode.setGoodsId(rechargePrice.getGoodsId().toString()); rechargeCode.setOperatorName("系统自动更新"); rechargeCode.setType(1); rechargeCode.setSourceId(rechargePrice.getId().toString()); rechargeCode.setRechargePlatform(2); rechargeCodeService.insertRechargeCode(rechargeCode); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestBody JSONObject object) { try { return ResponseMsgUtil.success(HuiLianTongConfig.test(object)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alipay.api.domain.ForbbidenTime; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongConfig; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.config.QianZhuConfig; import com.hai.config.WxOrderConfig; import com.hai.entity.*; import com.hai.model.OrderRefundModel; import com.hai.model.ResponseData; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighOilCardService oilCardService; @Resource private ApiProductService apiProductService; @Resource private BsRechargeCodeService rechargeCodeService; @Resource private OutRechargePriceService rechargePriceService; @RequestMapping(value = "/kfcRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "KFC退款") public ResponseData kfcRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { OrderRefundModel orderRefundModel = null; if (StringUtils.isNotBlank(orderNo)) { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 if (order != null && order.getOrderStatus() == 2) { orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), "1609882817", order.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } order.setOrderStatus(4); order.setRefundTime(new Date()); order.setRefundPrice(order.getPayRealPrice()); highOrderService.updateOrder(order); return ResponseMsgUtil.success(orderRefundModel); } } } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/oilCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "油卡退款") public ResponseData oilCardRefund(@RequestParam(name = "orderNo", required = true) String orderNo,HttpServletRequest request) { try { oilCardService.refund(orderNo); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/consumption",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡重新发起充值") public ResponseData consumption( @RequestParam(name = "orderNo", required = false) String orderNo ) { try { OutRechargeOrder order = outRechargeOrderService.findByOrderNo(orderNo); String goodsDesc = "重新充值"; String tranDesc = order.getRechargeContent() + "重新充值" + order.getPayRealPrice() + "元"; String instCode = "11101527"; String businessType = "hisen_consume"; String orderNoPost = "AGAIN" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNoPost, order.getLaborUnionCard(), order.getPayRealPrice(), businessType, instCode, goodsDesc, tranDesc); JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray("records"); // // String s = "HFR1"; // String s1 = "AGAIN1"; // // List list = new ArrayList<>(); // // // for (Object data : array) { // JSONObject dataObject = (JSONObject) data; // if (!StringUtils.contains(dataObject.getString("orderNo"),s) && !StringUtils.contains(dataObject.getString("orderNo"),s1)) { // list.add(dataObject); // } // return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分充值退款") public ResponseData orderToRefund(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } if (highUserService.findGoldRepeat(3 , highOrder.getId())) { String remark = "订单" + highOrder.getOrderNo() + "退款积分:" + highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(); highUserService.goldHandle(highOrder.getMemId(), highOrder.getPayRealPrice().multiply(BigDecimal.valueOf(100)).intValue(), 2, 3, highOrder.getId() , remark); }else { log.error("orderToPay error!", "已有退款记录"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有退款记录"); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/orderToRefundByHlt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通充值退款") public ResponseData orderToRefundByHlt(@RequestParam(name = "orderId", required = true) Long orderId ,HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderById(orderId); // 微信退款 OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), WxOrderConfig.MCH_ID_1619676214 , highOrder.getPayRealPrice()); if(orderRefundModel.getResult_code().equals("SUCCESS")) { for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { childOrder.setChildOrdeStatus(4); } highOrder.setOrderStatus(4); highOrder.setRefundTime(new Date()); highOrder.setRefundPrice(highOrder.getPayRealPrice()); highOrderService.updateOrder(highOrder); } return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "话费退款") public ResponseData rechargeOrderToRefund( @RequestParam(name = "orderId", required = true) Long orderId) { try { outRechargeOrderService.rechargeOrderToRefund(orderId); return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStarbucksProducts", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新星巴克商品") public ResponseData getStarbucksProducts(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getStarbucksProducts(1 , 200); JSONObject object = jsonObject.getJSONObject("data"); JSONArray array = object.getJSONArray("items"); for (Object data : array) { JSONObject dataObject = (JSONObject) data; ApiStarbucksProducts starbucksProducts = apiProductService.findStarbucksProductsByGoodsId(dataObject.getLong("id")); if (dataObject.getInteger("shelfStatus") == 5) { if (starbucksProducts == null) { starbucksProducts = new ApiStarbucksProducts(); } starbucksProducts.setCategoryName(dataObject.getString("categoryName")); starbucksProducts.setCream(dataObject.getString("cream")); starbucksProducts.setCupSize(dataObject.getString("cupSize")); starbucksProducts.setDefaultImage(dataObject.getString("defaultImage")); starbucksProducts.setDes(dataObject.getString("des")); starbucksProducts.setEspresso(dataObject.getString("espresso")); starbucksProducts.setMarketGrandePrice(dataObject.getBigDecimal("marketGrandePrice")); starbucksProducts.setMarketTallPrice(dataObject.getBigDecimal("marketTallPrice")); starbucksProducts.setMarketVentiPrice(dataObject.getBigDecimal("marketVentiPrice")); starbucksProducts.setSalesGrandePrice(dataObject.getBigDecimal("salesGrandePrice")); starbucksProducts.setSalesTallPrice(dataObject.getBigDecimal("salesTallPrice")); starbucksProducts.setSalesVentiPrice(dataObject.getBigDecimal("salesVentiPrice")); starbucksProducts.setMilk(dataObject.getString("milk")); starbucksProducts.setMilkBubble(dataObject.getString("milkBubble")); starbucksProducts.setName(dataObject.getString("name")); starbucksProducts.setTemperature(dataObject.getString("temperature")); if (starbucksProducts.getId() == null) { starbucksProducts.setCreateTime(new Date()); starbucksProducts.setOperatorId(9999L); starbucksProducts.setOperatorName("系统生成"); starbucksProducts.setStatus(100); starbucksProducts.setGoodsId(dataObject.getLong("id")); apiProductService.insertStarbucksProducts(starbucksProducts); } else { starbucksProducts.setUpdateTime(new Date()); apiProductService.updateStarbucksProducts(starbucksProducts); } } } return ResponseMsgUtil.success("商品生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基门店") public ResponseData getKfcStore(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getKfcStore(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; Map mapStore = new HashMap<>(); mapStore.put("storeCode" , dataObject.getString("storeCode")); ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore); if (apiKfcStores == null) { apiKfcStores = new ApiKfcStores(); } apiKfcStores.setProvinceCode(dataObject.getString("provinceCode")); apiKfcStores.setProvinceName(dataObject.getString("provinceName")); apiKfcStores.setCityCode(dataObject.getString("cityCode")); apiKfcStores.setCityName(dataObject.getString("cityName")); apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter")); apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId")); apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode")); apiKfcStores.setStoreName(dataObject.getString("storeName")); apiKfcStores.setStoreCode(dataObject.getString("storeCode")); apiKfcStores.setLon(dataObject.getString("lon")); apiKfcStores.setLat(dataObject.getString("lat")); apiKfcStores.setAddress(dataObject.getString("address")); apiKfcStores.setStartTime(dataObject.getString("startTime")); apiKfcStores.setEndTime(dataObject.getString("endTime")); apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus")); apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus")); if (apiKfcStores.getId() == null) { apiKfcStores.setCreateTime(new Date()); apiKfcStores.setOperatorId(9999L); apiKfcStores.setOperatorName("系统生成"); apiKfcStores.setStatus(100); apiProductService.insertKfcStore(apiKfcStores); } else { apiKfcStores.setUpdateTime(new Date()); apiProductService.updateKfcStore(apiKfcStores); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/insertCity", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "插入城市") public ResponseData insertCity(HttpServletRequest request) { try { JSONObject jsonObject = QianZhuConfig.getAllCities(); JSONArray object = jsonObject.getJSONArray("data"); for (Object data : object) { JSONObject dataObject = (JSONObject) data; ApiCity apiCity = new ApiCity(); apiCity.setCityInitial(dataObject.getString("cityInitial")); apiCity.setCityCode(dataObject.getString("cityCode")); apiCity.setCityName(dataObject.getString("cityName")); apiCity.setProvinceCode(dataObject.getString("provinceCode")); apiCity.setProvinceName(dataObject.getString("provinceName")); apiCity.setCreateTime(new Date()); apiCity.setUpdateTime(new Date()); apiCity.setOperatorId(9999L); apiCity.setOperatorName("系统生成"); apiCity.setStatus(100); apiProductService.insertCity(apiCity); } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/updatePrice", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "更新价格") public ResponseData updatePrice() { try { List list = rechargePriceService.getListRechargePrice(new HashMap<>()); for (OutRechargePrice rechargePrice : list) { BsRechargeCode rechargeCode = new BsRechargeCode(); if (rechargePrice.getGoodsId() != null) { rechargeCode.setStatus(100); rechargeCode.setUpdateTime(new Date()); rechargeCode.setCreateTime(new Date()); rechargeCode.setGoodsId(rechargePrice.getGoodsId().toString()); rechargeCode.setOperatorName("系统自动更新"); rechargeCode.setType(1); rechargeCode.setSourceId(rechargePrice.getId().toString()); rechargeCode.setRechargePlatform(2); rechargeCodeService.insertRechargeCode(rechargeCode); } } return ResponseMsgUtil.success("生成成功"); } catch (Exception e) { log.error("HighUserCardController --> oilCardRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestBody JSONObject object) { try { return ResponseMsgUtil.success(HuiLianTongConfig.test(object)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/下单", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { String orderNo = "HF2022080818504922206"; JSONObject object = QianZhuConfig.insertV2("PLM100024", orderNo, "15585850137"); object.put("orderNo", orderNo); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index e90bb844..b4c561fc 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -20,6 +20,7 @@ import com.hai.config.TuanYouConfig; import com.hai.entity.*; import com.hai.enum_type.DiscountUseScope; import com.hai.enum_type.GasClassGroupTaskStatus; +import com.hai.enum_type.MerAccountMarketingType; import com.hai.enum_type.OrderChildGoodsTypeEnum; import com.hai.model.GasPayPriceModel; import com.hai.model.HighMerchantStoreModel; @@ -71,6 +72,9 @@ public class HighOrderController { @Resource private HighMerchantStoreService highMerchantStoreService; + @Resource + private HighMerchantAccountMarketingService merchantAccountMarketingService; + @Resource private HighCouponCodeService highCouponCodeService; @@ -318,6 +322,9 @@ public class HighOrderController { } } + // 营销减免的金额 + BigDecimal marketingPrice = merchantAccountMarketingService.getPrice(store.getMerchantId(), MerAccountMarketingType.type3.getType(), Integer.valueOf(childOrder.getGasOilNo())); + // 计算价格 GasPayPriceModel priceModel = gasDiscountOilPriceService.oilPriceDiscountCompute(childOrder.getGoodsPrice(), childOrder.getGoodsId(), childOrder.getGasOilNo(), highOrder.getIsTyAgent()); @@ -336,7 +343,7 @@ public class HighOrderController { childOrder.setGasOilSubsidy(new BigDecimal("0")); childOrder.setGasLitersPreferences(new BigDecimal("0")); childOrder.setGasPricePreferences(priceModel.getPriceGun()); - } else { + } else { // 支付价格 childOrder.setGoodsActualPrice(priceModel.getPayPrice()); // 油价信息 @@ -363,6 +370,14 @@ public class HighOrderController { childOrder.setGoodsName(store.getStoreName()); childOrder.setGoodsSpecName("默认"); childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString()))); + + // 成本价 油站价 减 营销策略价 + childOrder.setGasPriceCost(priceModel.getPriceGun().subtract(marketingPrice)); + if (marketingPrice.compareTo(new BigDecimal("0")) <= 0) { + childOrder.setGasPriceCostTotal(childOrder.getTotalPrice()); + } else { + childOrder.setGasPriceCostTotal(childOrder.getGasPriceCost().multiply(childOrder.getGasOilLiters()).setScale(2, BigDecimal.ROUND_HALF_DOWN)); + } } if (childOrder.getGoodsType() == 7) { @@ -444,13 +459,14 @@ public class HighOrderController { - if (request.getHeader("regionId") != null) { + if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) { SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId"))); BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); highOrder.setCompanyId(bsCompany.getId()); } highOrder.setMerchId(request.getHeader("mchId")); + highOrder.setWhetherRebate(false); highOrder.setTotalPrice(totalPrice); highOrder.setPayablePrice(totalActualPrice); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index cc875b4c..8496a5b8 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -1 +1 @@ -package com.cweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOilGunNoService gasOilGunNoService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @Resource private UnionStagingPayConfig unionStagingPayConfig; @Resource private UnionUserConfig unionUserConfig; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOilCardService oilCardService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private MqttProviderConfig mqttProviderConfig; @Autowired private WebSocket webSocket; @Resource private ShellGroupService shellGroupService; @Resource private HighGasService gasService; @Resource private JinZhuJiaYouService jinZhuJiaYouService; @RequestMapping(value = "/spPrint", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发送打印机消息") public ResponseData spPrint(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); new Thread(() -> { try { SpPrinterConfig sp = new SpPrinterConfig(); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilCashierStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString(), new HashMap<>(), false ), 1); Thread.sleep(6000); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilClientStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString(), new HashMap<>(), false ), 1); } catch (Exception e) { e.printStackTrace(); } }).start(); } return ResponseMsgUtil.success("发送成功"); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoByGasId", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据油站 id 拉取最新的油站数据") public ResponseData queryGasInfoByGasId(@RequestParam(name = "gasId", required = true) String gasId, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(gasId)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "初始化加油站") public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue(); i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("初始化完成"); } @RequestMapping(value = "/detectTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "检测加油站") public ResponseData detectTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } Map param = new HashMap<>(); param.put("merchantId", merchant.getId()); List stores = highMerchantStoreService.getMerchantStoreList(param); for (HighMerchantStore store : stores) { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(store.getStoreKey()); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); store.setStatus(result.getInteger("gasStatus")); } else { store.setStatus(0); } highMerchantStoreService.updateMerchantStoreDetail(store); } return ResponseMsgUtil.success("初始化完成"); } /* @RequestMapping(value = "/pushTuanYouOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "推送团油订单") public ResponseData pushTuanYouOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); // 推送团油订单 Map paramMap = new HashMap<>(); paramMap.put("gasId", store.getStoreKey()); paramMap.put("oilNo", highChildOrder.getGasOilNo()); paramMap.put("gunNo", highChildOrder.getGasGunNo()); BigDecimal priceGun = highChildOrder.getGasPriceGun(); BigDecimal priceVip = highChildOrder.getGasPriceVip(); paramMap.put("priceGun", priceGun); // 枪单价 paramMap.put("priceVip", priceVip); // 优惠价 paramMap.put("driverPhone", order.getMemPhone()); // paramMap.put("driverPhone", "17726395120"); paramMap.put("thirdSerialNo", order.getOrderNo()); paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); // 油品类型 1:汽油:2:柴油;3:天然气 if (highChildOrder.getGasOilType() == 1) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); } else if (highChildOrder.getGasOilType() == 2) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); } JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); // 推送团油订单记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setCreateTime(new Date()); highGasOrderPush.setCode(orderPushObject.getString("code")); highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); highGasOrderPushMapper.insert(highGasOrderPush); if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); } highOrderService.updateOrder(order); } return ResponseMsgUtil.success(order); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } */ @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyAccountInfo2JD() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryCompanyPriceDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyPriceDetail() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyPriceDetail("LW000115995", "92")); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrdersPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "星巴克支付") public ResponseData starbucksOrdersPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrdersPay(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payKfcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "肯德基支付") public ResponseData payKfcOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxSplitAccount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "微信分账") public ResponseData wxSplitAccount() { try { HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304"); wxProfitsharing(orderNo.getOrderNo(), orderNo.getPaySerialNo(), orderNo.getPayRealPrice()); return ResponseMsgUtil.success("分账成功"); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryStaging", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期查询") public ResponseData queryStaging(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.queryStaging(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } /* @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "退款") public ResponseData orderToRefund(HttpServletRequest request) { try { OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund("4200001301202202035413938093", new BigDecimal("30.80"), new BigDecimal("16.90")); return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } }*/ @RequestMapping(value = "/query", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单查询") public ResponseData query(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.query(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } public void wxProfitsharing(String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1609882817"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); if (!resultProfitSharing.getResult_code().equals("FAIL")) { HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } public CloseableHttpClient readCertificate(String mchId) throws Exception { /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); // FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { instream.close(); } SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, "1289663601".toCharArray()).build();//这里也是写密码的 SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); // Allow TLSv1 protocol only return HttpClients.custom().setSSLSocketFactory(sslsf).build(); } public String doRefundRequest(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e) { throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket(@RequestParam(name = "orderNo", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map msgContent = new HashMap<>(); msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo())); msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + order.getTotalPrice())); pushMsg.put("message", JSONObject.toJSONString(msgContent)); HttpsUtils.doPost("http://127.0.0.1:9901/msg/test/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("null"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasStationQueryDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasStationQueryDetail") public ResponseData gasStationQueryDetail() { try { return ResponseMsgUtil.success(shellGroupService.gasStationQueryDetail("0001")); } catch (Exception e) { log.error("HighOrderController --> gasStationQueryDetail() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasPageQueryAllStation") public ResponseData gasPageQueryAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasSyncPayment", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasSyncPayment") public ResponseData gasSyncPayment() { try { HighOrder order = highOrderService.getOrderByOrderNo("HF2022071114274054900"); for (HighChildOrder childOrder : order.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); // 推送壳牌 JSONObject syncPayment = shellGroupService.gasSyncPayment(order.getOrderNo(), // store.getStoreKey(), "0001", new Date(), order.getTotalPrice(), "92", "1", order.getPayRealPrice(), childOrder.getGasDiscount() ); } return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasSyncRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasSyncRefund") public ResponseData gasSyncRefund() { try { shellGroupService.gasSyncRefund(new Date(1659511289000L), "1659511289357"); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJzStationListPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getJzStationListPage") public ResponseData getJzStationListPage() { try { gasService.getJinZhuAllStation(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "test") public ResponseData test() { try { JSONObject data = HuiLianTongUnionCardConfig.resolveResponse("Gbkl57c3fECXJRiCSOspjsb3bIyyFrE4TyMKKGsSAMzeXLElQQU00GoYZSYkJYg1G2Xlic2QvOd3\\nhJC7bc6qAg+9aoZr3IJi"); return ResponseMsgUtil.success(data); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } public static String hexStringToString(String s) { if (s == null || s.equals("")) { return null; } s = s.replace(" ", ""); byte[] baKeyword = new byte[s.length() / 2]; for (int i = 0; i < baKeyword.length; i++) { try { baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16)); } catch (Exception e) { e.printStackTrace(); } } try { s = new String(baKeyword, "UTF-8"); } catch (Exception e1) { e1.printStackTrace(); } return s; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final byte[] printText, final int pageCount, String encodingStr) { try { byte[] array = new byte[printText.length + 9]; array[0] = 30; array[1] = 16; array[2] = (byte) pageCount;//打印份数 int num = array.length - 5; array[3] = (byte) (num >> 8); //array[4] = (byte)((uint)num & 0xFFu); array[4] = (byte) (num & 0xFF); for (int i = 0; i < printText.length; i++) { array[i + 5] = printText[i]; } array[array.length - 4] = 27; array[array.length - 3] = 99; byte[] crc16CodeArray = getCRC(printText); array[array.length - 2] = crc16CodeArray[0]; array[array.length - 1] = crc16CodeArray[1]; return array; /* if(encodingStr.equals("")){ encodingStr="UTF-8"; } byte[] msgByte = printText; // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte;*/ } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final String printText, final int pageCount, String encodingStr) { try { if (encodingStr.equals("")) { encodingStr = "UTF-8"; } byte[] msgByte = printText.getBytes(encodingStr); // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte; } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } private static int[] CRC16Table = {0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78}; private static byte[] getCRC(byte[] bytes) { int crc = 0xFFFF; // 初始值 for (byte b : bytes) { crc = (crc >> 8) ^ CRC16Table[(crc ^ b) & 0xff]; } byte[] b = new byte[2]; b[0] = (byte) ((crc >> 8) ^ 0xff); b[1] = (byte) ((crc & 0xff) ^ 0xff); return b; } private static final char[] HEXES = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * byte数组 转换成 16进制小写字符串 */ private String bytes2Hex(byte[] bytes) { if (bytes == null || bytes.length == 0) { return null; } StringBuilder hex = new StringBuilder(); for (byte b : bytes) { hex.append(HEXES[(b >> 4) & 0x0F]); hex.append(HEXES[b & 0x0F]); } return hex.toString(); } @RequestMapping(value = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { String orderNo = "HF2022080818504922206"; JSONObject object = QianZhuConfig.insertV2("PLM100024", orderNo, "15585850137"); object.put("orderNo", orderNo); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/QueryV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单号") public ResponseData QueryV2(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); JSONObject orderObject = QianZhuConfig.QueryV2(orderNo); if (orderObject != null && orderObject.getLong("Code") == 999) { // 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 3) { // 订单失败 if (order.getOrderStatus() == 2) { highOrderService.thirdOrderToRefund(order.getId()); } else { highOrderService.thirdCancelOrder(order.getId()); } } // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(3); } order.setOrderStatus(3); order.setFinishTime(new Date()); highOrderService.updateOrder(order); } } return ResponseMsgUtil.success(QianZhuConfig.QueryV2(orderNo)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基订单") public ResponseData getKfcOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.getKfcOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克订单") public ResponseData starbucksOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/thirdOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "第三方退款") public ResponseData thirdOrderToRefund(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); highOrderService.thirdOrderToRefund(order.getId()); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇话费充值 ") public ResponseData rechargeOrderByCy() { try { JSONObject object = new JSONObject(); object.put("mobile" , "18090580471"); object.put("productId" , 172); object.put("agentOrderId" , "RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); return ResponseMsgUtil.success(RechargeConfig.rechargeOrderByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryRechargeByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇查询订单") public ResponseData queryRechargeByCy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("orderNo" , orderNo); return ResponseMsgUtil.success(RechargeConfig.queryRechargeByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/postIp", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求ip地址") public ResponseData postIp() { try { return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/brest/openApi/test")); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.cweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOilGunNoService gasOilGunNoService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @Resource private UnionStagingPayConfig unionStagingPayConfig; @Resource private UnionUserConfig unionUserConfig; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOilCardService oilCardService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private MqttProviderConfig mqttProviderConfig; @Autowired private WebSocket webSocket; @Resource private ShellGroupService shellGroupService; @Resource private HighGasService gasService; @Resource private JinZhuJiaYouService jinZhuJiaYouService; @RequestMapping(value = "/spPrint", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发送打印机消息") public ResponseData spPrint(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); new Thread(() -> { try { SpPrinterConfig sp = new SpPrinterConfig(); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilCashierStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString(), new HashMap<>(), false ), 1); Thread.sleep(6000); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilClientStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString(), new HashMap<>(), false ), 1); } catch (Exception e) { e.printStackTrace(); } }).start(); } return ResponseMsgUtil.success("发送成功"); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoByGasId", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据油站 id 拉取最新的油站数据") public ResponseData queryGasInfoByGasId(@RequestParam(name = "gasId", required = true) String gasId, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(gasId)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "初始化加油站") public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue(); i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("初始化完成"); } @RequestMapping(value = "/detectTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "检测加油站") public ResponseData detectTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } Map param = new HashMap<>(); param.put("merchantId", merchant.getId()); List stores = highMerchantStoreService.getMerchantStoreList(param); for (HighMerchantStore store : stores) { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(store.getStoreKey()); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); store.setStatus(result.getInteger("gasStatus")); } else { store.setStatus(0); } highMerchantStoreService.updateMerchantStoreDetail(store); } return ResponseMsgUtil.success("初始化完成"); } /* @RequestMapping(value = "/pushTuanYouOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "推送团油订单") public ResponseData pushTuanYouOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); // 推送团油订单 Map paramMap = new HashMap<>(); paramMap.put("gasId", store.getStoreKey()); paramMap.put("oilNo", highChildOrder.getGasOilNo()); paramMap.put("gunNo", highChildOrder.getGasGunNo()); BigDecimal priceGun = highChildOrder.getGasPriceGun(); BigDecimal priceVip = highChildOrder.getGasPriceVip(); paramMap.put("priceGun", priceGun); // 枪单价 paramMap.put("priceVip", priceVip); // 优惠价 paramMap.put("driverPhone", order.getMemPhone()); // paramMap.put("driverPhone", "17726395120"); paramMap.put("thirdSerialNo", order.getOrderNo()); paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); // 油品类型 1:汽油:2:柴油;3:天然气 if (highChildOrder.getGasOilType() == 1) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); } else if (highChildOrder.getGasOilType() == 2) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); } JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); // 推送团油订单记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setCreateTime(new Date()); highGasOrderPush.setCode(orderPushObject.getString("code")); highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); highGasOrderPushMapper.insert(highGasOrderPush); if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); } highOrderService.updateOrder(order); } return ResponseMsgUtil.success(order); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } */ @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyAccountInfo2JD() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryCompanyPriceDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyPriceDetail() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyPriceDetail("LW000115995", "92")); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrdersPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "星巴克支付") public ResponseData starbucksOrdersPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrdersPay(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payKfcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "肯德基支付") public ResponseData payKfcOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxSplitAccount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "微信分账") public ResponseData wxSplitAccount() { try { HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304"); wxProfitsharing(orderNo.getOrderNo(), orderNo.getPaySerialNo(), orderNo.getPayRealPrice()); return ResponseMsgUtil.success("分账成功"); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryStaging", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期查询") public ResponseData queryStaging(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.queryStaging(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } /* @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "退款") public ResponseData orderToRefund(HttpServletRequest request) { try { OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund("4200001301202202035413938093", new BigDecimal("30.80"), new BigDecimal("16.90")); return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } }*/ @RequestMapping(value = "/query", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单查询") public ResponseData query(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.query(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } public void wxProfitsharing(String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1609882817"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); if (!resultProfitSharing.getResult_code().equals("FAIL")) { HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } public CloseableHttpClient readCertificate(String mchId) throws Exception { /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); // FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { instream.close(); } SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, "1289663601".toCharArray()).build();//这里也是写密码的 SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); // Allow TLSv1 protocol only return HttpClients.custom().setSSLSocketFactory(sslsf).build(); } public String doRefundRequest(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e) { throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket(@RequestParam(name = "orderNo", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map msgContent = new HashMap<>(); msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo())); msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + order.getTotalPrice())); pushMsg.put("message", JSONObject.toJSONString(msgContent)); HttpsUtils.doPost("http://127.0.0.1:9901/msg/test/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("null"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasStationQueryDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasStationQueryDetail") public ResponseData gasStationQueryDetail() { try { return ResponseMsgUtil.success(shellGroupService.gasStationQueryDetail("0001")); } catch (Exception e) { log.error("HighOrderController --> gasStationQueryDetail() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasPageQueryAllStation") public ResponseData gasPageQueryAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasSyncPayment", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasSyncPayment") public ResponseData gasSyncPayment() { try { HighOrder order = highOrderService.getOrderByOrderNo("HF2022071114274054900"); for (HighChildOrder childOrder : order.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); // 推送壳牌 JSONObject syncPayment = shellGroupService.gasSyncPayment(order.getOrderNo(), // store.getStoreKey(), "0001", new Date(), order.getTotalPrice(), "92", "1", order.getPayRealPrice(), childOrder.getGasDiscount() ); } return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasSyncRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasSyncRefund") public ResponseData gasSyncRefund() { try { shellGroupService.gasSyncRefund(new Date(1659511289000L), "1659511289357"); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJzStationListPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getJzStationListPage") public ResponseData getJzStationListPage() { try { gasService.getJinZhuAllStation(); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "test") public ResponseData test() { try { JSONObject data = HuiLianTongUnionCardConfig.resolveResponse("Gbkl57c3fECXJRiCSOspjsb3bIyyFrE4TyMKKGsSAMzeXLElQQU00GoYZSYkJYg1G2Xlic2QvOd3\\nhJC7bc6qAg+9aoZr3IJi"); return ResponseMsgUtil.success(data); } catch (Exception e) { log.error("HighOrderController --> gasSyncRefund() error!", e); return ResponseMsgUtil.exception(e); } } public static String hexStringToString(String s) { if (s == null || s.equals("")) { return null; } s = s.replace(" ", ""); byte[] baKeyword = new byte[s.length() / 2]; for (int i = 0; i < baKeyword.length; i++) { try { baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16)); } catch (Exception e) { e.printStackTrace(); } } try { s = new String(baKeyword, "UTF-8"); } catch (Exception e1) { e1.printStackTrace(); } return s; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final byte[] printText, final int pageCount, String encodingStr) { try { byte[] array = new byte[printText.length + 9]; array[0] = 30; array[1] = 16; array[2] = (byte) pageCount;//打印份数 int num = array.length - 5; array[3] = (byte) (num >> 8); //array[4] = (byte)((uint)num & 0xFFu); array[4] = (byte) (num & 0xFF); for (int i = 0; i < printText.length; i++) { array[i + 5] = printText[i]; } array[array.length - 4] = 27; array[array.length - 3] = 99; byte[] crc16CodeArray = getCRC(printText); array[array.length - 2] = crc16CodeArray[0]; array[array.length - 1] = crc16CodeArray[1]; return array; /* if(encodingStr.equals("")){ encodingStr="UTF-8"; } byte[] msgByte = printText; // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte;*/ } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final String printText, final int pageCount, String encodingStr) { try { if (encodingStr.equals("")) { encodingStr = "UTF-8"; } byte[] msgByte = printText.getBytes(encodingStr); // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte; } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } private static int[] CRC16Table = {0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78}; private static byte[] getCRC(byte[] bytes) { int crc = 0xFFFF; // 初始值 for (byte b : bytes) { crc = (crc >> 8) ^ CRC16Table[(crc ^ b) & 0xff]; } byte[] b = new byte[2]; b[0] = (byte) ((crc >> 8) ^ 0xff); b[1] = (byte) ((crc & 0xff) ^ 0xff); return b; } private static final char[] HEXES = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * byte数组 转换成 16进制小写字符串 */ private String bytes2Hex(byte[] bytes) { if (bytes == null || bytes.length == 0) { return null; } StringBuilder hex = new StringBuilder(); for (byte b : bytes) { hex.append(HEXES[(b >> 4) & 0x0F]); hex.append(HEXES[b & 0x0F]); } return hex.toString(); } @RequestMapping(value = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { String orderNo = "HF2022080818504922206"; JSONObject object = QianZhuConfig.insertV2("PLM100024", orderNo, "15585850137"); object.put("orderNo", orderNo); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/QueryV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单号") public ResponseData QueryV2(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); JSONObject orderObject = QianZhuConfig.QueryV2(orderNo); if (orderObject != null && orderObject.getLong("Code") == 999) { // 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 3) { // 订单失败 if (order.getOrderStatus() == 2) { highOrderService.thirdOrderToRefund(order.getId()); } else { highOrderService.thirdCancelOrder(order.getId()); } } // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(3); } order.setOrderStatus(3); order.setFinishTime(new Date()); highOrderService.updateOrder(order); } } return ResponseMsgUtil.success(QianZhuConfig.QueryV2(orderNo)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基订单") public ResponseData getKfcOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.getKfcOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克订单") public ResponseData starbucksOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/thirdOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "第三方退款") public ResponseData thirdOrderToRefund(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); highOrderService.thirdOrderToRefund(order.getId()); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇话费充值 ") public ResponseData rechargeOrderByCy() { try { JSONObject object = new JSONObject(); object.put("mobile" , "18090580471"); object.put("productId" , 172); object.put("agentOrderId" , "RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); return ResponseMsgUtil.success(RechargeConfig.rechargeOrderByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryRechargeByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇查询订单") public ResponseData queryRechargeByCy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("orderNo" , orderNo); return ResponseMsgUtil.success(RechargeConfig.queryRechargeByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/postIp", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求ip地址") public ResponseData postIp(HttpServletRequest request) { try { request.getHeader("regionId"); if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) { System.out.println("111"); } return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/brest/openApi/test")); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 583037c1..a3901fa0 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -196,7 +196,7 @@ public class OrderController { if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { BigDecimal account = new BigDecimal("0"); // 查询账号余额 - HighMerchantAccount merAccount = merchantAccountService.getStoreAccountDetail(store.getMerchantId()); + HighMerchantAccount merAccount = merchantAccountService.getMerAccountDetail(store.getMerchantId()); if (merAccount != null) { account = merAccount.getAmounts().subtract(merchantAccountService.countMerGasOilAmount(store.getMerchantId())); } @@ -424,7 +424,7 @@ public class OrderController { || store.getSourceType().equals(MerchantStoreSourceType.type4.getNumber())) { BigDecimal account = new BigDecimal("0"); // 查询账号余额 - HighMerchantAccount merAccount = merchantAccountService.getStoreAccountDetail(store.getMerchantId()); + HighMerchantAccount merAccount = merchantAccountService.getMerAccountDetail(store.getMerchantId()); if (merAccount != null) { account = merAccount.getAmounts().subtract(merchantAccountService.countMerGasOilAmount(store.getMerchantId())); } @@ -551,7 +551,7 @@ public class OrderController { if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { BigDecimal account = new BigDecimal("0"); // 查询账号余额 - HighMerchantAccount merAccount = merchantAccountService.getStoreAccountDetail(store.getMerchantId()); + HighMerchantAccount merAccount = merchantAccountService.getMerAccountDetail(store.getMerchantId()); if (merAccount != null) { account = merAccount.getAmounts().subtract(merchantAccountService.countMerGasOilAmount(store.getMerchantId())); } @@ -677,7 +677,7 @@ public class OrderController { if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { BigDecimal account = new BigDecimal("0"); // 查询账号余额 - HighMerchantAccount merAccount = merchantAccountService.getStoreAccountDetail(store.getMerchantId()); + HighMerchantAccount merAccount = merchantAccountService.getMerAccountDetail(store.getMerchantId()); if (merAccount != null) { account = merAccount.getAmounts().subtract(merchantAccountService.countMerGasOilAmount(store.getMerchantId())); } @@ -783,7 +783,7 @@ public class OrderController { if (store.getSourceType().equals(MerchantStoreSourceType.type3.getNumber())) { BigDecimal account = new BigDecimal("0"); // 查询账号余额 - HighMerchantAccount merAccount = merchantAccountService.getStoreAccountDetail(store.getMerchantId()); + HighMerchantAccount merAccount = merchantAccountService.getMerAccountDetail(store.getMerchantId()); if (merAccount != null) { account = merAccount.getAmounts().subtract(merchantAccountService.countMerGasOilAmount(store.getMerchantId())); } diff --git a/hai-service/src/main/java/com/hai/config/ShellGroupService.java b/hai-service/src/main/java/com/hai/config/ShellGroupService.java index 7244a04e..11dc8354 100644 --- a/hai-service/src/main/java/com/hai/config/ShellGroupService.java +++ b/hai-service/src/main/java/com/hai/config/ShellGroupService.java @@ -69,7 +69,7 @@ public class ShellGroupService { * @param oilCode 油品编码 * @param oilGun 油枪 * @param settlementAmount 支付金额 - * @param favourAmount 优惠金额 + * @param channelFavourAmount 优惠金额 * @return */ public JSONObject gasSyncPayment(String orderNo, @@ -79,20 +79,20 @@ public class ShellGroupService { String oilCode, String oilGun, BigDecimal settlementAmount, - BigDecimal favourAmount) { + BigDecimal channelFavourAmount) { try { Map param = new HashMap<>(); param.put("platMerchantId", CommonSysConst.getSysConfig().getShellPlatMerchantId()); param.put("stationCode", stationCode); param.put("orderType", "OIL"); param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss")); + param.put("channelFavourAmount", channelFavourAmount); Map tradeOilOrder = new HashMap<>(); tradeOilOrder.put("amount", oilPrice); tradeOilOrder.put("code", oilCode); tradeOilOrder.put("oilGun", oilGun); tradeOilOrder.put("channelSettlementAmount", settlementAmount); - tradeOilOrder.put("channelFavourAmount", favourAmount); param.put("tradeOilOrder", JSONObject.toJSONString(tradeOilOrder)); return request(orderNo.replace("HF",""), "gas_sync_payment_notify", param); } catch (Exception e) { diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java index 72349bcd..2f0c68d2 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java @@ -52,6 +52,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "gas_oil_type, gas_order_no, ", "gas_price_platform, gas_price_gun, ", "gas_price_vip, gas_price_official, ", + "gas_price_cost, gas_price_cost_total, ", "gas_price_channel_pay, gas_oil_liters, ", "gas_discount, gas_oil_subsidy, ", "gas_liters_preferences, gas_price_preferences, ", @@ -76,6 +77,7 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "#{gasOilType,jdbcType=INTEGER}, #{gasOrderNo,jdbcType=VARCHAR}, ", "#{gasPricePlatform,jdbcType=DECIMAL}, #{gasPriceGun,jdbcType=DECIMAL}, ", "#{gasPriceVip,jdbcType=DECIMAL}, #{gasPriceOfficial,jdbcType=DECIMAL}, ", + "#{gasPriceCost,jdbcType=DECIMAL}, #{gasPriceCostTotal,jdbcType=DECIMAL}, ", "#{gasPriceChannelPay,jdbcType=DECIMAL}, #{gasOilLiters,jdbcType=DECIMAL}, ", "#{gasDiscount,jdbcType=DECIMAL}, #{gasOilSubsidy,jdbcType=DECIMAL}, ", "#{gasLitersPreferences,jdbcType=DECIMAL}, #{gasPricePreferences,jdbcType=DECIMAL}, ", @@ -124,6 +126,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_official", property="gasPriceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_cost", property="gasPriceCost", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_cost_total", property="gasPriceCostTotal", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_channel_pay", property="gasPriceChannelPay", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL), @Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL), @@ -156,11 +160,11 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "goods_name, goods_desc, goods_img, goods_spec_name, goods_price, goods_actual_price, ", "sale_count, total_price, giveaway_type, child_orde_status, praise_status, gas_oil_no, ", "gas_gun_no, gas_oil_type, gas_order_no, gas_price_platform, gas_price_gun, gas_price_vip, ", - "gas_price_official, gas_price_channel_pay, gas_oil_liters, gas_discount, gas_oil_subsidy, ", - "gas_liters_preferences, gas_price_preferences, gas_class_group_id, gas_class_group_name, ", - "gas_class_group_task_id, gas_staff_id, gas_staff_name, gas_salesman_id, gas_salesman_name, ", - "gas_agent_id, gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ", - "ext_4, ext_5, ext_6", + "gas_price_official, gas_price_cost, gas_price_cost_total, gas_price_channel_pay, ", + "gas_oil_liters, gas_discount, gas_oil_subsidy, gas_liters_preferences, gas_price_preferences, ", + "gas_class_group_id, gas_class_group_name, gas_class_group_task_id, gas_staff_id, ", + "gas_staff_name, gas_salesman_id, gas_salesman_name, gas_agent_id, gas_agent_name, ", + "gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6", "from high_child_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -192,6 +196,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_official", property="gasPriceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_cost", property="gasPriceCost", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_cost_total", property="gasPriceCostTotal", jdbcType=JdbcType.DECIMAL), @Result(column="gas_price_channel_pay", property="gasPriceChannelPay", jdbcType=JdbcType.DECIMAL), @Result(column="gas_oil_liters", property="gasOilLiters", jdbcType=JdbcType.DECIMAL), @Result(column="gas_discount", property="gasDiscount", jdbcType=JdbcType.DECIMAL), @@ -255,6 +261,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL},", "gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL},", "gas_price_official = #{gasPriceOfficial,jdbcType=DECIMAL},", + "gas_price_cost = #{gasPriceCost,jdbcType=DECIMAL},", + "gas_price_cost_total = #{gasPriceCostTotal,jdbcType=DECIMAL},", "gas_price_channel_pay = #{gasPriceChannelPay,jdbcType=DECIMAL},", "gas_oil_liters = #{gasOilLiters,jdbcType=DECIMAL},", "gas_discount = #{gasDiscount,jdbcType=DECIMAL},", diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java index 2159353f..cf0c0d2b 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java @@ -132,6 +132,14 @@ public class HighChildOrderSqlProvider { sql.VALUES("gas_price_official", "#{gasPriceOfficial,jdbcType=DECIMAL}"); } + if (record.getGasPriceCost() != null) { + sql.VALUES("gas_price_cost", "#{gasPriceCost,jdbcType=DECIMAL}"); + } + + if (record.getGasPriceCostTotal() != null) { + sql.VALUES("gas_price_cost_total", "#{gasPriceCostTotal,jdbcType=DECIMAL}"); + } + if (record.getGasPriceChannelPay() != null) { sql.VALUES("gas_price_channel_pay", "#{gasPriceChannelPay,jdbcType=DECIMAL}"); } @@ -260,6 +268,8 @@ public class HighChildOrderSqlProvider { sql.SELECT("gas_price_gun"); sql.SELECT("gas_price_vip"); sql.SELECT("gas_price_official"); + sql.SELECT("gas_price_cost"); + sql.SELECT("gas_price_cost_total"); sql.SELECT("gas_price_channel_pay"); sql.SELECT("gas_oil_liters"); sql.SELECT("gas_discount"); @@ -408,6 +418,14 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_official = #{record.gasPriceOfficial,jdbcType=DECIMAL}"); } + if (record.getGasPriceCost() != null) { + sql.SET("gas_price_cost = #{record.gasPriceCost,jdbcType=DECIMAL}"); + } + + if (record.getGasPriceCostTotal() != null) { + sql.SET("gas_price_cost_total = #{record.gasPriceCostTotal,jdbcType=DECIMAL}"); + } + if (record.getGasPriceChannelPay() != null) { sql.SET("gas_price_channel_pay = #{record.gasPriceChannelPay,jdbcType=DECIMAL}"); } @@ -535,6 +553,8 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); sql.SET("gas_price_official = #{record.gasPriceOfficial,jdbcType=DECIMAL}"); + sql.SET("gas_price_cost = #{record.gasPriceCost,jdbcType=DECIMAL}"); + sql.SET("gas_price_cost_total = #{record.gasPriceCostTotal,jdbcType=DECIMAL}"); sql.SET("gas_price_channel_pay = #{record.gasPriceChannelPay,jdbcType=DECIMAL}"); sql.SET("gas_oil_liters = #{record.gasOilLiters,jdbcType=DECIMAL}"); sql.SET("gas_discount = #{record.gasDiscount,jdbcType=DECIMAL}"); @@ -672,6 +692,14 @@ public class HighChildOrderSqlProvider { sql.SET("gas_price_official = #{gasPriceOfficial,jdbcType=DECIMAL}"); } + if (record.getGasPriceCost() != null) { + sql.SET("gas_price_cost = #{gasPriceCost,jdbcType=DECIMAL}"); + } + + if (record.getGasPriceCostTotal() != null) { + sql.SET("gas_price_cost_total = #{gasPriceCostTotal,jdbcType=DECIMAL}"); + } + if (record.getGasPriceChannelPay() != null) { sql.SET("gas_price_channel_pay = #{gasPriceChannelPay,jdbcType=DECIMAL}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java index 5eda9554..a805c217 100644 --- a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMapperExt.java @@ -14,7 +14,7 @@ public interface HighMerchantAccountMapperExt { @Select({"select " + - " case when sum(b.total_price) is not null then sum(b.total_price) ELSE 0 end " + + " case when sum(a.gas_price_cost_total) is not null then sum(a.gas_price_cost_total) ELSE 0 end " + " from high_child_order a, high_order b" + " where goods_type = 3 " + " and a.order_id = b.id" + diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingMapper.java new file mode 100644 index 00000000..e140161b --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingMapper.java @@ -0,0 +1,125 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantAccountMarketing; +import com.hai.entity.HighMerchantAccountMarketingExample; +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 HighMerchantAccountMarketingMapper extends HighMerchantAccountMarketingMapperExt { + @SelectProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="countByExample") + long countByExample(HighMerchantAccountMarketingExample example); + + @DeleteProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="deleteByExample") + int deleteByExample(HighMerchantAccountMarketingExample example); + + @Delete({ + "delete from high_merchant_account_marketing", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_merchant_account_marketing (`type`, mer_id, ", + "mer_account_id, price, ", + "oil_no_relief_price, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{type,jdbcType=INTEGER}, #{merId,jdbcType=BIGINT}, ", + "#{merAccountId,jdbcType=BIGINT}, #{price,jdbcType=DECIMAL}, ", + "#{oilNoReliefPrice,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighMerchantAccountMarketing record); + + @InsertProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighMerchantAccountMarketing record); + + @SelectProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_account_id", property="merAccountId", jdbcType=JdbcType.BIGINT), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="oil_no_relief_price", property="oilNoReliefPrice", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @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 selectByExample(HighMerchantAccountMarketingExample example); + + @Select({ + "select", + "id, `type`, mer_id, mer_account_id, price, oil_no_relief_price, `status`, create_time, ", + "update_time, ext_1, ext_2, ext_3", + "from high_merchant_account_marketing", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_account_id", property="merAccountId", jdbcType=JdbcType.BIGINT), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="oil_no_relief_price", property="oilNoReliefPrice", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + HighMerchantAccountMarketing selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighMerchantAccountMarketing record, @Param("example") HighMerchantAccountMarketingExample example); + + @UpdateProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighMerchantAccountMarketing record, @Param("example") HighMerchantAccountMarketingExample example); + + @UpdateProvider(type=HighMerchantAccountMarketingSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighMerchantAccountMarketing record); + + @Update({ + "update high_merchant_account_marketing", + "set `type` = #{type,jdbcType=INTEGER},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_account_id = #{merAccountId,jdbcType=BIGINT},", + "price = #{price,jdbcType=DECIMAL},", + "oil_no_relief_price = #{oilNoReliefPrice,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighMerchantAccountMarketing record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingMapperExt.java new file mode 100644 index 00000000..fac6b080 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighMerchantAccountMarketingMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingSqlProvider.java new file mode 100644 index 00000000..80df0b56 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountMarketingSqlProvider.java @@ -0,0 +1,332 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantAccountMarketing; +import com.hai.entity.HighMerchantAccountMarketingExample.Criteria; +import com.hai.entity.HighMerchantAccountMarketingExample.Criterion; +import com.hai.entity.HighMerchantAccountMarketingExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighMerchantAccountMarketingSqlProvider { + + public String countByExample(HighMerchantAccountMarketingExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_merchant_account_marketing"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighMerchantAccountMarketingExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_merchant_account_marketing"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighMerchantAccountMarketing record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_merchant_account_marketing"); + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerAccountId() != null) { + sql.VALUES("mer_account_id", "#{merAccountId,jdbcType=BIGINT}"); + } + + if (record.getPrice() != null) { + sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); + } + + if (record.getOilNoReliefPrice() != null) { + sql.VALUES("oil_no_relief_price", "#{oilNoReliefPrice,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + 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(HighMerchantAccountMarketingExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("`type`"); + sql.SELECT("mer_id"); + sql.SELECT("mer_account_id"); + sql.SELECT("price"); + sql.SELECT("oil_no_relief_price"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_merchant_account_marketing"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighMerchantAccountMarketing record = (HighMerchantAccountMarketing) parameter.get("record"); + HighMerchantAccountMarketingExample example = (HighMerchantAccountMarketingExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_merchant_account_marketing"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerAccountId() != null) { + sql.SET("mer_account_id = #{record.merAccountId,jdbcType=BIGINT}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + } + + if (record.getOilNoReliefPrice() != null) { + sql.SET("oil_no_relief_price = #{record.oilNoReliefPrice,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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.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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_account_marketing"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_account_id = #{record.merAccountId,jdbcType=BIGINT}"); + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + sql.SET("oil_no_relief_price = #{record.oilNoReliefPrice,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + HighMerchantAccountMarketingExample example = (HighMerchantAccountMarketingExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighMerchantAccountMarketing record) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_account_marketing"); + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerAccountId() != null) { + sql.SET("mer_account_id = #{merAccountId,jdbcType=BIGINT}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{price,jdbcType=DECIMAL}"); + } + + if (record.getOilNoReliefPrice() != null) { + sql.SET("oil_no_relief_price = #{oilNoReliefPrice,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + 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, HighMerchantAccountMarketingExample 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 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 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordMapper.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordMapper.java new file mode 100644 index 00000000..bdb65464 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordMapper.java @@ -0,0 +1,170 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantAccountRecord; +import com.hai.entity.HighMerchantAccountRecordExample; +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 HighMerchantAccountRecordMapper extends HighMerchantAccountRecordMapperExt { + @SelectProvider(type=HighMerchantAccountRecordSqlProvider.class, method="countByExample") + long countByExample(HighMerchantAccountRecordExample example); + + @DeleteProvider(type=HighMerchantAccountRecordSqlProvider.class, method="deleteByExample") + int deleteByExample(HighMerchantAccountRecordExample example); + + @Delete({ + "delete from high_merchant_account_record", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into high_merchant_account_record (mer_amount_id, mer_id, ", + "mer_name, `type`, amount, ", + "marketing_status, marketing_type, ", + "marketing_price, marketing_trade_price, ", + "trade_price, before_amount, ", + "after_amount, source_type, ", + "source_id, source_content, ", + "`status`, create_time, ", + "op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3)", + "values (#{merAmountId,jdbcType=BIGINT}, #{merId,jdbcType=BIGINT}, ", + "#{merName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, ", + "#{marketingStatus,jdbcType=BIT}, #{marketingType,jdbcType=INTEGER}, ", + "#{marketingPrice,jdbcType=DECIMAL}, #{marketingTradePrice,jdbcType=DECIMAL}, ", + "#{tradePrice,jdbcType=DECIMAL}, #{beforeAmount,jdbcType=DECIMAL}, ", + "#{afterAmount,jdbcType=DECIMAL}, #{sourceType,jdbcType=INTEGER}, ", + "#{sourceId,jdbcType=BIGINT}, #{sourceContent,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(HighMerchantAccountRecord record); + + @InsertProvider(type=HighMerchantAccountRecordSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(HighMerchantAccountRecord record); + + @SelectProvider(type=HighMerchantAccountRecordSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_amount_id", property="merAmountId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="marketing_status", property="marketingStatus", jdbcType=JdbcType.BIT), + @Result(column="marketing_type", property="marketingType", jdbcType=JdbcType.INTEGER), + @Result(column="marketing_price", property="marketingPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="marketing_trade_price", property="marketingTradePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="trade_price", property="tradePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="after_amount", property="afterAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_content", property="sourceContent", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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 selectByExample(HighMerchantAccountRecordExample example); + + @Select({ + "select", + "id, mer_amount_id, mer_id, mer_name, `type`, amount, marketing_status, marketing_type, ", + "marketing_price, marketing_trade_price, trade_price, before_amount, after_amount, ", + "source_type, source_id, source_content, `status`, create_time, op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3", + "from high_merchant_account_record", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_amount_id", property="merAmountId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="marketing_status", property="marketingStatus", jdbcType=JdbcType.BIT), + @Result(column="marketing_type", property="marketingType", jdbcType=JdbcType.INTEGER), + @Result(column="marketing_price", property="marketingPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="marketing_trade_price", property="marketingTradePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="trade_price", property="tradePrice", jdbcType=JdbcType.DECIMAL), + @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="after_amount", property="afterAmount", jdbcType=JdbcType.DECIMAL), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="source_id", property="sourceId", jdbcType=JdbcType.BIGINT), + @Result(column="source_content", property="sourceContent", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", 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) + }) + HighMerchantAccountRecord selectByPrimaryKey(Long id); + + @UpdateProvider(type=HighMerchantAccountRecordSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") HighMerchantAccountRecord record, @Param("example") HighMerchantAccountRecordExample example); + + @UpdateProvider(type=HighMerchantAccountRecordSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") HighMerchantAccountRecord record, @Param("example") HighMerchantAccountRecordExample example); + + @UpdateProvider(type=HighMerchantAccountRecordSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(HighMerchantAccountRecord record); + + @Update({ + "update high_merchant_account_record", + "set mer_amount_id = #{merAmountId,jdbcType=BIGINT},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "`type` = #{type,jdbcType=INTEGER},", + "amount = #{amount,jdbcType=DECIMAL},", + "marketing_status = #{marketingStatus,jdbcType=BIT},", + "marketing_type = #{marketingType,jdbcType=INTEGER},", + "marketing_price = #{marketingPrice,jdbcType=DECIMAL},", + "marketing_trade_price = #{marketingTradePrice,jdbcType=DECIMAL},", + "trade_price = #{tradePrice,jdbcType=DECIMAL},", + "before_amount = #{beforeAmount,jdbcType=DECIMAL},", + "after_amount = #{afterAmount,jdbcType=DECIMAL},", + "source_type = #{sourceType,jdbcType=INTEGER},", + "source_id = #{sourceId,jdbcType=BIGINT},", + "source_content = #{sourceContent,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(HighMerchantAccountRecord record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordMapperExt.java new file mode 100644 index 00000000..8429ba66 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighMerchantAccountRecordMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordSqlProvider.java new file mode 100644 index 00000000..4cfba3c5 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighMerchantAccountRecordSqlProvider.java @@ -0,0 +1,486 @@ +package com.hai.dao; + +import com.hai.entity.HighMerchantAccountRecord; +import com.hai.entity.HighMerchantAccountRecordExample.Criteria; +import com.hai.entity.HighMerchantAccountRecordExample.Criterion; +import com.hai.entity.HighMerchantAccountRecordExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class HighMerchantAccountRecordSqlProvider { + + public String countByExample(HighMerchantAccountRecordExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("high_merchant_account_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(HighMerchantAccountRecordExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("high_merchant_account_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(HighMerchantAccountRecord record) { + SQL sql = new SQL(); + sql.INSERT_INTO("high_merchant_account_record"); + + if (record.getMerAmountId() != null) { + sql.VALUES("mer_amount_id", "#{merAmountId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getAmount() != null) { + sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); + } + + if (record.getMarketingStatus() != null) { + sql.VALUES("marketing_status", "#{marketingStatus,jdbcType=BIT}"); + } + + if (record.getMarketingType() != null) { + sql.VALUES("marketing_type", "#{marketingType,jdbcType=INTEGER}"); + } + + if (record.getMarketingPrice() != null) { + sql.VALUES("marketing_price", "#{marketingPrice,jdbcType=DECIMAL}"); + } + + if (record.getMarketingTradePrice() != null) { + sql.VALUES("marketing_trade_price", "#{marketingTradePrice,jdbcType=DECIMAL}"); + } + + if (record.getTradePrice() != null) { + sql.VALUES("trade_price", "#{tradePrice,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.VALUES("before_amount", "#{beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.VALUES("after_amount", "#{afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.VALUES("source_type", "#{sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.VALUES("source_id", "#{sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceContent() != null) { + sql.VALUES("source_content", "#{sourceContent,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,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(HighMerchantAccountRecordExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_amount_id"); + sql.SELECT("mer_id"); + sql.SELECT("mer_name"); + sql.SELECT("`type`"); + sql.SELECT("amount"); + sql.SELECT("marketing_status"); + sql.SELECT("marketing_type"); + sql.SELECT("marketing_price"); + sql.SELECT("marketing_trade_price"); + sql.SELECT("trade_price"); + sql.SELECT("before_amount"); + sql.SELECT("after_amount"); + sql.SELECT("source_type"); + sql.SELECT("source_id"); + sql.SELECT("source_content"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("high_merchant_account_record"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + HighMerchantAccountRecord record = (HighMerchantAccountRecord) parameter.get("record"); + HighMerchantAccountRecordExample example = (HighMerchantAccountRecordExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("high_merchant_account_record"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerAmountId() != null) { + sql.SET("mer_amount_id = #{record.merAmountId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getAmount() != null) { + sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + } + + if (record.getMarketingStatus() != null) { + sql.SET("marketing_status = #{record.marketingStatus,jdbcType=BIT}"); + } + + if (record.getMarketingType() != null) { + sql.SET("marketing_type = #{record.marketingType,jdbcType=INTEGER}"); + } + + if (record.getMarketingPrice() != null) { + sql.SET("marketing_price = #{record.marketingPrice,jdbcType=DECIMAL}"); + } + + if (record.getMarketingTradePrice() != null) { + sql.SET("marketing_trade_price = #{record.marketingTradePrice,jdbcType=DECIMAL}"); + } + + if (record.getTradePrice() != null) { + sql.SET("trade_price = #{record.tradePrice,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.SET("after_amount = #{record.afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceContent() != null) { + sql.SET("source_content = #{record.sourceContent,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,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 parameter) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_account_record"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_amount_id = #{record.merAmountId,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + sql.SET("marketing_status = #{record.marketingStatus,jdbcType=BIT}"); + sql.SET("marketing_type = #{record.marketingType,jdbcType=INTEGER}"); + sql.SET("marketing_price = #{record.marketingPrice,jdbcType=DECIMAL}"); + sql.SET("marketing_trade_price = #{record.marketingTradePrice,jdbcType=DECIMAL}"); + sql.SET("trade_price = #{record.tradePrice,jdbcType=DECIMAL}"); + sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); + sql.SET("after_amount = #{record.afterAmount,jdbcType=DECIMAL}"); + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + sql.SET("source_id = #{record.sourceId,jdbcType=BIGINT}"); + sql.SET("source_content = #{record.sourceContent,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,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}"); + + HighMerchantAccountRecordExample example = (HighMerchantAccountRecordExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(HighMerchantAccountRecord record) { + SQL sql = new SQL(); + sql.UPDATE("high_merchant_account_record"); + + if (record.getMerAmountId() != null) { + sql.SET("mer_amount_id = #{merAmountId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getAmount() != null) { + sql.SET("amount = #{amount,jdbcType=DECIMAL}"); + } + + if (record.getMarketingStatus() != null) { + sql.SET("marketing_status = #{marketingStatus,jdbcType=BIT}"); + } + + if (record.getMarketingType() != null) { + sql.SET("marketing_type = #{marketingType,jdbcType=INTEGER}"); + } + + if (record.getMarketingPrice() != null) { + sql.SET("marketing_price = #{marketingPrice,jdbcType=DECIMAL}"); + } + + if (record.getMarketingTradePrice() != null) { + sql.SET("marketing_trade_price = #{marketingTradePrice,jdbcType=DECIMAL}"); + } + + if (record.getTradePrice() != null) { + sql.SET("trade_price = #{tradePrice,jdbcType=DECIMAL}"); + } + + if (record.getBeforeAmount() != null) { + sql.SET("before_amount = #{beforeAmount,jdbcType=DECIMAL}"); + } + + if (record.getAfterAmount() != null) { + sql.SET("after_amount = #{afterAmount,jdbcType=DECIMAL}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{sourceType,jdbcType=INTEGER}"); + } + + if (record.getSourceId() != null) { + sql.SET("source_id = #{sourceId,jdbcType=BIGINT}"); + } + + if (record.getSourceContent() != null) { + sql.SET("source_content = #{sourceContent,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,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, HighMerchantAccountRecordExample 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 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 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java index 0c936def..15f27d63 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapper.java @@ -58,9 +58,9 @@ public interface HighOrderMapper extends HighOrderMapperExt { "profit_sharing_ratio, account_merchant_num, ", "product_type, print_status, ", "print_num, whether_check, ", - "region_id, company_id, ", - "merch_id, ext_1, ext_2, ", - "ext_3)", + "whether_rebate, region_id, ", + "company_id, merch_id, ", + "ext_1, ext_2, ext_3)", "values (#{orderNo,jdbcType=VARCHAR}, #{memDiscountId,jdbcType=BIGINT}, ", "#{memDiscountName,jdbcType=VARCHAR}, #{memId,jdbcType=BIGINT}, ", "#{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ", @@ -80,9 +80,9 @@ public interface HighOrderMapper extends HighOrderMapperExt { "#{profitSharingRatio,jdbcType=DECIMAL}, #{accountMerchantNum,jdbcType=VARCHAR}, ", "#{productType,jdbcType=INTEGER}, #{printStatus,jdbcType=BIT}, ", "#{printNum,jdbcType=INTEGER}, #{whetherCheck,jdbcType=BIT}, ", - "#{regionId,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, ", - "#{merchId,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", - "#{ext3,jdbcType=VARCHAR})" + "#{whetherRebate,jdbcType=BIT}, #{regionId,jdbcType=VARCHAR}, ", + "#{companyId,jdbcType=BIGINT}, #{merchId,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighOrder record); @@ -132,6 +132,7 @@ public interface HighOrderMapper extends HighOrderMapperExt { @Result(column="print_status", property="printStatus", jdbcType=JdbcType.BIT), @Result(column="print_num", property="printNum", jdbcType=JdbcType.INTEGER), @Result(column="whether_check", property="whetherCheck", jdbcType=JdbcType.BIT), + @Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT), @Result(column="region_id", property="regionId", jdbcType=JdbcType.VARCHAR), @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), @Result(column="merch_id", property="merchId", jdbcType=JdbcType.VARCHAR), @@ -149,8 +150,8 @@ public interface HighOrderMapper extends HighOrderMapperExt { "total_price, create_time, pay_time, cancel_time, cancel_remarks, finish_time, ", "remarks, refund_no, refund_time, refund_price, refund_content, refusal_refund_content, ", "Identification_code, profit_sharing_status, profit_sharing_ratio, account_merchant_num, ", - "product_type, print_status, print_num, whether_check, region_id, company_id, ", - "merch_id, ext_1, ext_2, ext_3", + "product_type, print_status, print_num, whether_check, whether_rebate, region_id, ", + "company_id, merch_id, ext_1, ext_2, ext_3", "from high_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -194,6 +195,7 @@ public interface HighOrderMapper extends HighOrderMapperExt { @Result(column="print_status", property="printStatus", jdbcType=JdbcType.BIT), @Result(column="print_num", property="printNum", jdbcType=JdbcType.INTEGER), @Result(column="whether_check", property="whetherCheck", jdbcType=JdbcType.BIT), + @Result(column="whether_rebate", property="whetherRebate", jdbcType=JdbcType.BIT), @Result(column="region_id", property="regionId", jdbcType=JdbcType.VARCHAR), @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), @Result(column="merch_id", property="merchId", jdbcType=JdbcType.VARCHAR), @@ -252,6 +254,7 @@ public interface HighOrderMapper extends HighOrderMapperExt { "print_status = #{printStatus,jdbcType=BIT},", "print_num = #{printNum,jdbcType=INTEGER},", "whether_check = #{whetherCheck,jdbcType=BIT},", + "whether_rebate = #{whetherRebate,jdbcType=BIT},", "region_id = #{regionId,jdbcType=VARCHAR},", "company_id = #{companyId,jdbcType=BIGINT},", "merch_id = #{merchId,jdbcType=VARCHAR},", diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index ac3efd3b..1854ffa4 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -1250,7 +1250,7 @@ public interface HighOrderMapperExt { }) List getSelfOilStationOrderList(@Param("goodsId") String goodsId); - @Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 ") + @Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false ") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java index c45da981..363aba79 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java @@ -180,6 +180,10 @@ public class HighOrderSqlProvider { sql.VALUES("whether_check", "#{whetherCheck,jdbcType=BIT}"); } + if (record.getWhetherRebate() != null) { + sql.VALUES("whether_rebate", "#{whetherRebate,jdbcType=BIT}"); + } + if (record.getRegionId() != null) { sql.VALUES("region_id", "#{regionId,jdbcType=VARCHAR}"); } @@ -252,6 +256,7 @@ public class HighOrderSqlProvider { sql.SELECT("print_status"); sql.SELECT("print_num"); sql.SELECT("whether_check"); + sql.SELECT("whether_rebate"); sql.SELECT("region_id"); sql.SELECT("company_id"); sql.SELECT("merch_id"); @@ -431,6 +436,10 @@ public class HighOrderSqlProvider { sql.SET("whether_check = #{record.whetherCheck,jdbcType=BIT}"); } + if (record.getWhetherRebate() != null) { + sql.SET("whether_rebate = #{record.whetherRebate,jdbcType=BIT}"); + } + if (record.getRegionId() != null) { sql.SET("region_id = #{record.regionId,jdbcType=VARCHAR}"); } @@ -502,6 +511,7 @@ public class HighOrderSqlProvider { sql.SET("print_status = #{record.printStatus,jdbcType=BIT}"); sql.SET("print_num = #{record.printNum,jdbcType=INTEGER}"); sql.SET("whether_check = #{record.whetherCheck,jdbcType=BIT}"); + sql.SET("whether_rebate = #{record.whetherRebate,jdbcType=BIT}"); sql.SET("region_id = #{record.regionId,jdbcType=VARCHAR}"); sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); sql.SET("merch_id = #{record.merchId,jdbcType=VARCHAR}"); @@ -670,6 +680,10 @@ public class HighOrderSqlProvider { sql.SET("whether_check = #{whetherCheck,jdbcType=BIT}"); } + if (record.getWhetherRebate() != null) { + sql.SET("whether_rebate = #{whetherRebate,jdbcType=BIT}"); + } + if (record.getRegionId() != null) { sql.SET("region_id = #{regionId,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java index 9ed597a1..0d6c074b 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java @@ -148,6 +148,16 @@ public class HighChildOrder implements Serializable { */ private BigDecimal gasPriceOfficial; + /** + * 【加油站】成本单价 + */ + private BigDecimal gasPriceCost; + + /** + * 【加油站】成本总价 + */ + private BigDecimal gasPriceCostTotal; + /** * 【加油站】渠道支付金额 */ @@ -463,6 +473,22 @@ public class HighChildOrder implements Serializable { this.gasPriceOfficial = gasPriceOfficial; } + public BigDecimal getGasPriceCost() { + return gasPriceCost; + } + + public void setGasPriceCost(BigDecimal gasPriceCost) { + this.gasPriceCost = gasPriceCost; + } + + public BigDecimal getGasPriceCostTotal() { + return gasPriceCostTotal; + } + + public void setGasPriceCostTotal(BigDecimal gasPriceCostTotal) { + this.gasPriceCostTotal = gasPriceCostTotal; + } + public BigDecimal getGasPriceChannelPay() { return gasPriceChannelPay; } @@ -686,6 +712,8 @@ public class HighChildOrder implements Serializable { && (this.getGasPriceGun() == null ? other.getGasPriceGun() == null : this.getGasPriceGun().equals(other.getGasPriceGun())) && (this.getGasPriceVip() == null ? other.getGasPriceVip() == null : this.getGasPriceVip().equals(other.getGasPriceVip())) && (this.getGasPriceOfficial() == null ? other.getGasPriceOfficial() == null : this.getGasPriceOfficial().equals(other.getGasPriceOfficial())) + && (this.getGasPriceCost() == null ? other.getGasPriceCost() == null : this.getGasPriceCost().equals(other.getGasPriceCost())) + && (this.getGasPriceCostTotal() == null ? other.getGasPriceCostTotal() == null : this.getGasPriceCostTotal().equals(other.getGasPriceCostTotal())) && (this.getGasPriceChannelPay() == null ? other.getGasPriceChannelPay() == null : this.getGasPriceChannelPay().equals(other.getGasPriceChannelPay())) && (this.getGasOilLiters() == null ? other.getGasOilLiters() == null : this.getGasOilLiters().equals(other.getGasOilLiters())) && (this.getGasDiscount() == null ? other.getGasDiscount() == null : this.getGasDiscount().equals(other.getGasDiscount())) @@ -742,6 +770,8 @@ public class HighChildOrder implements Serializable { result = prime * result + ((getGasPriceGun() == null) ? 0 : getGasPriceGun().hashCode()); result = prime * result + ((getGasPriceVip() == null) ? 0 : getGasPriceVip().hashCode()); result = prime * result + ((getGasPriceOfficial() == null) ? 0 : getGasPriceOfficial().hashCode()); + result = prime * result + ((getGasPriceCost() == null) ? 0 : getGasPriceCost().hashCode()); + result = prime * result + ((getGasPriceCostTotal() == null) ? 0 : getGasPriceCostTotal().hashCode()); result = prime * result + ((getGasPriceChannelPay() == null) ? 0 : getGasPriceChannelPay().hashCode()); result = prime * result + ((getGasOilLiters() == null) ? 0 : getGasOilLiters().hashCode()); result = prime * result + ((getGasDiscount() == null) ? 0 : getGasDiscount().hashCode()); @@ -801,6 +831,8 @@ public class HighChildOrder implements Serializable { sb.append(", gasPriceGun=").append(gasPriceGun); sb.append(", gasPriceVip=").append(gasPriceVip); sb.append(", gasPriceOfficial=").append(gasPriceOfficial); + sb.append(", gasPriceCost=").append(gasPriceCost); + sb.append(", gasPriceCostTotal=").append(gasPriceCostTotal); sb.append(", gasPriceChannelPay=").append(gasPriceChannelPay); sb.append(", gasOilLiters=").append(gasOilLiters); sb.append(", gasDiscount=").append(gasDiscount); diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java index 124e94bf..994e49f2 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java @@ -1835,6 +1835,126 @@ public class HighChildOrderExample { return (Criteria) this; } + public Criteria andGasPriceCostIsNull() { + addCriterion("gas_price_cost is null"); + return (Criteria) this; + } + + public Criteria andGasPriceCostIsNotNull() { + addCriterion("gas_price_cost is not null"); + return (Criteria) this; + } + + public Criteria andGasPriceCostEqualTo(BigDecimal value) { + addCriterion("gas_price_cost =", value, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostNotEqualTo(BigDecimal value) { + addCriterion("gas_price_cost <>", value, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostGreaterThan(BigDecimal value) { + addCriterion("gas_price_cost >", value, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_cost >=", value, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostLessThan(BigDecimal value) { + addCriterion("gas_price_cost <", value, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostLessThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_cost <=", value, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostIn(List values) { + addCriterion("gas_price_cost in", values, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostNotIn(List values) { + addCriterion("gas_price_cost not in", values, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_cost between", value1, value2, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_cost not between", value1, value2, "gasPriceCost"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalIsNull() { + addCriterion("gas_price_cost_total is null"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalIsNotNull() { + addCriterion("gas_price_cost_total is not null"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalEqualTo(BigDecimal value) { + addCriterion("gas_price_cost_total =", value, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalNotEqualTo(BigDecimal value) { + addCriterion("gas_price_cost_total <>", value, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalGreaterThan(BigDecimal value) { + addCriterion("gas_price_cost_total >", value, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_cost_total >=", value, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalLessThan(BigDecimal value) { + addCriterion("gas_price_cost_total <", value, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalLessThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_cost_total <=", value, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalIn(List values) { + addCriterion("gas_price_cost_total in", values, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalNotIn(List values) { + addCriterion("gas_price_cost_total not in", values, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_cost_total between", value1, value2, "gasPriceCostTotal"); + return (Criteria) this; + } + + public Criteria andGasPriceCostTotalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_cost_total not between", value1, value2, "gasPriceCostTotal"); + return (Criteria) this; + } + public Criteria andGasPriceChannelPayIsNull() { addCriterion("gas_price_channel_pay is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantAccountMarketing.java b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountMarketing.java new file mode 100644 index 00000000..ce70bf7e --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountMarketing.java @@ -0,0 +1,230 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * high_merchant_account_marketing + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighMerchantAccountMarketing implements Serializable { + private Long id; + + /** + * 类型 1. 充值赠送 2. 充值返点 3. 加油减免 + */ + private Integer type; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户账户id + */ + private Long merAccountId; + + /** + * 金额 类型为 1,2才会使用此字段 + */ + private BigDecimal price; + + /** + * 油品金额减免,JSON数据。类型为3才会使用此字段 + */ + private String oilNoReliefPrice; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public Long getMerAccountId() { + return merAccountId; + } + + public void setMerAccountId(Long merAccountId) { + this.merAccountId = merAccountId; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public String getOilNoReliefPrice() { + return oilNoReliefPrice; + } + + public void setOilNoReliefPrice(String oilNoReliefPrice) { + this.oilNoReliefPrice = oilNoReliefPrice; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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 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; + } + HighMerchantAccountMarketing other = (HighMerchantAccountMarketing) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerAccountId() == null ? other.getMerAccountId() == null : this.getMerAccountId().equals(other.getMerAccountId())) + && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getOilNoReliefPrice() == null ? other.getOilNoReliefPrice() == null : this.getOilNoReliefPrice().equals(other.getOilNoReliefPrice())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (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 + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerAccountId() == null) ? 0 : getMerAccountId().hashCode()); + result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getOilNoReliefPrice() == null) ? 0 : getOilNoReliefPrice().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", type=").append(type); + sb.append(", merId=").append(merId); + sb.append(", merAccountId=").append(merAccountId); + sb.append(", price=").append(price); + sb.append(", oilNoReliefPrice=").append(oilNoReliefPrice); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + 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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantAccountMarketingExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountMarketingExample.java new file mode 100644 index 00000000..ff3ce2ef --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountMarketingExample.java @@ -0,0 +1,984 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighMerchantAccountMarketingExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighMerchantAccountMarketingExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdIsNull() { + addCriterion("mer_account_id is null"); + return (Criteria) this; + } + + public Criteria andMerAccountIdIsNotNull() { + addCriterion("mer_account_id is not null"); + return (Criteria) this; + } + + public Criteria andMerAccountIdEqualTo(Long value) { + addCriterion("mer_account_id =", value, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdNotEqualTo(Long value) { + addCriterion("mer_account_id <>", value, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdGreaterThan(Long value) { + addCriterion("mer_account_id >", value, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_account_id >=", value, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdLessThan(Long value) { + addCriterion("mer_account_id <", value, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdLessThanOrEqualTo(Long value) { + addCriterion("mer_account_id <=", value, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdIn(List values) { + addCriterion("mer_account_id in", values, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdNotIn(List values) { + addCriterion("mer_account_id not in", values, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdBetween(Long value1, Long value2) { + addCriterion("mer_account_id between", value1, value2, "merAccountId"); + return (Criteria) this; + } + + public Criteria andMerAccountIdNotBetween(Long value1, Long value2) { + addCriterion("mer_account_id not between", value1, value2, "merAccountId"); + return (Criteria) this; + } + + public Criteria andPriceIsNull() { + addCriterion("price is null"); + return (Criteria) this; + } + + public Criteria andPriceIsNotNull() { + addCriterion("price is not null"); + return (Criteria) this; + } + + public Criteria andPriceEqualTo(BigDecimal value) { + addCriterion("price =", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotEqualTo(BigDecimal value) { + addCriterion("price <>", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThan(BigDecimal value) { + addCriterion("price >", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price >=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThan(BigDecimal value) { + addCriterion("price <", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("price <=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceIn(List values) { + addCriterion("price in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotIn(List values) { + addCriterion("price not in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price not between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceIsNull() { + addCriterion("oil_no_relief_price is null"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceIsNotNull() { + addCriterion("oil_no_relief_price is not null"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceEqualTo(String value) { + addCriterion("oil_no_relief_price =", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceNotEqualTo(String value) { + addCriterion("oil_no_relief_price <>", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceGreaterThan(String value) { + addCriterion("oil_no_relief_price >", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceGreaterThanOrEqualTo(String value) { + addCriterion("oil_no_relief_price >=", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceLessThan(String value) { + addCriterion("oil_no_relief_price <", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceLessThanOrEqualTo(String value) { + addCriterion("oil_no_relief_price <=", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceLike(String value) { + addCriterion("oil_no_relief_price like", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceNotLike(String value) { + addCriterion("oil_no_relief_price not like", value, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceIn(List values) { + addCriterion("oil_no_relief_price in", values, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceNotIn(List values) { + addCriterion("oil_no_relief_price not in", values, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceBetween(String value1, String value2) { + addCriterion("oil_no_relief_price between", value1, value2, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andOilNoReliefPriceNotBetween(String value1, String value2) { + addCriterion("oil_no_relief_price not between", value1, value2, "oilNoReliefPrice"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantAccountRecord.java b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountRecord.java new file mode 100644 index 00000000..a3c2fcb1 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountRecord.java @@ -0,0 +1,406 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * high_merchant_account_record + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighMerchantAccountRecord implements Serializable { + private Long id; + + /** + * 商户账户表id + */ + private Long merAmountId; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户名称 + */ + private String merName; + + /** + * 类型 1:进账 2:出账 + */ + private Integer type; + + /** + * 账户金额 + */ + private BigDecimal amount; + + /** + * 参与营销 0:否 1:是 + */ + private Boolean marketingStatus; + + /** + * 营销类型 1:赠送金额 2:充值返点 + */ + private Integer marketingType; + + /** + * 营销金额 + */ + private BigDecimal marketingPrice; + + /** + * 营销交易金额 + */ + private BigDecimal marketingTradePrice; + + /** + * 交易金额 + */ + private BigDecimal tradePrice; + + /** + * 变更前金额 + */ + private BigDecimal beforeAmount; + + /** + * 变更后金额 + */ + private BigDecimal afterAmount; + + /** + * 来源类型 1.金额充值 2. 订单消费 3.订单退款 + */ + private Integer sourceType; + + /** + * 来源id + */ + private Long sourceId; + + /** + * 来源内容 + */ + private String sourceContent; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMerAmountId() { + return merAmountId; + } + + public void setMerAmountId(Long merAmountId) { + this.merAmountId = merAmountId; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Boolean getMarketingStatus() { + return marketingStatus; + } + + public void setMarketingStatus(Boolean marketingStatus) { + this.marketingStatus = marketingStatus; + } + + public Integer getMarketingType() { + return marketingType; + } + + public void setMarketingType(Integer marketingType) { + this.marketingType = marketingType; + } + + public BigDecimal getMarketingPrice() { + return marketingPrice; + } + + public void setMarketingPrice(BigDecimal marketingPrice) { + this.marketingPrice = marketingPrice; + } + + public BigDecimal getMarketingTradePrice() { + return marketingTradePrice; + } + + public void setMarketingTradePrice(BigDecimal marketingTradePrice) { + this.marketingTradePrice = marketingTradePrice; + } + + public BigDecimal getTradePrice() { + return tradePrice; + } + + public void setTradePrice(BigDecimal tradePrice) { + this.tradePrice = tradePrice; + } + + public BigDecimal getBeforeAmount() { + return beforeAmount; + } + + public void setBeforeAmount(BigDecimal beforeAmount) { + this.beforeAmount = beforeAmount; + } + + public BigDecimal getAfterAmount() { + return afterAmount; + } + + public void setAfterAmount(BigDecimal afterAmount) { + this.afterAmount = afterAmount; + } + + public Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public Long getSourceId() { + return sourceId; + } + + public void setSourceId(Long sourceId) { + this.sourceId = sourceId; + } + + public String getSourceContent() { + return sourceContent; + } + + public void setSourceContent(String sourceContent) { + this.sourceContent = sourceContent; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + 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; + } + HighMerchantAccountRecord other = (HighMerchantAccountRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerAmountId() == null ? other.getMerAmountId() == null : this.getMerAmountId().equals(other.getMerAmountId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) + && (this.getMarketingStatus() == null ? other.getMarketingStatus() == null : this.getMarketingStatus().equals(other.getMarketingStatus())) + && (this.getMarketingType() == null ? other.getMarketingType() == null : this.getMarketingType().equals(other.getMarketingType())) + && (this.getMarketingPrice() == null ? other.getMarketingPrice() == null : this.getMarketingPrice().equals(other.getMarketingPrice())) + && (this.getMarketingTradePrice() == null ? other.getMarketingTradePrice() == null : this.getMarketingTradePrice().equals(other.getMarketingTradePrice())) + && (this.getTradePrice() == null ? other.getTradePrice() == null : this.getTradePrice().equals(other.getTradePrice())) + && (this.getBeforeAmount() == null ? other.getBeforeAmount() == null : this.getBeforeAmount().equals(other.getBeforeAmount())) + && (this.getAfterAmount() == null ? other.getAfterAmount() == null : this.getAfterAmount().equals(other.getAfterAmount())) + && (this.getSourceType() == null ? other.getSourceType() == null : this.getSourceType().equals(other.getSourceType())) + && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId())) + && (this.getSourceContent() == null ? other.getSourceContent() == null : this.getSourceContent().equals(other.getSourceContent())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (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 + ((getMerAmountId() == null) ? 0 : getMerAmountId().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); + result = prime * result + ((getMarketingStatus() == null) ? 0 : getMarketingStatus().hashCode()); + result = prime * result + ((getMarketingType() == null) ? 0 : getMarketingType().hashCode()); + result = prime * result + ((getMarketingPrice() == null) ? 0 : getMarketingPrice().hashCode()); + result = prime * result + ((getMarketingTradePrice() == null) ? 0 : getMarketingTradePrice().hashCode()); + result = prime * result + ((getTradePrice() == null) ? 0 : getTradePrice().hashCode()); + result = prime * result + ((getBeforeAmount() == null) ? 0 : getBeforeAmount().hashCode()); + result = prime * result + ((getAfterAmount() == null) ? 0 : getAfterAmount().hashCode()); + result = prime * result + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); + result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode()); + result = prime * result + ((getSourceContent() == null) ? 0 : getSourceContent().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", merAmountId=").append(merAmountId); + sb.append(", merId=").append(merId); + sb.append(", merName=").append(merName); + sb.append(", type=").append(type); + sb.append(", amount=").append(amount); + sb.append(", marketingStatus=").append(marketingStatus); + sb.append(", marketingType=").append(marketingType); + sb.append(", marketingPrice=").append(marketingPrice); + sb.append(", marketingTradePrice=").append(marketingTradePrice); + sb.append(", tradePrice=").append(tradePrice); + sb.append(", beforeAmount=").append(beforeAmount); + sb.append(", afterAmount=").append(afterAmount); + sb.append(", sourceType=").append(sourceType); + sb.append(", sourceId=").append(sourceId); + sb.append(", sourceContent=").append(sourceContent); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + 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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantAccountRecordExample.java b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountRecordExample.java new file mode 100644 index 00000000..756b3202 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantAccountRecordExample.java @@ -0,0 +1,1664 @@ +package com.hai.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighMerchantAccountRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighMerchantAccountRecordExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMerAmountIdIsNull() { + addCriterion("mer_amount_id is null"); + return (Criteria) this; + } + + public Criteria andMerAmountIdIsNotNull() { + addCriterion("mer_amount_id is not null"); + return (Criteria) this; + } + + public Criteria andMerAmountIdEqualTo(Long value) { + addCriterion("mer_amount_id =", value, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdNotEqualTo(Long value) { + addCriterion("mer_amount_id <>", value, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdGreaterThan(Long value) { + addCriterion("mer_amount_id >", value, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_amount_id >=", value, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdLessThan(Long value) { + addCriterion("mer_amount_id <", value, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdLessThanOrEqualTo(Long value) { + addCriterion("mer_amount_id <=", value, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdIn(List values) { + addCriterion("mer_amount_id in", values, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdNotIn(List values) { + addCriterion("mer_amount_id not in", values, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdBetween(Long value1, Long value2) { + addCriterion("mer_amount_id between", value1, value2, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerAmountIdNotBetween(Long value1, Long value2) { + addCriterion("mer_amount_id not between", value1, value2, "merAmountId"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andAmountIsNull() { + addCriterion("amount is null"); + return (Criteria) this; + } + + public Criteria andAmountIsNotNull() { + addCriterion("amount is not null"); + return (Criteria) this; + } + + public Criteria andAmountEqualTo(BigDecimal value) { + addCriterion("amount =", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotEqualTo(BigDecimal value) { + addCriterion("amount <>", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThan(BigDecimal value) { + addCriterion("amount >", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("amount >=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThan(BigDecimal value) { + addCriterion("amount <", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("amount <=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountIn(List values) { + addCriterion("amount in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotIn(List values) { + addCriterion("amount not in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount not between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andMarketingStatusIsNull() { + addCriterion("marketing_status is null"); + return (Criteria) this; + } + + public Criteria andMarketingStatusIsNotNull() { + addCriterion("marketing_status is not null"); + return (Criteria) this; + } + + public Criteria andMarketingStatusEqualTo(Boolean value) { + addCriterion("marketing_status =", value, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusNotEqualTo(Boolean value) { + addCriterion("marketing_status <>", value, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusGreaterThan(Boolean value) { + addCriterion("marketing_status >", value, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusGreaterThanOrEqualTo(Boolean value) { + addCriterion("marketing_status >=", value, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusLessThan(Boolean value) { + addCriterion("marketing_status <", value, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusLessThanOrEqualTo(Boolean value) { + addCriterion("marketing_status <=", value, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusIn(List values) { + addCriterion("marketing_status in", values, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusNotIn(List values) { + addCriterion("marketing_status not in", values, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusBetween(Boolean value1, Boolean value2) { + addCriterion("marketing_status between", value1, value2, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingStatusNotBetween(Boolean value1, Boolean value2) { + addCriterion("marketing_status not between", value1, value2, "marketingStatus"); + return (Criteria) this; + } + + public Criteria andMarketingTypeIsNull() { + addCriterion("marketing_type is null"); + return (Criteria) this; + } + + public Criteria andMarketingTypeIsNotNull() { + addCriterion("marketing_type is not null"); + return (Criteria) this; + } + + public Criteria andMarketingTypeEqualTo(Integer value) { + addCriterion("marketing_type =", value, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeNotEqualTo(Integer value) { + addCriterion("marketing_type <>", value, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeGreaterThan(Integer value) { + addCriterion("marketing_type >", value, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("marketing_type >=", value, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeLessThan(Integer value) { + addCriterion("marketing_type <", value, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeLessThanOrEqualTo(Integer value) { + addCriterion("marketing_type <=", value, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeIn(List values) { + addCriterion("marketing_type in", values, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeNotIn(List values) { + addCriterion("marketing_type not in", values, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeBetween(Integer value1, Integer value2) { + addCriterion("marketing_type between", value1, value2, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingTypeNotBetween(Integer value1, Integer value2) { + addCriterion("marketing_type not between", value1, value2, "marketingType"); + return (Criteria) this; + } + + public Criteria andMarketingPriceIsNull() { + addCriterion("marketing_price is null"); + return (Criteria) this; + } + + public Criteria andMarketingPriceIsNotNull() { + addCriterion("marketing_price is not null"); + return (Criteria) this; + } + + public Criteria andMarketingPriceEqualTo(BigDecimal value) { + addCriterion("marketing_price =", value, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceNotEqualTo(BigDecimal value) { + addCriterion("marketing_price <>", value, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceGreaterThan(BigDecimal value) { + addCriterion("marketing_price >", value, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("marketing_price >=", value, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceLessThan(BigDecimal value) { + addCriterion("marketing_price <", value, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("marketing_price <=", value, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceIn(List values) { + addCriterion("marketing_price in", values, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceNotIn(List values) { + addCriterion("marketing_price not in", values, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("marketing_price between", value1, value2, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("marketing_price not between", value1, value2, "marketingPrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceIsNull() { + addCriterion("marketing_trade_price is null"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceIsNotNull() { + addCriterion("marketing_trade_price is not null"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceEqualTo(BigDecimal value) { + addCriterion("marketing_trade_price =", value, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceNotEqualTo(BigDecimal value) { + addCriterion("marketing_trade_price <>", value, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceGreaterThan(BigDecimal value) { + addCriterion("marketing_trade_price >", value, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("marketing_trade_price >=", value, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceLessThan(BigDecimal value) { + addCriterion("marketing_trade_price <", value, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("marketing_trade_price <=", value, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceIn(List values) { + addCriterion("marketing_trade_price in", values, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceNotIn(List values) { + addCriterion("marketing_trade_price not in", values, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("marketing_trade_price between", value1, value2, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andMarketingTradePriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("marketing_trade_price not between", value1, value2, "marketingTradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceIsNull() { + addCriterion("trade_price is null"); + return (Criteria) this; + } + + public Criteria andTradePriceIsNotNull() { + addCriterion("trade_price is not null"); + return (Criteria) this; + } + + public Criteria andTradePriceEqualTo(BigDecimal value) { + addCriterion("trade_price =", value, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceNotEqualTo(BigDecimal value) { + addCriterion("trade_price <>", value, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceGreaterThan(BigDecimal value) { + addCriterion("trade_price >", value, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("trade_price >=", value, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceLessThan(BigDecimal value) { + addCriterion("trade_price <", value, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("trade_price <=", value, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceIn(List values) { + addCriterion("trade_price in", values, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceNotIn(List values) { + addCriterion("trade_price not in", values, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("trade_price between", value1, value2, "tradePrice"); + return (Criteria) this; + } + + public Criteria andTradePriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("trade_price not between", value1, value2, "tradePrice"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIsNull() { + addCriterion("before_amount is null"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIsNotNull() { + addCriterion("before_amount is not null"); + return (Criteria) this; + } + + public Criteria andBeforeAmountEqualTo(BigDecimal value) { + addCriterion("before_amount =", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotEqualTo(BigDecimal value) { + addCriterion("before_amount <>", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountGreaterThan(BigDecimal value) { + addCriterion("before_amount >", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("before_amount >=", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountLessThan(BigDecimal value) { + addCriterion("before_amount <", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("before_amount <=", value, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountIn(List values) { + addCriterion("before_amount in", values, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotIn(List values) { + addCriterion("before_amount not in", values, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("before_amount between", value1, value2, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andBeforeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("before_amount not between", value1, value2, "beforeAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountIsNull() { + addCriterion("after_amount is null"); + return (Criteria) this; + } + + public Criteria andAfterAmountIsNotNull() { + addCriterion("after_amount is not null"); + return (Criteria) this; + } + + public Criteria andAfterAmountEqualTo(BigDecimal value) { + addCriterion("after_amount =", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotEqualTo(BigDecimal value) { + addCriterion("after_amount <>", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountGreaterThan(BigDecimal value) { + addCriterion("after_amount >", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("after_amount >=", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountLessThan(BigDecimal value) { + addCriterion("after_amount <", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("after_amount <=", value, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountIn(List values) { + addCriterion("after_amount in", values, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotIn(List values) { + addCriterion("after_amount not in", values, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("after_amount between", value1, value2, "afterAmount"); + return (Criteria) this; + } + + public Criteria andAfterAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("after_amount not between", value1, value2, "afterAmount"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNull() { + addCriterion("source_type is null"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNotNull() { + addCriterion("source_type is not null"); + return (Criteria) this; + } + + public Criteria andSourceTypeEqualTo(Integer value) { + addCriterion("source_type =", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotEqualTo(Integer value) { + addCriterion("source_type <>", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThan(Integer value) { + addCriterion("source_type >", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("source_type >=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThan(Integer value) { + addCriterion("source_type <", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThanOrEqualTo(Integer value) { + addCriterion("source_type <=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeIn(List values) { + addCriterion("source_type in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotIn(List values) { + addCriterion("source_type not in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeBetween(Integer value1, Integer value2) { + addCriterion("source_type between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("source_type not between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceIdIsNull() { + addCriterion("source_id is null"); + return (Criteria) this; + } + + public Criteria andSourceIdIsNotNull() { + addCriterion("source_id is not null"); + return (Criteria) this; + } + + public Criteria andSourceIdEqualTo(Long value) { + addCriterion("source_id =", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotEqualTo(Long value) { + addCriterion("source_id <>", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdGreaterThan(Long value) { + addCriterion("source_id >", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdGreaterThanOrEqualTo(Long value) { + addCriterion("source_id >=", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdLessThan(Long value) { + addCriterion("source_id <", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdLessThanOrEqualTo(Long value) { + addCriterion("source_id <=", value, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdIn(List values) { + addCriterion("source_id in", values, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotIn(List values) { + addCriterion("source_id not in", values, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdBetween(Long value1, Long value2) { + addCriterion("source_id between", value1, value2, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceIdNotBetween(Long value1, Long value2) { + addCriterion("source_id not between", value1, value2, "sourceId"); + return (Criteria) this; + } + + public Criteria andSourceContentIsNull() { + addCriterion("source_content is null"); + return (Criteria) this; + } + + public Criteria andSourceContentIsNotNull() { + addCriterion("source_content is not null"); + return (Criteria) this; + } + + public Criteria andSourceContentEqualTo(String value) { + addCriterion("source_content =", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotEqualTo(String value) { + addCriterion("source_content <>", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentGreaterThan(String value) { + addCriterion("source_content >", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentGreaterThanOrEqualTo(String value) { + addCriterion("source_content >=", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLessThan(String value) { + addCriterion("source_content <", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLessThanOrEqualTo(String value) { + addCriterion("source_content <=", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentLike(String value) { + addCriterion("source_content like", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotLike(String value) { + addCriterion("source_content not like", value, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentIn(List values) { + addCriterion("source_content in", values, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotIn(List values) { + addCriterion("source_content not in", values, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentBetween(String value1, String value2) { + addCriterion("source_content between", value1, value2, "sourceContent"); + return (Criteria) this; + } + + public Criteria andSourceContentNotBetween(String value1, String value2) { + addCriterion("source_content not between", value1, value2, "sourceContent"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index d08cbfd0..ee53040b 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -210,6 +210,11 @@ public class HighOrder implements Serializable { */ private Boolean whetherCheck; + /** + * 是否返利 + */ + private Boolean whetherRebate; + /** * 区域编码 */ @@ -228,6 +233,7 @@ public class HighOrder implements Serializable { private String ext3; + private String payPwd; private List highChildOrderList; @@ -245,15 +251,8 @@ public class HighOrder implements Serializable { */ private Boolean buyPoints; - private static final long serialVersionUID = 1L; - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } public String getPayPwd() { return payPwd; @@ -295,6 +294,14 @@ public class HighOrder implements Serializable { this.gasStaffCode = gasStaffCode; } + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + public Boolean getBuyPoints() { return buyPoints; } @@ -303,6 +310,8 @@ public class HighOrder implements Serializable { this.buyPoints = buyPoints; } + private static final long serialVersionUID = 1L; + public Long getId() { return id; } @@ -615,6 +624,14 @@ public class HighOrder implements Serializable { this.whetherCheck = whetherCheck; } + public Boolean getWhetherRebate() { + return whetherRebate; + } + + public void setWhetherRebate(Boolean whetherRebate) { + this.whetherRebate = whetherRebate; + } + public String getRegionId() { return regionId; } @@ -714,6 +731,7 @@ public class HighOrder implements Serializable { && (this.getPrintStatus() == null ? other.getPrintStatus() == null : this.getPrintStatus().equals(other.getPrintStatus())) && (this.getPrintNum() == null ? other.getPrintNum() == null : this.getPrintNum().equals(other.getPrintNum())) && (this.getWhetherCheck() == null ? other.getWhetherCheck() == null : this.getWhetherCheck().equals(other.getWhetherCheck())) + && (this.getWhetherRebate() == null ? other.getWhetherRebate() == null : this.getWhetherRebate().equals(other.getWhetherRebate())) && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) && (this.getMerchId() == null ? other.getMerchId() == null : this.getMerchId().equals(other.getMerchId())) @@ -765,6 +783,7 @@ public class HighOrder implements Serializable { result = prime * result + ((getPrintStatus() == null) ? 0 : getPrintStatus().hashCode()); result = prime * result + ((getPrintNum() == null) ? 0 : getPrintNum().hashCode()); result = prime * result + ((getWhetherCheck() == null) ? 0 : getWhetherCheck().hashCode()); + result = prime * result + ((getWhetherRebate() == null) ? 0 : getWhetherRebate().hashCode()); result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); result = prime * result + ((getMerchId() == null) ? 0 : getMerchId().hashCode()); @@ -819,6 +838,7 @@ public class HighOrder implements Serializable { sb.append(", printStatus=").append(printStatus); sb.append(", printNum=").append(printNum); sb.append(", whetherCheck=").append(whetherCheck); + sb.append(", whetherRebate=").append(whetherRebate); sb.append(", regionId=").append(regionId); sb.append(", companyId=").append(companyId); sb.append(", merchId=").append(merchId); diff --git a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java index 9ce0b527..6c33a2c6 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java @@ -2586,6 +2586,66 @@ public class HighOrderExample { return (Criteria) this; } + public Criteria andWhetherRebateIsNull() { + addCriterion("whether_rebate is null"); + return (Criteria) this; + } + + public Criteria andWhetherRebateIsNotNull() { + addCriterion("whether_rebate is not null"); + return (Criteria) this; + } + + public Criteria andWhetherRebateEqualTo(Boolean value) { + addCriterion("whether_rebate =", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateNotEqualTo(Boolean value) { + addCriterion("whether_rebate <>", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateGreaterThan(Boolean value) { + addCriterion("whether_rebate >", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateGreaterThanOrEqualTo(Boolean value) { + addCriterion("whether_rebate >=", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateLessThan(Boolean value) { + addCriterion("whether_rebate <", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateLessThanOrEqualTo(Boolean value) { + addCriterion("whether_rebate <=", value, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateIn(List values) { + addCriterion("whether_rebate in", values, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateNotIn(List values) { + addCriterion("whether_rebate not in", values, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateBetween(Boolean value1, Boolean value2) { + addCriterion("whether_rebate between", value1, value2, "whetherRebate"); + return (Criteria) this; + } + + public Criteria andWhetherRebateNotBetween(Boolean value1, Boolean value2) { + addCriterion("whether_rebate not between", value1, value2, "whetherRebate"); + return (Criteria) this; + } + public Criteria andRegionIdIsNull() { addCriterion("region_id is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/enum_type/MerAccountMarketingType.java b/hai-service/src/main/java/com/hai/enum_type/MerAccountMarketingType.java new file mode 100644 index 00000000..9a48780c --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/MerAccountMarketingType.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 商户账户营销类型 + * @author hurui + */ +public enum MerAccountMarketingType { + type1(1 , "充值赠送"), + type2(2 , "充值返点"), + type3(3 , "加油减免"), + ; + + private Integer type; + private String name; + + MerAccountMarketingType(int type , String name) { + this.type = type; + this.name = name; + } + + 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; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/MerAmountSourceTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/MerAmountSourceTypeEnum.java new file mode 100644 index 00000000..09059ea7 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/MerAmountSourceTypeEnum.java @@ -0,0 +1,37 @@ +package com.hai.enum_type; + +/** + * 商户账户记录来源 + * @author hurui + */ +public enum MerAmountSourceTypeEnum { + type1(1, "金额充值"), + type2(2, "订单消费"), + type3(3, "订单退款"), + ; + + private Integer type; + + private String name; + + MerAmountSourceTypeEnum(int type, String name) { + this.type = type; + this.name = name; + } + + 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; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/MerAmountTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/MerAmountTypeEnum.java new file mode 100644 index 00000000..8b2c1405 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/MerAmountTypeEnum.java @@ -0,0 +1,36 @@ +package com.hai.enum_type; + +/** + * 商户账户记录类型 + * @author hurui + */ +public enum MerAmountTypeEnum { + type1(1, "进账"), + type2(2, "出账") + ; + + private Integer type; + + private String name; + + MerAmountTypeEnum(int type, String name) { + this.type = type; + this.name = name; + } + + 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; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantAccountMarketingService.java b/hai-service/src/main/java/com/hai/service/HighMerchantAccountMarketingService.java new file mode 100644 index 00000000..5145d13a --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighMerchantAccountMarketingService.java @@ -0,0 +1,40 @@ +package com.hai.service; + +import com.hai.entity.HighMerchantAccountMarketing; + +import java.math.BigDecimal; + +/** + * 商户账户营销配置 + */ +public interface HighMerchantAccountMarketingService { + + /** + * 增加 + * @param merchantAccountMarketing + */ + void insert(HighMerchantAccountMarketing merchantAccountMarketing); + + /** + * 修改 + * @param merchantAccountMarketing + */ + void update(HighMerchantAccountMarketing merchantAccountMarketing); + + /** + * 查询详情 + * @param merId + * @param type + * @return + */ + HighMerchantAccountMarketing getDetailByMerAndType(Long merId,Integer type); + + /** + * 查询价格 + * @param merId + * @param type + * @param oilNo + * @return + */ + BigDecimal getPrice(Long merId,Integer type,Integer oilNo); +} diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantAccountRecordService.java b/hai-service/src/main/java/com/hai/service/HighMerchantAccountRecordService.java new file mode 100644 index 00000000..ece2d780 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighMerchantAccountRecordService.java @@ -0,0 +1,25 @@ +package com.hai.service; + +import com.hai.entity.HighMerchantAccountRecord; + +import java.util.List; +import java.util.Map; + +/** + * 商户账户变更记录 + */ +public interface HighMerchantAccountRecordService { + + /** + * 增加记录 + * @param record + */ + void insert(HighMerchantAccountRecord record); + + /** + * 查询记录列表 + * @param param + * @return + */ + List getRecordList(Map param); +} diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java b/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java index 00a5af15..72cedf83 100644 --- a/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java +++ b/hai-service/src/main/java/com/hai/service/HighMerchantAccountService.java @@ -20,14 +20,14 @@ public interface HighMerchantAccountService { * @param amount * @param otherParam */ - void recharge(Long merId, BigDecimal amount, Map otherParam); + void recharge(Long merId, BigDecimal amount, Map marketingParam, Map otherParam); /** * 查询商户账户 * @param merId * @return */ - HighMerchantAccount getStoreAccountDetail(Long merId); + HighMerchantAccount getMerAccountDetail(Long merId); /** * 统计商户加油金额 diff --git a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java index 5e3ab586..09fca572 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java @@ -5,7 +5,9 @@ import com.hai.common.utils.DateUtil; import com.hai.dao.BsIntegralRebateMapper; import com.hai.entity.BsIntegralRebate; import com.hai.entity.BsIntegralRebateExample; +import com.hai.entity.HighOrder; import com.hai.service.BsIntegralRebateService; +import com.hai.service.HighOrderService; import com.hai.service.HighUserService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; @@ -25,6 +27,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { @Resource private HighUserService highUserService; + @Resource + private HighOrderService highOrderService; + @Override public BsIntegralRebate findIntegralRebateByMap(Map map) { @@ -100,6 +105,11 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { BsIntegralRebate bsIntegralRebate = findIntegralRebateByMap(map); if (DateUtil.isEffectiveDate(object.getDate("createTime"), bsIntegralRebate.getStartTime() , bsIntegralRebate.getEndTime())) { + + HighOrder order = highOrderService.getOrderById(object.getLong("orderId")); + + order.setWhetherRebate(true); + BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP ); highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountMarketingServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountMarketingServiceImpl.java new file mode 100644 index 00000000..90fc1e52 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountMarketingServiceImpl.java @@ -0,0 +1,65 @@ +package com.hai.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hai.dao.HighMerchantAccountMarketingMapper; +import com.hai.entity.HighMerchantAccountMarketing; +import com.hai.entity.HighMerchantAccountMarketingExample; +import com.hai.enum_type.MerAccountMarketingType; +import com.hai.service.HighMerchantAccountMarketingService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Service("merchantAccountMarketingService") +public class HighMerchantAccountMarketingServiceImpl implements HighMerchantAccountMarketingService { + + @Resource + private HighMerchantAccountMarketingMapper marketingMapper; + + @Override + public void insert(HighMerchantAccountMarketing merchantAccountMarketing) { + merchantAccountMarketing.setStatus(1); + merchantAccountMarketing.setCreateTime(new Date()); + merchantAccountMarketing.setUpdateTime(new Date()); + marketingMapper.insert(merchantAccountMarketing); + } + + @Override + public void update(HighMerchantAccountMarketing merchantAccountMarketing) { + merchantAccountMarketing.setUpdateTime(new Date()); + marketingMapper.updateByPrimaryKeySelective(merchantAccountMarketing); + } + + @Override + public HighMerchantAccountMarketing getDetailByMerAndType(Long merId, Integer type) { + HighMerchantAccountMarketingExample example = new HighMerchantAccountMarketingExample(); + example.createCriteria().andMerIdEqualTo(merId).andTypeEqualTo(type).andStatusNotEqualTo(0); + List list = marketingMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + + @Override + public BigDecimal getPrice(Long merId, Integer type, Integer oilNo) { + HighMerchantAccountMarketing marketing = getDetailByMerAndType(merId, type); + if (marketing == null) { + return new BigDecimal("0"); + } + if (type.equals(MerAccountMarketingType.type3.getType())) { + JSONArray oilNoArray = JSONArray.parseArray(marketing.getOilNoReliefPrice()); + for (Object obj : oilNoArray) { + JSONObject oilNoData = (JSONObject) obj; + if (oilNo.equals(oilNoData.getInteger("oilNo"))) { + return oilNoData.getBigDecimal("price"); + } + } + } + return new BigDecimal("0"); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountRecordServiceImpl.java new file mode 100644 index 00000000..0872bbed --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountRecordServiceImpl.java @@ -0,0 +1,52 @@ +package com.hai.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hai.dao.HighMerchantAccountRecordMapper; +import com.hai.entity.HighMerchantAccountRecord; +import com.hai.entity.HighMerchantAccountRecordExample; +import com.hai.service.HighMerchantAccountRecordService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("merchantAccountRecordService") +public class HighMerchantAccountRecordServiceImpl implements HighMerchantAccountRecordService { + + @Resource + private HighMerchantAccountRecordMapper merchantAccountRecordMapper; + + @Override + public void insert(HighMerchantAccountRecord record) { + record.setCreateTime(new Date()); + record.setStatus(1); + merchantAccountRecordMapper.insert(record); + } + + @Override + public List getRecordList(Map param) { + HighMerchantAccountRecordExample example = new HighMerchantAccountRecordExample(); + HighMerchantAccountRecordExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (MapUtils.getLong(param, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); + } + + if (MapUtils.getObject(param, "merIdList") != null) { + JSONObject.toJSONString(MapUtils.getObject(param, "merIdList")); + List merList = (List) MapUtils.getObject(param, "merIdList"); + criteria.andMerIdIn(merList); + } + + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } + + example.setOrderByClause("create_time desc"); + return merchantAccountRecordMapper.selectByExample(example); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java index 0e05a400..8f94b9ba 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantAccountServiceImpl.java @@ -1,18 +1,25 @@ package com.hai.service.impl; +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.security.UserCenter; import com.hai.common.utils.BankNumberUtil; import com.hai.dao.HighMerchantAccountMapper; -import com.hai.entity.HighMerchant; -import com.hai.entity.HighMerchantAccount; -import com.hai.entity.HighMerchantAccountExample; -import com.hai.entity.HighMerchantStoreAccount; +import com.hai.entity.*; +import com.hai.enum_type.MerAccountMarketingType; +import com.hai.enum_type.MerAmountSourceTypeEnum; +import com.hai.enum_type.MerAmountTypeEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; +import com.hai.model.UserInfoModel; +import com.hai.service.HighMerchantAccountMarketingService; +import com.hai.service.HighMerchantAccountRecordService; import com.hai.service.HighMerchantAccountService; import com.hai.service.HighMerchantService; +import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -32,6 +39,15 @@ public class HighMerchantAccountServiceImpl implements HighMerchantAccountServic @Resource private HighMerchantService merchantService; + @Resource + private HighMerchantAccountRecordService merchantAccountRecordService; + + @Resource + private HighMerchantAccountMarketingService marketingService; + + @Resource + private UserCenter userCenter; + @Override public void editMerchantAccount(HighMerchantAccount merchantAccount) { if (merchantAccount.getId() == null) { @@ -48,30 +64,86 @@ public class HighMerchantAccountServiceImpl implements HighMerchantAccountServic @Override @Transactional(propagation= Propagation.REQUIRES_NEW) - public void recharge(Long merId, BigDecimal amount, Map otherParam) { + public void recharge(Long merId, BigDecimal amount, Map marketingParam, Map otherParam) { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + // 查询商户 HighMerchant merchant = merchantService.getDetailById(merId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); } // 是否开通了账户 - HighMerchantAccount account = getStoreAccountDetail(merId); + HighMerchantAccount account = getMerAccountDetail(merId); if (account == null) { account = new HighMerchantAccount(); account.setMerId(merId); account.setAmounts(new BigDecimal("0")); } + + // 本次交易金额 + BigDecimal tradePrice = amount; + + HighMerchantAccountRecord accountRecord = new HighMerchantAccountRecord(); + accountRecord.setMarketingStatus(MapUtils.getBoolean(marketingParam, "marketingStatus")); + + // 营销活动 + if (MapUtils.getBoolean(marketingParam, "marketingStatus") == true) { + if (MapUtils.getInteger(marketingParam, "marketingType").equals(MerAccountMarketingType.type1.getType())) { + accountRecord.setMarketingType(MerAccountMarketingType.type1.getType()); + accountRecord.setMarketingPrice(new BigDecimal(MapUtils.getString(marketingParam, "marketingPrice"))); + accountRecord.setMarketingTradePrice(new BigDecimal(MapUtils.getString(marketingParam, "marketingPrice"))); + tradePrice = tradePrice.add(accountRecord.getMarketingTradePrice()); + } + + if (MapUtils.getInteger(marketingParam, "marketingType").equals(MerAccountMarketingType.type2.getType())) { + accountRecord.setMarketingType(MerAccountMarketingType.type2.getType()); + accountRecord.setMarketingPrice(new BigDecimal(MapUtils.getString(marketingParam, "marketingPrice"))); + accountRecord.setMarketingTradePrice(amount.multiply(new BigDecimal(MapUtils.getString(marketingParam, "marketingPrice")).setScale(BigDecimal.ROUND_HALF_DOWN))); + tradePrice = tradePrice.add(accountRecord.getMarketingTradePrice()); + } + + if (MapUtils.getInteger(marketingParam, "marketingType").equals(MerAccountMarketingType.type3.getType())) { + HighMerchantAccountMarketing accountMarketing = marketingService.getDetailByMerAndType(merId, MerAccountMarketingType.type3.getType()); + if (accountMarketing == null) { + accountMarketing = new HighMerchantAccountMarketing(); + accountMarketing.setType(MerAccountMarketingType.type3.getType()); + accountMarketing.setMerId(merId); + accountMarketing.setMerAccountId(account.getId()); + JSONArray oilNoData = (JSONArray) marketingParam.get("marketingOilNoData"); + accountMarketing.setOilNoReliefPrice(oilNoData.toJSONString()); + marketingService.insert(accountMarketing); + } else { + JSONArray oilNoData = (JSONArray) marketingParam.get("marketingOilNoData"); + accountMarketing.setOilNoReliefPrice(oilNoData.toJSONString()); + marketingService.update(accountMarketing); + } + } + } + // 变更前金额 BigDecimal beforeAmount = account.getAmounts(); // 计算金额 - account.setAmounts(account.getAmounts().add(amount)); + account.setAmounts(account.getAmounts().add(tradePrice)); // 变更后金额 BigDecimal afterAmount = account.getAmounts(); editMerchantAccount(account); + + accountRecord.setMerAmountId(account.getId()); + accountRecord.setMerId(merchant.getId()); + accountRecord.setMerName(merchant.getMerchantName()); + accountRecord.setType(MerAmountTypeEnum.type1.getType()); + accountRecord.setAmount(amount); + accountRecord.setTradePrice(tradePrice); + accountRecord.setBeforeAmount(beforeAmount); + accountRecord.setAfterAmount(afterAmount); + accountRecord.setSourceType(MerAmountSourceTypeEnum.type1.getType()); + accountRecord.setOpUserId(userInfoModel.getSecUser().getId()); + accountRecord.setOpUserName(userInfoModel.getSecUser().getUserName()); + merchantAccountRecordService.insert(accountRecord); } @Override - public HighMerchantAccount getStoreAccountDetail(Long merId) { + public HighMerchantAccount getMerAccountDetail(Long merId) { HighMerchantAccountExample example = new HighMerchantAccountExample(); example.createCriteria().andStatusEqualTo(1).andMerIdEqualTo(merId); List list = merchantAccountMapper.selectByExample(example); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index fe8b4dd9..18972eb0 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -1608,6 +1608,11 @@ public class HighOrderServiceImpl implements HighOrderService { if (MapUtils.getString(map, "merchId") != null) { criteria.andMerchIdEqualTo(MapUtils.getString(map, "merchId")); } + if (StringUtils.isNotBlank(MapUtils.getString(map, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "createTimeE"))) { + criteria.andCreateTimeBetween( + DateUtil.format(MapUtils.getString(map, "createTimeS"), "yyyy-MM-dd HH:mm:ss"), + DateUtil.format(MapUtils.getString(map, "createTimeE"), "yyyy-MM-dd HH:mm:ss")); + } example.setOrderByClause("create_time desc"); List list = highOrderMapper.selectByExample(example); @@ -2217,6 +2222,7 @@ public class HighOrderServiceImpl implements HighOrderService { HighOrder highOrder = new HighOrder(); highOrder.setMerchId(object.getString("mchId")); + highOrder.setWhetherRebate(false); HighUser user = highUserService.findByUserId(object.getLong("userId")); JSONObject jsonObject = null; @@ -2688,6 +2694,7 @@ public class HighOrderServiceImpl implements HighOrderService { order.setOrderStatus(2); order.setMemCardNo(userCard.getCardNo()); order.setPayType(4); + order.setPayTime(new Date()); // 支付时间 updateOrder(order); diff --git a/v1/src/main/java/com/v1/controller/HighOrderController.java b/v1/src/main/java/com/v1/controller/HighOrderController.java index e1cdfa14..0d36d123 100644 --- a/v1/src/main/java/com/v1/controller/HighOrderController.java +++ b/v1/src/main/java/com/v1/controller/HighOrderController.java @@ -71,6 +71,9 @@ public class HighOrderController { } if (StringUtils.isBlank(object.getString("apiKey")) || + StringUtils.isBlank(object.getString("merchId")) || + StringUtils.isBlank(object.getString("createTimeS")) || + StringUtils.isBlank(object.getString("createTimeE")) || StringUtils.isBlank(object.getString("merchId")) || StringUtils.isBlank(object.getString("timetable")) || StringUtils.isBlank(object.getString("sign")) @@ -90,6 +93,8 @@ public class HighOrderController { map.put("apiKey" , object.getString("apiKey")); map.put("timetable" , object.getString("timetable")); map.put("merchId" , object.getString("merchId")); + map.put("createTimeS" , object.getString("createTimeS")); + map.put("createTimeE" , object.getString("createTimeE")); if (!secConfigService.isSignVerify(map , object.getString("sign"))) { log.error("getRechargeProduct error!", "签名校验失败!"); @@ -133,6 +138,8 @@ public class HighOrderController { if (StringUtils.isBlank(object.getString("apiKey")) || StringUtils.isBlank(object.getString("merchId")) || + StringUtils.isBlank(object.getString("createTimeS")) || + StringUtils.isBlank(object.getString("createTimeE")) || StringUtils.isBlank(object.getString("timetable")) || StringUtils.isBlank(object.getString("sign")) ) { @@ -151,6 +158,8 @@ public class HighOrderController { map.put("apiKey" , object.getString("apiKey")); map.put("timetable" , object.getString("timetable")); map.put("merchId" , object.getString("merchId")); + map.put("createTimeS" , object.getString("createTimeS")); + map.put("createTimeE" , object.getString("createTimeE")); if (!secConfigService.isSignVerify(map , object.getString("sign"))) { log.error("getRechargeProduct error!", "签名校验失败!");