dev-discount
袁野 2 years ago
commit a1986b9a29
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/BsIntegralRebateController.java
  2. 12
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java
  3. 18
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  5. 5
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  6. 1
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  7. 5
      hai-service/src/main/java/com/hai/config/ThirdProductConfig.java
  8. 3
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  9. 27
      hai-service/src/main/java/com/hai/model/GasOrderModel.java
  10. 47
      hai-service/src/main/java/com/hai/service/BsDistributionUserRelService.java
  11. 73
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  12. 11
      hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java
  13. 9
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  14. 2
      hai-service/src/main/java/com/hai/service/impl/HltUnionCardVipServiceImpl.java
  15. 2
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  16. 2
      hai-service/src/main/resources/prod/commonConfig.properties
  17. 2
      v1/src/main/java/com/v1/controller/GzSinopecController.java

@ -96,6 +96,8 @@ public class BsIntegralRebateController {
if (integralRebate.getPercentage() == null ||
integralRebate.getType() == null ||
integralRebate.getStartTime() == null ||
integralRebate.getEndTime() == null ||
integralRebate.getProductId() == null
) {
log.error("OutRechargePriceController -> insertPrice() error!");
@ -142,6 +144,8 @@ public class BsIntegralRebateController {
if (integralRebate.getPercentage() == null ||
integralRebate.getId() == null ||
integralRebate.getStartTime() == null ||
integralRebate.getEndTime() == null ||
integralRebate.getType() == null ||
integralRebate.getProductId() == null
) {

@ -164,9 +164,9 @@ public class HighDiscountPackageController {
if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highDiscountPackage.getSalesType() == null
|| StringUtils.isBlank(highDiscountPackage.getBannerImg())
|| StringUtils.isBlank(highDiscountPackage.getListImg())
|| StringUtils.isBlank(highDiscountPackage.getDetailsImg())
// || StringUtils.isBlank(highDiscountPackage.getBannerImg())
// || StringUtils.isBlank(highDiscountPackage.getListImg())
// || StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) {
log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -225,9 +225,9 @@ public class HighDiscountPackageController {
if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highDiscountPackage.getSalesType() == null
|| highDiscountPackage.getId() == null
|| StringUtils.isBlank(highDiscountPackage.getBannerImg())
|| StringUtils.isBlank(highDiscountPackage.getListImg())
|| StringUtils.isBlank(highDiscountPackage.getDetailsImg())
// || StringUtils.isBlank(highDiscountPackage.getBannerImg())
// || StringUtils.isBlank(highDiscountPackage.getListImg())
// || StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) {
log.error("HighAgentController -> updateCouponPackageInfo() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");

@ -233,7 +233,6 @@ public class HighOrderController {
log.error("HighOrderController --> addOrder() error!", "未找到用户");
throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "");
}
highOrder.setPayType(2); // 第三方平台
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
childOrder.setGoodsName(user.getName());
childOrder.setGoodsImg(user.getHeaderImg());
@ -306,8 +305,6 @@ public class HighOrderController {
log.error("HighOrderController --> addOrder() error!", "未找到门店信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息");
}
highOrder.setPayType(2); // 第三方平台
if (highOrder.getIsTyAgent() != null && highOrder.getIsTyAgent().equals(true)) {
// 查询加油站
HighTyAgentOilStation oilStation = tyAgentOilStationService.getDetailByOilStationId(childOrder.getGoodsId());
@ -330,15 +327,15 @@ public class HighOrderController {
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
// 油价信息
childOrder.setGasPriceGun(priceModel.getPriceGun());
childOrder.setGasPriceVip(priceModel.getPriceVip());
childOrder.setGasPriceOfficial(priceModel.getPriceOfficial());
childOrder.setGasPricePlatform(priceModel.getPriceVip());
childOrder.setGasPriceVip(priceModel.getPriceGun());
childOrder.setGasPriceOfficial(new BigDecimal("0"));
childOrder.setGasPricePlatform(priceModel.getPriceGun());
childOrder.setGasOilLiters(priceModel.getOilLiters());
childOrder.setGasDiscount(new BigDecimal("0"));
childOrder.setExt1(childOrder.getGasPricePlatform().toString());
childOrder.setGasOilSubsidy(new BigDecimal("0"));
childOrder.setGasLitersPreferences(new BigDecimal("0"));
childOrder.setGasPricePreferences(priceModel.getPriceVip());
childOrder.setGasPricePreferences(priceModel.getPriceGun());
} else {
// 支付价格
childOrder.setGoodsActualPrice(priceModel.getPayPrice());
@ -445,10 +442,11 @@ public class HighOrderController {
}
}
SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId")));
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
if (bsCompany != null) {
if (request.getHeader("regionId") != null) {
SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId")));
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
highOrder.setCompanyId(bsCompany.getId());
}

File diff suppressed because one or more lines are too long

@ -156,6 +156,11 @@ public class HighGasSchedule {
gasService.getJiaHaoYouAllStation();
}
@Scheduled(cron = "0 1 0 * * ?") //每日凌晨12点01分执行一次
public void getJinZhuAllStation() throws Exception {
gasService.getJinZhuAllStation();
}
/* @Scheduled(cron = "0 30 7 * * ?") //每日7点1分执行一次
public void refreshPriceOfficial() throws Exception {
gasOilPriceOfficialService.refreshPriceOfficial();

@ -452,6 +452,7 @@ public class HighOrderSchedule {
object.put("userId" , highOrder.getMemId());
object.put("orderId" , highOrder.getId());
object.put("companyId" , highOrder.getCompanyId());
object.put("createTime" , highOrder.getCreateTime());
bsIntegralRebateService.integralRebate(object);

@ -9,9 +9,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author hurui
@ -78,4 +76,5 @@ public class ThirdProductConfig {
return object;
}
}

@ -1154,9 +1154,12 @@ public interface HighOrderMapperExt {
" b.id orderId," +
" b.order_no orderNo," +
" a.gas_order_no gasOrderNo," +
" b.mem_discount_name memDiscountName," +
" b.pay_type payType," +
" b.total_price totalPrice," +
" b.deduction_price deductionPrice," +
" b.payable_price payablePrice," +
" b.pay_gold payGold," +
" b.pay_real_price payRealPrice," +
" b.order_status status," +
" REPLACE(b.mem_phone, SUBSTR(b.mem_phone,4,4), '****') merPhone," +

@ -12,9 +12,12 @@ public class GasOrderModel {
private Long orderId;
private String orderNo;
private String gasOrderNo;
private String memDiscountName;
private Integer payType;
private BigDecimal totalPrice;
private BigDecimal deductionPrice;
private BigDecimal payablePrice;
private BigDecimal payGold;
private BigDecimal payRealPrice;
private Integer status;
private String merPhone;
@ -39,6 +42,30 @@ public class GasOrderModel {
private Boolean printStatus;
private Integer printNum;
public BigDecimal getPayablePrice() {
return payablePrice;
}
public void setPayablePrice(BigDecimal payablePrice) {
this.payablePrice = payablePrice;
}
public BigDecimal getPayGold() {
return payGold;
}
public void setPayGold(BigDecimal payGold) {
this.payGold = payGold;
}
public String getMemDiscountName() {
return memDiscountName;
}
public void setMemDiscountName(String memDiscountName) {
this.memDiscountName = memDiscountName;
}
public String getGasStaffName() {
return gasStaffName;
}

@ -0,0 +1,47 @@
package com.hai.service;
import com.hai.entity.BsDistributionRebate;
import com.hai.entity.BsDistributionUserRel;
import java.util.List;
import java.util.Map;
/**
* @serviceName BsDistributionUserRelService.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 分销用户关联接口
* @createTime 17:47 2022/8/11
**/
public interface BsDistributionUserRelService {
/**
* @Author Sum1Dream
* @name insertDistributionRebate.java
* @Description // 新增关联关系
* @Date 17:55 2022/8/11
* @Param [java.lang.Long, java.lang.Long]
* @return void
*/
void insertDistributionRebate(Long userId , String userName, Long popularizeUserId);
/**
* @Author Sum1Dream
* @name getDistributionRebateList.java
* @Description // 查询关联列表
* @Date 17:51 2022/8/11
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.util.List<com.hai.entity.BsDistributionRebate>
*/
List<BsDistributionUserRel> getDistributionUserRelList(Map<String, Object> map);
/**
* @Author Sum1Dream
* @name findDistributionUserRel.java
* @Description // 查询关联关系详情
* @Date 18:00 2022/8/11
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return com.hai.entity.BsDistributionUserRel
*/
BsDistributionUserRel findDistributionUserRel(Map<String, Object> map);
}

@ -0,0 +1,73 @@
package com.hai.service.impl;
import com.hai.dao.BsDistributionRebateMapper;
import com.hai.dao.BsDistributionUserRelMapper;
import com.hai.entity.BsDistributionRebate;
import com.hai.entity.BsDistributionUserRel;
import com.hai.entity.BsDistributionUserRelExample;
import com.hai.service.BsDistributionUserRelService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("bsDistributionUserRelService")
public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelService {
@Resource
private BsDistributionUserRelMapper bsDistributionUserRelMapper;
@Override
public void insertDistributionRebate(Long userId, String userName , Long popularizeUserId) {
// 定义分销关联关系
BsDistributionUserRel distributionUserRel = new BsDistributionUserRel();
// 查询推广员信息
Map<String, Object> map = new HashMap<>();
map.put("userId" , popularizeUserId);
BsDistributionUserRel popularizeUser = findDistributionUserRel(map);
distributionUserRel.setUserId(userId);
distributionUserRel.setUserName(userName);
distributionUserRel.setAgentId(popularizeUser.getAgentId());
distributionUserRel.setAgentName(popularizeUser.getAgentName());
distributionUserRel.setPopularizeUserId(popularizeUserId);
distributionUserRel.setPopularizeUserName(popularizeUser.getUserName());
distributionUserRel.setCreateTime(new Date());
distributionUserRel.setUpdateTime(new Date());
distributionUserRel.setStatus(100);
bsDistributionUserRelMapper.insert(distributionUserRel);
}
@Override
public List<BsDistributionUserRel> getDistributionUserRelList(Map<String, Object> map) {
return null;
}
@Override
public BsDistributionUserRel findDistributionUserRel(Map<String, Object> map) {
BsDistributionUserRelExample example = new BsDistributionUserRelExample();
BsDistributionUserRelExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId"));
}
List<BsDistributionUserRel> list = bsDistributionUserRelMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -1,10 +1,13 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.hai.dao.BsIntegralRebateMapper;
import com.hai.entity.BsIntegralRebate;
import com.hai.entity.BsIntegralRebateExample;
import com.hai.entity.HighOrder;
import com.hai.service.BsIntegralRebateService;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
@ -24,6 +27,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
@Resource
private HighUserService highUserService;
@Resource
private HighOrderService highOrderService;
@Override
public BsIntegralRebate findIntegralRebateByMap(Map<String, Object> map) {
@ -98,13 +104,16 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
BsIntegralRebate bsIntegralRebate = findIntegralRebateByMap(map);
if (bsIntegralRebate != null) {
if (DateUtil.isEffectiveDate(object.getDate("createTime"), bsIntegralRebate.getStartTime() , bsIntegralRebate.getEndTime())) {
BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP );
HighOrder order = highOrderService.getOrderById(object.getLong("orderId"));
highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum);
}
}
}

@ -312,10 +312,11 @@ public class HighOrderServiceImpl implements HighOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付的积分金额大于支付金额");
}
// 应付金额 减去 积分抵扣金额 = 支付金额
highOrder.setPayPrice(highOrder.getPayablePrice().subtract(goldPrice));
// 积分金额小于应付金额
if (goldPrice.compareTo(highOrder.getPayablePrice()) == -1) {
// 应付金额 减去 积分抵扣金额 = 支付金额
highOrder.setPayPrice(highOrder.getPayablePrice().subtract(goldPrice));
updateOrderDetail(highOrder);
// 扣除用户积分
@ -334,7 +335,7 @@ public class HighOrderServiceImpl implements HighOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, "");
}
// 校验支付密码是否正确
if (userPayPwd.getPassword().equals(AESEncodeUtil.aesEncrypt(highOrder.getPayPwd()))) {
if (!userPayPwd.getPassword().equals(AESEncodeUtil.aesEncrypt(highOrder.getPayPwd()))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, "");
}
// 扣除用户积分
@ -342,7 +343,9 @@ public class HighOrderServiceImpl implements HighOrderService {
"抵扣积分订单:" + highOrder.getOrderNo() + ",使用积分:" + highOrder.getPayGold());
highOrder.setOrderStatus(OrderStatusEnum.type3.getType());
highOrder.setPayRealPrice(highOrder.getPayPrice());
highOrder.setPayTime(new Date());
for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) {
childOrder.setChildOrdeStatus(3);
}

@ -121,7 +121,7 @@ public class HltUnionCardVipServiceImpl implements HltUnionCardVipService {
map.put("salesType", 2);
map.put("status", 1);
// 查询话费专属优惠券包
// 查询专属优惠券包
List<HighDiscountPackage> highDiscountPackages = highDiscountPackageService.getDiscountPackageList(map);
if (highDiscountPackages.size() == 0) {

@ -33,7 +33,7 @@ qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify
thirdAppKey=211394653
thirdAppSecret=cyQpQKMaGUG186iEZRt1uQ==
thirdPostUrl=http://mbsmemberwebapi.test.onfishes.com/
thirdPostUrl=http://mbapiq.mbs.scyshy.com/
huiliantongUrl=https://gzapi.deepermobile.com.cn

@ -32,7 +32,7 @@ qianzhuOrderNotify=https://hsg.dctpay.com/crest/qianzhu/orderNotify
thirdAppKey=211395334
thirdAppSecret=VxNTJua4FkmRVgIm8HgCSg==
thirdPostUrl=http://mbsmemberclient.scyshy.com/
thirdPostUrl=http://mbapiq.mbs.scyshy.com/
huiliantongUrl=https://gzapi.deepermobile.com.cn
huiliantongAppNo=guizhouhuilt

@ -36,7 +36,7 @@ import java.util.Map;
@Controller
@RequestMapping(value = "/gzSinopec")
@Api(value = "贵州中石化")
public class GzSinopecController {
public class GzSinopecController {
private static Logger log = LoggerFactory.getLogger(GzSinopecController.class);

Loading…
Cancel
Save