Merge branch '2.0-dev' into 2.0-master

dev-discount
袁野 2 years ago
commit 06897dc4de
  1. 105
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java
  2. 35
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  3. 5
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  4. 4
      hai-service/src/main/java/com/hai/common/pay/WechatPayUtil.java
  5. 4
      hai-service/src/main/java/com/hai/common/utils/DateUtil.java
  6. 106
      hai-service/src/main/java/com/hai/dao/HighDiscountAgentCodeMapperExt.java
  7. 1
      hai-service/src/main/java/com/hai/enum_type/LoginPlatform.java
  8. 58
      hai-service/src/main/java/com/hai/model/DiscountUseConditionModel.java
  9. 3
      hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java
  10. 6
      hai-service/src/main/java/com/hai/service/HighUserService.java
  11. 8
      hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java
  12. 4
      hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java
  13. 16
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  14. 4
      hai-service/src/main/resources/dev/commonConfig.properties
  15. 2
      hai-user/src/main/java/com/web/controller/LoginController.java
  16. 2
      hai-user/src/main/java/com/web/type/LoginType.java

@ -1,8 +1,10 @@
package com.bweb.controller; package com.bweb.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst; import com.bweb.config.SysConst;
import com.bweb.model.ExportHighOrderModel;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.Base64Util; import com.hai.common.Base64Util;
@ -15,12 +17,16 @@ import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil; import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator; import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst; import com.hai.config.CommonSysConst;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.enum_type.QrCodeType; import com.hai.enum_type.QrCodeType;
import com.hai.model.DiscountUseConditionModel;
import com.hai.model.HighOrderModel;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.order.model.OrderCouponModel;
import com.hai.service.*; import com.hai.service.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -32,9 +38,11 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -205,10 +213,10 @@ public class HighDiscountAgentRelController {
@RequestMapping(value="/getDiscountUseConditionList",method = RequestMethod.GET) @RequestMapping(value="/getDiscountUseConditionList",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询优惠券使用情况") @ApiOperation(value = "查询优惠券使用情况")
public ResponseData getDiscountUseConditionList(@RequestParam(name = "discountId", required = false) Long discountId, public ResponseData getDiscountUseConditionList(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "discountName", required = false) String discountName, @RequestParam(name = "discountId", required = false) Long discountId,
@RequestParam(name = "storeName", required = false) String storeName, @RequestParam(name = "status", required = false) String status,
@RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "userPhone", required = false) String userPhone,
@RequestParam(name = "receiveTimeS", required = false) Long receiveTimeS, @RequestParam(name = "receiveTimeS", required = false) Long receiveTimeS,
@RequestParam(name = "receiveTimeE", required = false) Long receiveTimeE, @RequestParam(name = "receiveTimeE", required = false) Long receiveTimeE,
@RequestParam(name = "useTimeS", required = false) Long useTimeS, @RequestParam(name = "useTimeS", required = false) Long useTimeS,
@ -221,17 +229,18 @@ public class HighDiscountAgentRelController {
try { try {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (userInfoModel.getHighAgent() == null) {
log.error("HighCouponController -> insertCoupon() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (userInfoModel.getBsCompany() != null) {
map.put("agentId", agentId);
} else if (userInfoModel.getHighAgent() != null) {
map.put("agentId", userInfoModel.getHighAgent().getId()); map.put("agentId", userInfoModel.getHighAgent().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
map.put("discountId", discountId); map.put("discountId", discountId);
map.put("discountName", discountName);
map.put("storeName", storeName);
map.put("status", status); map.put("status", status);
map.put("userPhone", userPhone);
map.put("receiveTimeS", receiveTimeS); map.put("receiveTimeS", receiveTimeS);
map.put("receiveTimeE", receiveTimeE); map.put("receiveTimeE", receiveTimeE);
map.put("useTimeS", useTimeS); map.put("useTimeS", useTimeS);
@ -248,6 +257,55 @@ public class HighDiscountAgentRelController {
} }
} }
@RequestMapping(value="/exportDiscountUseCondition",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询优惠券使用情况")
public ResponseData exportDiscountUseCondition(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "discountId", required = false) Long discountId,
@RequestParam(name = "status", required = false) String status,
@RequestParam(name = "userPhone", required = false) String userPhone,
@RequestParam(name = "receiveTimeS", required = false) Long receiveTimeS,
@RequestParam(name = "receiveTimeE", required = false) Long receiveTimeE,
@RequestParam(name = "useTimeS", required = false) Long useTimeS,
@RequestParam(name = "useTimeE", required = false) Long useTimeE,
@RequestParam(name = "idS", required = false) Long idS,
@RequestParam(name = "idE", required = false) Long idE,
HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> map = new HashMap<>();
if (userInfoModel.getBsCompany() != null) {
map.put("agentId", agentId);
} else if (userInfoModel.getHighAgent() != null) {
map.put("agentId", userInfoModel.getHighAgent().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
map.put("discountId", discountId);
map.put("status", status);
map.put("userPhone", userPhone);
map.put("receiveTimeS", receiveTimeS);
map.put("receiveTimeE", receiveTimeE);
map.put("useTimeS", useTimeS);
map.put("useTimeE", useTimeE);
map.put("idS", idS);
map.put("idE", idE);
String fileName = "/temporary/" + System.currentTimeMillis() + ".xlsx";
EasyExcel.write(SysConst.getSysConfig().getFileUrl() + fileName, DiscountUseConditionModel.class)
.sheet("sheet1")
.doWrite(highDiscountAgentCodeService.getDiscountUseConditionList(map));
return ResponseMsgUtil.success(fileName);
} catch (Exception e) {
log.error("HighDiscountController -> getDiscountUseConditionList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDiscountCodeById",method = RequestMethod.GET) @RequestMapping(value="/getDiscountCodeById",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询优惠券码 详情") @ApiOperation(value = "查询优惠券码 详情")
@ -268,7 +326,7 @@ public class HighDiscountAgentRelController {
log.error("HighDiscountController -> getDiscountCodeById() error!",e); log.error("HighDiscountController -> getDiscountCodeById() error!",e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value="/getDiscountStatus",method = RequestMethod.POST) @RequestMapping(value="/getDiscountStatus",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -297,4 +355,29 @@ public class HighDiscountAgentRelController {
} }
} }
@RequestMapping(value="/exportDiscountReceive",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出领取记录")
public ResponseData exportDiscountReceive(@RequestParam(name = "id", required = true) Long id) {
try {
HighDiscountAgentRel rel = highDiscountAgentRelService.getRelById(id);
if (rel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "数据不存在");
}
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).sheet("sheet1").doWrite(dataList);
return ResponseMsgUtil.success(pathName);
} catch (Exception e) {
log.error("HighDiscountController -> getReceiveLink() error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -365,43 +365,8 @@ public class WechatController {
return ResponseMsgUtil.success(so); return ResponseMsgUtil.success(so);
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "微信签名")
public ResponseData verifyWx(@RequestParam(value = "url", required = true) String url) {
try {
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxH5AppId());
params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
Map<String, Object> map = new HashMap<>();
map.put("noncestr",WxUtils.makeNonStr());
map.put("jsapi_ticket",accessTokenObject.getString("ticket"));
map.put("timestamp", new Date().getTime());
map.put("url",url);
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("appId" , params.get("appId"));
objectMap.put("timestamp" , map.get("timestamp"));
objectMap.put("nonceStr" , map.get("nonceStr"));
objectMap.put("signature" , WxUtils.getSHA1(map));
return ResponseMsgUtil.success(objectMap);
} catch (Exception e) {
return null;
}
}
} }

@ -9,6 +9,7 @@ import com.hai.common.pay.entity.WeChatPayReqInfo;
import com.hai.common.pay.util.MD5Util; import com.hai.common.pay.util.MD5Util;
import com.hai.common.security.AESEncodeUtil; import com.hai.common.security.AESEncodeUtil;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.UnionPayConfig; import com.hai.config.UnionPayConfig;
import com.hai.config.WxOrderConfig; import com.hai.config.WxOrderConfig;
@ -41,6 +42,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.SortedMap; import java.util.SortedMap;
@ -121,7 +123,6 @@ public class OrderPayController {
log.error("wxPay ERROR", "订单不处于待支付状态"); log.error("wxPay ERROR", "订单不处于待支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
} }
Integer openIdType = body.getInteger("openIdType"); Integer openIdType = body.getInteger("openIdType");
// 是否分账 // 是否分账
String profitSharing = "N"; String profitSharing = "N";
@ -270,6 +271,8 @@ public class OrderPayController {
weChatPayReqInfo.setTrade_type("JSAPI"); // 交易类型 weChatPayReqInfo.setTrade_type("JSAPI"); // 交易类型
weChatPayReqInfo.setAttach(null); // 附件参数 weChatPayReqInfo.setAttach(null); // 附件参数
weChatPayReqInfo.setProfit_sharing(profitSharing); // 是否分账 Y:是 N:否 weChatPayReqInfo.setProfit_sharing(profitSharing); // 是否分账 Y:是 N:否
weChatPayReqInfo.setTime_start(DateUtil.date2String(order.getCreateTime(), "yyyyMMddHHmmss"));
weChatPayReqInfo.setTime_expire(DateUtil.date2String(DateUtil.addMinute(order.getCreateTime(), 10), "yyyyMMddHHmmss"));
//附加数据,区分订单类型 //附加数据,区分订单类型
Map<String,String> payMap = new HashMap<>(); Map<String,String> payMap = new HashMap<>();

@ -1,5 +1,8 @@
package com.hai.common.pay; package com.hai.common.pay;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.entity.WeChatPayReqInfo; import com.hai.common.pay.entity.WeChatPayReqInfo;
import com.hai.common.pay.entity.WechatCallBackInfo; import com.hai.common.pay.entity.WechatCallBackInfo;
import com.hai.common.pay.util.HttpReqUtil; import com.hai.common.pay.util.HttpReqUtil;
@ -73,6 +76,7 @@ public class WechatPayUtil {
} else { } else {
log.error("微信支付 -> 组装支付参数:支付信息错误"); log.error("微信支付 -> 组装支付参数:支付信息错误");
log.error("错误信息:" + unifiedOrderResultXmL); log.error("错误信息:" + unifiedOrderResultXmL);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法支付,请稍后重新提交订单支付!");
} }
return sortedMap; return sortedMap;

@ -413,7 +413,7 @@ public class DateUtil {
* @return: java.util.Date * @return: java.util.Date
* @throws * @throws
*/ */
public static Date addDate(Date date,int day) throws ParseException { public static Date addDate(Date date,int day) {
long time = date.getTime(); // 得到指定日期的毫秒数 long time = date.getTime(); // 得到指定日期的毫秒数
long longTime = (long)day; long longTime = (long)day;
long addDay = longTime*24*60*60*1000; // 要加上的天数转换成毫秒数 long addDay = longTime*24*60*60*1000; // 要加上的天数转换成毫秒数
@ -577,7 +577,7 @@ public class DateUtil {
* @return: int * @return: int
* @throws * @throws
*/ */
public static long getMinutesDiff(Date oldTime, Date newTime) throws Exception{ public static long getMinutesDiff(Date oldTime, Date newTime) {
long oldTimeStamp = oldTime.getTime(); long oldTimeStamp = oldTime.getTime();
long newTimeStamp = newTime.getTime(); long newTimeStamp = newTime.getTime();

@ -1,6 +1,7 @@
package com.hai.dao; package com.hai.dao;
import com.hai.entity.HighDiscountAgentCode; import com.hai.entity.HighDiscountAgentCode;
import com.hai.model.DiscountUseConditionModel;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
@ -32,61 +33,56 @@ public interface HighDiscountAgentCodeMapperExt {
void insertListCode(@Param(value = "list") List<HighDiscountAgentCode> discountAgentCodeList); void insertListCode(@Param(value = "list") List<HighDiscountAgentCode> discountAgentCodeList);
@Select({"<script>" + @Select({"<script>" +
" SELECT" + " select * FROM ( " +
" a.id," + " select " +
" a.`status`," + " a.id discountAgentCodeId, " +
" a.create_time createTime," + " c.discount_name discountName, " +
" c.discountId," + " case c.discount_type when 1 then '满减' when 2 then '抵扣' when 3 then '折扣' else '未知' end discountType, " +
" c.discountName," + " c.discount_price discountPrice, " +
" b.receiveTime," + " insert(b.phone, 4, 4, '****') userPhone, " +
" b.useEndTime," + " b.create_time receiveTime, " +
" b.useTime," + " b.use_end_time useEndTime, " +
" b.userId," + " b.use_time useTime, " +
" b.userName," + " case a.`status` " +
" insert(b.userPhone, 4, 4, '****') userPhone," + " when 1 then '待领取' " +
" b.storeName" + " when 2 then '待使用' " +
" FROM" + " when 3 then '已使用' " +
" high_discount_agent_code a" + " when 4 then '已过期' " +
" LEFT JOIN (" + " when 5 then '已分配' " +
" SELECT" + " end discountUseStatus, " +
" du.discount_agent_code_id," + " d.order_no orderNo, " +
" du.create_time receiveTime," + " d.total_price orderTotalPrice, " +
" du.use_end_time useEndTime," + " (d.total_price - d.pay_price) orderDiscountPrice, " +
" du.use_time useTime," + " d.pay_price orderPayPrice " +
" u.id userId," + " from (select id,status,discount_agent_id from high_discount_agent_code " +
" u.`name` userName," + " where discount_agent_id in (select id from high_discount_agent_rel where agent_id = #{param.agentId}" +
" u.phone userPhone," + " <if test='param.discountId != null'> and discount_id = #{param.discountId} </if> )) a " +
" c.store_name storeName" + " " +
" FROM" + " LEFT JOIN (select ur.discount_agent_code_id,ur.id,ur.create_time,ur.use_time,ur.use_end_time,u.phone " +
" high_discount_user_rel du" + " from high_discount_user_rel ur " +
" LEFT JOIN high_user u ON u.id = du.user_id " + " LEFT JOIN high_user u on u.id = ur.user_id " +
" LEFT JOIN (select a.mem_discount_id,b.store_name from (select b.id,a.mem_discount_id from high_order a" + " ) b on b.discount_agent_code_id = a.id " +
" left join high_child_order b on a.id = b.order_id " + " " +
" where a.mem_discount_id is not null " + " LEFT JOIN (select mem_discount_id,order_no,total_price,pay_price " +
" and a.order_status in (2,3,4,6,7)" + " from high_order where mem_discount_id is not null and order_status in (2,3) GROUP BY mem_discount_id) d on d.mem_discount_id = b.id " +
" and b.giveaway_type = 0) a,high_coupon_code b where a.id = b.child_order_id GROUP BY a.mem_discount_id) c on c.mem_discount_id = du.id" + " " +
" GROUP BY" + " LEFT JOIN (select a.id, b.id discount_id,b.discount_name,b.discount_type,b.discount_price " +
" du.id " + " from high_discount_agent_rel a, high_discount b where a.discount_id = b.id GROUP BY a.id) c on c.id = a.discount_agent_id " +
" ) b ON b.discount_agent_code_id = a.id " + " " +
" LEFT JOIN (select " + " where 1 = 1 <if test='param.userPhone != null'> <![CDATA[ AND b.phone = #{param.userPhone} ]]> </if> " +
" ca.id discountAgentCodeId," + " ORDER BY a.id desc " +
" hd.id discountId," + " " +
" hd.discount_name discountName from high_discount_agent_code ca,high_discount_agent_rel cb,high_discount hd " + " ) discountData " +
" where ca.discount_agent_id = cb.id and cb.discount_id = hd.id) c on c.discountAgentCodeId = a.id" + " where 1 = 1 " +
" WHERE" + " <if test='param.receiveTimeS != null'> <![CDATA[ AND receiveTime >= #{param.receiveTimeS} ]]> </if> " +
" a.discount_agent_id IN (SELECT id FROM high_discount_agent_rel WHERE agent_id = #{param.agentId} and status = 1)" + " <if test='param.receiveTimeE != null'> <![CDATA[ AND receiveTime <= #{param.receiveTimeE} ]]> </if> " +
" <if test='param.status != null'> and a.`status` = #{param.status} </if> " + " <if test='param.useTimeS != null'> <![CDATA[ AND useTime >= #{param.useTimeS} ]]> </if> " +
" <if test='param.discountId != null'> and c.discountId = #{param.discountId} </if> " + " <if test='param.useTimeE != null'> <![CDATA[ AND useTime <= #{param.useTimeE} ]]> </if> " +
" <if test='param.discountName != null'> and c.discountName like concat('%',#{param.discountName},'%') </if> " + " <if test='param.idS != null'> <![CDATA[ AND discountAgentCodeId >= #{param.idS} ]]> </if> " +
" <if test='param.storeName != null'> and b.storeName like concat('%',#{param.storeName},'%') </if> " + " <if test='param.idE != null'> <![CDATA[ AND discountAgentCodeId <= #{param.idE} ]]> </if> " +
" <if test='param.receiveTimeS != null'> <![CDATA[ and b.receiveTime >= #{param.receiveTimeS} ]]> </if> " + " <if test='param.status != null'> <![CDATA[ AND discountUseStatus = #{param.status} ]]> </if> " +
" <if test='param.receiveTimeE != null'> <![CDATA[ and b.receiveTime <= #{param.receiveTimeE} ]]> </if> " + "</script>" })
" <if test='param.useTimeS != null'> <![CDATA[ and b.useTime >= #{param.useTimeS} ]]> </if> " + List<DiscountUseConditionModel> getDiscountUseConditionList(@Param("param") Map<String, Object> param);
" <if test='param.useTimeE != null'> <![CDATA[ and b.useTime <= #{param.useTimeE} ]]> </if> " +
" <if test='param.idS != null'> <![CDATA[ and a.id >= #{param.idS} ]]> </if> " +
" <if test='param.idE != null'> <![CDATA[ and a.id <= #{param.idE} ]]> </if> " +
"</script>"})
List<Map<String,Object>> getDiscountUseConditionList(@Param("param") Map<String, Object> param);
@Select(" select * from high_discount_agent_code where discount_agent_id = #{discountAgentId} and status = 1 limit #{num} " ) @Select(" select * from high_discount_agent_code where discount_agent_id = #{discountAgentId} and status = 1 limit #{num} " )
@Results({ @Results({

@ -12,6 +12,7 @@ public enum LoginPlatform {
H5("H5", "H5客户端"), H5("H5", "H5客户端"),
WXAPPLETS("WXAPPLETS", "微信小程序"), WXAPPLETS("WXAPPLETS", "微信小程序"),
UNIONPAY("UNIONPAY", "云闪付"), UNIONPAY("UNIONPAY", "云闪付"),
HUIPAY("HUIPAY", "惠支付"),
; ;
private String code; private String code;

@ -0,0 +1,58 @@
package com.hai.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: DiscountUseConditionModel
* @author: HuRui
* @date: 2023/3/28
**/
@Data
public class DiscountUseConditionModel {
@ColumnWidth(15)
@ExcelProperty("优惠券编码")
private Long discountAgentCodeId;
@ColumnWidth(25)
@ExcelProperty("优惠券名称")
private String discountName;
@ColumnWidth(15)
@ExcelProperty("优惠券类型")
private String discountType;
@ColumnWidth(15)
@ExcelProperty("优惠券价格")
private BigDecimal discountPrice;
@ColumnWidth(15)
@ExcelProperty("优惠券状态")
private String discountUseStatus;
@ColumnWidth(15)
@ExcelProperty("客户电话")
private String userPhone;
@ColumnWidth(20)
@ExcelProperty("领取时间")
private Date receiveTime;
@ColumnWidth(20)
@ExcelProperty("过期时间")
private Date useEndTime;
@ColumnWidth(20)
@ExcelProperty("使用时间")
private Date useTime;
@ColumnWidth(25)
@ExcelProperty("交易订单号")
private String orderNo;
@ColumnWidth(15)
@ExcelProperty("交易金额")
private BigDecimal orderTotalPrice;
@ColumnWidth(15)
@ExcelProperty("交易优惠")
private BigDecimal orderDiscountPrice;
@ColumnWidth(15)
@ExcelProperty("交易实付")
private BigDecimal orderPayPrice;
}

@ -1,6 +1,7 @@
package com.hai.service; package com.hai.service;
import com.hai.entity.HighDiscountAgentCode; import com.hai.entity.HighDiscountAgentCode;
import com.hai.model.DiscountUseConditionModel;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import java.util.List; import java.util.List;
@ -46,7 +47,7 @@ public interface HighDiscountAgentCodeService {
* @param map * @param map
* @return * @return
*/ */
List<Map<String, Object>> getDiscountUseConditionList(Map<String,Object> map); List<DiscountUseConditionModel> getDiscountUseConditionList(Map<String,Object> map) throws Exception;
/** /**
* @Author Sum1Dream * @Author Sum1Dream

@ -30,6 +30,12 @@ public interface HighUserService {
*/ */
SessionObject loginAndRegister(LoginPlatform platForm, String phone, Long popularizeUserId, Map<String, Object> other, HttpServletRequest request, HttpServletResponse response) throws Exception; SessionObject loginAndRegister(LoginPlatform platForm, String phone, Long popularizeUserId, Map<String, Object> other, HttpServletRequest request, HttpServletResponse response) throws Exception;
/**
* 查询用户列表
* @param param
* @return
*/
List<HighUser> getUserList(Map<String, Object> param);
/** /**
* *
* @Title: getListUser * @Title: getListUser

@ -12,6 +12,7 @@ import com.hai.dao.HighCouponCodeMapper;
import com.hai.dao.HighCouponCodeOtherMapper; import com.hai.dao.HighCouponCodeOtherMapper;
import com.hai.dao.HighDiscountAgentCodeMapper; import com.hai.dao.HighDiscountAgentCodeMapper;
import com.hai.entity.*; import com.hai.entity.*;
import com.hai.model.DiscountUseConditionModel;
import com.hai.model.HighUserModel; import com.hai.model.HighUserModel;
import com.hai.service.*; import com.hai.service.*;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -119,8 +120,7 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe
} }
@Override @Override
public List<Map<String, Object>> getDiscountUseConditionList(Map<String, Object> map) { public List<DiscountUseConditionModel> getDiscountUseConditionList(Map<String, Object> map) throws Exception {
try {
if (MapUtils.getLong(map, "receiveTimeS") != null) { if (MapUtils.getLong(map, "receiveTimeS") != null) {
map.put("receiveTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "receiveTimeS")), "yyyy-MM-dd HH:mm:ss")); map.put("receiveTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "receiveTimeS")), "yyyy-MM-dd HH:mm:ss"));
} }
@ -134,9 +134,7 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe
if (MapUtils.getLong(map, "useTimeE") != null) { if (MapUtils.getLong(map, "useTimeE") != null) {
map.put("useTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "useTimeE")), "yyyy-MM-dd HH:mm:ss")); map.put("useTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "useTimeE")), "yyyy-MM-dd HH:mm:ss"));
} }
} catch (Exception e) {
e.printStackTrace();
}
return highDiscountAgentCodeMapper.getDiscountUseConditionList(map); return highDiscountAgentCodeMapper.getDiscountUseConditionList(map);
} }

@ -258,6 +258,10 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
HighDiscountUserRelExample example = new HighDiscountUserRelExample(); HighDiscountUserRelExample example = new HighDiscountUserRelExample();
HighDiscountUserRelExample.Criteria criteria = example.createCriteria(); HighDiscountUserRelExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map, "platform") != null) {
criteria.andDiscountPlatformEqualTo(MapUtils.getInteger(map, "platform"));
}
if (MapUtils.getLong(map, "userId") != null) { if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
} }

@ -140,6 +140,22 @@ public class HighUserServiceImpl implements HighUserService {
return so; return so;
} }
@Override
public List<HighUser> getUserList(Map<String, Object> param) {
HighUserExample example = new HighUserExample();
HighUserExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (StringUtils.isNotBlank(MapUtils.getString(param, "openId"))) {
criteria.andOpenIdEqualTo(MapUtils.getString(param, "openId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "openIdH5"))) {
criteria.andOpenIdH5EqualTo(MapUtils.getString(param, "openIdH5"));
}
return highUserMapper.selectByExample(example);
}
@Override @Override
public List<HighUser> getListUser(Map<String, String> map) { public List<HighUser> getListUser(Map<String, String> map) {
HighUserExample example = new HighUserExample(); HighUserExample example = new HighUserExample();

@ -110,8 +110,8 @@ unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c
#url #url
#fileUrl=/home/project/hsg/filesystem/ fileUrl=/home/project/hsg/filesystem/
fileUrl=/Volumes/work/filesystem/ #fileUrl=/Volumes/work/filesystem/
#wx #wx
wxAppId=wx8d49e2f83025229d wxAppId=wx8d49e2f83025229d

File diff suppressed because one or more lines are too long

@ -10,6 +10,8 @@ import java.util.Objects;
**/ **/
public enum LoginType { public enum LoginType {
SMS("SMS", "短信登录"), SMS("SMS", "短信登录"),
WECHAT_MA_OPENID("WECHAT_MA_OPENID", "微信小程序openId"),
WECHAT_MP_OPENID("WECHAT_MP_OPENID", "微信公众号openId"),
; ;
private String code; private String code;

Loading…
Cancel
Save