Merge branch '2.0-dev' of http://gitea.dctpay.com/hurui/hai-server into 2.0-dev

new-dev
胡锐 1 year ago
commit f66e8baa0d
  1. 49
      hai-bweb/src/main/java/com/bweb/controller/ApiCouponController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java
  3. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  4. 23
      hai-bweb/src/main/java/com/bweb/controller/HighUserController.java
  5. 11
      hai-cweb/src/main/java/com/cweb/controller/HighDiscountPackageController.java
  6. 110
      hai-order/src/main/java/com/web/controller/OrderController.java
  7. 77
      hai-schedule/src/main/java/com/hai/schedule/ApiBlxCouponSchedule.java
  8. 3
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  9. 21
      hai-service/src/main/java/com/hai/config/WxMaConfiguration.java
  10. 83
      hai-service/src/main/java/com/hai/openApi/config/BlxConfig.java
  11. 50
      hai-service/src/main/java/com/hai/openApi/service/ApiBlxCouponService.java
  12. 55
      hai-service/src/main/java/com/hai/openApi/service/impl/ApiBlxCouponServiceImpl.java
  13. 59
      hai-service/src/main/java/com/hai/order/model/ExportOrderModel.java
  14. 16
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  15. 3
      hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java
  16. 2
      hai-service/src/main/java/com/hai/service/HighUserService.java
  17. 3
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  18. 4
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  19. 36
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  20. 3
      hai-service/src/main/resources/dev/commonConfig.properties
  21. 3
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  22. 3
      hai-service/src/main/resources/prod/commonConfig.properties
  23. 2
      hai-user/src/main/java/com/web/controller/LoginController.java
  24. 18
      v1/src/main/java/com/v1/controller/WxMsgController.java
  25. 99
      v1/src/main/java/com/v1/controller/business/BlxCouponController.java

@ -0,0 +1,49 @@
package com.bweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.ApiBlxCoupon;
import com.hai.model.ResponseData;
import com.hai.openApi.service.ApiBlxCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/apiCoupon")
@Api(value = "外部卡券查询")
public class ApiCouponController {
private static Logger log = LoggerFactory.getLogger(HighDiscountPackageController.class);
@Resource
private ApiBlxCouponService apiBlxCouponService;
@RequestMapping(value = "/getBlxCouponList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取比邻星停车券列表")
public ResponseData getBlxCouponList( @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(apiBlxCouponService.getBlxCouponList(new HashMap<>())));
} catch (Exception e) {
log.error("HighDiscountPackageController --> getDiscountPackageList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -650,7 +650,7 @@ public class HighDiscountPackageController {
String fileUrl = SysConst.getSysConfig().getFileUrl() + File.separator + body.getString("fileUrl");
Map<String, String> param = new HashMap<>();
Map<String, Object> param = new HashMap<>();
param.put("status", "1");
ImportGiveAwayListener giveAwayListener = new ImportGiveAwayListener();

File diff suppressed because one or more lines are too long

@ -44,6 +44,7 @@ public class HighUserController {
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "isAgent", required = false) Boolean isAgent,
@RequestParam(value = "regTimeStart", required = false) Long regTimeStart,
@RequestParam(value = "regTimeEnd", required = false) Long regTimeEnd,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@ -51,23 +52,15 @@ public class HighUserController {
) {
try {
Map<String, String> map = new HashMap<>();
if (StringUtils.isNotBlank(name)) {
Map<String, Object> map = new HashMap<>();
map.put("isAgent", isAgent);
map.put("name", name);
}
if (StringUtils.isNotBlank(phone)) {
map.put("phone", phone);
}
if (status != null) {
map.put("status", Integer.toString(status));
}
if (regTimeStart != null) {
map.put("regTimeStart", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(regTimeStart));
}
if (regTimeEnd != null) {
map.put("regTimeEnd", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(regTimeEnd));
}
map.put("status", status);
map.put("regTimeStart", regTimeStart);
map.put("regTimeEnd", regTimeEnd);
PageHelper.startPage(pageNum, pageSize);

@ -57,28 +57,21 @@ public class HighDiscountPackageController {
@RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取优惠券包列表")
public ResponseData getDiscountPackageList(@RequestParam(name = "regionId", required = true) String regionId,
public ResponseData getDiscountPackageList(@RequestParam(name = "companyId", required = true) String companyId,
@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution,
@RequestParam(name = "title", required = false) String title,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
SecRegion region = commonService.getParentByRegion(Long.parseLong(regionId));
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
if (bsCompany != null) {
Map<String, Object> map = new HashMap<>();
map.put("companyId", bsCompany.getId());
map.put("companyId", companyId);
map.put("usingAttribution", usingAttribution);
map.put("title" , title);
map.put("salesType" , 1);
map.put("status" , 1);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highDiscountPackageService.getDiscountPackageList(map)));
}
}
return ResponseMsgUtil.success(new PageInfo<>());
} catch (Exception e) {
log.error("HighDiscountPackageController --> getDiscountPackageList() error!", e);

@ -1,5 +1,6 @@
package com.web.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -7,19 +8,30 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.*;
import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.goods.service.DeliveryAddressService;
import com.hai.goods.service.GoodsLogisticsService;
import com.hai.goods.service.GoodsOrderExtService;
import com.hai.model.GoodsOrderModel;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.order.model.CreateOrderChildModel;
import com.hai.order.model.CreateOrderModel;
import com.hai.order.model.ExportOrderMobileModel;
import com.hai.order.model.ExportOrderModel;
import com.hai.order.service.OrderService;
import com.hai.order.type.OrderChildGoodsType;
import com.hai.order.type.OrderPayType;
import com.hai.order.type.OrderStatus;
import com.hai.order.type.RechargePlatformType;
import com.hai.order.utils.OrderUtil;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserService;
import com.web.config.SysConst;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -30,7 +42,10 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@ -55,6 +70,12 @@ public class OrderController {
@Resource
private GoodsLogisticsService goodsLogisticsService;
@Resource
private RedisUtil redisUtil;
@Resource
private HighUserService highUserService;
@RequestMapping(value="/create",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建订单")
@ -258,4 +279,93 @@ public class OrderController {
}
}
@RequestMapping(value="/getPopularizeUserOrderList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取推广用户订单列表")
public ResponseData getPopularizeUserOrderList(@RequestParam(name = "promoteCode", required = true) String promoteCode) {
try {
Map<String, Object> param = new HashMap<>();
param.put("promoteCode", promoteCode);
param.put("orderStatus", 3);
return ResponseMsgUtil.success(orderService.getOrderList(param));
} catch (Exception e) {
log.error("OrderController -> getUserOrderList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportPopularizeUserOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出推广用户订单")
public ResponseData exportPopularizeUserOrderList(@RequestParam(name = "serialNumber", required = false) String serialNumber,
@RequestParam(name = "promoteCode", required = true) String promoteCode) {
try {
Map<String, Object> param = new HashMap<>();
param.put("promoteCode", promoteCode);
param.put("orderStatus", 3);
// 查询数据
List<HighOrder> order = orderService.getOrderList(param);
List<ExportOrderModel> list = new ArrayList<>();
// 配置初始化处理条数
int i = 0;
int percent;
ExportOrderModel model;
for (HighOrder highOrder : order) {
i++;
// 生成百分比
percent = i*100/order.size();
redisUtil.set(serialNumber , percent , 3600);
model = new ExportOrderModel();
HighUser user = highUserService.findByUserId(Long.valueOf(highOrder.getPromoteCode()));
if (user != null) {
model.setUserName(user.getName());
}
model.setFinishTime(highOrder.getFinishTime());
model.setMemPhone(highOrder.getMemPhone());
model.setCreateTime(highOrder.getCreateTime());
model.setTitle(highOrder.getTitle());
model.setPayablePrice(highOrder.getPayablePrice());
model.setPayPrice(highOrder.getPayPrice());
model.setOrderNo(highOrder.getOrderNo());
list.add(model);
}
String fileUrl = SysConst.getSysConfig().getFileUrl() + "temporary/";
String pathName = System.currentTimeMillis()+".xlsx";
File file = new File(fileUrl);
if (!file.exists()) {
file.mkdirs();
}
EasyExcel.write(fileUrl+pathName)
.head(ExportOrderModel.class)
.sheet("推广用户交易订单")
.doWrite(list);
redisUtil.set(serialNumber + "download" , pathName , 60);
return ResponseMsgUtil.success(pathName);
} catch (Exception e) {
log.error("OrderCouponController --> getOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,77 @@
package com.hai.schedule;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.config.QianZhuConfig;
import com.hai.entity.ApiBlxCoupon;
import com.hai.entity.ApiStarbucksProducts;
import com.hai.openApi.config.BlxConfig;
import com.hai.openApi.service.ApiBlxCouponService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Configuration
public class ApiBlxCouponSchedule {
private static final Logger log = LoggerFactory.getLogger(ApiBlxCouponSchedule.class);
@Resource
private ApiBlxCouponService apiBlxCouponService;
@Resource
private BlxConfig blxConfig;
@Scheduled(cron="0 0/60 * * * ?") //每60分钟执行一次
public void getBlxCoupon() {
JSONObject object = blxConfig.queryCouponPage();
if (object.getInteger("code") == 1) {
JSONArray jsonArray = object.getJSONObject("data").getJSONArray("records");
for (int i = 0; i < jsonArray.size(); i++) {
if (jsonArray.getJSONObject(i).getString("couponCode") != null) {
ApiBlxCoupon apiBlxCoupon = apiBlxCouponService.findBlxCoupon(jsonArray.getJSONObject(i).getString("couponCode"));
if (apiBlxCoupon == null) {
apiBlxCoupon = new ApiBlxCoupon();
apiBlxCoupon.setCouponCode(jsonArray.getJSONObject(i).getString("couponCode"));
apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus"));
apiBlxCoupon.setCreateTime(new Date());
apiBlxCoupon.setCouponName(jsonArray.getJSONObject(i).getString("couponName"));
apiBlxCoupon.setDenomination(jsonArray.getJSONObject(i).getInteger("denomination"));
apiBlxCoupon.setUpdateTime(new Date());
apiBlxCoupon.setMinPrice(jsonArray.getJSONObject(i).getInteger("minPrice"));
apiBlxCoupon.setUseStartTime(jsonArray.getJSONObject(i).getDate("useStartTime"));
apiBlxCoupon.setUseEndTime(jsonArray.getJSONObject(i).getDate("useEndTime"));
apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus"));
apiBlxCoupon.setReceiveDays(jsonArray.getJSONObject(i).getInteger("receiveDays"));
apiBlxCoupon.setReceiveLimit(jsonArray.getJSONObject(i).getInteger("receiveLimit"));
apiBlxCouponService.insertBlxCoupon(apiBlxCoupon);
} else {
apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus"));
apiBlxCoupon.setCouponName(jsonArray.getJSONObject(i).getString("couponName"));
apiBlxCoupon.setDenomination(jsonArray.getJSONObject(i).getInteger("denomination"));
apiBlxCoupon.setUpdateTime(new Date());
apiBlxCoupon.setMinPrice(jsonArray.getJSONObject(i).getInteger("minPrice"));
apiBlxCoupon.setUseStartTime(jsonArray.getJSONObject(i).getDate("useStartTime"));
apiBlxCoupon.setUseEndTime(jsonArray.getJSONObject(i).getDate("useEndTime"));
apiBlxCoupon.setCouponStatus(jsonArray.getJSONObject(i).getInteger("couponStatus"));
apiBlxCoupon.setReceiveDays(jsonArray.getJSONObject(i).getInteger("receiveDays"));
apiBlxCoupon.setReceiveLimit(jsonArray.getJSONObject(i).getInteger("receiveLimit"));
apiBlxCouponService.editBlxCoupon(apiBlxCoupon);
}
}
}
}
}
}

@ -124,6 +124,9 @@ public class CommonSysConfig {
private String wxAppId;
private String wxAppSecret;
private String wxQyxAppId;
private String wxQyxAppSecret;
private String wxH5AppId;
private String wxH5AppSecret;

@ -11,6 +11,7 @@ import javax.annotation.PostConstruct;
public class WxMaConfiguration {
private static WxMaService maService;
private static WxMaService maQyxService;
public static WxMaService getMaService() {
if (maService == null) {
@ -20,6 +21,19 @@ public class WxMaConfiguration {
return maService;
}
public static WxMaService getMaService(Integer type) {
if (maService == null || maQyxService == null) {
throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!"));
}
// type 1:嗨森逛小程序参数 2:黔印象小程序参数
if (type == 1) {
return maService;
}
return maQyxService;
}
@PostConstruct
public void init() {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
@ -28,6 +42,13 @@ public class WxMaConfiguration {
maService = new WxMaServiceImpl();
maService.setWxMaConfig(config);
WxMaDefaultConfigImpl qyxConfig = new WxMaDefaultConfigImpl();
qyxConfig.setAppid(CommonSysConst.getSysConfig().getWxQyxAppId());
qyxConfig.setSecret(CommonSysConst.getSysConfig().getWxQyxAppSecret());
maQyxService = new WxMaServiceImpl();
maQyxService.setWxMaConfig(qyxConfig);
}
}

@ -0,0 +1,83 @@
package com.hai.openApi.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Component
public class BlxConfig {
@Resource
private RedisUtil redisUtil;
/**
* @Author Sum1Dream
* @Name generateJw
* @Description // 获取token
* @Date 10:42 2023/7/11
* @Param []
* @Return java.lang.String
*/
public String generateJw() {
Object token = redisUtil.get("BlxToken");
if (token == null) {
Map<String , Object > map = new HashMap<>();
map.put("organizeCode" , "dhy");
JSONObject object = HttpsUtils.doGet("https://vertical-formats-gateway.blx.bodata.cn:18443/admin/api/generateJwt" , map);
return object.getString("data");
}
return token.toString();
}
/**
* @Author Sum1Dream
* @Name queryCouponPage
* @Description // 获取比邻星停车券列表
* @Date 10:57 2023/7/11
* @Param []
* @Return com.alibaba.fastjson.JSONObject
*/
public JSONObject queryCouponPage() {
Map<String , Object > map = new HashMap<>();
map.put("rows" , "20");
map.put("currPage" , "1");
Map<String , Object> header = new HashMap<>();
header.put("token" , generateJw());
return HttpsUtils.doPost("https://vertical-formats-gateway.blx.bodata.cn:18443/admin/api/qureyCouponPage" , map , header);
}
/**
* @Author Sum1Dream
* @Name sendCoupon
* @Description // 发放券
* @Date 11:01 2023/7/11
* @Param [object]
* @Return com.alibaba.fastjson.JSONObject
*/
public JSONObject sendCoupon(JSONObject object) {
Map<String , Object > map = new HashMap<>();
map.put("couponCode" , object.getString("couponCode"));
map.put("receiverPhone" , object.getString("receiverPhone"));
map.put("receiverCount" , object.getInteger("receiverCount"));
Map<String , Object> header = new HashMap<>();
header.put("token" , generateJw());
return HttpsUtils.doPost("https://vertical-formats-gateway.blx.bodata.cn:18443/admin/api/qureyCouponPage" , map , header);
}
}

@ -0,0 +1,50 @@
package com.hai.openApi.service;
import com.hai.entity.ApiBlxCoupon;
import java.util.List;
import java.util.Map;
public interface ApiBlxCouponService {
/**
* @Author Sum1Dream
* @Name insertBlxCoupon
* @Description // 新增停车券
* @Date 14:20 2023/7/11
* @Param [apiBlxCoupon]
* @Return void
*/
void insertBlxCoupon(ApiBlxCoupon apiBlxCoupon);
/**
* @Author Sum1Dream
* @Name editBlxCoupon
* @Description // 修改停车券
* @Date 14:23 2023/7/11
* @Param [apiBlxCoupon]
* @Return void
*/
void editBlxCoupon(ApiBlxCoupon apiBlxCoupon);
/**
* @Author Sum1Dream
* @Name FindBlxCoupon
* @Description // 根据卡券编码查询券
* @Date 14:23 2023/7/11
* @Param [couponCode]
* @Return com.hai.entity.ApiBlxCoupon
*/
ApiBlxCoupon findBlxCoupon(String couponCode);
/**
* @Author Sum1Dream
* @Name getBlxCouponList
* @Description // 查询停车券列表
* @Date 14:23 2023/7/11
* @Param [map]
* @Return java.util.List<com.hai.entity.ApiBlxCoupon>
*/
List<ApiBlxCoupon> getBlxCouponList(Map<String , Object> map);
}

@ -0,0 +1,55 @@
package com.hai.openApi.service.impl;
import com.hai.dao.ApiBlxCouponMapper;
import com.hai.entity.ApiBlxCoupon;
import com.hai.entity.ApiBlxCouponExample;
import com.hai.openApi.service.ApiBlxCouponService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service("apiBlxCouponService")
public class ApiBlxCouponServiceImpl implements ApiBlxCouponService {
@Resource
private ApiBlxCouponMapper apiBlxCouponMapper;
@Override
public void insertBlxCoupon(ApiBlxCoupon apiBlxCoupon) {
apiBlxCouponMapper.insert(apiBlxCoupon);
}
@Override
public void editBlxCoupon(ApiBlxCoupon apiBlxCoupon) {
apiBlxCouponMapper.updateByPrimaryKey(apiBlxCoupon);
}
@Override
public ApiBlxCoupon findBlxCoupon(String couponCode) {
ApiBlxCouponExample example = new ApiBlxCouponExample();
ApiBlxCouponExample.Criteria criteria = example.createCriteria();
criteria.andCouponCodeEqualTo(couponCode);
List<ApiBlxCoupon> apiBlxCoupons = apiBlxCouponMapper.selectByExample(example);
if (apiBlxCoupons.size() > 0) {
return apiBlxCoupons.get(0);
}
return null;
}
@Override
public List<ApiBlxCoupon> getBlxCouponList(Map<String, Object> map) {
ApiBlxCouponExample example = new ApiBlxCouponExample();
ApiBlxCouponExample.Criteria criteria = example.createCriteria();
criteria.andCouponStatusEqualTo(1);
return apiBlxCouponMapper.selectByExample(example);
}
}

@ -0,0 +1,59 @@
package com.hai.order.model;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 订单退款模型
* @className: ExportGasOrderModel
* @author: 袁野
* @date: 2022/10/28
**/
@Data
public class ExportOrderModel {
@ColumnWidth(25)
@ExcelProperty("推广人")
private String userName;
@ColumnWidth(25)
@ExcelProperty("标题")
private String title;
@ColumnWidth(15)
@ExcelProperty("客户电话")
private String memPhone;
@ColumnWidth(25)
@ExcelProperty("交易单号")
private String orderNo;
@ColumnWidth(13)
@ExcelProperty(value = "应付金额")
private BigDecimal payablePrice;
@ColumnWidth(13)
@ExcelProperty(value = "实付金额")
private BigDecimal payPrice;
@ColumnWidth(15)
@ExcelProperty("创建时间")
private Date createTime;
@ColumnWidth(15)
@ExcelProperty("支付时间")
private Date payTime;
@ColumnWidth(15)
@ExcelProperty("完成时间")
private Date finishTime;
@ColumnWidth(15)
@ExcelProperty("备注")
private String remark;
}

@ -68,6 +68,9 @@ public class OrderServiceImpl implements OrderService {
@Resource
private HighDiscountAgentCodeService discountAgentCodeService;
@Resource
private BsDistributionUserRelService bsDistributionUserRelService;
@Resource
private HighUserService userService;
@ -154,12 +157,20 @@ public class OrderServiceImpl implements OrderService {
discountAgentCodeService.updateCode(code);
}
// 查询推广员信息
Map<String, Object> mapUser = new HashMap<>();
mapUser.put("userId" , createOrderModel.getMemId());
BsDistributionUserRel popularizeUser = bsDistributionUserRelService.findDistributionUserRel(mapUser);
HighOrder order = new HighOrder();
if (popularizeUser != null) {
order.setPromoteCode(popularizeUser.getAgentId().toString());
}
order.setOrderNo(createOrderModel.getOrderNo());
order.setMemId(createOrderModel.getMemId());
order.setMemName(createOrderModel.getMemName());
order.setMemPhone(createOrderModel.getMemPhone());
order.setPromoteCode(createOrderModel.getPromoteCode());
order.setRemarks(createOrderModel.getRemarks());
order.setOrderStatus(OrderStatus.STATUS1.getNumber());
order.setWhetherCheck(false);
@ -828,6 +839,9 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotBlank(MapUtils.getString(param, "memPhone"))) {
criteria.andMemPhoneLike("%" + MapUtils.getString(param, "memPhone") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "promoteCode"))) {
criteria.andPromoteCodeEqualTo(MapUtils.getString(param, "promoteCode"));
}
if (MapUtils.getInteger(param, "orderStatus") != null) {
criteria.andOrderStatusEqualTo(MapUtils.getInteger(param, "orderStatus"));

@ -25,7 +25,7 @@ public interface BsDistributionUserRelService {
* @Param [java.lang.Long, java.lang.Long]
* @return void
*/
void insertDistributionRebate(Long userId , Long popularizeUserId , String requestIp);
void insertDistributionUserRel(Long userId , Long popularizeUserId , String requestIp);
/**
* @Author Sum1Dream
@ -128,4 +128,5 @@ public interface BsDistributionUserRelService {
*/
List<HighUser> agentUserList();
}

@ -47,7 +47,7 @@ public interface HighUserService {
* @throws Exception 抛出异常
*/
List<HighUser> getListUser(Map<String , String> map) throws Exception;
List<HighUser> getListUser(Map<String , Object> map) throws Exception;
/**
*

@ -45,7 +45,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
private HighUserMapper highUserMapper;
@Override
public void insertDistributionRebate(Long userId, Long popularizeUserId , String requestIp) {
public void insertDistributionUserRel(Long userId, Long popularizeUserId , String requestIp) {
HighUser user = highUserService.findByUserId(userId);
@ -315,4 +315,5 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
return highUserMapper.selectByExample(example);
}
}

@ -21,6 +21,7 @@ import com.hai.enum_type.*;
import com.hai.model.*;
import com.hai.msg.entity.MsgTopic;
import com.hai.order.type.OrderPayType;
import com.hai.order.type.OrderProductType;
import com.hai.order.utils.OrderUtil;
import com.hai.service.*;
import com.hai.service.pay.impl.GoodsOrderServiceImpl;
@ -2303,8 +2304,7 @@ public class HighOrderServiceImpl implements HighOrderService {
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()));
order.setGoodsTypeName("下单:" + OrderProductType.getDataByType(order.getProductType()).getName());
}
return list;

@ -119,10 +119,9 @@ public class HighUserServiceImpl implements HighUserService {
}
SecRegion region = commonService.getRegionsByName(loginLog.getProvinceName());
// distributionUserRelService.insertDistributionRebate(user.getId(), popularizeUserId, "500000");
if (region != null) {
// 绑定推广关联关系
distributionUserRelService.insertDistributionRebate(user.getId(), popularizeUserId, region.getRegionId().toString());
distributionUserRelService.insertDistributionUserRel(user.getId(), popularizeUserId, region.getRegionId().toString());
}
}
user.setOpenIdH5(MapUtils.getString(other, "openIdH5"));
@ -155,26 +154,35 @@ public class HighUserServiceImpl implements HighUserService {
}
@Override
public List<HighUser> getListUser(Map<String, String> map) {
public List<HighUser> getListUser(Map<String, Object> map) {
HighUserExample example = new HighUserExample();
HighUserExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(map.get("phone"))) {
criteria.andPhoneLike("%" + map.get("phone") + "%");
if (StringUtils.isNotBlank(MapUtils.getString(map , "phone"))) {
criteria.andPhoneLike("%" + MapUtils.getString(map , "phone") + "%");
}
if (StringUtils.isNotBlank(map.get("name"))) {
criteria.andNameLike("%" + map.get("name") + "%");
if (StringUtils.isNotBlank(MapUtils.getString(map , "name"))) {
criteria.andNameLike("%" + MapUtils.getString(map , "name") + "%");
}
if (StringUtils.isNotBlank(map.get("status"))) {
criteria.andStatusEqualTo(Integer.valueOf(map.get("status")));
if (MapUtils.getInteger(map , "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map , "status"));
}
if (StringUtils.isNotBlank(map.get("ext4"))) {
if (MapUtils.getBoolean(map , "isAgent") != null) {
criteria.andIsAgentEqualTo(MapUtils.getBoolean(map , "isAgent"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map , "ext4"))) {
criteria.andExt4EqualTo(String.valueOf(map.get("ext4")));
}
if (StringUtils.isNotBlank(map.get("regTimeStart")) && StringUtils.isNotBlank(map.get("regTimeEnd"))) {
if (StringUtils.isNotBlank(MapUtils.getString(map , "regTimeStart")) && StringUtils.isNotBlank(MapUtils.getString(map , "regTimeEnd"))) {
criteria.andRegTimeBetween(
DateUtil.format(map.get("regTimeStart") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("regTimeEnd") , "yyyy-MM-dd HH:mm:ss"));
DateUtil.format(MapUtils.getString(map , "regTimeStart") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(MapUtils.getString(map , "regTimeEnd") , "yyyy-MM-dd HH:mm:ss"));
}
if (MapUtils.getLong(map, "regTimeStart") != null) {
criteria.andRegTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "regTimeStart")));
}
if (MapUtils.getLong(map, "regTimeEnd") != null) {
criteria.andRegTimeLessThan(new Date(MapUtils.getLong(map, "regTimeEnd")));
}
return highUserMapper.selectByExample(example);
@ -327,7 +335,7 @@ public class HighUserServiceImpl implements HighUserService {
// 记录登录信息
String requestIp = RequestUtils.getRequestIp();
// 绑定推广关联关系
distributionUserRelService.insertDistributionRebate(highUser.getId() , popularizeUserId , requestIp);
distributionUserRelService.insertDistributionUserRel(highUser.getId() , popularizeUserId , requestIp);
}
@Override

@ -117,6 +117,9 @@ fileUrl=/home/project/hsg/filesystem/
wxAppId=wx8d49e2f83025229d
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxQyxAppId=wx5e0cac96ea91c01f
wxQyxAppSecret=9889fff2283e249199a9f6afb32f6136
wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -110,6 +110,9 @@ fileUrl=/home/project/hsg/filesystem/
wxAppId=wx8d49e2f83025229d
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxQyxAppId=wx5e0cac96ea91c01f
wxQyxAppSecret=9889fff2283e249199a9f6afb32f6136
wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -116,6 +116,9 @@ fileUrl=/home/project/hsg/filesystem/
wxAppId=wx8d49e2f83025229d
wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df
wxQyxAppId=wx5e0cac96ea91c01f
wxQyxAppSecret=9889fff2283e249199a9f6afb32f6136
wxH5AppId=wxa075e8509802f826
wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5

File diff suppressed because one or more lines are too long

@ -151,7 +151,14 @@ public class WxMsgController {
JSONObject object = weChatQrcodeUtils.paramPars(eventKey);
// type = 1 推广扫码
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type1.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type1.getType())) {
linkContent ="<a data-miniprogram-appid='wx8d49e2f83025229d' data-miniprogram-path='/pages/tabBar/user/user' href='https://mp.weixin.qq.com/s/qKUny68yCU4_6jBdNb1OVg'>扫码领取</a>\n\n";
linkContent =
"欢迎加入我们\uD83D\uDC97\n\n"
+ "<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ "/hsgH5?accountId=0000017&key=&code="
+ object.getString("code")
+ "'>点击加入我们</a>\n\n"
+ "走得更远,看得更美的风景![太阳]\n\n";
// todo 推广扫码
}
// type = 2 在线加油门店扫码
@ -274,7 +281,14 @@ public class WxMsgController {
JSONObject object = weChatQrcodeUtils.paramPars(eventKey);
// type = 1 推广扫码
if (Objects.equals(object.getString("qrscene_type"), WxQrCodeTypeEnum.type1.getType()) || Objects.equals(object.getString("type"), WxQrCodeTypeEnum.type1.getType())) {
linkContent ="<a data-miniprogram-appid='wx8d49e2f83025229d' data-miniprogram-path='/pages/tabBar/user/user' href='https://mp.weixin.qq.com/s/qKUny68yCU4_6jBdNb1OVg'>扫码领取</a>\n\n";
linkContent =
"欢迎加入我们\uD83D\uDC97\n\n"
+ "<a href='"
+ CommonSysConst.getSysConfig().getHsgDomainName()
+ "/hsgH5?accountId=0000017&key=&code="
+ object.getString("code")
+ "'>点击加入我们</a>\n\n"
+ "走得更远,看得更美的风景![太阳]\n\n";
// todo 推广扫码
}
// type = 2 在线加油门店扫码

@ -0,0 +1,99 @@
package com.v1.controller.business;
import com.hai.openApi.service.ApiBlxCouponService;
import com.hai.openApi.service.ApiMobileRechargeProductService;
import com.hai.order.type.OrderProductType;
import com.hai.service.ApiIpAddressService;
import com.hai.service.ApiMerchantsService;
import com.hai.service.SecConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping(value="/blxCoupon")
@Api(value="优惠券")
public class BlxCouponController {
private static Logger log = LoggerFactory.getLogger(MobileRechargeController.class);
@Resource
private ApiMerchantsService apiMerchantsService;
@Resource
private SecConfigService secConfigService;
@Resource
private ApiBlxCouponService apiBlxCouponService;
@Resource
private ApiIpAddressService apiIpAddressService;
// @RequestMapping(value = "/getCouponList", method = RequestMethod.POST)
// @ResponseBody
// @ApiOperation(value = "获取话费充值产品")
// public ResponseData getCouponList(@RequestBody JSONObject object , HttpServletRequest request ) {
// try {
//
// String ip = "";
// // 有的user可能使用代理,为处理用户使用代理的情况,使用x-forwarded-for
// if (request.getHeader("x-forwarded-for") == null) {
// ip = request.getRemoteAddr();
// } else {
// ip = request.getHeader("x-forwarded-for");
// }
//
// if (!apiIpAddressService.validationIpAddressLegal(object.getString("merchId") , ip)) {
// log.error("getRechargeProduct error!", "非法ip地址,请联系管理人员!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.IP_ERROR, "非法ip地址,请联系管理人员!");
// }
//
// if (
// StringUtils.isBlank(object.getString("merchId")) ||
// StringUtils.isBlank(object.getString("sign"))
// ) {
// log.error("getRechargeProduct error!", "请求参数校验失败!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
// }
//
// ApiMerchants apiMerchants = apiMerchantsService.findByMchId(object.getString("merchId"));
//
// if (apiMerchants == null) {
// log.error("getRechargeProduct error!", "帐户号错误!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_NOT_EXIST);
// }
//
// if (!secConfigService.isConfig(OrderProductType.PRODUCT_TYPE9.getApiCode(), object.getString("merchId"))) {
// log.error("getAllCities error!", "当前帐户无权限查询!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOT_AUTHORIZED, "");
// }
//
// Map<String , Object> map = new HashMap<>();
// map.put("apiKey" , apiMerchants.getApiKey());
// map.put("merchId" , object.getString("merchId"));
//
// if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
// log.error("getRechargeProduct error!", "签名校验失败!");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
// }
//
// return ResponseMsgUtil.success(apiBlxCouponService.getBlxCouponList(object.getString("merchId")));
//
// } catch (Exception e) {
// log.error("HighOpenApiController --> getRechargeProduct() error!", e);
// return ResponseMsgUtil.exception(e);
// }
// }
}
Loading…
Cancel
Save