From eb4796c488927fec65027490eb8de96233d095fb Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 22 Jun 2021 21:31:22 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighAgentController.java | 6 +- .../OutRechargeOrderController.java | 33 ++++++--- .../src/main/resources/dev/application.yml | 2 +- .../com/hai/dao/OutRechargeOrderMapper.java | 15 ++-- .../hai/dao/OutRechargeOrderMapperExt.java | 23 ++++-- .../hai/dao/OutRechargeOrderSqlProvider.java | 14 ++++ .../java/com/hai/entity/OutRechargeOrder.java | 18 ++++- .../hai/entity/OutRechargeOrderExample.java | 70 +++++++++++++++++++ .../com/hai/model/OutRechargeOrderModel.java | 15 +--- .../hai/service/OutRechargeOrderService.java | 2 +- .../impl/OutRechargeOrderServiceImpl.java | 19 ++++- 11 files changed, 176 insertions(+), 41 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java b/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java index 4c8c7349..97339c81 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java @@ -171,14 +171,14 @@ public class HighAgentController { HighAgent highAgent = highAgentService.findByAgentMsgId(agentId); // 代理商类型 1:卡券代理商 2:充值代理商 - if (highAgent == null && highAgent.getType() != 2) { + if (highAgent == null || highAgent.getType() != 2) { log.error("HighAgentController --> generateRechargeAgentQrCode() error!", "此代理商暂无法生成二维码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此代理商暂无法生成二维码"); } // 生成二维码 String url = "https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue="; - String qrCodeImg = highAgent.getAgentKey()+".png"; - String qrCodeUrl = "/home/project/hsg/filesystem/rechargeAgentQrCode/" + qrCodeImg; + String qrCodeImg = "rechargeAgentQrCode/" + highAgent.getAgentKey()+".png"; + String qrCodeUrl = "/home/project/hsg/filesystem/" + qrCodeImg; QRCodeGenerator.generateQRCodeImage(url+highAgent.getAgentKey(), 350, 350, qrCodeUrl); highAgent.setExt1(qrCodeImg); highAgentService.updateAgentDetail(highAgent); diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java index 9272f023..b68624fc 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java @@ -18,12 +18,9 @@ import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.entity.OutRechargeOrder; -<<<<<<< HEAD import com.hai.model.HighOrderModel; import com.hai.model.OutRechargeOrderModel; -======= import com.hai.model.OrderRefundModel; ->>>>>>> 4d1958377a2ed60952b3280c17eec28e48b6b0c6 import com.hai.model.ResponseData; import com.hai.service.OutRechargeOrderService; import com.hai.service.TelApiService; @@ -45,6 +42,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.io.File; import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; @@ -182,27 +180,43 @@ public class OutRechargeOrderController { } } -<<<<<<< HEAD @RequestMapping(value = "/exportOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "导出订单") - public ResponseData exportOrderList() { + public ResponseData exportOrderList(@RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "rechargeModel", required = false) String rechargeModel, + @RequestParam(name = "rechargeContent", required = false) String rechargeContent, + @RequestParam(name = "userPhone", required = false) String userPhone, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE) { try { - String name = "/outRechargeOrder/充值订单" + System.currentTimeMillis() + ".xlsx"; Map map = new HashMap<>(); + map.put("status", status); + map.put("orderNo", orderNo); + map.put("rechargeModel", rechargeModel); + map.put("rechargeContent", rechargeContent); + map.put("userPhone", userPhone); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); List list = outRechargeOrderService.getOrderCount(map); + + String name = "/outRechargeOrder/充值订单" + System.currentTimeMillis() + ".xlsx"; String fileName = SysConst.getSysConfig().getFileUrl() + name; - EasyExcel.write(fileName, ExportOutRechargeOrder.class).sheet("商品订单").doWrite(list); + EasyExcel.write(fileName, ExportOutRechargeOrder.class).sheet("充值订单").doWrite(list); return ResponseMsgUtil.success(name); - } catch (Exception e) { log.error("HighOrderController --> exportOrderList() error!", e); return ResponseMsgUtil.exception(e); } } -======= + @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单退款") @@ -284,5 +298,4 @@ public class OutRechargeOrderController { httpClient.close(); } } ->>>>>>> 4d1958377a2ed60952b3280c17eec28e48b6b0c6 } diff --git a/hai-bweb/src/main/resources/dev/application.yml b/hai-bweb/src/main/resources/dev/application.yml index 3412b88f..3b6bb9fa 100644 --- a/hai-bweb/src/main/resources/dev/application.yml +++ b/hai-bweb/src/main/resources/dev/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java index d8d3ea73..0ca1a1e2 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapper.java @@ -50,7 +50,7 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "cancel_time, finish_time, ", "remarks, out_refund_no, ", "refund_time, refund_id, ", - "refund_fee)", + "refund_fee, agent_key)", "values (#{orderNo,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ", "#{userName,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, ", "#{rechargeModel,jdbcType=INTEGER}, #{payType,jdbcType=INTEGER}, ", @@ -62,7 +62,7 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "#{cancelTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", "#{remarks,jdbcType=VARCHAR}, #{outRefundNo,jdbcType=VARCHAR}, ", "#{refundTime,jdbcType=TIMESTAMP}, #{refundId,jdbcType=VARCHAR}, ", - "#{refundFee,jdbcType=DECIMAL})" + "#{refundFee,jdbcType=DECIMAL}, #{agentKey,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(OutRechargeOrder record); @@ -96,7 +96,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR), - @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL) + @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL), + @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR) }) List selectByExample(OutRechargeOrderExample example); @@ -105,7 +106,7 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "id, order_no, user_id, user_name, user_phone, recharge_model, pay_type, pay_price, ", "order_price, pay_real_price, pay_serial_no, `status`, recharge_content, recharge_name, ", "id_card, create_timed, pay_time, cancel_time, finish_time, remarks, out_refund_no, ", - "refund_time, refund_id, refund_fee", + "refund_time, refund_id, refund_fee, agent_key", "from out_recharge_order", "where id = #{id,jdbcType=BIGINT}" }) @@ -133,7 +134,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR), @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR), - @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL) + @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL), + @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR) }) OutRechargeOrder selectByPrimaryKey(Long id); @@ -170,7 +172,8 @@ public interface OutRechargeOrderMapper extends OutRechargeOrderMapperExt { "out_refund_no = #{outRefundNo,jdbcType=VARCHAR},", "refund_time = #{refundTime,jdbcType=TIMESTAMP},", "refund_id = #{refundId,jdbcType=VARCHAR},", - "refund_fee = #{refundFee,jdbcType=DECIMAL}", + "refund_fee = #{refundFee,jdbcType=DECIMAL},", + "agent_key = #{agentKey,jdbcType=VARCHAR}", "where id = #{id,jdbcType=BIGINT}" }) int updateByPrimaryKey(OutRechargeOrder record); diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java index 835bcadd..f204e625 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java @@ -1,6 +1,7 @@ package com.hai.dao; import com.hai.model.OutRechargeOrderModel; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @@ -11,8 +12,8 @@ import java.util.Map; */ public interface OutRechargeOrderMapperExt { - @Select({ - "SELECT" + + @Select({"" }) - List selectOrderCount(Map map); + List selectOrderCount(@Param("map") Map map); } \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java index 70d95c41..ea331a3b 100644 --- a/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/OutRechargeOrderSqlProvider.java @@ -120,6 +120,10 @@ public class OutRechargeOrderSqlProvider { sql.VALUES("refund_fee", "#{refundFee,jdbcType=DECIMAL}"); } + if (record.getAgentKey() != null) { + sql.VALUES("agent_key", "#{agentKey,jdbcType=VARCHAR}"); + } + return sql.toString(); } @@ -153,6 +157,7 @@ public class OutRechargeOrderSqlProvider { sql.SELECT("refund_time"); sql.SELECT("refund_id"); sql.SELECT("refund_fee"); + sql.SELECT("agent_key"); sql.FROM("out_recharge_order"); applyWhere(sql, example, false); @@ -266,6 +271,10 @@ public class OutRechargeOrderSqlProvider { sql.SET("refund_fee = #{record.refundFee,jdbcType=DECIMAL}"); } + if (record.getAgentKey() != null) { + sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}"); + } + applyWhere(sql, example, true); return sql.toString(); } @@ -298,6 +307,7 @@ public class OutRechargeOrderSqlProvider { sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); sql.SET("refund_id = #{record.refundId,jdbcType=VARCHAR}"); sql.SET("refund_fee = #{record.refundFee,jdbcType=DECIMAL}"); + sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}"); OutRechargeOrderExample example = (OutRechargeOrderExample) parameter.get("example"); applyWhere(sql, example, true); @@ -400,6 +410,10 @@ public class OutRechargeOrderSqlProvider { sql.SET("refund_fee = #{refundFee,jdbcType=DECIMAL}"); } + if (record.getAgentKey() != null) { + sql.SET("agent_key = #{agentKey,jdbcType=VARCHAR}"); + } + sql.WHERE("id = #{id,jdbcType=BIGINT}"); return sql.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java index 21747de5..35640d02 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java @@ -134,6 +134,11 @@ public class OutRechargeOrder implements Serializable { */ private BigDecimal refundFee; + /** + * 代理商编号 + */ + private String agentKey; + private static final long serialVersionUID = 1L; public Long getId() { @@ -328,6 +333,14 @@ public class OutRechargeOrder implements Serializable { this.refundFee = refundFee; } + public String getAgentKey() { + return agentKey; + } + + public void setAgentKey(String agentKey) { + this.agentKey = agentKey; + } + @Override public boolean equals(Object that) { if (this == that) { @@ -363,7 +376,8 @@ public class OutRechargeOrder implements Serializable { && (this.getOutRefundNo() == null ? other.getOutRefundNo() == null : this.getOutRefundNo().equals(other.getOutRefundNo())) && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) && (this.getRefundId() == null ? other.getRefundId() == null : this.getRefundId().equals(other.getRefundId())) - && (this.getRefundFee() == null ? other.getRefundFee() == null : this.getRefundFee().equals(other.getRefundFee())); + && (this.getRefundFee() == null ? other.getRefundFee() == null : this.getRefundFee().equals(other.getRefundFee())) + && (this.getAgentKey() == null ? other.getAgentKey() == null : this.getAgentKey().equals(other.getAgentKey())); } @Override @@ -394,6 +408,7 @@ public class OutRechargeOrder implements Serializable { result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); result = prime * result + ((getRefundId() == null) ? 0 : getRefundId().hashCode()); result = prime * result + ((getRefundFee() == null) ? 0 : getRefundFee().hashCode()); + result = prime * result + ((getAgentKey() == null) ? 0 : getAgentKey().hashCode()); return result; } @@ -427,6 +442,7 @@ public class OutRechargeOrder implements Serializable { sb.append(", refundTime=").append(refundTime); sb.append(", refundId=").append(refundId); sb.append(", refundFee=").append(refundFee); + sb.append(", agentKey=").append(agentKey); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); diff --git a/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java b/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java index 83071e1a..27e220da 100644 --- a/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/OutRechargeOrderExample.java @@ -1665,6 +1665,76 @@ public class OutRechargeOrderExample { addCriterion("refund_fee not between", value1, value2, "refundFee"); return (Criteria) this; } + + public Criteria andAgentKeyIsNull() { + addCriterion("agent_key is null"); + return (Criteria) this; + } + + public Criteria andAgentKeyIsNotNull() { + addCriterion("agent_key is not null"); + return (Criteria) this; + } + + public Criteria andAgentKeyEqualTo(String value) { + addCriterion("agent_key =", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotEqualTo(String value) { + addCriterion("agent_key <>", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyGreaterThan(String value) { + addCriterion("agent_key >", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyGreaterThanOrEqualTo(String value) { + addCriterion("agent_key >=", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyLessThan(String value) { + addCriterion("agent_key <", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyLessThanOrEqualTo(String value) { + addCriterion("agent_key <=", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyLike(String value) { + addCriterion("agent_key like", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotLike(String value) { + addCriterion("agent_key not like", value, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyIn(List values) { + addCriterion("agent_key in", values, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotIn(List values) { + addCriterion("agent_key not in", values, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyBetween(String value1, String value2) { + addCriterion("agent_key between", value1, value2, "agentKey"); + return (Criteria) this; + } + + public Criteria andAgentKeyNotBetween(String value1, String value2) { + addCriterion("agent_key not between", value1, value2, "agentKey"); + return (Criteria) this; + } } /** diff --git a/hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java b/hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java index eef5fe2e..ca563541 100644 --- a/hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java +++ b/hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java @@ -11,10 +11,9 @@ public class OutRechargeOrderModel { private String rechargeModelName; private String rechargeContent; private String rechargeName; - private String rechargeIdCard; private String remarks; private String payTypeName; - private String orderPrice; + private BigDecimal orderPrice; private BigDecimal payPrice; private BigDecimal payRealPrice; private String statusName; @@ -75,14 +74,6 @@ public class OutRechargeOrderModel { this.rechargeName = rechargeName; } - public String getRechargeIdCard() { - return rechargeIdCard; - } - - public void setRechargeIdCard(String rechargeIdCard) { - this.rechargeIdCard = rechargeIdCard; - } - public String getRemarks() { return remarks; } @@ -99,11 +90,11 @@ public class OutRechargeOrderModel { this.payTypeName = payTypeName; } - public String getOrderPrice() { + public BigDecimal getOrderPrice() { return orderPrice; } - public void setOrderPrice(String orderPrice) { + public void setOrderPrice(BigDecimal orderPrice) { this.orderPrice = orderPrice; } diff --git a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java index 00fc5987..58553acf 100644 --- a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java +++ b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java @@ -77,7 +77,7 @@ public interface OutRechargeOrderService { * @param map * @return */ - List getOrderCount(Map map); + List getOrderCount(Map map) throws Exception; /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index f3668795..de641112 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.service.impl; +import com.hai.common.utils.DateUtil; import com.hai.dao.OutRechargeOrderMapper; import com.hai.entity.*; import com.hai.model.OutRechargeOrderModel; @@ -105,7 +106,23 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { } @Override - public List getOrderCount(Map map) { + public List getOrderCount(Map map) throws Exception { + if(MapUtils.getLong(map, "createTimeS") != null) { + map.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "createTimeE") != null) { + map.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeS") != null) { + map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeE") != null) { + map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + return outRechargeOrderMapper.selectOrderCount(map); }