dev-discount
胡锐 2 years ago
commit f61433f761
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java
  2. 121
      hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java
  3. 2
      hai-service/src/main/java/com/hai/model/UserModel.java
  4. 39
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  5. 2
      hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java
  6. 2
      hai-service/src/main/java/com/hai/service/HighUserService.java
  7. 2
      hai-service/src/main/java/com/hai/service/impl/BsConfigServiceImpl.java
  8. 20
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  9. 25
      hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java
  10. 2
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  11. 5
      hai-service/src/main/java/com/hai/service/impl/OutRechargePriceServiceImpl.java

@ -98,7 +98,9 @@ public class OutRechargePriceController {
listMap.put("productType", "3"); listMap.put("productType", "3");
listMap.put("sourceId", list.getId()); listMap.put("sourceId", list.getId());
BeanUtils.copyProperties(list, outRechargePriceModel); BeanUtils.copyProperties(list, outRechargePriceModel);
outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount()); if (bsConfigService.getProductDiscountByMap(listMap) != null) {
outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount());
}
outRechargePriceModel.setProductPayTypeString(bsConfigService.getProductPayTypeByMap(listMap)); outRechargePriceModel.setProductPayTypeString(bsConfigService.getProductPayTypeByMap(listMap));
outRechargePriceModel.setProductPlatformString(bsConfigService.getProductPlatformByMap(listMap)); outRechargePriceModel.setProductPlatformString(bsConfigService.getProductPlatformByMap(listMap));
outRechargePriceModelList.add(outRechargePriceModel); outRechargePriceModelList.add(outRechargePriceModel);

@ -0,0 +1,121 @@
package com.web.controller.business;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.ResponseMsgUtil;
import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.order.service.OrderService;
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 javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "thirdParty")
@Api(value = "第三方订单业务")
public class OrderThirdPartyController {
private static Logger log = LoggerFactory.getLogger(OrderOilController.class);
@Resource
private UserCenter userCenter;
@Resource
private OrderService orderService;
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询第三方订单列表")
public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "memCardNo", required = false) String memCardNo,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
@RequestParam(name = "productType", required = false) Integer productType,
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String,Object> map = new HashMap<>();
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
map.put("companyId" , companyId);
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("companyId", userInfoModel.getBsCompany().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
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));
}
if (createTimeS != null && createTimeE != null) {
map.put("payTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeS));
map.put("payTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(payTimeE));
}
if (createTimeS != null && createTimeE != null) {
map.put("finishTimeS", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(finishTimeS));
map.put("finishTimeE", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(finishTimeE));
}
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("memCardNo", memCardNo);
map.put("productType", productType);
map.put("orderStatus", orderStatus);
map.put("payType", payType);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(orderService.getOrderList(map)));
} catch (Exception e) {
log.error("OrderCouponController --> getOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getOrderDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询订单详情")
public ResponseData getOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) {
try {
Map<String, Object> map = new HashMap<>();
map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo));
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("OrderIntegralRechargeController -> getOrderDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -20,7 +20,7 @@ public class UserModel {
// 待支付数量 // 待支付数量
private Long unpaid; private Long unpaid;
// 待支付数量 // 待查看数量
private Long whetherCheckNum; private Long whetherCheckNum;
// 支付数量 // 支付数量

@ -8,6 +8,7 @@ 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.AESEncodeUtil; import com.hai.common.security.AESEncodeUtil;
import com.hai.common.utils.DateUtil;
import com.hai.dao.HighChildOrderMapper; import com.hai.dao.HighChildOrderMapper;
import com.hai.dao.HighOrderMapper; import com.hai.dao.HighOrderMapper;
import com.hai.entity.*; import com.hai.entity.*;
@ -205,7 +206,7 @@ public class OrderServiceImpl implements OrderService {
List<HighChildOrder> couponOrderList = orderCreateHandleService.thirdPartyOrder(object); List<HighChildOrder> couponOrderList = orderCreateHandleService.thirdPartyOrder(object);
childOrderList = couponOrderList; childOrderList = couponOrderList;
for (HighChildOrder childOrder : couponOrderList) { for (HighChildOrder childOrder : couponOrderList) {
if (StringUtils.isBlank(order.getSearchTitle())) { if (StringUtils.isBlank(order.getTitle())) {
order.setTitle(childOrder.getGoodsName()); order.setTitle(childOrder.getGoodsName());
} else { } else {
order.setTitle("+"+childOrder.getGoodsName()); order.setTitle("+"+childOrder.getGoodsName());
@ -240,7 +241,7 @@ public class OrderServiceImpl implements OrderService {
List<HighChildOrder> couponOrderList = orderCreateHandleService.thirdPartyOrder(object); List<HighChildOrder> couponOrderList = orderCreateHandleService.thirdPartyOrder(object);
childOrderList = couponOrderList; childOrderList = couponOrderList;
for (HighChildOrder childOrder : couponOrderList) { for (HighChildOrder childOrder : couponOrderList) {
if (StringUtils.isBlank(order.getSearchTitle())) { if (StringUtils.isBlank(order.getTitle())) {
order.setTitle(childOrder.getGoodsName()); order.setTitle(childOrder.getGoodsName());
} else { } else {
order.setTitle("+"+childOrder.getGoodsName()); order.setTitle("+"+childOrder.getGoodsName());
@ -253,7 +254,7 @@ public class OrderServiceImpl implements OrderService {
List<HighChildOrder> couponOrderList = orderCreateHandleService.thirdPartyOrder(object); List<HighChildOrder> couponOrderList = orderCreateHandleService.thirdPartyOrder(object);
childOrderList = couponOrderList; childOrderList = couponOrderList;
for (HighChildOrder childOrder : couponOrderList) { for (HighChildOrder childOrder : couponOrderList) {
if (StringUtils.isBlank(order.getSearchTitle())) { if (StringUtils.isBlank(order.getTitle())) {
order.setTitle(childOrder.getGoodsName()); order.setTitle(childOrder.getGoodsName());
} else { } else {
order.setTitle("+"+childOrder.getGoodsName()); order.setTitle("+"+childOrder.getGoodsName());
@ -662,6 +663,10 @@ public class OrderServiceImpl implements OrderService {
criteria.andMemIdEqualTo(MapUtils.getLong(param, "userId")); criteria.andMemIdEqualTo(MapUtils.getLong(param, "userId"));
} }
if (MapUtils.getLong(param, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "title"))) { if (StringUtils.isNotBlank(MapUtils.getString(param, "title"))) {
criteria.andTitleEqualTo("%" + MapUtils.getString(param, "title") + "%"); criteria.andTitleEqualTo("%" + MapUtils.getString(param, "title") + "%");
} }
@ -677,9 +682,33 @@ public class OrderServiceImpl implements OrderService {
if (MapUtils.getInteger(param, "productType") != null) { if (MapUtils.getInteger(param, "productType") != null) {
criteria.andProductTypeEqualTo(MapUtils.getInteger(param, "productType")); criteria.andProductTypeEqualTo(MapUtils.getInteger(param, "productType"));
} }
if (MapUtils.getInteger(param, "payType") != null) {
criteria.andPayTypeEqualTo(MapUtils.getInteger(param, "payType"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "memCardNo"))) {
criteria.andMemCardNoLike("%" + MapUtils.getString(param, "memCardNo") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "memPhone"))) {
criteria.andMemPhoneLike("%" + MapUtils.getString(param, "memPhone") + "%");
}
if (MapUtils.getInteger(param, "status") != null) { if (MapUtils.getInteger(param, "orderStatus") != null) {
criteria.andOrderStatusEqualTo(MapUtils.getInteger(param, "status")); criteria.andOrderStatusEqualTo(MapUtils.getInteger(param, "orderStatus"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(param, "createTimeE"))) {
criteria.andCreateTimeBetween(
DateUtil.format(MapUtils.getString(param, "createTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(param, "createTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "payTimeS")) && StringUtils.isNotBlank(MapUtils.getString(param, "payTimeE"))) {
criteria.andPayTimeBetween(
DateUtil.format(MapUtils.getString(param, "payTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(param, "payTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "finishTimeS")) && StringUtils.isNotBlank(MapUtils.getString(param, "finishTimeE"))) {
criteria.andFinishTimeBetween(
DateUtil.format(MapUtils.getString(param, "finishTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(param, "finishTimeE"), "yyyy-MM-dd HH:mm:ss"));
} }
example.setOrderByClause("create_time desc"); example.setOrderByClause("create_time desc");

@ -25,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 , Long popularizeUserId , String regionId); void insertDistributionRebate(Long userId , Long popularizeUserId , String regionId) throws Exception;
/** /**
* @Author Sum1Dream * @Author Sum1Dream

@ -123,7 +123,7 @@ public interface HighUserService {
* @param: [highUser] 用户信息 * @param: [highUser] 用户信息
* @return: com.hai.entity.HighUser * @return: com.hai.entity.HighUser
*/ */
void insertUser(HighUser highUser , Long popularizeUserId , String regionId); void insertUser(HighUser highUser , Long popularizeUserId , String regionId) throws Exception;
/** /**
* @Author 胡锐 * @Author 胡锐

@ -37,7 +37,7 @@ public class BsConfigServiceImpl implements BsConfigService {
criteria.andSourceIdEqualTo(MapUtils.getLong(map , "sourceId")); criteria.andSourceIdEqualTo(MapUtils.getLong(map , "sourceId"));
} }
if (bsProductDiscountMapper.selectByExample(example) == null) { if (bsProductDiscountMapper.selectByExample(example).size() == 0) {
return null; return null;
} }

@ -43,7 +43,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
private HighUserMapper highUserMapper; private HighUserMapper highUserMapper;
@Override @Override
public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) { public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) throws Exception {
HighUser user = highUserService.findByUserId(userId); HighUser user = highUserService.findByUserId(userId);
HighUser pUser = highUserService.findByUserId(popularizeUserId); HighUser pUser = highUserService.findByUserId(popularizeUserId);
@ -78,10 +78,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
bsDistributionUserRelMapper.insert(distributionUserRel); bsDistributionUserRelMapper.insert(distributionUserRel);
new Thread(() -> { }
new Thread(() -> {
try { try {
if (regionId != null) {
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId));
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
@ -93,7 +96,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
freeMap.put("userPhone", user.getPhone()); freeMap.put("userPhone", user.getPhone());
highDiscountPackageService.freeUserDiscountPackage(freeMap); highDiscountPackageService.freeUserDiscountPackage(freeMap);
if (pUser.getIsAgent() == null) { if (pUser != null && pUser.getIsAgent() == null) {
// 查询推广有礼优惠券包 // 查询推广有礼优惠券包
HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue());
Map<String, Object> freeMap1 = new HashMap<>(); Map<String, Object> freeMap1 = new HashMap<>();
@ -102,14 +105,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
freeMap1.put("userPhone", pUser.getPhone()); freeMap1.put("userPhone", pUser.getPhone());
highDiscountPackageService.freeUserDiscountPackage(freeMap1); highDiscountPackageService.freeUserDiscountPackage(freeMap1);
} }
} catch (Exception e) {
e.printStackTrace();
} }
}).start(); } catch (Exception e) {
} e.printStackTrace();
}
}).start();
} }
@Override @Override

@ -609,18 +609,19 @@ public class CommonServiceImpl implements CommonService {
// 配置展示平台 // 配置展示平台
JSONArray productPlatformArray = object.getJSONArray("productPlatform"); JSONArray productPlatformArray = object.getJSONArray("productPlatform");
for (Object platform : productPlatformArray) { for (Object platform : productPlatformArray) {
productPlatform = new BsProductPlatform(); if (String.valueOf(platform).length() > 0) {
SecDictionary dictionary = mappingSysCode("SHOW_PLATFORM", String.valueOf(platform)); productPlatform = new BsProductPlatform();
productPlatform.setProductType(object.getInteger("productType")); SecDictionary dictionary = mappingSysCode("SHOW_PLATFORM", String.valueOf(platform));
productPlatform.setPlatformId(Integer.valueOf(String.valueOf(platform))); productPlatform.setProductType(object.getInteger("productType"));
productPlatform.setPlatformName(dictionary.getCodeName()); productPlatform.setPlatformId(Integer.valueOf(String.valueOf(platform)));
productPlatform.setCreateTime(new Date()); productPlatform.setPlatformName(dictionary.getCodeName());
productPlatform.setUpdateTime(new Date()); productPlatform.setCreateTime(new Date());
productPlatform.setOperatorId(object.getLong("operatorId")); productPlatform.setUpdateTime(new Date());
productPlatform.setOperatorName(object.getString("operatorName")); productPlatform.setOperatorId(object.getLong("operatorId"));
productPlatform.setSourceId(object.getLong("sourceId")); productPlatform.setOperatorName(object.getString("operatorName"));
productPlatform.setSourceId(object.getLong("sourceId"));
bsProductPlatformMapper.insert(productPlatform); bsProductPlatformMapper.insert(productPlatform);
}
} }
} }

@ -300,7 +300,7 @@ public class HighUserServiceImpl implements HighUserService {
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertUser(HighUser highUser , Long popularizeUserId , String regionId) { public void insertUser(HighUser highUser , Long popularizeUserId , String regionId) throws Exception {
highUserMapper.insert(highUser); highUserMapper.insert(highUser);
if (highUser.getPhone() != null) { if (highUser.getPhone() != null) {

@ -85,8 +85,9 @@ public class OutRechargePriceServiceImpl implements OutRechargePriceService {
listMap.put("returnType", 1); listMap.put("returnType", 1);
listMap.put("sourceId", outRechargePrice.getId()); listMap.put("sourceId", outRechargePrice.getId());
listMap.put("platformId", platformId); listMap.put("platformId", platformId);
if (bsConfigService.getProductDiscountByMap(listMap) != null) {
outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount()); outRechargePriceModel.setIntegralDiscount(bsConfigService.getProductDiscountByMap(listMap).getDiscount());
}
outRechargePriceModel.setProductPayTypeString(bsConfigService.getProductPayTypeByMap(listMap)); outRechargePriceModel.setProductPayTypeString(bsConfigService.getProductPayTypeByMap(listMap));
outRechargePriceModel.setProductPlatformString(bsConfigService.getProductPlatformByMap(listMap)); outRechargePriceModel.setProductPlatformString(bsConfigService.getProductPlatformByMap(listMap));
return outRechargePriceModel; return outRechargePriceModel;

Loading…
Cancel
Save