提交代码

dev
胡锐 3 months ago
parent 6b5c47bf52
commit 0993e8d32e
  1. 1
      bweb/src/main/java/com/bweb/config/AuthConfig.java
  2. 105
      bweb/src/main/java/com/bweb/controller/BsGasOrderReceiptController.java
  3. 1
      bweb/src/main/java/com/bweb/controller/BsOrderRefundController.java
  4. 89
      bweb/src/main/java/com/bweb/controller/notify/NewLinkNotify.java
  5. 124
      cweb/src/main/java/com/cweb/controller/BsUserReceiptController.java
  6. 6
      cweb/src/main/java/com/cweb/controller/order/GasOrderController.java
  7. 57
      cweb/src/main/java/com/cweb/controller/order/GasOrderReceiptController.java
  8. 4
      cweb/src/main/java/com/cweb/controller/order/OrderPayController.java
  9. 131
      service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkGasService.java
  10. 2
      service/src/main/java/com/hfkj/channel/gas/newlink/NewLinkRequestService.java
  11. 183
      service/src/main/java/com/hfkj/channel/gas/shell/ScShellPetroleumRequestService.java
  12. 12
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  13. 14
      service/src/main/java/com/hfkj/dao/BsGasOrderMapper.java
  14. 150
      service/src/main/java/com/hfkj/dao/BsGasOrderReceiptMapper.java
  15. 7
      service/src/main/java/com/hfkj/dao/BsGasOrderReceiptMapperExt.java
  16. 416
      service/src/main/java/com/hfkj/dao/BsGasOrderReceiptSqlProvider.java
  17. 28
      service/src/main/java/com/hfkj/dao/BsGasOrderSqlProvider.java
  18. 130
      service/src/main/java/com/hfkj/dao/BsUserReceiptMapper.java
  19. 7
      service/src/main/java/com/hfkj/dao/BsUserReceiptMapperExt.java
  20. 346
      service/src/main/java/com/hfkj/dao/BsUserReceiptSqlProvider.java
  21. 32
      service/src/main/java/com/hfkj/entity/BsGasOrder.java
  22. 130
      service/src/main/java/com/hfkj/entity/BsGasOrderExample.java
  23. 326
      service/src/main/java/com/hfkj/entity/BsGasOrderReceipt.java
  24. 1424
      service/src/main/java/com/hfkj/entity/BsGasOrderReceiptExample.java
  25. 245
      service/src/main/java/com/hfkj/entity/BsUserReceipt.java
  26. 1073
      service/src/main/java/com/hfkj/entity/BsUserReceiptExample.java
  27. 4
      service/src/main/java/com/hfkj/pay/HuiPayService.java
  28. 61
      service/src/main/java/com/hfkj/service/gas/BsGasOrderReceiptService.java
  29. 184
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderReceiptServiceImpl.java
  30. 7
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOrderServiceImpl.java
  31. 4
      service/src/main/java/com/hfkj/service/order/BsOrderRefundService.java
  32. 2
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  33. 38
      service/src/main/java/com/hfkj/service/order/OrderRefundBusiness.java
  34. 14
      service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java
  35. 33
      service/src/main/java/com/hfkj/service/user/BsUserReceiptService.java
  36. 64
      service/src/main/java/com/hfkj/service/user/impl/BsUserReceiptServiceImpl.java
  37. 39
      service/src/main/java/com/hfkj/sysenum/gas/GasOrderReceiptStatusEnum.java
  38. 4
      service/src/main/java/com/hfkj/sysenum/gas/OrderOilStatus.java
  39. 8
      service/src/main/java/com/hfkj/sysenum/order/OrderPayTypeEnum.java

@ -92,6 +92,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/secUser/login")
.excludePathPatterns("/secUser/loginOut")
.excludePathPatterns("/agentMer/*")
.excludePathPatterns("/newLinkNotify/*")
.excludePathPatterns("/merchantPayConfig/editConfig")
;
}

@ -0,0 +1,105 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.gas.BsGasOrderReceiptService;
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 java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value = "/gasOrderReceipt")
@Api(value = "加油订单业务")
public class BsGasOrderReceiptController {
private static Logger log = LoggerFactory.getLogger(BsGasOrderReceiptController.class);
@Resource
private BsGasOrderReceiptService gasOrderReceiptService;
@RequestMapping(value="/success",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "开票成功")
public ResponseData success(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("applyNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasOrderReceiptService.success(body.getString("applyNo"));
return ResponseMsgUtil.success("申请成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/fail",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "开票失败")
public ResponseData fail(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("applyNo"))
|| StringUtils.isBlank(body.getString("remark"))
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasOrderReceiptService.fail(body.getString("applyNo"),body.getString("remark"));
return ResponseMsgUtil.success("申请成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryReceiptList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询申请列表")
public ResponseData queryReceiptList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "contactsPhone", required = false) String contactsPhone,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String,Object> param = new HashMap<>();
param.put("orderNo", orderNo);
param.put("contactsPhone", contactsPhone);
param.put("status", status);
param.put("createTimeS", createTimeS);
param.put("createTimeE", createTimeE);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasOrderReceiptService.getList(param)));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -112,6 +112,7 @@ public class BsOrderRefundController {
return ResponseMsgUtil.success(orderRefundService.tradeOrderChildRefund(
body.getString("childOrderNo"),
true,
body.getInteger("productCount"),
body.getString("remark")
));

@ -0,0 +1,89 @@
package com.bweb.controller.notify;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.gas.newlink.NewLinkGasService;
import com.hfkj.channel.gas.newlink.NewLinkRequestService;
import com.hfkj.common.security.AESEncodeUtil;
import com.hfkj.entity.BsGasOrder;
import com.hfkj.entity.BsOrderRefund;
import com.hfkj.service.gas.BsGasOrderService;
import com.hfkj.service.order.BsOrderRefundService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* @className: NewLinkNotify
* @author: HuRui
* @date: 2024/7/26
**/
@Controller
@RequestMapping(value = "/newLinkNotify")
@Api(value = "加油订单业务")
public class NewLinkNotify {
@Resource
private NewLinkGasService newLinkGasService;
@Resource
private BsOrderRefundService orderRefundService;
@Resource
private BsGasOrderService gasOrderService;
@RequestMapping(value="/merChange",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "商户变更")
public String merChange(@RequestBody JSONObject body) {
try {
System.out.println("================团油商户变更通知==================");
System.out.println(body);
String bodyData = body.getString("data");
// 解密参数
JSONObject data = JSONObject.parseObject(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(bodyData), NewLinkRequestService.APP_SECRET));
if ("001".equals(data.getString("type"))) {
// 油站更新
newLinkGasService.merChange(data.getString("value"));
}
} catch (Exception e) {
System.out.println("变更异常:" + e.getMessage());
} finally {
System.out.println("================团油商户变更通知==================");
}
return "success";
}
@RequestMapping(value="/orderRefund",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "订单退款")
public String orderRefund(@RequestBody JSONObject body) {
try {
System.out.println("================团油交易退款通知==================");
System.out.println(body);
String bodyData = body.getString("data");
// 解密参数
JSONObject data = JSONObject.parseObject(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(bodyData), NewLinkRequestService.APP_SECRET));
if (data.getBoolean("refundResult").equals(true)) {
// 查询加油订单
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(data.getString("thirdOrderNo"));
if (gasOrder != null) {
// 退款
orderRefundService.tradeOrderChildRefund(gasOrder.getChannelOrderNo(), false,1, data.getString("refundFailReason"));
}
}
} catch (Exception e) {
System.out.println("变更异常:" + e.getMessage());
} finally {
System.out.println("================团油交易退款通知==================");
}
return "success";
}
}

@ -0,0 +1,124 @@
package com.cweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsUserReceipt;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.user.BsUserReceiptService;
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 java.util.HashMap;
import java.util.Map;
/**
* @className: BsUserReceiptController
* @author: HuRui
* @date: 2024/7/24
**/
@Controller
@RequestMapping(value = "/userReceipt")
@Api(value = "用户收据")
public class BsUserReceiptController {
private static Logger log = LoggerFactory.getLogger(BsUserReceiptController.class);
@Resource
private UserCenter userCenter;
@Resource
private BsUserReceiptService userReceiptService;
@RequestMapping(value = "/editReceipt", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑收据")
public ResponseData editReceipt(@RequestBody BsUserReceipt body) {
try {
UserSessionObject sessionObject = userCenter.getSessionModel(UserSessionObject.class);
if (sessionObject == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
if (body == null
|| StringUtils.isBlank(body.getCompanyName())
|| StringUtils.isBlank(body.getTaxNo())
|| StringUtils.isBlank(body.getContactsPhone())
|| StringUtils.isBlank(body.getEmail())
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
BsUserReceipt receipt = null;
if (body.getId() != null) {
// 查询数据
receipt = userReceiptService.getDetail(body.getId());
if (receipt == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的数据");
}
} else {
receipt = new BsUserReceipt();
receipt.setUserId(sessionObject.getUser().getId());
receipt.setStatus(1);
}
receipt.setType(1);
receipt.setCompanyName(body.getCompanyName());
receipt.setTaxNo(body.getTaxNo());
receipt.setContactsPhone(body.getContactsPhone());
receipt.setEmail(body.getEmail());
userReceiptService.editData(receipt);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询详情")
public ResponseData queryDetail(@RequestParam(name = "id", required = true) Long id) {
try {
return ResponseMsgUtil.success(userReceiptService.getDetail(id));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryUserReceiptList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户票据")
public ResponseData queryUserReceiptList(@RequestParam(name = "status", required = false) String status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
UserSessionObject sessionObject = userCenter.getSessionModel(UserSessionObject.class);
if (sessionObject == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
Map<String,Object> param = new HashMap<>();
param.put("userId", sessionObject.getUser().getId());
param.put("status", status);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(userReceiptService.getList(param)));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -36,7 +36,10 @@ public class GasOrderController {
@ResponseBody
@ApiOperation(value = "查询用户加油订单")
public ResponseData queryUserOilOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "receiptStatus", required = false) String receiptStatus,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
@ -48,6 +51,9 @@ public class GasOrderController {
param.put("userId", userSession.getUser().getId());
param.put("orderNo", orderNo);
param.put("status", orderStatus);
param.put("receiptStatus", receiptStatus);
param.put("payTimeS", payTimeS);
param.put("payTimeE", payTimeE);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasOrderService.getGasOrderList(param)));

@ -0,0 +1,57 @@
package com.cweb.controller.order;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.service.gas.BsGasOrderReceiptService;
import com.hfkj.service.gas.BsGasOrderService;
import com.hfkj.service.user.BsUserReceiptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value = "/gasOrderReceipt")
@Api(value = "加油订单业务")
public class GasOrderReceiptController {
private static Logger log = LoggerFactory.getLogger(GasOrderReceiptController.class);
@Resource
private BsGasOrderReceiptService gasOrderReceiptService;
@RequestMapping(value="/applyReceipt",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "申请收据")
public ResponseData applyReceipt(@RequestBody JSONObject body) {
try {
if (body == null
|| body.getLong("userReceiptId") == null
|| body.getJSONArray("orderNo") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
List<String> orderNoList = body.getJSONArray("orderNo")
.stream().map(Object::toString)
.collect(Collectors.toList());
gasOrderReceiptService.applyReceipt(body.getLong("userReceiptId"), orderNoList);
return ResponseMsgUtil.success("申请成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -115,7 +115,7 @@ public class OrderPayController {
payMerKey = payConfig.getChannelMerKey();
ledgerAccountFlag = payConfig.getLedgerAccountFlag();
}
order.setPayType(OrderPayTypeEnum.type1.getCode());
order.setPayType(OrderPayTypeEnum.type2.getCode());
// appIdType 1: 公众号 2:小程序
if (body.getInteger("appIdType") != null && body.getInteger("appIdType") == 2) {
@ -202,7 +202,7 @@ public class OrderPayController {
payMerKey = payConfig.getChannelMerKey();
ledgerAccountFlag = payConfig.getLedgerAccountFlag();
}
order.setPayType(OrderPayTypeEnum.type2.getCode());
order.setPayType(OrderPayTypeEnum.type1.getCode());
// 请求支付渠道
Map<Object, Object> preorder = HuiPayService.preorder(payMerNo, payMerKey, null, body.getString("userId"), ledgerAccountFlag, order);

@ -228,6 +228,137 @@ public class NewLinkGasService {
System.out.println("本次更新任务结束,共计用时"+useTime+"毫秒");
}
/**
* 油站更新
* @param merNo
*/
public void merChange(String merNo) throws Exception {
// 渠道查询信息
JSONObject response = NewLinkRequestService.queryGasInfoByGasId(merNo);
if ("200".equals(response.getString("code"))) {
// 获取加油站数据
JSONObject gasData = response.getJSONObject("result");
// 查询商户
BsMerchant merchant = merchantService.getMerchant(gasData.getString("gasId"));
if (merchant == null) {
merchant = new BsMerchant();
}
merchant.setStatus(MerchantStatusEnum.status1.getNumber());
merchant.setSourceType(MerchantSourceTypeEnum.type2.getNumber());
merchant.setProvinceCode(gasData.getLong("provinceCode"));
merchant.setProvinceName(gasData.getString("provinceName"));
merchant.setCityCode(gasData.getLong("cityCode"));
merchant.setCityName(gasData.getString("cityName"));
merchant.setAreaCode(gasData.getLong("countyCode"));
merchant.setAreaName(gasData.getString("countyName"));
merchant.setMerNo(gasData.getString("gasId"));
merchant.setMerName(gasData.getString("gasName"));
merchant.setMerLogo("https://oil.dctpay.com/filesystem/gas_logo_default.jpg");
merchant.setAddress(gasData.getString("gasAddress"));
merchant.setLongitude(gasData.getString("gasAddressLongitude"));
merchant.setLatitude(gasData.getString("gasAddressLatitude"));
merchant.setContactsName(merchant.getMerName());
merchant.setContactsTel(merchant.getMerNo());
merchant.setCustomerServiceTel("400-0236806");
merchant.setMerLabel(StringUtils.join(gasData.getJSONArray("gasFeatureList"),","));
if (merchant.getId() == null) {
merchantService.createMerchant(merchant);
} else {
merchantService.updateMerchant(merchant);
}
// 查询油站油价
List<BsGasOilPrice> gasOilPriceList = gasOilPriceService.getGasOilPriceList(merchant.getId());
if (!gasOilPriceList.isEmpty()) {
BsGasOilPrice oilPriceExample = new BsGasOilPrice();
oilPriceExample.setStatus(GasOilPriceStatusEnum.status2.getNumber());
gasOilPriceService.batchUpdate(merchant.getMerNo(), oilPriceExample);
}
// 查询油站抢号
List<BsGasOilGunNo> oilGunNoList = gasOilGunNoService.getOilGunNoList(merchant.getMerNo());
for (BsGasOilGunNo gunNo : oilGunNoList) {
gunNo.setStatus(0);
}
JSONArray oilPriceList = gasData.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询油站油价
List<BsGasOilPrice> oilPriceCollect = gasOilPriceList.stream().filter(o -> o.getOilNo().equals(oilPriceObject.getString("oilNo"))).collect(Collectors.toList());
BsGasOilPrice gasOilPrice = null;
if (oilPriceCollect.isEmpty()) {
gasOilPrice = new BsGasOilPrice();
gasOilPrice.setMerId(merchant.getId());
gasOilPrice.setMerNo(merchant.getMerNo());
gasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
gasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
gasOilPrice.setOilNo(oilPriceObject.getString("oilNo"));
gasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));
gasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber());
} else {
gasOilPrice = oilPriceCollect.get(0);
gasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber());
}
// 平台优惠
gasOilPrice.setPreferentialMargin(new BigDecimal("0"));
// 国标价 - 油站价 = 油站直降
gasOilPrice.setGasStationDrop(oilPriceObject.getBigDecimal("priceOfficial").subtract(oilPriceObject.getBigDecimal("priceGun")));
gasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip"));
gasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip"));
gasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun"));
gasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
gasOilPriceService.editOilPrice(gasOilPrice);
for (Object gunNo : gasData.getJSONArray("gasGunList")) {
JSONObject gunNoObject = (JSONObject) gunNo;
// 查询抢号
List<BsGasOilGunNo> gunNoCollect = oilGunNoList.stream()
.filter(o -> o.getOilNo().equals(gunNoObject.getString("oilNo")) && o.getGunNo().equals(gunNoObject.getString("gunNo")))
.collect(Collectors.toList());
// 如果没有找到抢号就新增一个
BsGasOilGunNo gasOilGunNo = null;
if (gunNoCollect.isEmpty()) {
gasOilGunNo = new BsGasOilGunNo();
gasOilGunNo.setGasOilPriceId(gasOilPrice.getId());
gasOilGunNo.setMerId(gasOilPrice.getMerId());
gasOilGunNo.setMerNo(gasOilPrice.getMerNo());
gasOilGunNo.setOilNo(gasOilPrice.getOilNo());
gasOilGunNo.setOilNoName(gasOilPrice.getOilNoName());
gasOilGunNo.setOilType(gasOilPrice.getOilType());
gasOilGunNo.setOilTypeName(gasOilPrice.getOilTypeName());
gasOilGunNo.setGunNo(gunNoObject.getString("gunNo"));
gasOilGunNo.setStatus(1);
gasOilGunNo.setCreateTime(new Date());
oilGunNoList.add(gasOilGunNo);
} else {
gasOilGunNo = gunNoCollect.get(0);
gasOilGunNo.setStatus(1);
}
}
}
// 添加
gasOilGunNoService.batchInsert(oilGunNoList.stream().filter(o-> o.getId() == null).collect(Collectors.toList()));
// 更新
gasOilGunNoService.batchUpdate(oilGunNoList.stream().filter(o-> o.getId() != null && o.getStatus().equals(0)).collect(Collectors.toList()));
// 删除缓存
gasOilGunNoService.cleanCache(merchant.getMerNo());
// 清除油站缓存
gasService.clean(merchant.getMerNo());
}
else if ("120000".equals(response.getString("code"))) {
/*** 油站下线 ***/
// 获取加油站数据
JSONObject gasData = response.getJSONObject("result");
// 查询商户
BsMerchant merchant = merchantService.getMerchant(gasData.getString("gasId"));
if (merchant != null) {
merchant.setStatus(MerchantStatusEnum.status2.getNumber());
// 修改商户信息
merchantService.updateMerchant(merchant);
}
}
}
/**
* 拆分集合

@ -20,7 +20,7 @@ public class NewLinkRequestService {
private static final Logger log = LoggerFactory.getLogger(NewLinkRequestService.class);
private static final String REQ_URL = CommonSysConst.getSysConfig().getNewLinkReqUrl();
private static final String APP_KEY = CommonSysConst.getSysConfig().getNewLinkAppKey();
private static final String APP_SECRET = CommonSysConst.getSysConfig().getNewLinkAppSecret();
public static final String APP_SECRET = CommonSysConst.getSysConfig().getNewLinkAppSecret();
/**
* 分页获取(全量)油站信息

@ -0,0 +1,183 @@
package com.hfkj.channel.gas.shell;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.MD5Util;
import com.hfkj.config.CommonSysConst;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
/**
* paylo系统 四川壳牌
* @className: PayloService
* @author: HuRui
* @date: 2024/7/24
**/
@Component
public class ScShellPetroleumRequestService {
private final static String REQ_URL = CommonSysConst.getSysConfig().getScShellReqUrl();
private static final String PARTNER_ID = CommonSysConst.getSysConfig().getScShellPartnerId();
private static final String PLAT_MERCHANT_KEY = CommonSysConst.getSysConfig().getScShellPlatMerchantKey();
/**
* 查询全量加油站
* @param pageNum 当前页码
* @param pageSize 每页数据量最大值50
* @return
*/
public JSONObject ycShellPageQueryAllStation(Integer pageNum, Integer pageSize) throws Exception {
Map<String, Object> param = new HashMap<>();
param.put("pageNo", pageNum);
param.put("pageSize", pageSize);
return request(System.currentTimeMillis()+"","ycShellPageQueryAllStation", param);
}
/**
* 查询单个油站全量信息
* @param stationCode 油站编码
* @return
*/
public JSONObject ycShellStationQueryDetail(String stationCode) {
try {
Map<String, Object> param = new HashMap<>();
param.put("stationCode", stationCode);
return request(System.currentTimeMillis()+"","ycShellStationQueryDetail", param);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 同步油站付款
* @param orderNo 订单号
* @param stationCode 油站编码
* @param finishTime 完成时间
* @param oilPrice 加油金额
* @param oilCode 油品编码
* @param oilGun 油枪
* @param settlementAmount 支付金额
* @param channelFavourAmount 优惠金额
* @return
*/
public JSONObject syncYcShellPaymentNotify(String orderNo,
String stationCode,
Date finishTime,
BigDecimal oilPrice,
String oilCode,
String oilGun,
BigDecimal settlementAmount,
BigDecimal channelFavourAmount) throws Exception {
Map<String, Object> param = new HashMap<>();
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<String, Object> tradeOilOrder = new HashMap<>();
tradeOilOrder.put("amount", oilPrice);
tradeOilOrder.put("code", oilCode);
tradeOilOrder.put("oilGun", oilGun);
tradeOilOrder.put("channelSettlementAmount", settlementAmount);
param.put("tradeOilOrder", JSONObject.toJSONString(tradeOilOrder));
return request(orderNo, "syncYcShellPaymentNotify", param);
}
/**
* 同步油站退款
* @param finishTime 业务完成时间
* @param tradeNo 交易流水号
* @return
*/
public JSONObject syncYcShellRefundNotify(Date finishTime,String tradeNo) throws Exception {
Map<String, Object> param = new HashMap<>();
param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss"));
param.put("tradeNo", tradeNo);
// 请求接口
return request(System.currentTimeMillis()+"" ,"syncYcShellRefundNotify", param);
}
/**
* 接口请求
* @param map
* @return
* @throws Exception
*/
private JSONObject request(String logSerialNo, String service, Map<String,Object> map) throws Exception {
Map<String, Object> param = new HashMap<>();
param.put("merchantOrderNo", logSerialNo);
param.put("partnerId", PARTNER_ID);
param.put("service", service);
param.put("version", "1.0.0");
param.put("signType", "MD5");
for (Map.Entry<String, Object> entry : map.entrySet()) {
param.put(entry.getKey(), entry.getValue());
}
param.put("sign", MD5Util.encode(generateSignature(param, PLAT_MERCHANT_KEY).getBytes()).toLowerCase());
// 请求接口
JSONObject object = HttpsUtils.doPost(REQ_URL, param);
if (object == null || !object.getString("status").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object == null?"请求失败":object.getString("message"));
}
return object;
}
/**
* 生成签名
* @param data 数据
* @param key 秘钥app_secret
* @return 加密结果
*/
public static String generateSignature(final Map<String, Object> data, String key) {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (data.get(k) != null) {
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(data.get(k));
} else {
sb.append("&").append(k).append("=").append(data.get(k));
}
}
}
sb.append(key);
return sb.toString();
}
/**
* 生成参数
* @param data 数据
* @return 加密结果
*/
public static String generateParam(final Map<String, Object> data) {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (data.get(k) != null) {
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(data.get(k));
} else {
sb.append("&").append(k).append("=").append(data.get(k));
}
}
}
return sb.toString();
}
}

@ -54,6 +54,18 @@ public class CommonSysConfig {
*/
private String cqShellPlatMerchantKey;
/**
* paylo四川壳牌请求地址
*/
private String scShellReqUrl;
/**
* paylo四川壳牌壳牌合作伙伴id
*/
private String scShellPartnerId;
/**
* paylo四川壳牌平台商key
*/
private String scShellPlatMerchantKey;
/**
* 惠支付支付渠道回调地址

@ -60,6 +60,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"gas_staff_id, gas_staff_name, ",
"pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, ",
"receipt_status, receipt_fail_remark, ",
"create_time, cancel_time, ",
"pay_time, refund_time, ",
"refund_remarks, abnormal, ",
@ -87,6 +88,7 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ",
"#{payType,jdbcType=INTEGER}, #{paySerialNo,jdbcType=VARCHAR}, ",
"#{payChannelOrderNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{receiptStatus,jdbcType=INTEGER}, #{receiptFailRemark,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ",
"#{refundRemarks,jdbcType=VARCHAR}, #{abnormal,jdbcType=BIT}, ",
@ -147,6 +149,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_status", property="receiptStatus", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_fail_remark", property="receiptFailRemark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@ -173,9 +177,9 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"gas_price_platform, gas_price_cost, 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, pay_type, pay_serial_no, ",
"pay_channel_order_no, `status`, create_time, cancel_time, pay_time, refund_time, ",
"refund_remarks, abnormal, abnormal_content, ext_1, ext_2, ext_3, ext_4, ext_5, ",
"ext_6",
"pay_channel_order_no, `status`, receipt_status, receipt_fail_remark, create_time, ",
"cancel_time, pay_time, refund_time, refund_remarks, abnormal, abnormal_content, ",
"ext_1, ext_2, ext_3, ext_4, ext_5, ext_6",
"from bs_gas_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -224,6 +228,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_status", property="receiptStatus", jdbcType=JdbcType.INTEGER),
@Result(column="receipt_fail_remark", property="receiptFailRemark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@ -294,6 +300,8 @@ public interface BsGasOrderMapper extends BsGasOrderMapperExt {
"pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
"pay_channel_order_no = #{payChannelOrderNo,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"receipt_status = #{receiptStatus,jdbcType=INTEGER},",
"receipt_fail_remark = #{receiptFailRemark,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"cancel_time = #{cancelTime,jdbcType=TIMESTAMP},",
"pay_time = #{payTime,jdbcType=TIMESTAMP},",

@ -0,0 +1,150 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasOrderReceipt;
import com.hfkj.entity.BsGasOrderReceiptExample;
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 BsGasOrderReceiptMapper extends BsGasOrderReceiptMapperExt {
@SelectProvider(type=BsGasOrderReceiptSqlProvider.class, method="countByExample")
long countByExample(BsGasOrderReceiptExample example);
@DeleteProvider(type=BsGasOrderReceiptSqlProvider.class, method="deleteByExample")
int deleteByExample(BsGasOrderReceiptExample example);
@Delete({
"delete from bs_gas_order_receipt",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_gas_order_receipt (apply_no, user_receipt_id, ",
"company_name, tax_no, ",
"contacts_phone, email, ",
"order_no, order_child_no, ",
"oil_no, amount, `status`, ",
"fail_remark, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{applyNo,jdbcType=VARCHAR}, #{userReceiptId,jdbcType=BIGINT}, ",
"#{companyName,jdbcType=VARCHAR}, #{taxNo,jdbcType=VARCHAR}, ",
"#{contactsPhone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, ",
"#{orderNo,jdbcType=VARCHAR}, #{orderChildNo,jdbcType=VARCHAR}, ",
"#{oilNo,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{failRemark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsGasOrderReceipt record);
@InsertProvider(type=BsGasOrderReceiptSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsGasOrderReceipt record);
@SelectProvider(type=BsGasOrderReceiptSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
@Result(column="user_receipt_id", property="userReceiptId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR),
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="fail_remark", property="failRemark", jdbcType=JdbcType.VARCHAR),
@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<BsGasOrderReceipt> selectByExample(BsGasOrderReceiptExample example);
@Select({
"select",
"id, apply_no, user_receipt_id, company_name, tax_no, contacts_phone, email, ",
"order_no, order_child_no, oil_no, amount, `status`, fail_remark, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_gas_order_receipt",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
@Result(column="user_receipt_id", property="userReceiptId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR),
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_child_no", property="orderChildNo", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="fail_remark", property="failRemark", jdbcType=JdbcType.VARCHAR),
@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)
})
BsGasOrderReceipt selectByPrimaryKey(Long id);
@UpdateProvider(type=BsGasOrderReceiptSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsGasOrderReceipt record, @Param("example") BsGasOrderReceiptExample example);
@UpdateProvider(type=BsGasOrderReceiptSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsGasOrderReceipt record, @Param("example") BsGasOrderReceiptExample example);
@UpdateProvider(type=BsGasOrderReceiptSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsGasOrderReceipt record);
@Update({
"update bs_gas_order_receipt",
"set apply_no = #{applyNo,jdbcType=VARCHAR},",
"user_receipt_id = #{userReceiptId,jdbcType=BIGINT},",
"company_name = #{companyName,jdbcType=VARCHAR},",
"tax_no = #{taxNo,jdbcType=VARCHAR},",
"contacts_phone = #{contactsPhone,jdbcType=VARCHAR},",
"email = #{email,jdbcType=VARCHAR},",
"order_no = #{orderNo,jdbcType=VARCHAR},",
"order_child_no = #{orderChildNo,jdbcType=VARCHAR},",
"oil_no = #{oilNo,jdbcType=VARCHAR},",
"amount = #{amount,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",
"fail_remark = #{failRemark,jdbcType=VARCHAR},",
"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(BsGasOrderReceipt record);
}

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

@ -0,0 +1,416 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasOrderReceipt;
import com.hfkj.entity.BsGasOrderReceiptExample.Criteria;
import com.hfkj.entity.BsGasOrderReceiptExample.Criterion;
import com.hfkj.entity.BsGasOrderReceiptExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsGasOrderReceiptSqlProvider {
public String countByExample(BsGasOrderReceiptExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_gas_order_receipt");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsGasOrderReceiptExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_gas_order_receipt");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsGasOrderReceipt record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_gas_order_receipt");
if (record.getApplyNo() != null) {
sql.VALUES("apply_no", "#{applyNo,jdbcType=VARCHAR}");
}
if (record.getUserReceiptId() != null) {
sql.VALUES("user_receipt_id", "#{userReceiptId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}");
}
if (record.getTaxNo() != null) {
sql.VALUES("tax_no", "#{taxNo,jdbcType=VARCHAR}");
}
if (record.getContactsPhone() != null) {
sql.VALUES("contacts_phone", "#{contactsPhone,jdbcType=VARCHAR}");
}
if (record.getEmail() != null) {
sql.VALUES("email", "#{email,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderChildNo() != null) {
sql.VALUES("order_child_no", "#{orderChildNo,jdbcType=VARCHAR}");
}
if (record.getOilNo() != null) {
sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}");
}
if (record.getAmount() != null) {
sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getFailRemark() != null) {
sql.VALUES("fail_remark", "#{failRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.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(BsGasOrderReceiptExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("apply_no");
sql.SELECT("user_receipt_id");
sql.SELECT("company_name");
sql.SELECT("tax_no");
sql.SELECT("contacts_phone");
sql.SELECT("email");
sql.SELECT("order_no");
sql.SELECT("order_child_no");
sql.SELECT("oil_no");
sql.SELECT("amount");
sql.SELECT("`status`");
sql.SELECT("fail_remark");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_gas_order_receipt");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsGasOrderReceipt record = (BsGasOrderReceipt) parameter.get("record");
BsGasOrderReceiptExample example = (BsGasOrderReceiptExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_gas_order_receipt");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getApplyNo() != null) {
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}");
}
if (record.getUserReceiptId() != null) {
sql.SET("user_receipt_id = #{record.userReceiptId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
}
if (record.getTaxNo() != null) {
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}");
}
if (record.getContactsPhone() != null) {
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}");
}
if (record.getEmail() != null) {
sql.SET("email = #{record.email,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderChildNo() != null) {
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}");
}
if (record.getOilNo() != null) {
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
}
if (record.getAmount() != null) {
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getFailRemark() != null) {
sql.SET("fail_remark = #{record.failRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_gas_order_receipt");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("apply_no = #{record.applyNo,jdbcType=VARCHAR}");
sql.SET("user_receipt_id = #{record.userReceiptId,jdbcType=BIGINT}");
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}");
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}");
sql.SET("email = #{record.email,jdbcType=VARCHAR}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("order_child_no = #{record.orderChildNo,jdbcType=VARCHAR}");
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
sql.SET("amount = #{record.amount,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("fail_remark = #{record.failRemark,jdbcType=VARCHAR}");
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}");
BsGasOrderReceiptExample example = (BsGasOrderReceiptExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsGasOrderReceipt record) {
SQL sql = new SQL();
sql.UPDATE("bs_gas_order_receipt");
if (record.getApplyNo() != null) {
sql.SET("apply_no = #{applyNo,jdbcType=VARCHAR}");
}
if (record.getUserReceiptId() != null) {
sql.SET("user_receipt_id = #{userReceiptId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}");
}
if (record.getTaxNo() != null) {
sql.SET("tax_no = #{taxNo,jdbcType=VARCHAR}");
}
if (record.getContactsPhone() != null) {
sql.SET("contacts_phone = #{contactsPhone,jdbcType=VARCHAR}");
}
if (record.getEmail() != null) {
sql.SET("email = #{email,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getOrderChildNo() != null) {
sql.SET("order_child_no = #{orderChildNo,jdbcType=VARCHAR}");
}
if (record.getOilNo() != null) {
sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}");
}
if (record.getAmount() != null) {
sql.SET("amount = #{amount,jdbcType=DECIMAL}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getFailRemark() != null) {
sql.SET("fail_remark = #{failRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.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, BsGasOrderReceiptExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -200,6 +200,14 @@ public class BsGasOrderSqlProvider {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getReceiptStatus() != null) {
sql.VALUES("receipt_status", "#{receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.VALUES("receipt_fail_remark", "#{receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
@ -305,6 +313,8 @@ public class BsGasOrderSqlProvider {
sql.SELECT("pay_serial_no");
sql.SELECT("pay_channel_order_no");
sql.SELECT("`status`");
sql.SELECT("receipt_status");
sql.SELECT("receipt_fail_remark");
sql.SELECT("create_time");
sql.SELECT("cancel_time");
sql.SELECT("pay_time");
@ -511,6 +521,14 @@ public class BsGasOrderSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getReceiptStatus() != null) {
sql.SET("receipt_status = #{record.receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.SET("receipt_fail_remark = #{record.receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
@ -615,6 +633,8 @@ public class BsGasOrderSqlProvider {
sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}");
sql.SET("pay_channel_order_no = #{record.payChannelOrderNo,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("receipt_status = #{record.receiptStatus,jdbcType=INTEGER}");
sql.SET("receipt_fail_remark = #{record.receiptFailRemark,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}");
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
@ -810,6 +830,14 @@ public class BsGasOrderSqlProvider {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getReceiptStatus() != null) {
sql.SET("receipt_status = #{receiptStatus,jdbcType=INTEGER}");
}
if (record.getReceiptFailRemark() != null) {
sql.SET("receipt_fail_remark = #{receiptFailRemark,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}

@ -0,0 +1,130 @@
package com.hfkj.dao;
import com.hfkj.entity.BsUserReceipt;
import com.hfkj.entity.BsUserReceiptExample;
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 BsUserReceiptMapper extends BsUserReceiptMapperExt {
@SelectProvider(type=BsUserReceiptSqlProvider.class, method="countByExample")
long countByExample(BsUserReceiptExample example);
@DeleteProvider(type=BsUserReceiptSqlProvider.class, method="deleteByExample")
int deleteByExample(BsUserReceiptExample example);
@Delete({
"delete from bs_user_receipt",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_user_receipt (user_id, `type`, ",
"company_name, tax_no, ",
"contacts_phone, email, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{userId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ",
"#{companyName,jdbcType=VARCHAR}, #{taxNo,jdbcType=VARCHAR}, ",
"#{contactsPhone,jdbcType=VARCHAR}, #{email,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(BsUserReceipt record);
@InsertProvider(type=BsUserReceiptSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsUserReceipt record);
@SelectProvider(type=BsUserReceiptSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR),
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", 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<BsUserReceipt> selectByExample(BsUserReceiptExample example);
@Select({
"select",
"id, user_id, `type`, company_name, tax_no, contacts_phone, email, `status`, ",
"create_time, update_time, ext_1, ext_2, ext_3",
"from bs_user_receipt",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="tax_no", property="taxNo", jdbcType=JdbcType.VARCHAR),
@Result(column="contacts_phone", property="contactsPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="email", property="email", 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)
})
BsUserReceipt selectByPrimaryKey(Long id);
@UpdateProvider(type=BsUserReceiptSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsUserReceipt record, @Param("example") BsUserReceiptExample example);
@UpdateProvider(type=BsUserReceiptSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsUserReceipt record, @Param("example") BsUserReceiptExample example);
@UpdateProvider(type=BsUserReceiptSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsUserReceipt record);
@Update({
"update bs_user_receipt",
"set user_id = #{userId,jdbcType=BIGINT},",
"`type` = #{type,jdbcType=INTEGER},",
"company_name = #{companyName,jdbcType=VARCHAR},",
"tax_no = #{taxNo,jdbcType=VARCHAR},",
"contacts_phone = #{contactsPhone,jdbcType=VARCHAR},",
"email = #{email,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(BsUserReceipt record);
}

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

@ -0,0 +1,346 @@
package com.hfkj.dao;
import com.hfkj.entity.BsUserReceipt;
import com.hfkj.entity.BsUserReceiptExample.Criteria;
import com.hfkj.entity.BsUserReceiptExample.Criterion;
import com.hfkj.entity.BsUserReceiptExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsUserReceiptSqlProvider {
public String countByExample(BsUserReceiptExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_user_receipt");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsUserReceiptExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_user_receipt");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsUserReceipt record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_user_receipt");
if (record.getUserId() != null) {
sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getCompanyName() != null) {
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}");
}
if (record.getTaxNo() != null) {
sql.VALUES("tax_no", "#{taxNo,jdbcType=VARCHAR}");
}
if (record.getContactsPhone() != null) {
sql.VALUES("contacts_phone", "#{contactsPhone,jdbcType=VARCHAR}");
}
if (record.getEmail() != null) {
sql.VALUES("email", "#{email,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(BsUserReceiptExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("user_id");
sql.SELECT("`type`");
sql.SELECT("company_name");
sql.SELECT("tax_no");
sql.SELECT("contacts_phone");
sql.SELECT("email");
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("bs_user_receipt");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsUserReceipt record = (BsUserReceipt) parameter.get("record");
BsUserReceiptExample example = (BsUserReceiptExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_user_receipt");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getUserId() != null) {
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
}
if (record.getTaxNo() != null) {
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}");
}
if (record.getContactsPhone() != null) {
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}");
}
if (record.getEmail() != null) {
sql.SET("email = #{record.email,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<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_user_receipt");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
sql.SET("tax_no = #{record.taxNo,jdbcType=VARCHAR}");
sql.SET("contacts_phone = #{record.contactsPhone,jdbcType=VARCHAR}");
sql.SET("email = #{record.email,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}");
BsUserReceiptExample example = (BsUserReceiptExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsUserReceipt record) {
SQL sql = new SQL();
sql.UPDATE("bs_user_receipt");
if (record.getUserId() != null) {
sql.SET("user_id = #{userId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}");
}
if (record.getTaxNo() != null) {
sql.SET("tax_no = #{taxNo,jdbcType=VARCHAR}");
}
if (record.getContactsPhone() != null) {
sql.SET("contacts_phone = #{contactsPhone,jdbcType=VARCHAR}");
}
if (record.getEmail() != null) {
sql.SET("email = #{email,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, BsUserReceiptExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -240,6 +240,16 @@ public class BsGasOrder implements Serializable {
*/
private Integer status;
/**
* 收据状态0未开票 1处理中 2开票成功 3开票失败
*/
private Integer receiptStatus;
/**
* 开票失败备注
*/
private String receiptFailRemark;
/**
* 创建时间
*/
@ -641,6 +651,22 @@ public class BsGasOrder implements Serializable {
this.status = status;
}
public Integer getReceiptStatus() {
return receiptStatus;
}
public void setReceiptStatus(Integer receiptStatus) {
this.receiptStatus = receiptStatus;
}
public String getReceiptFailRemark() {
return receiptFailRemark;
}
public void setReceiptFailRemark(String receiptFailRemark) {
this.receiptFailRemark = receiptFailRemark;
}
public Date getCreateTime() {
return createTime;
}
@ -801,6 +827,8 @@ public class BsGasOrder implements Serializable {
&& (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo()))
&& (this.getPayChannelOrderNo() == null ? other.getPayChannelOrderNo() == null : this.getPayChannelOrderNo().equals(other.getPayChannelOrderNo()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getReceiptStatus() == null ? other.getReceiptStatus() == null : this.getReceiptStatus().equals(other.getReceiptStatus()))
&& (this.getReceiptFailRemark() == null ? other.getReceiptFailRemark() == null : this.getReceiptFailRemark().equals(other.getReceiptFailRemark()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime()))
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
@ -864,6 +892,8 @@ public class BsGasOrder implements Serializable {
result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode());
result = prime * result + ((getPayChannelOrderNo() == null) ? 0 : getPayChannelOrderNo().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getReceiptStatus() == null) ? 0 : getReceiptStatus().hashCode());
result = prime * result + ((getReceiptFailRemark() == null) ? 0 : getReceiptFailRemark().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode());
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
@ -930,6 +960,8 @@ public class BsGasOrder implements Serializable {
sb.append(", paySerialNo=").append(paySerialNo);
sb.append(", payChannelOrderNo=").append(payChannelOrderNo);
sb.append(", status=").append(status);
sb.append(", receiptStatus=").append(receiptStatus);
sb.append(", receiptFailRemark=").append(receiptFailRemark);
sb.append(", createTime=").append(createTime);
sb.append(", cancelTime=").append(cancelTime);
sb.append(", payTime=").append(payTime);

@ -2916,6 +2916,136 @@ public class BsGasOrderExample {
return (Criteria) this;
}
public Criteria andReceiptStatusIsNull() {
addCriterion("receipt_status is null");
return (Criteria) this;
}
public Criteria andReceiptStatusIsNotNull() {
addCriterion("receipt_status is not null");
return (Criteria) this;
}
public Criteria andReceiptStatusEqualTo(Integer value) {
addCriterion("receipt_status =", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotEqualTo(Integer value) {
addCriterion("receipt_status <>", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusGreaterThan(Integer value) {
addCriterion("receipt_status >", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("receipt_status >=", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusLessThan(Integer value) {
addCriterion("receipt_status <", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusLessThanOrEqualTo(Integer value) {
addCriterion("receipt_status <=", value, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusIn(List<Integer> values) {
addCriterion("receipt_status in", values, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotIn(List<Integer> values) {
addCriterion("receipt_status not in", values, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusBetween(Integer value1, Integer value2) {
addCriterion("receipt_status between", value1, value2, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptStatusNotBetween(Integer value1, Integer value2) {
addCriterion("receipt_status not between", value1, value2, "receiptStatus");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIsNull() {
addCriterion("receipt_fail_remark is null");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIsNotNull() {
addCriterion("receipt_fail_remark is not null");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkEqualTo(String value) {
addCriterion("receipt_fail_remark =", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotEqualTo(String value) {
addCriterion("receipt_fail_remark <>", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkGreaterThan(String value) {
addCriterion("receipt_fail_remark >", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkGreaterThanOrEqualTo(String value) {
addCriterion("receipt_fail_remark >=", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLessThan(String value) {
addCriterion("receipt_fail_remark <", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLessThanOrEqualTo(String value) {
addCriterion("receipt_fail_remark <=", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkLike(String value) {
addCriterion("receipt_fail_remark like", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotLike(String value) {
addCriterion("receipt_fail_remark not like", value, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkIn(List<String> values) {
addCriterion("receipt_fail_remark in", values, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotIn(List<String> values) {
addCriterion("receipt_fail_remark not in", values, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkBetween(String value1, String value2) {
addCriterion("receipt_fail_remark between", value1, value2, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andReceiptFailRemarkNotBetween(String value1, String value2) {
addCriterion("receipt_fail_remark not between", value1, value2, "receiptFailRemark");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

@ -0,0 +1,326 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_gas_order_receipt
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsGasOrderReceipt implements Serializable {
private Long id;
/**
* 申请单号
*/
private String applyNo;
/**
* 用户收据信息id
*/
private Long userReceiptId;
/**
* 公司名称
*/
private String companyName;
/**
* 税号
*/
private String taxNo;
/**
* 联系人手机号
*/
private String contactsPhone;
/**
* 邮箱
*/
private String email;
/**
* 交易订单号
*/
private String orderNo;
/**
* 商品订单号
*/
private String orderChildNo;
/**
* 油号
*/
private String oilNo;
/**
* 收据金额
*/
private BigDecimal amount;
/**
* 状态 1待处理 2开票成功 3开票失败
*/
private Integer status;
/**
* 失败备注
*/
private String failRemark;
/**
* 创建时间
*/
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 String getApplyNo() {
return applyNo;
}
public void setApplyNo(String applyNo) {
this.applyNo = applyNo;
}
public Long getUserReceiptId() {
return userReceiptId;
}
public void setUserReceiptId(Long userReceiptId) {
this.userReceiptId = userReceiptId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getTaxNo() {
return taxNo;
}
public void setTaxNo(String taxNo) {
this.taxNo = taxNo;
}
public String getContactsPhone() {
return contactsPhone;
}
public void setContactsPhone(String contactsPhone) {
this.contactsPhone = contactsPhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getOrderChildNo() {
return orderChildNo;
}
public void setOrderChildNo(String orderChildNo) {
this.orderChildNo = orderChildNo;
}
public String getOilNo() {
return oilNo;
}
public void setOilNo(String oilNo) {
this.oilNo = oilNo;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getFailRemark() {
return failRemark;
}
public void setFailRemark(String failRemark) {
this.failRemark = failRemark;
}
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;
}
BsGasOrderReceipt other = (BsGasOrderReceipt) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getApplyNo() == null ? other.getApplyNo() == null : this.getApplyNo().equals(other.getApplyNo()))
&& (this.getUserReceiptId() == null ? other.getUserReceiptId() == null : this.getUserReceiptId().equals(other.getUserReceiptId()))
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
&& (this.getTaxNo() == null ? other.getTaxNo() == null : this.getTaxNo().equals(other.getTaxNo()))
&& (this.getContactsPhone() == null ? other.getContactsPhone() == null : this.getContactsPhone().equals(other.getContactsPhone()))
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getOrderChildNo() == null ? other.getOrderChildNo() == null : this.getOrderChildNo().equals(other.getOrderChildNo()))
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getFailRemark() == null ? other.getFailRemark() == null : this.getFailRemark().equals(other.getFailRemark()))
&& (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 + ((getApplyNo() == null) ? 0 : getApplyNo().hashCode());
result = prime * result + ((getUserReceiptId() == null) ? 0 : getUserReceiptId().hashCode());
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
result = prime * result + ((getTaxNo() == null) ? 0 : getTaxNo().hashCode());
result = prime * result + ((getContactsPhone() == null) ? 0 : getContactsPhone().hashCode());
result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getOrderChildNo() == null) ? 0 : getOrderChildNo().hashCode());
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getFailRemark() == null) ? 0 : getFailRemark().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(", applyNo=").append(applyNo);
sb.append(", userReceiptId=").append(userReceiptId);
sb.append(", companyName=").append(companyName);
sb.append(", taxNo=").append(taxNo);
sb.append(", contactsPhone=").append(contactsPhone);
sb.append(", email=").append(email);
sb.append(", orderNo=").append(orderNo);
sb.append(", orderChildNo=").append(orderChildNo);
sb.append(", oilNo=").append(oilNo);
sb.append(", amount=").append(amount);
sb.append(", status=").append(status);
sb.append(", failRemark=").append(failRemark);
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();
}
}

@ -0,0 +1,245 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_user_receipt
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsUserReceipt implements Serializable {
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 类型 1企业 2个人
*/
private Integer type;
/**
* 公司名称
*/
private String companyName;
/**
* 税号
*/
private String taxNo;
/**
* 联系人手机号
*/
private String contactsPhone;
/**
* 邮箱
*/
private String email;
/**
* 状态 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 Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getTaxNo() {
return taxNo;
}
public void setTaxNo(String taxNo) {
this.taxNo = taxNo;
}
public String getContactsPhone() {
return contactsPhone;
}
public void setContactsPhone(String contactsPhone) {
this.contactsPhone = contactsPhone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
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;
}
BsUserReceipt other = (BsUserReceipt) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
&& (this.getTaxNo() == null ? other.getTaxNo() == null : this.getTaxNo().equals(other.getTaxNo()))
&& (this.getContactsPhone() == null ? other.getContactsPhone() == null : this.getContactsPhone().equals(other.getContactsPhone()))
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
&& (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 + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
result = prime * result + ((getTaxNo() == null) ? 0 : getTaxNo().hashCode());
result = prime * result + ((getContactsPhone() == null) ? 0 : getContactsPhone().hashCode());
result = prime * result + ((getEmail() == null) ? 0 : getEmail().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(", userId=").append(userId);
sb.append(", type=").append(type);
sb.append(", companyName=").append(companyName);
sb.append(", taxNo=").append(taxNo);
sb.append(", contactsPhone=").append(contactsPhone);
sb.append(", email=").append(email);
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();
}
}

@ -46,9 +46,9 @@ public class HuiPayService {
param.put("outTradeNo", order.getOrderNo());
param.put("transType", "JSAPI");
if (OrderPayTypeEnum.type1.getCode() == order.getPayType()) {
param.put("payMode", "WECHAT");
} else if (OrderPayTypeEnum.type2.getCode() == order.getPayType()) {
param.put("payMode", "ALIPAY");
} else if (OrderPayTypeEnum.type2.getCode() == order.getPayType()) {
param.put("payMode", "WECHAT");
}
param.put("totalAmount", order.getPayRealPrice());
param.put("profitSharing", profitSharing?1:0);

@ -0,0 +1,61 @@
package com.hfkj.service.gas;
import com.hfkj.entity.BsGasOrderReceipt;
import java.util.List;
import java.util.Map;
/**
* @className: BsGasOrderReceiptService
* @author: HuRui
* @date: 2024/7/24
**/
public interface BsGasOrderReceiptService {
/**
* 编辑数据
* @param data
*/
void editData(BsGasOrderReceipt data);
/**
* 申请
* @param userReceiptId
* @param orderNos
*/
void applyReceipt(Long userReceiptId, List<String> orderNos);
/**
* 开票成功
* @param applyNo
*/
void success(String applyNo);
/**
* 开票失败
* @param applyNo
*/
void fail(String applyNo, String remark);
/**
* 查询详情
* @param applyNo
*/
BsGasOrderReceipt getDetail(String applyNo);
/**
* 查询详情
* @param orderReceiptId
* @return
*/
BsGasOrderReceipt getDetail(Long orderReceiptId);
/**
* 查询列表
* @param param
* @return
*/
List<BsGasOrderReceipt> getList(Map<String,Object> param);
}

@ -0,0 +1,184 @@
package com.hfkj.service.gas.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.dao.BsGasOrderReceiptMapper;
import com.hfkj.entity.BsGasOrder;
import com.hfkj.entity.BsGasOrderReceipt;
import com.hfkj.entity.BsGasOrderReceiptExample;
import com.hfkj.entity.BsUserReceipt;
import com.hfkj.service.gas.BsGasOrderReceiptService;
import com.hfkj.service.gas.BsGasOrderService;
import com.hfkj.service.user.BsUserReceiptService;
import com.hfkj.sysenum.gas.GasOrderReceiptStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* @className: BsGasOrderReceiptServiceImpl
* @author: HuRui
* @date: 2024/7/24
**/
@Service("gasOrderReceiptServiceImpl")
public class BsGasOrderReceiptServiceImpl implements BsGasOrderReceiptService {
@Resource
private BsGasOrderReceiptMapper gasOrderReceiptMapper;
@Resource
private BsUserReceiptService userReceiptService;
@Resource
private BsGasOrderService gasOrderService;
@Override
public void editData(BsGasOrderReceipt data) {
data.setUpdateTime(new Date());
if (data.getId() == null) {
data.setCreateTime(new Date());
gasOrderReceiptMapper.insert(data);
} else {
gasOrderReceiptMapper.updateByPrimaryKeySelective(data);
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class})
public void applyReceipt(Long userReceiptId, List<String> orderNos) {
// 查询收据
BsUserReceipt receipt = userReceiptService.getDetail(userReceiptId);
if (receipt == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的收据");
}
for (Object orderNo : orderNos) {
// 查询订单
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderNo.toString());
if (gasOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, orderNo+"未知的订单");
}
if (!GasOrderReceiptStatusEnum.status0.getStatus().equals(gasOrder.getReceiptStatus())
&& !GasOrderReceiptStatusEnum.status3.getStatus().equals(gasOrder.getReceiptStatus())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, gasOrder.getOrderNo()+"订单未处于未开票状态");
}
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status1.getStatus());
gasOrder.setReceiptFailRemark(null);
gasOrderService.updateGasOrder(gasOrder);
BsGasOrderReceipt gasOrderReceipt = new BsGasOrderReceipt();
gasOrderReceipt.setApplyNo(System.currentTimeMillis()+"");
gasOrderReceipt.setUserReceiptId(receipt.getUserId());
gasOrderReceipt.setCompanyName(receipt.getCompanyName());
gasOrderReceipt.setTaxNo(receipt.getTaxNo());
gasOrderReceipt.setContactsPhone(receipt.getContactsPhone());
gasOrderReceipt.setEmail(receipt.getEmail());
gasOrderReceipt.setOrderNo(gasOrder.getOrderNo());
gasOrderReceipt.setOrderChildNo(gasOrder.getOrderChildNo());
gasOrderReceipt.setOilNo(gasOrder.getGasOilNo());
gasOrderReceipt.setAmount(gasOrder.getActualPayPrice());
gasOrderReceipt.setStatus(GasOrderReceiptStatusEnum.status1.getStatus());
editData(gasOrderReceipt);
}
}
@Override
public void success(String applyNo) {
// 查询详情
BsGasOrderReceipt orderReceipt = getDetail(applyNo);
if (orderReceipt == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请");
}
if (!GasOrderReceiptStatusEnum.status1.getStatus().equals(orderReceipt.getStatus())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "申请状态错误");
}
orderReceipt.setStatus(GasOrderReceiptStatusEnum.status2.getStatus());
editData(orderReceipt);
// 查询订单
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderReceipt.getOrderNo());
if (gasOrder != null) {
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status2.getStatus());
gasOrder.setReceiptFailRemark(null);
gasOrderService.updateGasOrder(gasOrder);
}
}
@Override
public void fail(String applyNo, String remark) {
// 查询详情
BsGasOrderReceipt orderReceipt = getDetail(applyNo);
if (orderReceipt == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的申请");
}
if (!GasOrderReceiptStatusEnum.status1.getStatus().equals(orderReceipt.getStatus())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "申请状态错误");
}
orderReceipt.setStatus(GasOrderReceiptStatusEnum.status3.getStatus());
orderReceipt.setFailRemark(remark);
editData(orderReceipt);
// 查询订单
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(orderReceipt.getOrderNo());
if (gasOrder != null) {
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status3.getStatus());
gasOrder.setReceiptFailRemark(remark);
gasOrderService.updateGasOrder(gasOrder);
}
}
@Override
public BsGasOrderReceipt getDetail(String applyNo) {
BsGasOrderReceiptExample example = new BsGasOrderReceiptExample();
example.createCriteria().andApplyNoEqualTo(applyNo);
List<BsGasOrderReceipt> list = gasOrderReceiptMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public BsGasOrderReceipt getDetail(Long orderReceiptId) {
return gasOrderReceiptMapper.selectByPrimaryKey(orderReceiptId);
}
@Override
public List<BsGasOrderReceipt> getList(Map<String, Object> param) {
BsGasOrderReceiptExample example = new BsGasOrderReceiptExample();
BsGasOrderReceiptExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) {
criteria.andOrderNoLike("%"+MapUtils.getString(param, "orderNo")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "contactsPhone"))) {
criteria.andContactsPhoneLike("%"+MapUtils.getString(param, "contactsPhone")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) {
List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(","))
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed()
.collect(Collectors.toList());
criteria.andStatusIn(status);
}
if (MapUtils.getLong(param, "createTimeS") != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS")));
}
if (MapUtils.getLong(param, "createTimeE") != null) {
criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE")));
}
example.setOrderByClause("create_time desc");
return gasOrderReceiptMapper.selectByExample(example);
}
}

@ -210,6 +210,13 @@ public class BsGasOrderServiceImpl implements BsGasOrderService {
criteria.andGasClassGroupTaskIdEqualTo(MapUtils.getLong(param, "gasClassGroupTaskId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "receiptStatus"))) {
List<Integer> receiptStatus = Arrays.stream(MapUtils.getString(param, "receiptStatus").split(","))
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed()
.collect(Collectors.toList());
criteria.andReceiptStatusIn(receiptStatus);
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) {
List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(","))
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed()

@ -35,10 +35,12 @@ public interface BsOrderRefundService {
/**
* 交易子订单退款
* @param childOrderNo 子订单号
* @param handleBusiness 处理业务 true:处理 false不处理
* @param productCount 退款产品数量
* @param remark 备注
* @return
*/
BsOrderRefund tradeOrderChildRefund(String childOrderNo, Integer productCount, String remark);
BsOrderRefund tradeOrderChildRefund(String childOrderNo, Boolean handleBusiness, Integer productCount, String remark);
/**
* 查询退款

@ -14,6 +14,7 @@ import com.hfkj.service.gas.BsGasService;
import com.hfkj.service.gas.BsGasStaffService;
import com.hfkj.service.sec.SecDictionaryService;
import com.hfkj.sysenum.MerchantStatusEnum;
import com.hfkj.sysenum.gas.GasOrderReceiptStatusEnum;
import com.hfkj.sysenum.gas.OrderOilStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -93,6 +94,7 @@ public class OrderCreateService {
gasOrder.setMerName(merchant.getMerName());
gasOrder.setMerAddress(merchant.getAddress());
gasOrder.setStatus(OrderOilStatus.STATUS1.getNumber());
gasOrder.setReceiptStatus(GasOrderReceiptStatusEnum.status0.getStatus());
gasOrder.setDeductionCouponPrice(new BigDecimal("0"));
gasOrder.setDeductionOilPrice(priceModel.getTotalPreferences());

@ -17,6 +17,7 @@ import com.hfkj.service.merchant.BsMerchantAccountService;
import com.hfkj.sysenum.MerchantSourceTypeEnum;
import com.hfkj.sysenum.gas.OrderOilStatus;
import com.hfkj.sysenum.merchant.MerchantAccountRecordSourceTypeEnum;
import com.hfkj.sysenum.order.OrderChildProductTypeEnum;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@ -32,12 +33,47 @@ import java.util.Map;
**/
@Component
public class OrderRefundBusiness {
@Resource
private BsOrderChildService orderChildService;
@Resource
private BsGasOrderService gasOrderService;
@Resource
private BsMerchantAccountService merchantAccountService;
/**
* 前置业务处理
* @param refund
*/
public BsOrderRefund prepose(BsOrderRefund refund) {
// 查询商品订单
OrderChildModel orderChild = orderChildService.getDetail(refund.getOrderChildNo());
if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
// 查询加油订单
BsGasOrder gasOrder = gasOrderService.getDetailByOrderNo(refund.getOrderNo());
if (gasOrder != null) {
if (gasOrder.getChannelType().equals(MerchantSourceTypeEnum.type2.getNumber())) {
try {
// 请求团油渠道申请退款
JSONObject object = NewLinkRequestService.refuelingOrderRefund(gasOrder.getUserPhone(), gasOrder.getOrderNo(), refund.getRefundRemark());
if (object == null || !object.getString("code").equals("200")) {
gasOrder.setAbnormal(true);
gasOrder.setAbnormalContent("渠道申请退款失败!原因:" + object.getString("message"));
gasOrderService.updateGasOrder(gasOrder);
} else {
gasOrder.setStatus(OrderOilStatus.STATUS5.getNumber());
gasOrderService.updateGasOrder(gasOrder);
}
} catch (Exception e) {
gasOrder.setAbnormal(true);
gasOrder.setAbnormalContent("渠道申请退款失败!原因:未知原因");
gasOrderService.updateGasOrder(gasOrder);
}
}
}
}
return refund;
}
/**
* 加油订单业务
* @param refund

@ -114,7 +114,7 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService {
boolean refundSuccess = true;
for (OrderChildModel orderChild : order.getOrderChildList()) {
try {
BsOrderRefund orderRefund = tradeOrderChildRefund(orderChild.getChildOrderNo(), orderChild.getProductCount(), remark);
BsOrderRefund orderRefund = tradeOrderChildRefund(orderChild.getChildOrderNo(), true, orderChild.getProductCount(), remark);
if (orderRefund.getRefundStatus().equals(OrderRefundStatusEnum.status3.getCode())) {
refundSuccess = false;
}
@ -133,7 +133,7 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService {
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class})
public BsOrderRefund tradeOrderChildRefund(String childOrderNo, Integer productCount, String remark) {
public BsOrderRefund tradeOrderChildRefund(String childOrderNo, Boolean handleBusiness, Integer productCount, String remark) {
// 查询子订单
OrderChildModel orderChild = orderChildService.getDetail(childOrderNo);
if (orderChild == null) {
@ -222,10 +222,12 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService {
orderChildService.editData(orderChild);
// 处理退款业务
if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
try {
orderRefundBusiness.gasOrder(orderRefund);
} catch (Exception e) { }
if (handleBusiness.equals(true)) {
if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
try {
orderRefundBusiness.gasOrder(orderRefund);
} catch (Exception e) { }
}
}
// 查询子订单已全部退款

@ -0,0 +1,33 @@
package com.hfkj.service.user;
import com.hfkj.entity.BsUserReceipt;
import java.util.List;
import java.util.Map;
/**
* @className: BsUserReceiptService
* @author: HuRui
* @date: 2024/7/24
**/
public interface BsUserReceiptService {
/**
* 编辑数据
* @param data
*/
void editData(BsUserReceipt data);
/**
* 查询详情
* @param id
*/
BsUserReceipt getDetail(Long id);
/**
* 查询列表
* @param param
*/
List<BsUserReceipt> getList(Map<String,Object> param);
}

@ -0,0 +1,64 @@
package com.hfkj.service.user.impl;
import com.hfkj.dao.BsUserReceiptMapper;
import com.hfkj.entity.BsUserReceipt;
import com.hfkj.entity.BsUserReceiptExample;
import com.hfkj.service.user.BsUserReceiptService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* @className: BsUserReceiptServiceImpl
* @author: HuRui
* @date: 2024/7/24
**/
@Service("userReceiptService")
public class BsUserReceiptServiceImpl implements BsUserReceiptService {
@Resource
private BsUserReceiptMapper userReceiptMapper;
@Override
public void editData(BsUserReceipt data) {
data.setUpdateTime(new Date());
if (data.getId() == null) {
data.setCreateTime(new Date());
userReceiptMapper.insert(data);
} else {
userReceiptMapper.updateByPrimaryKey(data);
}
}
@Override
public BsUserReceipt getDetail(Long id) {
return userReceiptMapper.selectByPrimaryKey(id);
}
@Override
public List<BsUserReceipt> getList(Map<String, Object> param) {
BsUserReceiptExample example = new BsUserReceiptExample();
BsUserReceiptExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "status"))) {
List<Integer> status = Arrays.stream(MapUtils.getString(param, "status").split(","))
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed()
.collect(Collectors.toList());
criteria.andStatusIn(status);
}
example.setOrderByClause("create_time desc");
return userReceiptMapper.selectByExample(example);
}
}

@ -0,0 +1,39 @@
package com.hfkj.sysenum.gas;
import lombok.Getter;
/**
* 加油站价格任务
* @author hurui
*/
@Getter
public enum GasOrderReceiptStatusEnum {
/**
* 未开票
*/
status0(0 , "未开票", ""),
/**
* 待处理
*/
status1(1 , "处理中", "待处理"),
/**
* 开票成功
*/
status2(2 , "开票成功", "开票成功"),
/**
* 开票失败
*/
status3(3 , "开票失败", "开票失败"),
;
private Integer status;
private String userName;
private String manageName;
GasOrderReceiptStatusEnum(int status, String userName, String manageName) {
this.status = status;
this.userName = userName;
this.manageName = manageName;
}
}

@ -12,8 +12,8 @@ public enum OrderOilStatus {
STATUS2(2, "已支付"),
STATUS3(3, "已取消"),
STATUS4(4, "已退款"),
STATUS6(5, "退款中"),
STATUS8(6, "退款失败"),
STATUS5(5, "退款中"),
STATUS6(6, "退款失败"),
;
private Integer number;

@ -13,13 +13,13 @@ import java.util.Objects;
@Getter
public enum OrderPayTypeEnum {
/**
* 微信
* 支付宝
*/
type1(1, "微信"),
type1(1, "支付宝"),
/**
* 支付宝
* 微信
*/
type2(2, "支付宝"),
type2(2, "微信"),
/**
* 云闪付
*/

Loading…
Cancel
Save