Merge branch 'dev_yy' into pre

* dev_yy:
  分销代码
  修改区域公司
  1
  修改话费定时任务问题
  修改话费定时任务问题
  1
  修改话费定时任务问题
  修改话费定时任务问题
  修改话费定时任务问题
dev-discount
袁野 2 years ago
commit 7642add9ff
  1. 158
      hai-bweb/src/main/java/com/bweb/controller/BsDistributionUserRelController.java
  2. 6
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java
  3. 30
      hai-bweb/src/main/java/com/bweb/controller/HighUserController.java
  4. 9
      hai-cweb/src/main/java/com/cweb/config/SysConfig.java
  5. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  6. 9
      hai-cweb/src/main/java/com/cweb/controller/HighUserCommonController.java
  7. 110
      hai-cweb/src/main/java/com/cweb/controller/HighUserController.java
  8. 79
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  9. 2
      hai-cweb/src/main/resources/dev/config.properties
  10. 3
      hai-cweb/src/main/resources/prod-9401/config.properties
  11. 3
      hai-cweb/src/main/resources/prod/config.properties
  12. 9
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  13. 10
      hai-service/src/main/java/com/hai/common/QRCodeGenerator.java
  14. 307
      hai-service/src/main/java/com/hai/common/utils/ImageUtils.java
  15. 3
      hai-service/src/main/java/com/hai/common/utils/TelApiUtil.java
  16. 2
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  17. 169
      hai-service/src/main/java/com/hai/config/CommonConfig.java
  18. 10
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  19. 24
      hai-service/src/main/java/com/hai/dao/BsDistributionRebateMapperExt.java
  20. 17
      hai-service/src/main/java/com/hai/dao/BsDistributionUserRelMapper.java
  21. 37
      hai-service/src/main/java/com/hai/dao/BsDistributionUserRelMapperExt.java
  22. 14
      hai-service/src/main/java/com/hai/dao/BsDistributionUserRelSqlProvider.java
  23. 9
      hai-service/src/main/java/com/hai/dao/BsRequestRecordMapperExt.java
  24. 2
      hai-service/src/main/java/com/hai/dao/HighOrderMapper.java
  25. 18
      hai-service/src/main/java/com/hai/entity/BsDistributionUserRel.java
  26. 70
      hai-service/src/main/java/com/hai/entity/BsDistributionUserRelExample.java
  27. 30
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  28. 6
      hai-service/src/main/java/com/hai/enum_type/GoodsType.java
  29. 49
      hai-service/src/main/java/com/hai/enum_type/OrderLogoEnum.java
  30. 86
      hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java
  31. 21
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  32. 14
      hai-service/src/main/java/com/hai/service/HighUserService.java
  33. 266
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  34. 22
      hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java
  35. 2
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java
  36. 61
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  37. 18
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  38. 5
      hai-service/src/main/resources/dev/commonConfig.properties
  39. 3
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  40. 3
      hai-service/src/main/resources/prod/commonConfig.properties
  41. 6
      v1/src/main/java/com/v1/controller/GzSinopecController.java
  42. 11
      v1/src/main/java/com/v1/controller/HighOrderController.java
  43. 8
      v1/src/main/java/com/v1/controller/RechargeProductController.java
  44. 2
      v1/src/main/java/com/v1/controller/SelfOilStationController.java

@ -0,0 +1,158 @@
package com.bweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.BsDistributionUserRelService;
import com.hai.service.HighOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
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 javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/bsDistributionUserRel")
@Api(value = "分销人员")
public class BsDistributionUserRelController {
private static Logger log = LoggerFactory.getLogger(BsIntegralRebateController.class);
@Autowired
private UserCenter userCenter;
@Resource
private HighOrderService highOrderService;
@Resource
private BsDistributionUserRelService bsDistributionUserRelService;
@RequestMapping(value = "/getDistributionAgent", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销代理商")
public ResponseData getDistributionAgent() {
try {
return ResponseMsgUtil.success(bsDistributionUserRelService.getDistributionAgent());
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDistributionFirst", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销一级")
public ResponseData getDistributionFirst(@RequestParam(name = "agentId", required = false) Long agentId) {
try {
return ResponseMsgUtil.success(bsDistributionUserRelService.getDistributionFirst(agentId));
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDistributionSecond", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销二级")
public ResponseData getDistributionSecond(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "popularizeUserId", required = false) Long popularizeUserId) {
try {
return ResponseMsgUtil.success(bsDistributionUserRelService.getDistributionSecond(agentId , popularizeUserId));
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDistributionIntegralList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销积分记录")
public ResponseData getDistributionIntegralList(@RequestParam(name = "title", required = false) String title,
@RequestParam(name = "type", required = false) Integer type,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "popularizeUserId", required = false) Long popularizeUserId,
@RequestParam(name = "userName", required = false) String userName,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize
) {
try {
Map<String , Object> map = new HashMap<>();
map.put("title", title);
map.put("type", type);
map.put("orderNo", orderNo);
map.put("agentId", agentId);
map.put("popularizeUserId", popularizeUserId);
map.put("userName", userName);
if (createTimeS != null && createTimeE != null) {
map.put("createTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTimeS));
map.put("createTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTimeE));
}
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(bsDistributionUserRelService.getDistributionIntegralList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/agentUserList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询代理商用户")
public ResponseData agentUserList() {
try {
return ResponseMsgUtil.success(bsDistributionUserRelService.agentUserList());
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/orderListByAgentId", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "B端查询代理商订单")
public ResponseData orderListByAgentId(@RequestParam(name = "agentId", required = false) Long agentId,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String , Object> map = new HashMap<>();
map.put("agentId" , agentId);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.orderListByAgentId(map)));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -43,12 +43,6 @@ public class HighTyAgentOilStationController {
@Resource @Resource
private HighTyAgentOilStationService highTyAgentOilStationService; private HighTyAgentOilStationService highTyAgentOilStationService;
@Resource
private BsOrganizationService organizationService;
@Resource
private HighTySalesmanService tySalesmanService;
@Resource @Resource
private UserCenter userCenter; private UserCenter userCenter;

@ -165,4 +165,34 @@ public class HighUserController {
} }
} }
@RequestMapping(value = "/setUpAgent", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "设置代理商")
public ResponseData setUpAgent(@RequestParam(value = "userId" , required = true) Long userId) {
try {
HighUser highUser = highUserService.findByUserId(userId);
if (highUser == null) {
log.error("HighUserController --> forbiddenUser() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, "");
}
if (highUser.getIsAgent() == null || !highUser.getIsAgent()) {
highUser.setIsAgent(true);
} else {
highUser.setIsAgent(false);
}
highUserService.updateUser(highUser);
return ResponseMsgUtil.success("设置成功");
} catch (Exception e) {
log.error("BsPositionController --> addPosition() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -30,6 +30,7 @@ public class SysConfig {
private String wxGzSubAppId; private String wxGzSubAppId;
private String wxGzSubMchId; private String wxGzSubMchId;
private String qrCodeUrl;
// 重庆电子商务有限公司 // 重庆电子商务有限公司
private String HDAppId; private String HDAppId;
@ -177,4 +178,12 @@ public class SysConfig {
public void setImgUrl(String imgUrl) { public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl; this.imgUrl = imgUrl;
} }
public String getQrCodeUrl() {
return qrCodeUrl;
}
public void setQrCodeUrl(String qrCodeUrl) {
this.qrCodeUrl = qrCodeUrl;
}
} }

File diff suppressed because one or more lines are too long

@ -55,6 +55,8 @@ public class HighUserCommonController {
@ApiOperation(value = "登录接口【用户不存在会自动注册】") @ApiOperation(value = "登录接口【用户不存在会自动注册】")
public ResponseData login(@RequestParam(value = "phone", required = true) String phone, public ResponseData login(@RequestParam(value = "phone", required = true) String phone,
@RequestParam(value = "code", required = true) String code, @RequestParam(value = "code", required = true) String code,
@RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId,
@RequestParam(value = "regionId", required = false) String regionId,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
try { try {
@ -80,7 +82,8 @@ public class HighUserCommonController {
// 1:需要填写用户信息 // 1:需要填写用户信息
// 2:需要填写手机号 // 2:需要填写手机号
user.setInfoCompleteStatus(1); user.setInfoCompleteStatus(1);
highUserService.insertUser(user);
highUserService.insertUser(user , popularizeUserId , regionId);
} }
HighUserModel highUserModel = new HighUserModel(); HighUserModel highUserModel = new HighUserModel();
@ -99,6 +102,8 @@ public class HighUserCommonController {
@ResponseBody @ResponseBody
@ApiOperation(value = "银联授权手机号登录接口") @ApiOperation(value = "银联授权手机号登录接口")
public ResponseData unionPhoneLogin(@RequestParam(value = "code", required = true) String code, public ResponseData unionPhoneLogin(@RequestParam(value = "code", required = true) String code,
@RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId,
@RequestParam(value = "regionId", required = false) String regionId,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
try { try {
@ -133,7 +138,7 @@ public class HighUserCommonController {
// 1:需要填写用户信息 // 1:需要填写用户信息
// 2:需要填写手机号 // 2:需要填写手机号
user.setInfoCompleteStatus(1); user.setInfoCompleteStatus(1);
highUserService.insertUser(user); highUserService.insertUser(user , popularizeUserId , regionId);
} else { } else {
user.setUnionOpenId(token.getJSONObject("params").getString("openId")); user.setUnionOpenId(token.getJSONObject("params").getString("openId"));
user.setUnionUnionId(token.getJSONObject("params").getString("unionId")); user.setUnionUnionId(token.getJSONObject("params").getString("unionId"));

@ -1,12 +1,17 @@
package com.cweb.controller; package com.cweb.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.*; import com.hai.common.security.*;
import com.hai.common.utils.ImageUtils;
import com.hai.common.utils.RedisUtil; import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonConfig;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.entity.HighUser; import com.hai.entity.HighUser;
import com.hai.entity.HighUserCoupon; import com.hai.entity.HighUserCoupon;
@ -27,6 +32,8 @@ 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 javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
@ -53,6 +60,12 @@ public class HighUserController {
@Resource @Resource
private HltUnionCardVipService hltUnionCardVipService; private HltUnionCardVipService hltUnionCardVipService;
@Resource
private BsDistributionUserRelService bsDistributionUserRelService;
@Resource
private HighOrderService highOrderService;
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@ -267,4 +280,101 @@ public class HighUserController {
} }
} }
@RequestMapping(value = "/userDistributionStatistics", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销用户统计内容")
public ResponseData userDistributionStatistics(HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
return ResponseMsgUtil.success(bsDistributionUserRelService.userDistributionStatistics(userInfoModel.getHighUser().getId()));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/distributionInviteList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销用户邀请列表")
public ResponseData distributionInviteList(HttpServletRequest request,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String , Object> map = new HashMap<>();
map.put("popularizeUserId" , userInfoModel.getHighUser().getId());
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(bsDistributionUserRelService.getDistributionUserRelList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/distributionOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询分销用户积分列表")
public ResponseData distributionOrderList(HttpServletRequest request,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String , Object> map = new HashMap<>();
map.put("popularizeUserId" , userInfoModel.getHighUser().getId());
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(bsDistributionUserRelService.getDistributionRebateList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/promotionalPosters", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "生成推广海报")
public ResponseData promotionalPosters(HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
String path = ImageUtils.QrCodeImg(SysConst.getSysConfig().getQrCodeUrl() , userInfoModel.getHighUser().getId().intValue());
CommonConfig.overlapImage(path , userInfoModel.getHighUser().getId().toString());
return ResponseMsgUtil.success(SysConst.getSysConfig().getImgUrl() + path);
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/promoteOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询用户推广列表")
public ResponseData promoteOrderList(HttpServletRequest request,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.promoteOrderList(userInfoModel.getHighUser().getId())));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -54,9 +54,6 @@ public class WechatController {
@Resource @Resource
private HighUserService highUserService; private HighUserService highUserService;
@Resource
private HighUserPayPasswordService highUserPayPasswordService;
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@ -89,6 +86,8 @@ public class WechatController {
public ResponseData loginByPhone(@RequestParam(value = "encryptedData", required = true) String encryptedData, public ResponseData loginByPhone(@RequestParam(value = "encryptedData", required = true) String encryptedData,
@RequestParam(value = "iv", required = true) String iv, @RequestParam(value = "iv", required = true) String iv,
@RequestParam(value = "openId", required = true) String openId, @RequestParam(value = "openId", required = true) String openId,
@RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId,
@RequestParam(value = "regionId", required = false) String regionId,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
try { try {
log.error("origin encryptedData:" + encryptedData + ";iv:" + iv); log.error("origin encryptedData:" + encryptedData + ";iv:" + iv);
@ -130,7 +129,7 @@ public class WechatController {
// 1:需要填写用户信息 // 1:需要填写用户信息
// 2:需要填写手机号 // 2:需要填写手机号
user.setInfoCompleteStatus(1); user.setInfoCompleteStatus(1);
highUserService.insertUser(user); highUserService.insertUser(user , popularizeUserId , regionId);
} else { } else {
if (session.getOpenid() == null) { if (session.getOpenid() == null) {
user.setOpenId(session.getOpenid()); user.setOpenId(session.getOpenid());
@ -248,10 +247,20 @@ public class WechatController {
@ApiOperation(value = "根据手机号码登陆") @ApiOperation(value = "根据手机号码登陆")
public ResponseData loginByTel(@RequestParam(value = "phone", required = true) String phone, public ResponseData loginByTel(@RequestParam(value = "phone", required = true) String phone,
@RequestParam(value = "code", required = true) String code, @RequestParam(value = "code", required = true) String code,
@RequestParam(value = "popularizeUserId", required = false) Long popularizeUserId,
@RequestParam(value = "regionId", required = false) String regionId,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
try { try {
// 获取手机号验证码
String phoneSmsCode = (String) redisUtil.get("SMS_"+ phone);
// 验证码校验
if (!(StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,code))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误");
}
// 根据手机号查询用户 // 根据手机号查询用户
HighUser user = highUserService.findByPhone(phone); HighUser user = highUserService.findByPhone(phone);
@ -267,30 +276,60 @@ public class WechatController {
// 1:需要填写用户信息 // 1:需要填写用户信息
// 2:需要填写手机号 // 2:需要填写手机号
user.setInfoCompleteStatus(1); user.setInfoCompleteStatus(1);
highUserService.insertUser(user); highUserService.insertUser(user , popularizeUserId , regionId);
} }
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
// 获取手机号验证码 } catch (Exception e) {
String phoneSmsCode = (String) redisUtil.get("SMS_"+ phone); return ResponseMsgUtil.exception(e);
}
}
// 验证码校验 @RequestMapping(value = "/loginBySilence", method = RequestMethod.GET)
if (StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,code)) { @ResponseBody
// 定义个人所有数据 @ApiOperation(value = "根据手机号码登陆")
HighUserModel highUserModel = new HighUserModel(); public ResponseData loginByTel(@RequestParam(value = "phone", required = true) String phone,
HighUser detailData = highUserService.getDetailDataByUser(user.getId()); HttpServletRequest request, HttpServletResponse response) {
detailData.setPassword(null); try {
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误");
}
// 根据手机号查询用户
HighUser user = highUserService.findByPhone(phone);
if (user == null) {
user = new HighUser();
user.setName("用户" + IDGenerator.nextId(5));
user.setPhone(phone);
user.setRegTime(new Date());
user.setGold(0);
user.setStatus(1);
// 用户信息完整状态
// 0:完整
// 1:需要填写用户信息
// 2:需要填写手机号
user.setInfoCompleteStatus(1);
highUserService.insertUser(user , null , null);
}
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
} catch (Exception e) { } catch (Exception e) {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
} }

@ -23,3 +23,5 @@ imgUrl=https://hsgcs.dctpay.com/filesystem/
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/hsg/filesystem/cmsPath
couponCodePath=/home/project/hsg/filesystem/couponCode couponCodePath=/home/project/hsg/filesystem/couponCode
qrCodeUrl=https://hsgcs.dctpay.com/hsgH5?accountId=0000010&key=&code=

@ -21,3 +21,6 @@ imgUrl=https://hsg.dctpay.com/filesystem/
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/hsg/filesystem/cmsPath
couponCodePath=/home/project/hsg/filesystem/couponCode couponCodePath=/home/project/hsg/filesystem/couponCode
qrCodeUrl=https://hsg.dctpay.com/hsgH5?accountId=0000010&key=&code=

@ -23,3 +23,6 @@ imgUrl=https://hsg.dctpay.com/filesystem/
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/hsg/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/hsg/filesystem/cmsPath
couponCodePath=/home/project/hsg/filesystem/couponCode couponCodePath=/home/project/hsg/filesystem/couponCode
qrCodeUrl=https://hsg.dctpay.com/hsgH5?accountId=0000010&key=&code=

@ -431,6 +431,14 @@ public class HighOrderSchedule {
} }
} }
} }
/**
* @Author Sum1Dream
* @name integralRebateOrder.java
* @Description // 执行返利操作
* @Date 15:13 2022/8/22
* @Param []
* @return void
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void integralRebateOrder() { public void integralRebateOrder() {
List<HighOrder> order = highOrderService.integralRebateOrder(); List<HighOrder> order = highOrderService.integralRebateOrder();
@ -446,6 +454,7 @@ public class HighOrderSchedule {
if (goldRecs.size() == 0) { if (goldRecs.size() == 0) {
List<HighChildOrder> childOrderList = highOrderService.getChildOrderByOrder(highOrder.getId()); List<HighChildOrder> childOrderList = highOrderService.getChildOrderByOrder(highOrder.getId());
// 查询订单来源
JSONObject object = highOrderService.orderSource(childOrderList.get(0).getGoodsType() , childOrderList.get(0).getGoodsId(),highOrder.getOrderNo() , highOrder.getCompanyId()); JSONObject object = highOrderService.orderSource(childOrderList.get(0).getGoodsType() , childOrderList.get(0).getGoodsId(),highOrder.getOrderNo() , highOrder.getCompanyId());
object.put("price" , highOrder.getPayRealPrice()); object.put("price" , highOrder.getPayRealPrice());

@ -32,14 +32,4 @@ public class QRCodeGenerator {
} }
public static void main(String[] args) {
try {
generateQRCodeImage("This is my first QR Code", 350, 350, "D:\\/ss/qr1.png");
} catch (WriterException e) {
System.out.println("Could not generate QR Code, WriterException :: " + e.getMessage());
} catch (IOException e) {
System.out.println("Could not generate QR Code, IOException :: " + e.getMessage());
}
}
} }

@ -0,0 +1,307 @@
package com.hai.common.utils;
import com.hai.common.QRCodeGenerator;
import com.hai.config.CommonSysConst;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Objects;
/**
* 图片处理
*/
public class ImageUtils {
public static void main(String[] args) throws Exception {
String a = ImageToBase64ByOnline("https://oos.jyfwy.cn/common/test/test20210511.jpg");
System.out.println(a);
}
public static String transferAlphaForHttp(InputStream inputStream){
try {
byte[] data = transferAlpha(null,inputStream,130);
return byteArrayToBase64(data);
}catch (Exception e){
e.printStackTrace();
}
return "";
}
public static String byteArrayToBase64(byte[] bytes) {
BASE64Encoder encoder = new BASE64Encoder();
String png_base64 = encoder.encodeBuffer(bytes).trim();//转换成base64串
png_base64 = png_base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n
System.out.println("值为:" + "data:image/jpg;base64," + png_base64);
return "data:image/jpg;base64," + png_base64;
}
/**
* 图片去白色的背景并裁切
*
* @param image 图片
* @param range 范围 1-255 越大 容错越高 去掉的背景越多
* @return 图片
* @throws Exception 异常
*/
public static byte[] transferAlpha(Image image, InputStream in, int range) throws Exception {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
if (image == null && in != null) {
image = ImageIO.read(in);
}
ImageIcon imageIcon = new ImageIcon(image);
BufferedImage bufferedImage = new BufferedImage(imageIcon
.getIconWidth(), imageIcon.getIconHeight(),
BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics();
g2D.drawImage(imageIcon.getImage(), 0, 0, imageIcon
.getImageObserver());
int alpha = 0;
int minX = bufferedImage.getWidth();
int minY = bufferedImage.getHeight();
int maxX = 0;
int maxY = 0;
for (int j1 = bufferedImage.getMinY(); j1 < bufferedImage
.getHeight(); j1++) {
for (int j2 = bufferedImage.getMinX(); j2 < bufferedImage
.getWidth(); j2++) {
int rgb = bufferedImage.getRGB(j2, j1);
int R = (rgb & 0xff0000) >> 16;
int G = (rgb & 0xff00) >> 8;
int B = (rgb & 0xff);
if (((255 - R) < range) && ((255 - G) < range) && ((255 - B) < range)) { //去除白色背景;
rgb = ((alpha + 1) << 24) | (rgb & 0x00ffffff);
} else {
minX = minX <= j2 ? minX : j2;
minY = minY <= j1 ? minY : j1;
maxX = maxX >= j2 ? maxX : j2;
maxY = maxY >= j1 ? maxY : j1;
}
bufferedImage.setRGB(j2, j1, rgb);
}
}
int width = maxX - minX;
int height = maxY - minY;
BufferedImage sub = bufferedImage.getSubimage(minX, minY, width, height);
ImageIO.write(sub, "png", byteArrayOutputStream);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
return byteArrayOutputStream.toByteArray();
}
public static byte[] transferAlphaAndRotate(Image image, InputStream in, int range, double angel) throws Exception {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
if (image == null && in != null) {
image = ImageIO.read(in);
}
image = imageRotate(image,angel);
ImageIcon imageIcon = new ImageIcon(image);
BufferedImage bufferedImage = new BufferedImage(imageIcon
.getIconWidth(), imageIcon.getIconHeight(),
BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2D = (Graphics2D) bufferedImage.getGraphics();
g2D.drawImage(imageIcon.getImage(), 0, 0, imageIcon
.getImageObserver());
int alpha = 0;
int minX = bufferedImage.getWidth();
int minY = bufferedImage.getHeight();
int maxX = 0;
int maxY = 0;
for (int j1 = bufferedImage.getMinY(); j1 < bufferedImage
.getHeight(); j1++) {
for (int j2 = bufferedImage.getMinX(); j2 < bufferedImage
.getWidth(); j2++) {
int rgb = bufferedImage.getRGB(j2, j1);
int R = (rgb & 0xff0000) >> 16;
int G = (rgb & 0xff00) >> 8;
int B = (rgb & 0xff);
if (((255 - R) < range) && ((255 - G) < range) && ((255 - B) < range)) { //去除白色背景;
rgb = ((alpha + 1) << 24) | (rgb & 0x00ffffff);
} else {
minX = minX <= j2 ? minX : j2;
minY = minY <= j1 ? minY : j1;
maxX = maxX >= j2 ? maxX : j2;
maxY = maxY >= j1 ? maxY : j1;
}
bufferedImage.setRGB(j2, j1, rgb);
}
}
int width = maxX - minX;
int height = maxY - minY;
BufferedImage sub = bufferedImage.getSubimage(minX, minY, width, height);
ImageIO.write(sub, "png", byteArrayOutputStream);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
return byteArrayOutputStream.toByteArray();
}
/**
* 图像旋转
* @param src
* @param angel
* @return
*/
public static BufferedImage imageRotate(Image src, double angel) {
int src_width = src.getWidth(null);
int src_height = src.getHeight(null);
// calculate the new image size
Rectangle rect_des = CalcRotatedSize(new Rectangle(new Dimension(
src_width, src_height)), angel);
BufferedImage res = null;
res = new BufferedImage(rect_des.width, rect_des.height,
BufferedImage.TYPE_3BYTE_BGR);
Graphics2D g2 = res.createGraphics();
// transform
g2.translate((rect_des.width - src_width) / 2,
(rect_des.height - src_height) / 2);
g2.rotate(Math.toRadians(angel), src_width / 2, src_height / 2);
g2.drawImage(src, null, null);
return res;
}
public static Rectangle CalcRotatedSize(Rectangle src, double angel) {
// if angel is greater than 90 degree, we need to do some conversion
if (angel >= 90) {
if(angel / 90 % 2 == 1){
int temp = src.height;
src.height = src.width;
src.width = temp;
}
angel = angel % 90;
}
double r = Math.sqrt(src.height * src.height + src.width * src.width) / 2;
double len = 2 * Math.sin(Math.toRadians(angel) / 2) * r;
double angel_alpha = (Math.PI - Math.toRadians(angel)) / 2;
double angel_dalta_width = Math.atan((double) src.height / src.width);
double angel_dalta_height = Math.atan((double) src.width / src.height);
int len_dalta_width = (int) (len * Math.cos(Math.PI - angel_alpha
- angel_dalta_width));
len_dalta_width=len_dalta_width>0?len_dalta_width:-len_dalta_width;
int len_dalta_height = (int) (len * Math.cos(Math.PI - angel_alpha
- angel_dalta_height));
len_dalta_height=len_dalta_height>0?len_dalta_height:-len_dalta_height;
int des_width = src.width + len_dalta_width * 2;
int des_height = src.height + len_dalta_height * 2;
des_width=des_width>0?des_width:-des_width;
des_height=des_height>0?des_height:-des_height;
return new Rectangle(new Dimension(des_width, des_height));
}
/**
* base64转inputStream
* @param base64string
* @return
*/
public static InputStream BaseToInputStream(String base64string){
ByteArrayInputStream stream = null;
try {
BASE64Decoder decoder = new BASE64Decoder();
byte[] bytes1 = decoder.decodeBuffer(base64string);
stream = new ByteArrayInputStream(bytes1);
} catch (Exception e) {
// TODO: handle exception
}
return stream;
}
/**
* 获取网络图片流
*
* @param url
* @return
*/
public static InputStream getImageStream(String url) {
try {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
connection.setReadTimeout(5000);
connection.setConnectTimeout(5000);
connection.setRequestMethod("GET");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
InputStream inputStream = connection.getInputStream();
return inputStream;
}
} catch (IOException e) {
System.out.println("获取网络图片出现异常,图片路径为:" + url);
e.printStackTrace();
}
return null;
}
public static String ImageToBase64ByOnline(String imgURL) {
ByteArrayOutputStream data = new ByteArrayOutputStream();
try {
// 创建URL
URL url = new URL(imgURL);
byte[] by = new byte[1024];
// 创建链接
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(5000);
InputStream is = conn.getInputStream();
// 将内容读取内存中
int len = -1;
while ((len = is.read(by)) != -1) {
data.write(by, 0, len);
}
// 关闭流
is.close();
} catch (IOException e) {
e.printStackTrace();
}
// 对字节数组Base64编码
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(data.toByteArray());
}
public static String ImageToBase64(String imgPath) {
byte[] data = null;
// 读取图片字节数组
try {
InputStream in = new FileInputStream(imgPath);
data = new byte[in.available()];
in.read(data);
in.close();
} catch (IOException e) {
e.printStackTrace();
}
// 对字节数组Base64编码
BASE64Encoder encoder = new BASE64Encoder();
// 返回Base64编码过的字节数组字符串
return encoder.encode(Objects.requireNonNull(data));
}
public static String QrCodeImg(String imgPath , Integer id) throws Exception {
// 生成二维码
String qrCodeImg = "qrCode/" + id + ".png";
String qrCodeUrl = CommonSysConst.getSysConfig().getFileUrl() + qrCodeImg;
QRCodeGenerator.generateQRCodeImage(imgPath + id, 134, 134, qrCodeUrl);
return qrCodeImg;
}
}

@ -28,5 +28,8 @@ public class TelApiUtil {
return m.matches(); return m.matches();
} }
public static String phoneDesensitization(String phone) {
return phone.substring(0,3) + "****" + phone.substring(phone.length() - 4);
}
} }

@ -484,7 +484,7 @@ public class WxUtils {
Arrays.sort(keyArray); Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (String k : keyArray) { for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) { if (k.equals(WXPayConstants.FIELD_SIGN) || k.equals("apiKey")) {
continue; continue;
} }
if (data.get(k) != null) // 参数值为空,则不参与签名 if (data.get(k) != null) // 参数值为空,则不参与签名

@ -0,0 +1,169 @@
package com.hai.config;
import org.springframework.context.annotation.Configuration;
import sun.font.FontDesignMetrics;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* @serviceName QrCodeUtilsConfig.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 工具
* @createTime 09:54 2022/4/13
**/
@Configuration
public class CommonConfig {
//得到该字体字符串的长度
public static int getWordWidth(Font font, String content) {
FontDesignMetrics metrics = FontDesignMetrics.getMetrics(font);
int width = 0;
for (int i = 0; i < content.length(); i++) {
width += metrics.charWidth(content.charAt(i));
}
return width;
}
// 二维码生产自定义图片
public static void overlapImage(String path , String content) throws Exception {
BufferedImage read = ImageIO.read(new File(CommonSysConst.getSysConfig().getFileUrl() + "img/original_image.png"));
Image image = ImageIO.read(new File(CommonSysConst.getSysConfig().getFileUrl() + "/" + path));
Graphics graphics = read.getGraphics();
graphics.drawImage(image, (read.getWidth() - image.getWidth(null))/2 ,306, null);
graphics.setColor(Color.BLACK);
//定义字体
Font font = new Font("微软雅黑", Font.PLAIN, 14);
//计算该字体文本的长度
int wordWidth = CommonConfig.getWordWidth(font, content);
graphics.setFont(font);
graphics.drawString( content, (read.getWidth() - wordWidth)/2 ,304 + image.getHeight(null));
ImageIO.write(read , "png" , new File(CommonSysConst.getSysConfig().getFileUrl() + "/" + path));
}
/**
* 多文件压缩成ZIP
*
* @param imageMap 需要压缩的文件列表键值对为 <文件名文件的字节数组>文件名必须包含后缀
* @param out 压缩文件输出流
* @throws RuntimeException 压缩失败会抛出运行时异常
*/
public static void toZip(Map<String, byte[]> imageMap, OutputStream out) throws RuntimeException {
long start = System.currentTimeMillis();
try (ZipOutputStream zos = new ZipOutputStream(out)) {
for (Map.Entry<String, byte[]> map : imageMap.entrySet()) {
zos.putNextEntry(new ZipEntry(map.getKey()));
zos.write(map.getValue());
zos.closeEntry();
}
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
}
}
/**
*
* 文件夹压缩成ZIP
*
* @param srcDir 压缩文件夹路径
* @param out 压缩文件输出流
* @param keepDirStructure 是否保留原来的目录结构,true:保留目录结构;
*
* false:所有文件跑到压缩包根目录下(注意不保留目录结构可能会出现同名文件,会压缩失败)
*
* @throws RuntimeException 压缩失败会抛出运行时异常
*
*/
public static void toZip(String srcDir, OutputStream out, boolean keepDirStructure)
throws RuntimeException {
long start = System.currentTimeMillis();
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(out);
File sourceFile = new File(srcDir);
compress(sourceFile, zos, sourceFile.getName(), keepDirStructure);
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
} finally {
if (zos != null) {
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
*
* 递归压缩方法
* @param sourceFile 源文件
* @param zos zip输出流
* @param name 压缩后的名称
* @param keepDirStructure 是否保留原来的目录结构,true:保留目录结构;
*
* false:所有文件跑到压缩包根目录下(注意不保留目录结构可能会出现同名文件,会压缩失败)
* @throws Exception
*/
private static void compress(File sourceFile, ZipOutputStream zos, String name, boolean keepDirStructure) throws Exception {
byte[] buf = new byte[2048];
if (sourceFile.isFile()) {
// 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
zos.putNextEntry(new ZipEntry(name));
// copy文件到zip输出流中
int len;
FileInputStream in = new FileInputStream(sourceFile);
while ((len = in.read(buf)) != -1) {
zos.write(buf, 0, len);
}
// Complete the entry
zos.closeEntry();
in.close();
} else {
File[] listFiles = sourceFile.listFiles();
if (listFiles == null || listFiles.length == 0) {
// 需要保留原来的文件结构时,需要对空文件夹进行处理
if (keepDirStructure) {
// 空文件夹的处理
zos.putNextEntry(new ZipEntry(name + "/"));
// 没有文件,不需要文件的copy
zos.closeEntry();
}
} else {
for (File file : listFiles) {
// 判断是否需要保留原来的文件结构
if (keepDirStructure) {
// 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
// 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
compress(file, zos, name + "/" + file.getName(), keepDirStructure);
} else {
compress(file, zos, file.getName(), keepDirStructure);
}
}
}
}
}
}

@ -99,6 +99,8 @@ public class CommonSysConfig {
private String unionSecret; private String unionSecret;
private String unionRsaKey; private String unionRsaKey;
private String fileUrl;
public String getJzAppId() { public String getJzAppId() {
return jzAppId; return jzAppId;
} }
@ -643,4 +645,12 @@ public class CommonSysConfig {
public void setGasDefaultOilStationImg(String gasDefaultOilStationImg) { public void setGasDefaultOilStationImg(String gasDefaultOilStationImg) {
this.gasDefaultOilStationImg = gasDefaultOilStationImg; this.gasDefaultOilStationImg = gasDefaultOilStationImg;
} }
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
} }

@ -1,7 +1,29 @@
package com.hai.dao; package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.Map;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface BsDistributionRebateMapperExt { public interface BsDistributionRebateMapperExt {
}
@Select({
"<script> " +
" select count(*) as count , sum(integral_num) as sum from bs_distribution_rebate where popularize_user_id = #{userId} " +
"</script>"
})
Map<String, Object> countDistribution(@Param("userId") Long userId);
@Select({
"<script> " +
" SELECT sum(integral_num) FROM bs_distribution_rebate WHERE DATEDIFF(create_time,NOW())=0 and popularize_user_id = #{userId} " +
"</script>"
})
BigDecimal toDayIntegralNum(@Param("userId") Long userId);
}

@ -42,15 +42,15 @@ public interface BsDistributionUserRelMapper extends BsDistributionUserRelMapper
"insert into bs_distribution_user_rel (agent_id, agent_name, ", "insert into bs_distribution_user_rel (agent_id, agent_name, ",
"popularize_user_id, popularize_user_name, ", "popularize_user_id, popularize_user_name, ",
"user_id, user_name, ", "user_id, user_name, ",
"create_time, update_time, ", "phone, create_time, ",
"`status`, ext_1, ext_2, ", "update_time, `status`, ",
"ext_3)", "ext_1, ext_2, ext_3)",
"values (#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ", "values (#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
"#{popularizeUserId,jdbcType=BIGINT}, #{popularizeUserName,jdbcType=VARCHAR}, ", "#{popularizeUserId,jdbcType=BIGINT}, #{popularizeUserName,jdbcType=VARCHAR}, ",
"#{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, ", "#{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", "#{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsDistributionUserRel record); int insert(BsDistributionUserRel record);
@ -68,6 +68,7 @@ public interface BsDistributionUserRelMapper extends BsDistributionUserRelMapper
@Result(column="popularize_user_name", property="popularizeUserName", jdbcType=JdbcType.VARCHAR), @Result(column="popularize_user_name", property="popularizeUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -80,7 +81,7 @@ public interface BsDistributionUserRelMapper extends BsDistributionUserRelMapper
@Select({ @Select({
"select", "select",
"id, agent_id, agent_name, popularize_user_id, popularize_user_name, user_id, ", "id, agent_id, agent_name, popularize_user_id, popularize_user_name, user_id, ",
"user_name, create_time, update_time, `status`, ext_1, ext_2, ext_3", "user_name, phone, create_time, update_time, `status`, ext_1, ext_2, ext_3",
"from bs_distribution_user_rel", "from bs_distribution_user_rel",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -92,6 +93,7 @@ public interface BsDistributionUserRelMapper extends BsDistributionUserRelMapper
@Result(column="popularize_user_name", property="popularizeUserName", jdbcType=JdbcType.VARCHAR), @Result(column="popularize_user_name", property="popularizeUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -118,6 +120,7 @@ public interface BsDistributionUserRelMapper extends BsDistributionUserRelMapper
"popularize_user_name = #{popularizeUserName,jdbcType=VARCHAR},", "popularize_user_name = #{popularizeUserName,jdbcType=VARCHAR},",
"user_id = #{userId,jdbcType=BIGINT},", "user_id = #{userId,jdbcType=BIGINT},",
"user_name = #{userName,jdbcType=VARCHAR},", "user_name = #{userName,jdbcType=VARCHAR},",
"phone = #{phone,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",

@ -1,7 +1,42 @@
package com.hai.dao; package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface BsDistributionUserRelMapperExt { public interface BsDistributionUserRelMapperExt {
}
@Select({
"<script> " +
" select agent_id as agentId , agent_name as agentName from bs_distribution_user_rel where status = 100 group by agent_id " +
"</script>"
})
List<Map<String , Object>> getDistributionAgent();
@Select({
"<script> " +
" select user_id as userId , user_name as userName from bs_distribution_user_rel where popularize_user_id is null and status = 100 " +
"<if test='agentId != null'> and agent_id = #{agentId} </if>" +
" group by user_id; " +
"</script>"
})
List<Map<String , Object>> getDistributionFirst(@Param("agentId") Long agentId);
@Select({
"<script> " +
" select user_id as userId , user_name as userName from bs_distribution_user_rel where status = 100 " +
"<if test='agentId != null'> and agent_id = #{agentId} </if>" +
"<if test='popularizeUserId != null'> and popularize_user_id = #{popularizeUserId} </if>" +
"<if test='popularizeUserId == null'> and popularize_user_id is not null </if>" +
" group by user_id; " +
"</script>"
})
List<Map<String , Object>> getDistributionSecond(@Param("agentId") Long agentId , @Param("popularizeUserId") Long popularizeUserId);
}

@ -52,6 +52,10 @@ public class BsDistributionUserRelSqlProvider {
sql.VALUES("user_name", "#{userName,jdbcType=VARCHAR}"); sql.VALUES("user_name", "#{userName,jdbcType=VARCHAR}");
} }
if (record.getPhone() != null) {
sql.VALUES("phone", "#{phone,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
} }
@ -92,6 +96,7 @@ public class BsDistributionUserRelSqlProvider {
sql.SELECT("popularize_user_name"); sql.SELECT("popularize_user_name");
sql.SELECT("user_id"); sql.SELECT("user_id");
sql.SELECT("user_name"); sql.SELECT("user_name");
sql.SELECT("phone");
sql.SELECT("create_time"); sql.SELECT("create_time");
sql.SELECT("update_time"); sql.SELECT("update_time");
sql.SELECT("`status`"); sql.SELECT("`status`");
@ -143,6 +148,10 @@ public class BsDistributionUserRelSqlProvider {
sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}"); sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
} }
if (record.getPhone() != null) {
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
} }
@ -182,6 +191,7 @@ public class BsDistributionUserRelSqlProvider {
sql.SET("popularize_user_name = #{record.popularizeUserName,jdbcType=VARCHAR}"); sql.SET("popularize_user_name = #{record.popularizeUserName,jdbcType=VARCHAR}");
sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); sql.SET("user_id = #{record.userId,jdbcType=BIGINT}");
sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}"); sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
sql.SET("phone = #{record.phone,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -222,6 +232,10 @@ public class BsDistributionUserRelSqlProvider {
sql.SET("user_name = #{userName,jdbcType=VARCHAR}"); sql.SET("user_name = #{userName,jdbcType=VARCHAR}");
} }
if (record.getPhone() != null) {
sql.SET("phone = #{phone,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
} }

@ -1,7 +1,14 @@
package com.hai.dao; package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Map;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface BsRequestRecordMapperExt { public interface BsRequestRecordMapperExt {
}
}

@ -264,4 +264,4 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
int updateByPrimaryKey(HighOrder record); int updateByPrimaryKey(HighOrder record);
} }

@ -48,6 +48,11 @@ public class BsDistributionUserRel implements Serializable {
*/ */
private String userName; private String userName;
/**
* 用户手机号码
*/
private String phone;
/** /**
* 创建时间 * 创建时间
*/ */
@ -136,6 +141,14 @@ public class BsDistributionUserRel implements Serializable {
this.userName = userName; this.userName = userName;
} }
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
@ -203,6 +216,7 @@ public class BsDistributionUserRel implements Serializable {
&& (this.getPopularizeUserName() == null ? other.getPopularizeUserName() == null : this.getPopularizeUserName().equals(other.getPopularizeUserName())) && (this.getPopularizeUserName() == null ? other.getPopularizeUserName() == null : this.getPopularizeUserName().equals(other.getPopularizeUserName()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -222,6 +236,7 @@ public class BsDistributionUserRel implements Serializable {
result = prime * result + ((getPopularizeUserName() == null) ? 0 : getPopularizeUserName().hashCode()); result = prime * result + ((getPopularizeUserName() == null) ? 0 : getPopularizeUserName().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -244,6 +259,7 @@ public class BsDistributionUserRel implements Serializable {
sb.append(", popularizeUserName=").append(popularizeUserName); sb.append(", popularizeUserName=").append(popularizeUserName);
sb.append(", userId=").append(userId); sb.append(", userId=").append(userId);
sb.append(", userName=").append(userName); sb.append(", userName=").append(userName);
sb.append(", phone=").append(phone);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", status=").append(status); sb.append(", status=").append(status);
@ -254,4 +270,4 @@ public class BsDistributionUserRel implements Serializable {
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
} }

@ -575,6 +575,76 @@ public class BsDistributionUserRelExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPhoneIsNull() {
addCriterion("phone is null");
return (Criteria) this;
}
public Criteria andPhoneIsNotNull() {
addCriterion("phone is not null");
return (Criteria) this;
}
public Criteria andPhoneEqualTo(String value) {
addCriterion("phone =", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotEqualTo(String value) {
addCriterion("phone <>", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThan(String value) {
addCriterion("phone >", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneGreaterThanOrEqualTo(String value) {
addCriterion("phone >=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThan(String value) {
addCriterion("phone <", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLessThanOrEqualTo(String value) {
addCriterion("phone <=", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneLike(String value) {
addCriterion("phone like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotLike(String value) {
addCriterion("phone not like", value, "phone");
return (Criteria) this;
}
public Criteria andPhoneIn(List<String> values) {
addCriterion("phone in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotIn(List<String> values) {
addCriterion("phone not in", values, "phone");
return (Criteria) this;
}
public Criteria andPhoneBetween(String value1, String value2) {
addCriterion("phone between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andPhoneNotBetween(String value1, String value2) {
addCriterion("phone not between", value1, value2, "phone");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;

@ -246,6 +246,36 @@ public class HighOrder implements Serializable {
private String password; private String password;
private String time;
private String goodsTypeName;
private String agentName;
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getGoodsTypeName() {
return goodsTypeName;
}
public void setGoodsTypeName(String goodsTypeName) {
this.goodsTypeName = goodsTypeName;
}
/** /**
* 是否自动充值积分 0 1 * 是否自动充值积分 0 1
*/ */

@ -9,7 +9,11 @@ public enum GoodsType {
goodsType3(3 , "团油"), goodsType3(3 , "团油"),
goodsType4(4 , "KFC"), goodsType4(4 , "KFC"),
goodsType5(5 , "电影票"), goodsType5(5 , "电影票"),
goodsType6(6 , "话费充值") goodsType6(6 , "话费充值"),
goodsType7(7 , "优惠卷包"),
goodsType8(8 , "汇联通充值"),
goodsType9(9 , "星巴克"),
goodsType10(10 , "会员充值"),
; ;
private Integer type; private Integer type;

@ -0,0 +1,49 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* 产品图片
* @author hurui
*/
public enum OrderLogoEnum {
name1("orderLogo/coupon.png", 1),
name3("orderLogo/refuel.png", 3),
name4("orderLogo/kfc.png", 4),
name9("orderLogo/starbucks.png", 9),
name10("orderLogo/member-recharge.png", 10),
name20("orderLogo/call-charges.png", 20),
;
private String imgUrl;
private Integer type;
public static String getNameByImgUrl(Integer type) {
for (OrderLogoEnum ele : values()) {
if(Objects.equals(type,ele.getType())) return ele.getImgUrl();
}
return null;
}
OrderLogoEnum(String imgUrl, Integer type) {
this.imgUrl = imgUrl;
this.type = type;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
}

@ -1,7 +1,9 @@
package com.hai.service; package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.BsDistributionRebate; import com.hai.entity.BsDistributionRebate;
import com.hai.entity.BsDistributionUserRel; import com.hai.entity.BsDistributionUserRel;
import com.hai.entity.HighUser;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -23,7 +25,7 @@ public interface BsDistributionUserRelService {
* @Param [java.lang.Long, java.lang.Long] * @Param [java.lang.Long, java.lang.Long]
* @return void * @return void
*/ */
void insertDistributionRebate(Long userId , String userName, Long popularizeUserId); void insertDistributionRebate(Long userId , Long popularizeUserId , String regionId);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
@ -44,4 +46,86 @@ public interface BsDistributionUserRelService {
* @return com.hai.entity.BsDistributionUserRel * @return com.hai.entity.BsDistributionUserRel
*/ */
BsDistributionUserRel findDistributionUserRel(Map<String, Object> map); BsDistributionUserRel findDistributionUserRel(Map<String, Object> map);
/**
* @Author Sum1Dream
* @name distributionRebate.java
* @Description // 分销返利
* @Date 14:24 2022/8/15
* @Param [com.alibaba.fastjson.JSONObject]
* @return void
*/
void distributionRebate(JSONObject object);
/**
* @Author Sum1Dream
* @name userDistributionStatistics.java
* @Description // 用户分销统计
* @Date 10:50 2022/8/16
* @Param [java.lang.Long]
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject userDistributionStatistics(Long userId);
/**
* @Author Sum1Dream
* @name getDistributionRebateList.java
* @Description //TODO
* @Date 15:52 2022/8/18
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.BsDistributionRebate>
*/
List<BsDistributionRebate> getDistributionRebateList(Map<String, Object> map) throws Exception;
/**
* @Author Sum1Dream
* @name getDistributionAgent.java
* @Description // 查询分销代理商
* @Date 16:11 2022/8/18
* @Param []
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
*/
List<Map<String , Object>> getDistributionAgent();
/**
* @Author Sum1Dream
* @name getDistributionFirst.java
* @Description // 查询一级分销
* @Date 16:27 2022/8/18
* @Param []
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
*/
List<Map<String , Object>> getDistributionFirst(Long agentId);
/**
* @Author Sum1Dream
* @name getDistributionSecond.java
* @Description // 查询二级分销
* @Date 16:27 2022/8/18
* @Param []
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
*/
List<Map<String , Object>> getDistributionSecond(Long agentId , Long popularizeUserId);
/**
* @Author Sum1Dream
* @name getDistributionIntegralList.java
* @Description // 查询分销积分列表
* @Date 17:10 2022/8/18
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.BsDistributionRebate>
*/
List<BsDistributionRebate> getDistributionIntegralList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name agentUserList.java
* @Description // 查询代理商用户
* @Date 15:21 2022/8/19
* @Param []
* @return java.util.List<com.hai.entity.HighUser>
*/
List<HighUser> agentUserList();
} }

@ -562,4 +562,25 @@ public interface HighOrderService {
* @return com.alibaba.fastjson.JSONObject * @return com.alibaba.fastjson.JSONObject
*/ */
JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId); JSONObject orderSource(Integer goodsType , Long goodsId , String orderNo , Long companyId);
/**
* @Author Sum1Dream
* @name promoteOrderList.java
* @Description // 根据渠道商编码查询订单
* @Date 16:10 2022/8/19
* @Param [java.lang.Long]
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> promoteOrderList(Long identificationCode) throws Exception;
/**
* @Author Sum1Dream
* @name orderListByAgentId.java
* @Description // B端查询代理商订单
* @Date 16:11 2022/8/19
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> orderListByAgentId(Map<String , Object> map) throws Exception;
} }

@ -1,5 +1,6 @@
package com.hai.service; package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighUser; import com.hai.entity.HighUser;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -99,7 +100,7 @@ public interface HighUserService {
* @param: [highUser] 用户信息 * @param: [highUser] 用户信息
* @return: com.hai.entity.HighUser * @return: com.hai.entity.HighUser
*/ */
void insertUser(HighUser highUser); void insertUser(HighUser highUser , Long popularizeUserId , String regionId);
/** /**
* @Author 胡锐 * @Author 胡锐
@ -121,4 +122,15 @@ public interface HighUserService {
Long countUser(); Long countUser();
/**
* @Author Sum1Dream
* @name userDistributionStatistics.java
* @Description // 用户分销统计
* @Date 10:00 2022/8/16
* @Param [java.lang.Long]
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject userDistributionStatistics(Long userId);
} }

@ -1,12 +1,15 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.TelApiUtil;
import com.hai.dao.BsDistributionRebateMapper; import com.hai.dao.BsDistributionRebateMapper;
import com.hai.dao.BsDistributionUserRelMapper; import com.hai.dao.BsDistributionUserRelMapper;
import com.hai.entity.BsDistributionRebate; import com.hai.dao.HighUserMapper;
import com.hai.entity.BsDistributionUserRel; import com.hai.entity.*;
import com.hai.entity.BsDistributionUserRelExample; import com.hai.service.*;
import com.hai.service.BsDistributionUserRelService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -21,8 +24,29 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
@Resource @Resource
private BsDistributionUserRelMapper bsDistributionUserRelMapper; private BsDistributionUserRelMapper bsDistributionUserRelMapper;
@Resource
private HighDiscountPackageService highDiscountPackageService;
@Resource
private BsDistributionRebateMapper bsDistributionRebateMapper;
@Resource
private HighUserService highUserService;
@Resource
private BsCompanyService bsCompanyService;
@Resource
private CommonService commonService;
@Resource
private HighUserMapper highUserMapper;
@Override @Override
public void insertDistributionRebate(Long userId, String userName , Long popularizeUserId) { public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) {
HighUser user = highUserService.findByUserId(userId);
HighUser pUser = highUserService.findByUserId(popularizeUserId);
// 定义分销关联关系 // 定义分销关联关系
BsDistributionUserRel distributionUserRel = new BsDistributionUserRel(); BsDistributionUserRel distributionUserRel = new BsDistributionUserRel();
@ -32,24 +56,78 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
map.put("userId" , popularizeUserId); map.put("userId" , popularizeUserId);
BsDistributionUserRel popularizeUser = findDistributionUserRel(map); BsDistributionUserRel popularizeUser = findDistributionUserRel(map);
if (pUser != null) {
if (pUser.getIsAgent() != null) {
distributionUserRel.setAgentId(pUser.getId());
distributionUserRel.setAgentName(pUser.getName());
} else {
if (popularizeUser != null) {
distributionUserRel.setAgentId(popularizeUser.getAgentId());
distributionUserRel.setAgentName(popularizeUser.getAgentName());
}
distributionUserRel.setPopularizeUserId(popularizeUserId);
distributionUserRel.setPopularizeUserName(pUser.getName());
}
distributionUserRel.setUserId(userId);
distributionUserRel.setUserName(user.getName());
distributionUserRel.setPhone(TelApiUtil.phoneDesensitization(user.getPhone()));
distributionUserRel.setCreateTime(new Date());
distributionUserRel.setUpdateTime(new Date());
distributionUserRel.setStatus(100);
bsDistributionUserRelMapper.insert(distributionUserRel);
new Thread(() -> {
try {
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId));
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
distributionUserRel.setUserId(userId); // 查询注册有礼优惠券包
distributionUserRel.setUserName(userName); HighDiscountPackage discountPackage = highDiscountPackageService.getCallExclusive(3 , bsCompany.getId().intValue());
distributionUserRel.setAgentId(popularizeUser.getAgentId()); Map<String, Object> freeMap = new HashMap<>();
distributionUserRel.setAgentName(popularizeUser.getAgentName()); freeMap.put("discountPackageId", discountPackage.getId());
distributionUserRel.setPopularizeUserId(popularizeUserId); freeMap.put("userId", userId);
distributionUserRel.setPopularizeUserName(popularizeUser.getUserName()); freeMap.put("userPhone", user.getPhone());
distributionUserRel.setCreateTime(new Date()); highDiscountPackageService.freeUserDiscountPackage(freeMap);
distributionUserRel.setUpdateTime(new Date());
distributionUserRel.setStatus(100);
bsDistributionUserRelMapper.insert(distributionUserRel); if (pUser.getIsAgent() == null) {
// 查询推广有礼优惠券包
HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue());
Map<String, Object> freeMap1 = new HashMap<>();
freeMap1.put("discountPackageId", promoteDiscountPackage.getId());
freeMap1.put("userId", pUser.getId());
freeMap1.put("userPhone", pUser.getPhone());
highDiscountPackageService.freeUserDiscountPackage(freeMap1);
}
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
} }
@Override @Override
public List<BsDistributionUserRel> getDistributionUserRelList(Map<String, Object> map) { public List<BsDistributionUserRel> getDistributionUserRelList(Map<String, Object> map) {
return null;
BsDistributionUserRelExample example = new BsDistributionUserRelExample();
BsDistributionUserRelExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
if (MapUtils.getLong(map , "popularizeUserId") != null) {
criteria.andPopularizeUserIdEqualTo(MapUtils.getLong(map , "popularizeUserId"));
}
return bsDistributionUserRelMapper.selectByExample(example);
} }
@Override @Override
@ -70,4 +148,160 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
return null; return null;
} }
@Override
public void distributionRebate(JSONObject object) {
HighUser user = highUserService.findByUserId(object.getLong("userId"));
// 查询下单用户上级推广员
Map<String , Object> mapSuper = new HashMap<>();
mapSuper.put("userId" , object.getLong("userId"));
BsDistributionUserRel distributionUserRel = findDistributionUserRel(mapSuper);
BsDistributionRebate distributionRebate = new BsDistributionRebate();
// 上级推广员返利
if (distributionUserRel != null) {
distributionRebate.setAgentId(distributionUserRel.getAgentId());
distributionRebate.setCreateTime(new Date());
distributionRebate.setUpdateTime(new Date());
distributionRebate.setStatus(100);
distributionRebate.setType(1);
distributionRebate.setUserName(user.getName());
distributionRebate.setUserId(object.getLong("userId"));
distributionRebate.setAgentId(distributionUserRel.getAgentId());
distributionUserRel.setAgentName(distributionUserRel.getAgentName());
distributionUserRel.setUserName(user.getName());
distributionRebate.setPopularizeUserId(distributionUserRel.getPopularizeUserId());
distributionRebate.setTitle(object.getString("title"));
distributionRebate.setIntegralNum(object.getBigDecimal("integralNumFirst"));
distributionRebate.setOrderNo(object.getString("orderNo"));
distributionRebate.setExt1(object.getString("logoImg"));
if (distributionUserRel.getPopularizeUserId() != null) {
bsDistributionRebateMapper.insert(distributionRebate);
// 上级返利
highUserService.goldHandle(distributionUserRel.getPopularizeUserId(), object.getInteger("integralNumFirst"), 1, 4, object.getLong("userId") , user.getName() + "下单:获得返利" + object.getInteger("integralNumFirst"));
// 查询下单用户顶级推广员
Map<String , Object> mapTop = new HashMap<>();
mapTop.put("userId" , distributionUserRel.getPopularizeUserId());
BsDistributionUserRel distributionUserRelTop = findDistributionUserRel(mapTop);
if (distributionUserRelTop != null) {
// 顶级推广员
if (distributionUserRelTop.getPopularizeUserId() != null) {
distributionRebate.setIntegralNum(object.getBigDecimal("integralNumSecond"));
distributionRebate.setPopularizeUserId(distributionUserRelTop.getPopularizeUserId());
distributionRebate.setType(2);
bsDistributionRebateMapper.insert(distributionRebate);
// 顶级返利
highUserService.goldHandle(distributionUserRelTop.getPopularizeUserId(), object.getInteger("integralNumSecond"), 1, 4, object.getLong("userId") , user.getName() + "下单:获得返利" + object.getInteger("integralNumSecond"));
}
}
}
}
}
@Override
public JSONObject userDistributionStatistics(Long userId) {
JSONObject jsonObject = new JSONObject();
BsDistributionUserRelExample example = new BsDistributionUserRelExample();
BsDistributionUserRelExample.Criteria criteria = example.createCriteria();
criteria.andPopularizeUserIdEqualTo(userId);
Map<String, Object> map = bsDistributionRebateMapper.countDistribution(userId);
jsonObject.put("inviteeNum" , bsDistributionUserRelMapper.countByExample(example));
jsonObject.put("integralIncome" , map.get("sum"));
jsonObject.put("orderCount" , map.get("count"));
jsonObject.put("toDayIntegralNum" , bsDistributionRebateMapper.toDayIntegralNum(userId));
return jsonObject;
}
@Override
public List<BsDistributionRebate> getDistributionRebateList(Map<String, Object> map) throws Exception {
BsDistributionRebateExample example = new BsDistributionRebateExample();
BsDistributionRebateExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
if (MapUtils.getLong(map , "popularizeUserId") != null) {
criteria.andPopularizeUserIdEqualTo(MapUtils.getLong(map , "popularizeUserId"));
}
List<BsDistributionRebate> list = bsDistributionRebateMapper.selectByExample(example);
for (BsDistributionRebate distributionRebate : list ) {
distributionRebate.setExt3(DateUtil.date2String(distributionRebate.getCreateTime() , "MM月dd日 HH:mm"));
}
return list;
}
@Override
public List<Map<String, Object>> getDistributionAgent() {
return bsDistributionUserRelMapper.getDistributionAgent();
}
@Override
public List<Map<String, Object>> getDistributionFirst(Long agentId) {
return bsDistributionUserRelMapper.getDistributionFirst(agentId);
}
@Override
public List<Map<String, Object>> getDistributionSecond(Long agentId, Long popularizeUserId) {
return bsDistributionUserRelMapper.getDistributionSecond(agentId , popularizeUserId);
}
@Override
public List<BsDistributionRebate> getDistributionIntegralList(Map<String, Object> map) {
BsDistributionRebateExample example = new BsDistributionRebateExample();
BsDistributionRebateExample.Criteria criteria = example.createCriteria();
if (MapUtils.getString(map, "title") != null) {
criteria.andTitleLike("%" + MapUtils.getString(map, "title") + "%");
}
if (MapUtils.getInteger(map, "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map, "type"));
}
if (MapUtils.getString(map, "orderNo") != null) {
criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo"));
}
if (MapUtils.getLong(map, "agentId") != null) {
criteria.andAgentIdEqualTo(MapUtils.getLong(map, "agentId"));
}
if (MapUtils.getLong(map, "popularizeUserId") != null) {
criteria.andPopularizeUserIdEqualTo(MapUtils.getLong(map, "popularizeUserId"));
}
if (MapUtils.getString(map, "userName") != null) {
criteria.andUserNameLike("%" + MapUtils.getString(map, "userName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "createTimeE"))) {
criteria.andCreateTimeBetween(
DateUtil.format(MapUtils.getString(map, "createTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(map, "createTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
example.setOrderByClause("create_time desc");
return bsDistributionRebateMapper.selectByExample(example);
}
@Override
public List<HighUser> agentUserList() {
HighUserExample example = new HighUserExample();
example.createCriteria().andIsAgentEqualTo(true).andStatusEqualTo(1);
return highUserMapper.selectByExample(example);
}
} }

@ -6,6 +6,7 @@ import com.hai.dao.BsIntegralRebateMapper;
import com.hai.entity.BsIntegralRebate; import com.hai.entity.BsIntegralRebate;
import com.hai.entity.BsIntegralRebateExample; import com.hai.entity.BsIntegralRebateExample;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.service.BsDistributionUserRelService;
import com.hai.service.BsIntegralRebateService; import com.hai.service.BsIntegralRebateService;
import com.hai.service.HighOrderService; import com.hai.service.HighOrderService;
import com.hai.service.HighUserService; import com.hai.service.HighUserService;
@ -30,6 +31,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
@Resource @Resource
private HighOrderService highOrderService; private HighOrderService highOrderService;
@Resource
private BsDistributionUserRelService bsDistributionUserRelService;
@Override @Override
public BsIntegralRebate findIntegralRebateByMap(Map<String, Object> map) { public BsIntegralRebate findIntegralRebateByMap(Map<String, Object> map) {
@ -111,13 +115,25 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
order.setWhetherRebate(true); order.setWhetherRebate(true);
BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP ); BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP );
BigDecimal integralNumFirst = object.getBigDecimal("price").multiply(bsIntegralRebate.getFirstDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP );
BigDecimal integralNumSecond = object.getBigDecimal("price").multiply(bsIntegralRebate.getSecondDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP );
/* order.setWhetherRebate(true);
HighOrder order = highOrderService.getOrderById(object.getLong("orderId"));
*/
JSONObject jsonObject = new JSONObject();
jsonObject.put("integralNumFirst" , integralNumFirst);
jsonObject.put("integralNumSecond" , integralNumSecond);
jsonObject.put("title" , object.getString("name"));
jsonObject.put("orderNo" , order.getOrderNo());
jsonObject.put("userId" , object.getLong("userId"));
jsonObject.put("logoImg" , object.getString("logoImg"));
bsDistributionUserRelService.distributionRebate(jsonObject);
highOrderService.updateOrder(order);
highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum); highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum);
} }

@ -402,7 +402,7 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
user.setGold(0); user.setGold(0);
user.setStatus(1); user.setStatus(1);
user.setInfoCompleteStatus(1); // 用户信息完整状态 0:完整 1:需要填写用户信息 2:需要填写手机号 user.setInfoCompleteStatus(1); // 用户信息完整状态 0:完整 1:需要填写用户信息 2:需要填写手机号
highUserService.insertUser(user); highUserService.insertUser(user , null , null);
// 赠送卷包 // 赠送卷包
Map<String, Object> freeMap = new HashMap<>(); Map<String, Object> freeMap = new HashMap<>();

@ -1608,6 +1608,11 @@ public class HighOrderServiceImpl implements HighOrderService {
if (MapUtils.getString(map, "merchId") != null) { if (MapUtils.getString(map, "merchId") != null) {
criteria.andMerchIdEqualTo(MapUtils.getString(map, "merchId")); criteria.andMerchIdEqualTo(MapUtils.getString(map, "merchId"));
} }
if (MapUtils.getLong(map, "identificationCode") != null) {
criteria.andIdentificationCodeEqualTo(MapUtils.getLong(map, "identificationCode"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "createTimeE"))) { if (StringUtils.isNotBlank(MapUtils.getString(map, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "createTimeE"))) {
criteria.andCreateTimeBetween( criteria.andCreateTimeBetween(
DateUtil.format(MapUtils.getString(map, "createTimeS"), "yyyy-MM-dd HH:mm:ss"), DateUtil.format(MapUtils.getString(map, "createTimeS"), "yyyy-MM-dd HH:mm:ss"),
@ -3008,9 +3013,10 @@ public class HighOrderServiceImpl implements HighOrderService {
HighCoupon coupon = highCouponService.getCouponById(goodsId); HighCoupon coupon = highCouponService.getCouponById(goodsId);
object.put("type" , 1); object.put("type" , 1);
object.put("productId", coupon.getCouponSource()); object.put("productId", 1);
object.put("companyId", coupon.getCompanyId()); object.put("companyId", coupon.getCompanyId());
object.put("remark" , "卡券订单" + orderNo + "积分返利:"); object.put("remark" , "卡券订单:"+ coupon.getCouponName() + "-" + orderNo + "积分返利:");
object.put("name" , "购买卡券产品:"+ coupon.getCouponName());
} }
if (goodsType == 3) { if (goodsType == 3) {
@ -3019,6 +3025,7 @@ public class HighOrderServiceImpl implements HighOrderService {
object.put("productId", 1); object.put("productId", 1);
object.put("companyId", merchantStore.getCompanyId()); object.put("companyId", merchantStore.getCompanyId());
object.put("remark" , "在线加油订单" + orderNo + "积分返利:"); object.put("remark" , "在线加油订单" + orderNo + "积分返利:");
object.put("name" , "购买在线加油产品");
} }
if (goodsType == 4) { if (goodsType == 4) {
@ -3026,20 +3033,70 @@ public class HighOrderServiceImpl implements HighOrderService {
object.put("productId", 2); object.put("productId", 2);
object.put("companyId", companyId); object.put("companyId", companyId);
object.put("remark" , "肯德基订单" + orderNo + "积分返利:"); object.put("remark" , "肯德基订单" + orderNo + "积分返利:");
object.put("name" , "购买肯德基产品");
} }
if (goodsType == 9) { if (goodsType == 9) {
object.put("type" , 4); object.put("type" , 4);
object.put("productId", 1); object.put("productId", 1);
object.put("companyId", companyId); object.put("companyId", companyId);
object.put("remark" , "星巴克订单" + orderNo + "积分返利:"); object.put("remark" , "星巴克订单" + orderNo + "积分返利:");
object.put("name" , "购买星巴克产品");
} }
if (goodsType == 10) { if (goodsType == 10) {
object.put("type" , 4); object.put("type" , 4);
object.put("productId", 3); object.put("productId", 3);
object.put("companyId", companyId); object.put("companyId", companyId);
object.put("remark" , "会员充值订单" + orderNo + "积分返利:"); object.put("remark" , "会员充值订单" + orderNo + "积分返利:");
object.put("name" , "购买会员充值产品");
} }
object.put("logoImg" , OrderLogoEnum.getNameByImgUrl(goodsType));
return object; return object;
} }
@Override
public List<HighOrder> promoteOrderList(Long identificationCode) throws Exception {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
criteria.andIdentificationCodeEqualTo(identificationCode).andOrderStatusEqualTo(3);
List<HighOrder> list = highOrderMapper.selectByExample(example);
for (HighOrder order : list) {
order.setTime(DateUtil.date2String(order.getCreateTime() , "MM月dd日 HH:mm"));
List<HighChildOrder> childOrder = getChildOrderByOrder(order.getId());
order.setGoodsTypeName("购买:" + GoodsType.getNameByType(childOrder.get(0).getGoodsType()));
}
return list;
}
@Override
public List<HighOrder> orderListByAgentId(Map<String, Object> map) throws Exception {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
criteria.andOrderStatusEqualTo(3);
if (MapUtils.getLong(map , "agentId") != null) {
criteria.andIdentificationCodeEqualTo(MapUtils.getLong(map , "agentId"));
} else {
criteria.andIdentificationCodeIsNotNull();
}
List<HighOrder> list = highOrderMapper.selectByExample(example);
for (HighOrder order : list) {
HighUser user = highUserService.findByUserId(order.getIdentificationCode());
order.setTime(DateUtil.date2String(order.getCreateTime() , "MM月dd日 HH:mm"));
List<HighChildOrder> childOrder = getChildOrderByOrder(order.getId());
order.setGoodsTypeName("购买:" + GoodsType.getNameByType(childOrder.get(0).getGoodsType()));
order.setAgentName(user.getName());
}
return list;
}
} }

@ -1,5 +1,6 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
@ -61,6 +62,9 @@ public class HighUserServiceImpl implements HighUserService {
@Resource @Resource
private HighOilCardService oilCardService; private HighOilCardService oilCardService;
@Resource
private BsDistributionUserRelService distributionUserRelService;
@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();
@ -212,7 +216,7 @@ public class HighUserServiceImpl implements HighUserService {
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertUser(HighUser highUser) { public void insertUser(HighUser highUser , Long popularizeUserId , String regionId) {
highUserMapper.insert(highUser); highUserMapper.insert(highUser);
if (highUser.getPhone() != null) { if (highUser.getPhone() != null) {
@ -221,6 +225,9 @@ public class HighUserServiceImpl implements HighUserService {
highUserCardService.bindCard(UserCardType.type2.getType(), oilCard.getCardNo(), highUser.getId()); highUserCardService.bindCard(UserCardType.type2.getType(), oilCard.getCardNo(), highUser.getId());
} }
} }
// 绑定推广关联关系
distributionUserRelService.insertDistributionRebate(highUser.getId() , popularizeUserId , regionId);
} }
@Override @Override
@ -274,4 +281,13 @@ public class HighUserServiceImpl implements HighUserService {
example.createCriteria().andResIdEqualTo(resId).andResTypeEqualTo(resType); example.createCriteria().andResIdEqualTo(resId).andResTypeEqualTo(resType);
return highGoldRecMapper.selectByExample(example).size() == 0; return highGoldRecMapper.selectByExample(example).size() == 0;
} }
@Override
public JSONObject userDistributionStatistics(Long userId) {
JSONObject object = new JSONObject();
return null;
}
} }

@ -96,3 +96,8 @@ CyPostUrl=http://120.24.83.85:8999/
unionAppId=7113783e75354df2a985efd3f31b9528 unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653 unionSecret=e2c731d2a026469aa6d218432f361653
unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c
#url
fileUrl=/home/project/hsg/filesystem/
#fileUrl=/Volumes/work/code/filesystem/

@ -94,3 +94,6 @@ CyPostUrl=http://120.24.83.85:8999/
unionAppId=ced46392acfe42be863fdfdd3e61164a unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa
unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586 unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586
#url
fileUrl=/home/project/hlt/filesystem/

@ -92,3 +92,6 @@ CyPostUrl=http://120.24.83.85:8999/
unionAppId=ced46392acfe42be863fdfdd3e61164a unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa
unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586 unionRsaKey=f2e6b6b95da445866194498c371a7c8af2e6b6b95da44586
#url
fileUrl=/home/project/hlt/filesystem/

@ -107,7 +107,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
// 查询电子卡券类型 // 查询电子卡券类型
@ -186,7 +186,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
if (object.getInteger("count") > 5) { if (object.getInteger("count") > 5) {
@ -287,7 +287,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(object.getString("couNo")); JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(object.getString("couNo"));

@ -22,6 +22,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.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -103,11 +104,14 @@ public class HighOrderController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
Map<String, Object> postMap = new HashMap<>(); Map<String, Object> postMap = new HashMap<>();
postMap.put("merchId" , object.getString("merchId")); postMap.put("merchId" , object.getString("merchId"));
postMap.put("createTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(object.getLong("createTimeS")));
postMap.put("createTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(object.getLong("createTimeE")));
return ResponseMsgUtil.success(outRechargeOrderService.getListRechargeOrder(postMap)); return ResponseMsgUtil.success(outRechargeOrderService.getListRechargeOrder(postMap));
@ -168,11 +172,14 @@ public class HighOrderController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
Map<String, Object> postMap = new HashMap<>(); Map<String, Object> postMap = new HashMap<>();
postMap.put("merchId" , object.getString("merchId")); postMap.put("merchId" , object.getString("merchId"));
postMap.put("createTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(object.getLong("createTimeS")));
postMap.put("createTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(object.getLong("createTimeE")));
return ResponseMsgUtil.success(highOrderService.getOrderList(postMap)); return ResponseMsgUtil.success(highOrderService.getOrderList(postMap));

@ -106,7 +106,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
return ResponseMsgUtil.success(apiMerchantsService.getMerchProduct(apiMerchants.getId() , object.getInteger("rechargeType"))); return ResponseMsgUtil.success(apiMerchantsService.getMerchProduct(apiMerchants.getId() , object.getInteger("rechargeType")));
@ -164,7 +164,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
return ResponseMsgUtil.success(apiMerchants.getAmounts()); return ResponseMsgUtil.success(apiMerchants.getAmounts());
@ -224,7 +224,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
ApiOrderRecord apiOrderRecord = apiOrderRecordService.queryOrderResult(map); ApiOrderRecord apiOrderRecord = apiOrderRecordService.queryOrderResult(map);
@ -322,7 +322,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
apiOpenService.createOrder(object , apiMerchants , apiProductConfig); apiOpenService.createOrder(object , apiMerchants , apiProductConfig);

@ -100,7 +100,7 @@ public class SelfOilStationController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY); throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
} }
SecConfig config = secConfigService.findByCodeType(object.getString("merchId")); SecConfig config = secConfigService.findByCodeType(object.getString("merchId"));

Loading…
Cancel
Save