diff --git a/hai-order/src/main/java/com/web/controller/OrderRefundController.java b/hai-order/src/main/java/com/web/controller/OrderRefundController.java index cb6147fd..cf53a0d2 100644 --- a/hai-order/src/main/java/com/web/controller/OrderRefundController.java +++ b/hai-order/src/main/java/com/web/controller/OrderRefundController.java @@ -1,5 +1,6 @@ package com.web.controller; +import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -10,17 +11,22 @@ import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighChildOrder; import com.hai.entity.HighOrder; +import com.hai.entity.HighOrderRefund; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.order.model.CreateOrderChildModel; import com.hai.order.model.CreateOrderModel; +import com.hai.order.model.ExportGasOrderModel; +import com.hai.order.model.ExportOrderRefundModel; import com.hai.order.service.OrderPaySuccessService; import com.hai.order.service.OrderRefundService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderChildGoodsType; import com.hai.order.type.OrderChildStatus; import com.hai.order.type.OrderPayType; +import com.hai.order.type.OrderRefundStatus; import com.hai.order.utils.OrderUtil; +import com.web.config.SysConst; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -32,8 +38,11 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.io.File; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; @Controller @@ -157,18 +166,30 @@ public class OrderRefundController { @ApiOperation(value = "获取退款列表") public ResponseData getRefundList(@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "orderChildNo", required = false) String orderChildNo, + @RequestParam(name = "refundOrderNo", required = false) String refundOrderNo, @RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "goodsType", required = false) Integer goodsType, + @RequestParam(name = "goodsName", required = false) String goodsName, @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "refundTimeS", required = false) Long refundTimeS, + @RequestParam(name = "refundTimeE", required = false) Long refundTimeE, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { Map param = new HashMap<>(); param.put("orderNo", orderNo); param.put("orderChildNo", orderChildNo); + param.put("refundOrderNo", refundOrderNo); param.put("memPhone", memPhone); param.put("goodsType", goodsType); + param.put("goodsName", goodsName); param.put("status", status); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + param.put("refundTimeS", refundTimeS); + param.put("refundTimeE", refundTimeE); PageHelper.startPage(pageNum, pageSize); return ResponseMsgUtil.success(new PageInfo<>(orderRefundService.getRefundOrderList(param))); @@ -179,4 +200,75 @@ public class OrderRefundController { } } + @RequestMapping(value="/excelRefund",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "导出退款") + public ResponseData excelRefund(@RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "orderChildNo", required = false) String orderChildNo, + @RequestParam(name = "refundOrderNo", required = false) String refundOrderNo, + @RequestParam(name = "memPhone", required = false) String memPhone, + @RequestParam(name = "goodsType", required = false) Integer goodsType, + @RequestParam(name = "goodsName", required = false) String goodsName, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "refundTimeS", required = false) Long refundTimeS, + @RequestParam(name = "refundTimeE", required = false) Long refundTimeE) { + try { + Map param = new HashMap<>(); + param.put("orderNo", orderNo); + param.put("orderChildNo", orderChildNo); + param.put("refundOrderNo", refundOrderNo); + param.put("memPhone", memPhone); + param.put("goodsType", goodsType); + param.put("goodsName", goodsName); + param.put("status", status); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + param.put("refundTimeS", refundTimeS); + param.put("refundTimeE", refundTimeE); + + List list = orderRefundService.getRefundOrderList(param); + + List orderRefundModelList = new ArrayList<>(); + ExportOrderRefundModel orderRefundModel; + + for (HighOrderRefund orderRefund : list) { + orderRefundModel = new ExportOrderRefundModel(); + orderRefundModel.setOrderNo(orderRefund.getOrderNo()); + orderRefundModel.setChildOrderNo(orderRefund.getOrderChildNo()); + orderRefundModel.setMemPhone(orderRefund.getMemPhone()); + orderRefundModel.setGoodsType(OrderChildGoodsType.getDataByType(orderRefund.getGoodsType()).getName()); + orderRefundModel.setGoodsName(orderRefund.getGoodsName()); + orderRefundModel.setRefundOrderNo(orderRefund.getRefundOrderNo()); + orderRefundModel.setRefundGoodsNum(orderRefund.getRefundGoodsNum()); + orderRefundModel.setReturnTotalPrice(orderRefund.getReturnTotalPrice()); + orderRefundModel.setRefundPrice(orderRefund.getRefundPrice()); + orderRefundModel.setRefundIntegral(orderRefund.getRefundIntegral()); + orderRefundModel.setRefundStatus(OrderRefundStatus.getDataByType(orderRefund.getRefundStatus()).getName()); + orderRefundModel.setCreateTime(orderRefund.getCreateTime()); + orderRefundModel.setRefundTime(orderRefund.getRefundTime()); + orderRefundModel.setRefundRemark(orderRefund.getRefundRemark()); + orderRefundModelList.add(orderRefundModel); + } + + String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/"; + String pathName = System.currentTimeMillis()+".xlsx"; + File file = new File(fileUrl); + if (!file.exists()) { + file.mkdirs(); + } + EasyExcel.write(fileUrl+pathName) + .head(ExportOrderRefundModel.class) + .sheet("交易退款记录") + .doWrite(orderRefundModelList); + + return ResponseMsgUtil.success(fileUrl+pathName); + + } catch (Exception e) { + log.error("OrderRefundController -> excelRefund() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java index ad390d75..bd2c6f1b 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java @@ -190,7 +190,6 @@ public class HuiLianTongUnionCardConfig { dataMap.put("instCode", instCode); dataMap.put("goodsDesc", goodsDesc); dataMap.put("tranDesc", tranDesc); - System.out.println("工会卡支付请求参数" + JSON.toJSONString(dataMap)); return request("qtk/consumption", dataMap); } @@ -308,7 +307,7 @@ public class HuiLianTongUnionCardConfig { public static void main(String[] args) { - String data = "T3xbPEKEXV+WYFZGgpCAIkf48/BkSo8RybQf7BpKvU4ul+a1IN29PI/qyrjYOYVw1rfA6vXK8Sht\\nqCeY6UVqUpci+xsG0+1chVRakKluFTZL73B93yy9gV7AVOOJpUeMILav5N53NeOPQtYf8Boxg/Fz\\nTIW0BtuR".replace("\\n", ""); + String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDwYfnUdBVz6Kj4HS2oCA1TTiqJkCUIYa4G\\nnKXcKOzlf7gwVpP6h5gK1tT3xUQd1iW9VOjF0iOn9bVuWzUqlPb+6YhgCjwVIWvutzGr07fQX1jV\\n4jlRdiZVaq3frwd8SuG5KRlWTHXXTnshDIoO4DyR5P7HfF3W3m4=".replace("\\n", ""); String decodeData = DesUtil.decode("F8E91A3C", data, Charset.forName("UTF-8")); System.out.println(JSONObject.parseObject(decodeData)); diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java index 331dc2da..f8b43e8a 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponCodeMapperExt.java @@ -109,7 +109,7 @@ public interface HighCouponCodeMapperExt { * @param couponId * @return */ - @Select("SELECT * FROM high_coupon_code where coupon_id = 23423608 and is_assign_agent = false and status = 1 and sales_end_time > now()" + + @Select("SELECT * FROM high_coupon_code where coupon_id = #{couponId} and is_assign_agent = false and status = 1 and sales_end_time > now()" + "ORDER BY sales_end_time asc LIMIT 1") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapper.java b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapper.java index 8d482d39..b030bbbd 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapper.java @@ -39,12 +39,20 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_discount_user_rel (discount_id, agent_id, ", + "insert into high_discount_user_rel (discount_company_id, discount_id, ", + "discount_name, discount_img, ", + "discount_using_range, discount_use_scope, ", + "discount_type, discount_condition, ", + "discount_price, agent_id, ", "discount_agent_code_id, user_id, ", "`status`, use_time, ", "create_time, use_end_time, ", "ext_1, ext_2, ext_3)", - "values (#{discountId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ", + "values (#{discountCompanyId,jdbcType=BIGINT}, #{discountId,jdbcType=BIGINT}, ", + "#{discountName,jdbcType=VARCHAR}, #{discountImg,jdbcType=VARCHAR}, ", + "#{discountUsingRange,jdbcType=INTEGER}, #{discountUseScope,jdbcType=INTEGER}, ", + "#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ", + "#{discountPrice,jdbcType=DECIMAL}, #{agentId,jdbcType=BIGINT}, ", "#{discountAgentCodeId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ", "#{status,jdbcType=INTEGER}, #{useTime,jdbcType=TIMESTAMP}, ", "#{createTime,jdbcType=TIMESTAMP}, #{useEndTime,jdbcType=TIMESTAMP}, ", @@ -60,7 +68,15 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt @SelectProvider(type=HighDiscountUserRelSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_company_id", property="discountCompanyId", jdbcType=JdbcType.BIGINT), @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_using_range", property="discountUsingRange", jdbcType=JdbcType.INTEGER), + @Result(column="discount_use_scope", property="discountUseScope", jdbcType=JdbcType.INTEGER), + @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), + @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), @Result(column="discount_agent_code_id", property="discountAgentCodeId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @@ -76,14 +92,24 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt @Select({ "select", - "id, discount_id, agent_id, discount_agent_code_id, user_id, `status`, use_time, ", - "create_time, use_end_time, ext_1, ext_2, ext_3", + "id, discount_company_id, discount_id, discount_name, discount_img, discount_using_range, ", + "discount_use_scope, discount_type, discount_condition, discount_price, agent_id, ", + "discount_agent_code_id, user_id, `status`, use_time, create_time, use_end_time, ", + "ext_1, ext_2, ext_3", "from high_discount_user_rel", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_company_id", property="discountCompanyId", jdbcType=JdbcType.BIGINT), @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_img", property="discountImg", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_using_range", property="discountUsingRange", jdbcType=JdbcType.INTEGER), + @Result(column="discount_use_scope", property="discountUseScope", jdbcType=JdbcType.INTEGER), + @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), + @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), @Result(column="discount_agent_code_id", property="discountAgentCodeId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @@ -108,7 +134,15 @@ public interface HighDiscountUserRelMapper extends HighDiscountUserRelMapperExt @Update({ "update high_discount_user_rel", - "set discount_id = #{discountId,jdbcType=BIGINT},", + "set discount_company_id = #{discountCompanyId,jdbcType=BIGINT},", + "discount_id = #{discountId,jdbcType=BIGINT},", + "discount_name = #{discountName,jdbcType=VARCHAR},", + "discount_img = #{discountImg,jdbcType=VARCHAR},", + "discount_using_range = #{discountUsingRange,jdbcType=INTEGER},", + "discount_use_scope = #{discountUseScope,jdbcType=INTEGER},", + "discount_type = #{discountType,jdbcType=INTEGER},", + "discount_condition = #{discountCondition,jdbcType=DECIMAL},", + "discount_price = #{discountPrice,jdbcType=DECIMAL},", "agent_id = #{agentId,jdbcType=BIGINT},", "discount_agent_code_id = #{discountAgentCodeId,jdbcType=BIGINT},", "user_id = #{userId,jdbcType=BIGINT},", diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelSqlProvider.java index 37a99bc8..6219ee6b 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelSqlProvider.java @@ -28,10 +28,42 @@ public class HighDiscountUserRelSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("high_discount_user_rel"); + if (record.getDiscountCompanyId() != null) { + sql.VALUES("discount_company_id", "#{discountCompanyId,jdbcType=BIGINT}"); + } + if (record.getDiscountId() != null) { sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); } + if (record.getDiscountName() != null) { + sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountImg() != null) { + sql.VALUES("discount_img", "#{discountImg,jdbcType=VARCHAR}"); + } + + if (record.getDiscountUsingRange() != null) { + sql.VALUES("discount_using_range", "#{discountUsingRange,jdbcType=INTEGER}"); + } + + if (record.getDiscountUseScope() != null) { + sql.VALUES("discount_use_scope", "#{discountUseScope,jdbcType=INTEGER}"); + } + + if (record.getDiscountType() != null) { + sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}"); + } + + if (record.getDiscountCondition() != null) { + sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}"); + } + + if (record.getDiscountPrice() != null) { + sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); + } + if (record.getAgentId() != null) { sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); } @@ -82,7 +114,15 @@ public class HighDiscountUserRelSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("discount_company_id"); sql.SELECT("discount_id"); + sql.SELECT("discount_name"); + sql.SELECT("discount_img"); + sql.SELECT("discount_using_range"); + sql.SELECT("discount_use_scope"); + sql.SELECT("discount_type"); + sql.SELECT("discount_condition"); + sql.SELECT("discount_price"); sql.SELECT("agent_id"); sql.SELECT("discount_agent_code_id"); sql.SELECT("user_id"); @@ -114,10 +154,42 @@ public class HighDiscountUserRelSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getDiscountCompanyId() != null) { + sql.SET("discount_company_id = #{record.discountCompanyId,jdbcType=BIGINT}"); + } + if (record.getDiscountId() != null) { sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); } + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountImg() != null) { + sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}"); + } + + if (record.getDiscountUsingRange() != null) { + sql.SET("discount_using_range = #{record.discountUsingRange,jdbcType=INTEGER}"); + } + + if (record.getDiscountUseScope() != null) { + sql.SET("discount_use_scope = #{record.discountUseScope,jdbcType=INTEGER}"); + } + + if (record.getDiscountType() != null) { + sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); + } + + if (record.getDiscountCondition() != null) { + sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); + } + + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); + } + if (record.getAgentId() != null) { sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); } @@ -167,7 +239,15 @@ public class HighDiscountUserRelSqlProvider { sql.UPDATE("high_discount_user_rel"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("discount_company_id = #{record.discountCompanyId,jdbcType=BIGINT}"); sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + sql.SET("discount_img = #{record.discountImg,jdbcType=VARCHAR}"); + sql.SET("discount_using_range = #{record.discountUsingRange,jdbcType=INTEGER}"); + sql.SET("discount_use_scope = #{record.discountUseScope,jdbcType=INTEGER}"); + sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); + sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); sql.SET("discount_agent_code_id = #{record.discountAgentCodeId,jdbcType=BIGINT}"); sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); @@ -188,10 +268,42 @@ public class HighDiscountUserRelSqlProvider { SQL sql = new SQL(); sql.UPDATE("high_discount_user_rel"); + if (record.getDiscountCompanyId() != null) { + sql.SET("discount_company_id = #{discountCompanyId,jdbcType=BIGINT}"); + } + if (record.getDiscountId() != null) { sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); } + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountImg() != null) { + sql.SET("discount_img = #{discountImg,jdbcType=VARCHAR}"); + } + + if (record.getDiscountUsingRange() != null) { + sql.SET("discount_using_range = #{discountUsingRange,jdbcType=INTEGER}"); + } + + if (record.getDiscountUseScope() != null) { + sql.SET("discount_use_scope = #{discountUseScope,jdbcType=INTEGER}"); + } + + if (record.getDiscountType() != null) { + sql.SET("discount_type = #{discountType,jdbcType=INTEGER}"); + } + + if (record.getDiscountCondition() != null) { + sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}"); + } + + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); + } + if (record.getAgentId() != null) { sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountUserRel.java b/hai-service/src/main/java/com/hai/entity/HighDiscountUserRel.java index 11e966a4..36c07a4a 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountUserRel.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountUserRel.java @@ -3,6 +3,7 @@ package com.hai.entity; import com.hai.model.HighDiscountUserRelModel; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -20,11 +21,51 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser */ private Long id; + /** + * 优惠券发放公司 + */ + private Long discountCompanyId; + /** * 优惠券id */ private Long discountId; + /** + * 优惠券名称 + */ + private String discountName; + + /** + * 优惠券图片 + */ + private String discountImg; + + /** + * 使用归属 + */ + private Integer discountUsingRange; + + /** + * 使用范围 1. 全场 2.卡券 3.话费 + */ + private Integer discountUseScope; + + /** + * 卡卷类型 1:满减 2:抵扣 3:折扣 + */ + private Integer discountType; + + /** + * 优惠券条件(满减价格) + */ + private BigDecimal discountCondition; + + /** + * 优惠券价格 + */ + private BigDecimal discountPrice; + /** * 代理商id */ @@ -76,6 +117,14 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser this.id = id; } + public Long getDiscountCompanyId() { + return discountCompanyId; + } + + public void setDiscountCompanyId(Long discountCompanyId) { + this.discountCompanyId = discountCompanyId; + } + public Long getDiscountId() { return discountId; } @@ -84,6 +133,62 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser this.discountId = discountId; } + public String getDiscountName() { + return discountName; + } + + public void setDiscountName(String discountName) { + this.discountName = discountName; + } + + public String getDiscountImg() { + return discountImg; + } + + public void setDiscountImg(String discountImg) { + this.discountImg = discountImg; + } + + public Integer getDiscountUsingRange() { + return discountUsingRange; + } + + public void setDiscountUsingRange(Integer discountUsingRange) { + this.discountUsingRange = discountUsingRange; + } + + public Integer getDiscountUseScope() { + return discountUseScope; + } + + public void setDiscountUseScope(Integer discountUseScope) { + this.discountUseScope = discountUseScope; + } + + public Integer getDiscountType() { + return discountType; + } + + public void setDiscountType(Integer discountType) { + this.discountType = discountType; + } + + public BigDecimal getDiscountCondition() { + return discountCondition; + } + + public void setDiscountCondition(BigDecimal discountCondition) { + this.discountCondition = discountCondition; + } + + public BigDecimal getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(BigDecimal discountPrice) { + this.discountPrice = discountPrice; + } + public Long getAgentId() { return agentId; } @@ -177,7 +282,15 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser } HighDiscountUserRel other = (HighDiscountUserRel) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDiscountCompanyId() == null ? other.getDiscountCompanyId() == null : this.getDiscountCompanyId().equals(other.getDiscountCompanyId())) && (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) + && (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) + && (this.getDiscountImg() == null ? other.getDiscountImg() == null : this.getDiscountImg().equals(other.getDiscountImg())) + && (this.getDiscountUsingRange() == null ? other.getDiscountUsingRange() == null : this.getDiscountUsingRange().equals(other.getDiscountUsingRange())) + && (this.getDiscountUseScope() == null ? other.getDiscountUseScope() == null : this.getDiscountUseScope().equals(other.getDiscountUseScope())) + && (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) + && (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) + && (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) && (this.getDiscountAgentCodeId() == null ? other.getDiscountAgentCodeId() == null : this.getDiscountAgentCodeId().equals(other.getDiscountAgentCodeId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) @@ -195,7 +308,15 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getDiscountCompanyId() == null) ? 0 : getDiscountCompanyId().hashCode()); result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); + result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); + result = prime * result + ((getDiscountImg() == null) ? 0 : getDiscountImg().hashCode()); + result = prime * result + ((getDiscountUsingRange() == null) ? 0 : getDiscountUsingRange().hashCode()); + result = prime * result + ((getDiscountUseScope() == null) ? 0 : getDiscountUseScope().hashCode()); + result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); + result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); + result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); result = prime * result + ((getDiscountAgentCodeId() == null) ? 0 : getDiscountAgentCodeId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); @@ -216,7 +337,15 @@ public class HighDiscountUserRel extends HighDiscountUserRelModel implements Ser sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", discountCompanyId=").append(discountCompanyId); sb.append(", discountId=").append(discountId); + sb.append(", discountName=").append(discountName); + sb.append(", discountImg=").append(discountImg); + sb.append(", discountUsingRange=").append(discountUsingRange); + sb.append(", discountUseScope=").append(discountUseScope); + sb.append(", discountType=").append(discountType); + sb.append(", discountCondition=").append(discountCondition); + sb.append(", discountPrice=").append(discountPrice); sb.append(", agentId=").append(agentId); sb.append(", discountAgentCodeId=").append(discountAgentCodeId); sb.append(", userId=").append(userId); diff --git a/hai-service/src/main/java/com/hai/entity/HighDiscountUserRelExample.java b/hai-service/src/main/java/com/hai/entity/HighDiscountUserRelExample.java index 1c593d37..5aa9dfa3 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDiscountUserRelExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDiscountUserRelExample.java @@ -1,5 +1,6 @@ package com.hai.entity; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -185,6 +186,66 @@ public class HighDiscountUserRelExample { return (Criteria) this; } + public Criteria andDiscountCompanyIdIsNull() { + addCriterion("discount_company_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdIsNotNull() { + addCriterion("discount_company_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdEqualTo(Long value) { + addCriterion("discount_company_id =", value, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdNotEqualTo(Long value) { + addCriterion("discount_company_id <>", value, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdGreaterThan(Long value) { + addCriterion("discount_company_id >", value, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_company_id >=", value, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdLessThan(Long value) { + addCriterion("discount_company_id <", value, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("discount_company_id <=", value, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdIn(List values) { + addCriterion("discount_company_id in", values, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdNotIn(List values) { + addCriterion("discount_company_id not in", values, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdBetween(Long value1, Long value2) { + addCriterion("discount_company_id between", value1, value2, "discountCompanyId"); + return (Criteria) this; + } + + public Criteria andDiscountCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("discount_company_id not between", value1, value2, "discountCompanyId"); + return (Criteria) this; + } + public Criteria andDiscountIdIsNull() { addCriterion("discount_id is null"); return (Criteria) this; @@ -245,6 +306,446 @@ public class HighDiscountUserRelExample { return (Criteria) this; } + public Criteria andDiscountNameIsNull() { + addCriterion("discount_name is null"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNotNull() { + addCriterion("discount_name is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNameEqualTo(String value) { + addCriterion("discount_name =", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotEqualTo(String value) { + addCriterion("discount_name <>", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThan(String value) { + addCriterion("discount_name >", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThanOrEqualTo(String value) { + addCriterion("discount_name >=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThan(String value) { + addCriterion("discount_name <", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThanOrEqualTo(String value) { + addCriterion("discount_name <=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLike(String value) { + addCriterion("discount_name like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotLike(String value) { + addCriterion("discount_name not like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameIn(List values) { + addCriterion("discount_name in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotIn(List values) { + addCriterion("discount_name not in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameBetween(String value1, String value2) { + addCriterion("discount_name between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotBetween(String value1, String value2) { + addCriterion("discount_name not between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountImgIsNull() { + addCriterion("discount_img is null"); + return (Criteria) this; + } + + public Criteria andDiscountImgIsNotNull() { + addCriterion("discount_img is not null"); + return (Criteria) this; + } + + public Criteria andDiscountImgEqualTo(String value) { + addCriterion("discount_img =", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgNotEqualTo(String value) { + addCriterion("discount_img <>", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgGreaterThan(String value) { + addCriterion("discount_img >", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgGreaterThanOrEqualTo(String value) { + addCriterion("discount_img >=", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgLessThan(String value) { + addCriterion("discount_img <", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgLessThanOrEqualTo(String value) { + addCriterion("discount_img <=", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgLike(String value) { + addCriterion("discount_img like", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgNotLike(String value) { + addCriterion("discount_img not like", value, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgIn(List values) { + addCriterion("discount_img in", values, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgNotIn(List values) { + addCriterion("discount_img not in", values, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgBetween(String value1, String value2) { + addCriterion("discount_img between", value1, value2, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountImgNotBetween(String value1, String value2) { + addCriterion("discount_img not between", value1, value2, "discountImg"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeIsNull() { + addCriterion("discount_using_range is null"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeIsNotNull() { + addCriterion("discount_using_range is not null"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeEqualTo(Integer value) { + addCriterion("discount_using_range =", value, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeNotEqualTo(Integer value) { + addCriterion("discount_using_range <>", value, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeGreaterThan(Integer value) { + addCriterion("discount_using_range >", value, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeGreaterThanOrEqualTo(Integer value) { + addCriterion("discount_using_range >=", value, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeLessThan(Integer value) { + addCriterion("discount_using_range <", value, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeLessThanOrEqualTo(Integer value) { + addCriterion("discount_using_range <=", value, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeIn(List values) { + addCriterion("discount_using_range in", values, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeNotIn(List values) { + addCriterion("discount_using_range not in", values, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeBetween(Integer value1, Integer value2) { + addCriterion("discount_using_range between", value1, value2, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUsingRangeNotBetween(Integer value1, Integer value2) { + addCriterion("discount_using_range not between", value1, value2, "discountUsingRange"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeIsNull() { + addCriterion("discount_use_scope is null"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeIsNotNull() { + addCriterion("discount_use_scope is not null"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeEqualTo(Integer value) { + addCriterion("discount_use_scope =", value, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeNotEqualTo(Integer value) { + addCriterion("discount_use_scope <>", value, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeGreaterThan(Integer value) { + addCriterion("discount_use_scope >", value, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeGreaterThanOrEqualTo(Integer value) { + addCriterion("discount_use_scope >=", value, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeLessThan(Integer value) { + addCriterion("discount_use_scope <", value, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeLessThanOrEqualTo(Integer value) { + addCriterion("discount_use_scope <=", value, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeIn(List values) { + addCriterion("discount_use_scope in", values, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeNotIn(List values) { + addCriterion("discount_use_scope not in", values, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeBetween(Integer value1, Integer value2) { + addCriterion("discount_use_scope between", value1, value2, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountUseScopeNotBetween(Integer value1, Integer value2) { + addCriterion("discount_use_scope not between", value1, value2, "discountUseScope"); + return (Criteria) this; + } + + public Criteria andDiscountTypeIsNull() { + addCriterion("discount_type is null"); + return (Criteria) this; + } + + public Criteria andDiscountTypeIsNotNull() { + addCriterion("discount_type is not null"); + return (Criteria) this; + } + + public Criteria andDiscountTypeEqualTo(Integer value) { + addCriterion("discount_type =", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeNotEqualTo(Integer value) { + addCriterion("discount_type <>", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeGreaterThan(Integer value) { + addCriterion("discount_type >", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("discount_type >=", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeLessThan(Integer value) { + addCriterion("discount_type <", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeLessThanOrEqualTo(Integer value) { + addCriterion("discount_type <=", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeIn(List values) { + addCriterion("discount_type in", values, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeNotIn(List values) { + addCriterion("discount_type not in", values, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeBetween(Integer value1, Integer value2) { + addCriterion("discount_type between", value1, value2, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeNotBetween(Integer value1, Integer value2) { + addCriterion("discount_type not between", value1, value2, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountConditionIsNull() { + addCriterion("discount_condition is null"); + return (Criteria) this; + } + + public Criteria andDiscountConditionIsNotNull() { + addCriterion("discount_condition is not null"); + return (Criteria) this; + } + + public Criteria andDiscountConditionEqualTo(BigDecimal value) { + addCriterion("discount_condition =", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionNotEqualTo(BigDecimal value) { + addCriterion("discount_condition <>", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionGreaterThan(BigDecimal value) { + addCriterion("discount_condition >", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_condition >=", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionLessThan(BigDecimal value) { + addCriterion("discount_condition <", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_condition <=", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionIn(List values) { + addCriterion("discount_condition in", values, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionNotIn(List values) { + addCriterion("discount_condition not in", values, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_condition between", value1, value2, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_condition not between", value1, value2, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNull() { + addCriterion("discount_price is null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNotNull() { + addCriterion("discount_price is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceEqualTo(BigDecimal value) { + addCriterion("discount_price =", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotEqualTo(BigDecimal value) { + addCriterion("discount_price <>", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThan(BigDecimal value) { + addCriterion("discount_price >", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price >=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThan(BigDecimal value) { + addCriterion("discount_price <", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price <=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIn(List values) { + addCriterion("discount_price in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotIn(List values) { + addCriterion("discount_price not in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price between", value1, value2, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price not between", value1, value2, "discountPrice"); + return (Criteria) this; + } + public Criteria andAgentIdIsNull() { addCriterion("agent_id is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/order/model/ExportOrderRefundModel.java b/hai-service/src/main/java/com/hai/order/model/ExportOrderRefundModel.java new file mode 100644 index 00000000..870f2416 --- /dev/null +++ b/hai-service/src/main/java/com/hai/order/model/ExportOrderRefundModel.java @@ -0,0 +1,74 @@ +package com.hai.order.model; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单退款模型 + * @className: ExportGasOrderModel + * @author: HuRui + * @date: 2022/10/28 + **/ +@Data +public class ExportOrderRefundModel { + + @ColumnWidth(25) + @ExcelProperty("交易单号") + private String orderNo; + + @ColumnWidth(25) + @ExcelProperty("产品单号") + private String childOrderNo; + + @ColumnWidth(15) + @ExcelProperty("客户电话") + private String memPhone; + + @ColumnWidth(15) + @ExcelProperty("产品类型") + private String goodsType; + + @ColumnWidth(30) + @ExcelProperty("产品名称") + private String goodsName; + + @ColumnWidth(25) + @ExcelProperty("退款单号") + private String refundOrderNo; + + @ColumnWidth(15) + @ExcelProperty("退款数量") + private Integer refundGoodsNum; + + @ColumnWidth(15) + @ExcelProperty("退款总额") + private BigDecimal returnTotalPrice; + + @ColumnWidth(15) + @ExcelProperty("退款金额") + private BigDecimal refundPrice; + + @ColumnWidth(15) + @ExcelProperty("退款积分") + private Integer refundIntegral; + + @ColumnWidth(15) + @ExcelProperty("退款状态") + private String refundStatus; + + @ColumnWidth(15) + @ExcelProperty("创建时间") + private Date createTime; + + @ColumnWidth(15) + @ExcelProperty("退款时间") + private Date refundTime; + + @ColumnWidth(50) + @ExcelProperty("退款备注") + private String refundRemark; +} diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index 1cad207c..cd132cd0 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -96,7 +96,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) { HighOrder order = orderService.getOrderDetailByNo(orderNo); try { - if (order != null && order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber())) { + if (order != null && order.getOrderStatus().equals(OrderStatus.STATUS1.getNumber())) { order.setPaySerialNo(paySerialNo); order.setPayRealPrice(payRealPrice); order.setPayTime(new Date()); @@ -131,7 +131,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { order.setExceptionContent(e.getMessage()); orderService.updateOrderData(order); } - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage()); + return order; } } @@ -141,9 +141,9 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { * @throws Exception */ @Transactional( - propagation= Propagation.REQUIRES_NEW, + propagation= Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED, - timeout = 10, + timeout = 20, rollbackFor = Exception.class) public void orderBusHandle(HighOrder order) throws Exception { for (HighChildOrder childOrder : order.getHighChildOrderList()) { diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java index 9e2a3c15..5e3bb0ba 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java @@ -147,8 +147,23 @@ public class OrderRefundServiceImpl implements OrderRefundService { criteria.andGoodsNameLike("%"+MapUtils.getString(param, "goodsName")+"%"); } - if (StringUtils.isNotBlank(MapUtils.getString(param, "goodsName"))) { - criteria.andGoodsNameLike("%"+MapUtils.getString(param, "goodsName")+"%"); + if (MapUtils.getInteger(param, "status") != null) { + criteria.andRefundStatusEqualTo(MapUtils.getInteger(param, "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"))); + } + + if (MapUtils.getLong(param, "refundTimeS") != null) { + criteria.andRefundTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeS"))); + } + if (MapUtils.getLong(param, "refundTimeE") != null) { + criteria.andRefundTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "refundTimeE"))); } example.setOrderByClause("create_time desc"); diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index d00e1569..d93cbb43 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -118,7 +118,7 @@ public class OrderServiceImpl implements OrderService { // 使用优惠券 if (createOrderModel.getMemDiscountId() != null) { // 卡优惠券信息 - discountUserRel = discountUserRelService.getRelById(createOrderModel.getMemId()); + discountUserRel = discountUserRelService.getRelById(createOrderModel.getMemDiscountId()); if (discountUserRel == null || discountUserRel.getStatus() != 1) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券不可用"); } @@ -266,8 +266,15 @@ public class OrderServiceImpl implements OrderService { order.setHighChildOrderList(childOrderList); /*********** 组装处理子订单 商品业务************/ + + // 计算订单金额 + Map calculateOrderPrice = OrderUtil.calculateOrderPrice(order.getHighChildOrderList()); + order.setTotalPrice(new BigDecimal(calculateOrderPrice.get("totalPrice").toString())); + order.setPayablePrice(new BigDecimal(calculateOrderPrice.get("payablePrice").toString())); + // 是否使用了优惠券 if (discountUserRel != null) { + order.setMemDiscountId(discountUserRel.getId()); order.setMemDiscountName(discountUserRel.getHighDiscount().getDiscountName()); // 优惠券使用范围 if (discountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType())) { @@ -327,13 +334,8 @@ public class OrderServiceImpl implements OrderService { } } - // 计算订单金额 - Map calculateOrderPrice = OrderUtil.calculateOrderPrice(order.getHighChildOrderList()); - order.setTotalPrice(new BigDecimal(calculateOrderPrice.get("totalPrice").toString())); - order.setDeductionCouponPrice(order.getDeductionCouponPrice()); order.setDeductionProductPrice(new BigDecimal(calculateOrderPrice.get("deductionPrice").toString())); order.setTotalDeductionPrice(order.getDeductionCouponPrice().add(order.getDeductionProductPrice())); - order.setPayablePrice(new BigDecimal(calculateOrderPrice.get("payablePrice").toString())); order.setPayPrice(order.getPayablePrice()); // 积分抵扣 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java index 5f0c368b..f3cd8466 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java @@ -94,7 +94,15 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic }*/ HighDiscountUserRel userRel = new HighDiscountUserRel(); + userRel.setDiscountCompanyId(discount.getCompanyId()); userRel.setDiscountId(rel.getDiscountId()); + userRel.setDiscountName(discount.getDiscountName()); + userRel.setDiscountImg(discount.getDiscountImg()); + userRel.setDiscountUseScope(discount.getUseScope()); + userRel.setDiscountUsingRange(discount.getUsingRange()); + userRel.setDiscountType(discount.getDiscountType()); + userRel.setDiscountCondition(discount.getDiscountCondition()); + userRel.setDiscountPrice(discount.getDiscountPrice()); userRel.setAgentId(rel.getAgentId()); userRel.setUserId(userId); userRel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 @@ -233,13 +241,12 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } - example.setOrderByClause("create_time desc"); - List list = highDiscountUserRelMapper.selectByExample(example); - for (HighDiscountUserRel rel : list) { - rel.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); - rel.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); + if (MapUtils.getInteger(map, "discountUseScope") != null) { + criteria.andDiscountUseScopeEqualTo(MapUtils.getInteger(map, "discountUseScope")); } - return list; + + example.setOrderByClause("create_time desc"); + return highDiscountUserRelMapper.selectByExample(example); } @Override diff --git a/hai-user/src/main/java/com/web/controller/DiscountController.java b/hai-user/src/main/java/com/web/controller/DiscountController.java index 50c5344d..ed3f754a 100644 --- a/hai-user/src/main/java/com/web/controller/DiscountController.java +++ b/hai-user/src/main/java/com/web/controller/DiscountController.java @@ -43,7 +43,7 @@ public class DiscountController { public ResponseData getUserDiscountList(@RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "useScope", required = false) Integer useScope, @RequestParam(name = "pageNum", required = true) Integer pageNum, - @RequestParam(name = "ppageSizeageNum", required = true) Integer pageSize) { + @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { HighUserModel userInfoModel = userCenter.getSessionModel(HighUserModel.class); diff --git a/hai-user/src/main/java/com/web/controller/TestController.java b/hai-user/src/main/java/com/web/controller/TestController.java index 5bef80c0..d0a7159c 100644 --- a/hai-user/src/main/java/com/web/controller/TestController.java +++ b/hai-user/src/main/java/com/web/controller/TestController.java @@ -1 +1 @@ -package com.web.controller; import com.hai.common.utils.DateUtil; import com.hai.common.utils.RedisUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighOrder; import com.hai.model.ResponseData; import com.hai.order.model.CreateOrderModel; import com.hai.order.service.OrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.Date; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class TestController { private static Logger log = LoggerFactory.getLogger(TestController.class); @Autowired private RocketMQTemplate rocketMQTemplate; @Resource private OrderService orderService; @Resource private RedisUtil redisUtil; @Autowired private RedisTemplate redisTemplate; @RequestMapping(value = "/q", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "") public ResponseData q(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = orderService.getOrderDetailByNo(orderNo); if (order != null) { orderService.refundOrder(orderNo, DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss")); // order.setRefundTime(new Date()); // orderService.updateOrderData(order); return ResponseMsgUtil.success("修改成功"); } return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighUserCardController --> rocketMq() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rocketMq", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "") public ResponseData rocketMq(@RequestParam(name = "topicGroup", required = true) String topicGroup, @RequestParam(name = "body", required = true) String body) { try { long startTime = System.currentTimeMillis(); // org.springframework.messaging.Message message = MessageBuilder.withPayload(order).build(); CreateOrderModel createOrder = new CreateOrderModel(); //发送对象消息 HighOrder order = rocketMQTemplate.sendAndReceive("order-topic:create", createOrder, HighOrder.class); System.out.println("订单号:" + order.getOrderNo()); // SendResult sendResult = rocketMQTemplate.syncSend("order-topic:create", message, 3000); /*List list = new LinkedList<>(); for (int i = 0; i <= 100;i++) { list.add(orderService.getDetailByOrderNo("HF2022080918014365701")); *//* list.add(orderService.getDetailByOrderNo("HF2022080918014365701"));*//* *//* updateUserWithRedisLock("coupon_" + couponKey, i+""); new Thread(() -> {*//* *//* redisTemplate.opsForValue().setIfAbsent("coupon_" + couponKey, i); System.out.println("加入数据" + i);*//* // redisTemplate.delete("coupon" + couponKey); // System.out.println("释放数据" + index); *//* });*//* }*/ System.out.println(System.currentTimeMillis() - startTime); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighUserCardController --> rocketMq() error!", e); return ResponseMsgUtil.exception(e); } } public void updateUserWithRedisLock(String couponKey, String value) throws InterruptedException { // 占分布式锁,去redis占坑 // 1. 分布式锁占坑 Boolean lock = redisTemplate.opsForValue().setIfAbsent("coupon" + couponKey, value); if(lock) { //加锁成功... // todo business System.out.println("加锁成功: " + value); redisTemplate.delete("coupon" + couponKey); //删除key,释放锁 } else { System.out.println("加锁失败"); /* Thread.sleep(100); // 加锁失败,重试 updateUserWithRedisLock("sysUser");*/ } } } \ No newline at end of file +package com.web.controller; import com.alibaba.fastjson.JSONObject; import com.hai.common.utils.DateUtil; import com.hai.common.utils.RedisUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.entity.HighOrder; import com.hai.model.ResponseData; import com.hai.order.model.CreateOrderModel; import com.hai.order.service.OrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.Date; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class TestController { private static Logger log = LoggerFactory.getLogger(TestController.class); @Autowired private RocketMQTemplate rocketMQTemplate; @Resource private OrderService orderService; @Resource private RedisUtil redisUtil; @Autowired private RedisTemplate redisTemplate; @RequestMapping(value = "/q", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "") public ResponseData q(@RequestParam(name = "orderNo", required = true) String orderNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance("8800030115015135432"); if (cardInfo.getInteger("respCode").equals(0000)) { // 解密响应参数 JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse.getBigDecimal("balance")); } return ResponseMsgUtil.success(0); } catch (Exception e) { log.error("HighUserCardController --> rocketMq() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rocketMq", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "") public ResponseData rocketMq(@RequestParam(name = "topicGroup", required = true) String topicGroup, @RequestParam(name = "body", required = true) String body) { try { long startTime = System.currentTimeMillis(); // org.springframework.messaging.Message message = MessageBuilder.withPayload(order).build(); CreateOrderModel createOrder = new CreateOrderModel(); //发送对象消息 HighOrder order = rocketMQTemplate.sendAndReceive("order-topic:create", createOrder, HighOrder.class); System.out.println("订单号:" + order.getOrderNo()); // SendResult sendResult = rocketMQTemplate.syncSend("order-topic:create", message, 3000); /*List list = new LinkedList<>(); for (int i = 0; i <= 100;i++) { list.add(orderService.getDetailByOrderNo("HF2022080918014365701")); *//* list.add(orderService.getDetailByOrderNo("HF2022080918014365701"));*//* *//* updateUserWithRedisLock("coupon_" + couponKey, i+""); new Thread(() -> {*//* *//* redisTemplate.opsForValue().setIfAbsent("coupon_" + couponKey, i); System.out.println("加入数据" + i);*//* // redisTemplate.delete("coupon" + couponKey); // System.out.println("释放数据" + index); *//* });*//* }*/ System.out.println(System.currentTimeMillis() - startTime); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighUserCardController --> rocketMq() error!", e); return ResponseMsgUtil.exception(e); } } public void updateUserWithRedisLock(String couponKey, String value) throws InterruptedException { // 占分布式锁,去redis占坑 // 1. 分布式锁占坑 Boolean lock = redisTemplate.opsForValue().setIfAbsent("coupon" + couponKey, value); if(lock) { //加锁成功... // todo business System.out.println("加锁成功: " + value); redisTemplate.delete("coupon" + couponKey); //删除key,释放锁 } else { System.out.println("加锁失败"); /* Thread.sleep(100); // 加锁失败,重试 updateUserWithRedisLock("sysUser");*/ } } } \ No newline at end of file diff --git a/hai-user/src/main/java/com/web/controller/UserController.java b/hai-user/src/main/java/com/web/controller/UserController.java index 2b0fd861..56868649 100644 --- a/hai-user/src/main/java/com/web/controller/UserController.java +++ b/hai-user/src/main/java/com/web/controller/UserController.java @@ -108,10 +108,12 @@ public class UserController { // 贵州汇联通工会卡 List hltCardList = userCardService.getListByUser(userInfoModel.getHighUser().getId(), UserCardType.type1.getType()); if (hltCardList.size() > 0) { - // 查询油卡 - JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(oilCardList.get(0).getCardNo()); - if (StringUtils.isBlank(cardInfo.getString("data"))) { - map.put("hltCardPrice", cardInfo.getString("data")); + // 查询工会卡 + JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(hltCardList.get(0).getCardNo()); + if (cardInfo.getInteger("respCode").equals(0000)) { + // 解密响应参数 + JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); + map.put("hltCardPrice", resolveResponse.getBigDecimal("balance")); } } return ResponseMsgUtil.success(map);