修改话费定时任务问题

dev-discount
袁野 2 years ago
parent dd9bcc4cbe
commit 5121d06e06
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  2. 3
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  3. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  4. 2
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  5. 2
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  6. 80
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  7. 10
      hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java
  8. 7
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  9. 9
      v1/src/main/java/com/v1/controller/HighOrderController.java

File diff suppressed because one or more lines are too long

@ -444,13 +444,14 @@ public class HighOrderController {
if (request.getHeader("regionId") != null) {
if (request.getHeader("regionId") != null && request.getHeader("regionId").length() != 0) {
SecRegion region = commonService.getParentByRegion(Long.valueOf(request.getHeader("regionId")));
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
highOrder.setCompanyId(bsCompany.getId());
}
highOrder.setMerchId(request.getHeader("mchId"));
highOrder.setWhetherRebate(false);
highOrder.setTotalPrice(totalPrice);
highOrder.setPayablePrice(totalActualPrice);

File diff suppressed because one or more lines are too long

@ -431,7 +431,7 @@ public class HighOrderSchedule {
}
}
}
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
@Scheduled(cron="0 0/1 * * * ?") //每10分钟执行一次
public void integralRebateOrder() {
List<HighOrder> order = highOrderService.integralRebateOrder();
for (HighOrder highOrder : order) {

@ -1250,7 +1250,7 @@ public interface HighOrderMapperExt {
})
List<SelfOilStationModel> getSelfOilStationOrderList(@Param("goodsId") String goodsId);
@Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 ")
@Select("select * from high_order where order_status = 3 and pay_type != 3 and pay_real_price > 0 and whether_rebate = false ")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),

@ -3,6 +3,7 @@ package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* high_order
@ -232,6 +233,83 @@ public class HighOrder implements Serializable {
private String ext3;
private String payPwd;
private List<HighChildOrder> highChildOrderList;
private HighDiscount highDiscount;
private Boolean isTyAgent;
private String gasStaffCode;
private String password;
/**
* 是否自动充值积分 0 1
*/
private Boolean buyPoints;
public String getPayPwd() {
return payPwd;
}
public void setPayPwd(String payPwd) {
this.payPwd = payPwd;
}
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}
public void setHighChildOrderList(List<HighChildOrder> highChildOrderList) {
this.highChildOrderList = highChildOrderList;
}
public HighDiscount getHighDiscount() {
return highDiscount;
}
public void setHighDiscount(HighDiscount highDiscount) {
this.highDiscount = highDiscount;
}
public Boolean getIsTyAgent() {
return isTyAgent;
}
public void setIsTyAgent(Boolean tyAgent) {
isTyAgent = tyAgent;
}
public String getGasStaffCode() {
return gasStaffCode;
}
public void setGasStaffCode(String gasStaffCode) {
this.gasStaffCode = gasStaffCode;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Boolean getBuyPoints() {
return buyPoints;
}
public void setBuyPoints(Boolean buyPoints) {
this.buyPoints = buyPoints;
}
private static final long serialVersionUID = 1L;
public Long getId() {
@ -771,4 +849,4 @@ public class HighOrder implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

@ -5,7 +5,9 @@ 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;
@ -25,6 +27,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
@Resource
private HighUserService highUserService;
@Resource
private HighOrderService highOrderService;
@Override
public BsIntegralRebate findIntegralRebateByMap(Map<String, Object> map) {
@ -100,6 +105,11 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService {
BsIntegralRebate bsIntegralRebate = findIntegralRebateByMap(map);
if (DateUtil.isEffectiveDate(object.getDate("createTime"), bsIntegralRebate.getStartTime() , bsIntegralRebate.getEndTime())) {
HighOrder order = highOrderService.getOrderById(object.getLong("orderId"));
order.setWhetherRebate(true);
BigDecimal integralNum = object.getBigDecimal("price").multiply(bsIntegralRebate.getPercentage()).setScale( 0, BigDecimal.ROUND_HALF_UP );
highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum);

@ -1608,6 +1608,11 @@ public class HighOrderServiceImpl implements HighOrderService {
if (MapUtils.getString(map, "merchId") != null) {
criteria.andMerchIdEqualTo(MapUtils.getString(map, "merchId"));
}
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");
List<HighOrder> list = highOrderMapper.selectByExample(example);
@ -2217,6 +2222,7 @@ public class HighOrderServiceImpl implements HighOrderService {
HighOrder highOrder = new HighOrder();
highOrder.setMerchId(object.getString("mchId"));
highOrder.setWhetherRebate(false);
HighUser user = highUserService.findByUserId(object.getLong("userId"));
JSONObject jsonObject = null;
@ -2688,6 +2694,7 @@ public class HighOrderServiceImpl implements HighOrderService {
order.setOrderStatus(2);
order.setMemCardNo(userCard.getCardNo());
order.setPayType(4);
order.setPayTime(new Date()); // 支付时间
updateOrder(order);

@ -71,6 +71,9 @@ public class HighOrderController {
}
if (StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("createTimeS")) ||
StringUtils.isBlank(object.getString("createTimeE")) ||
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("sign"))
@ -90,6 +93,8 @@ public class HighOrderController {
map.put("apiKey" , object.getString("apiKey"));
map.put("timetable" , object.getString("timetable"));
map.put("merchId" , object.getString("merchId"));
map.put("createTimeS" , object.getString("createTimeS"));
map.put("createTimeE" , object.getString("createTimeE"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
log.error("getRechargeProduct error!", "签名校验失败!");
@ -133,6 +138,8 @@ public class HighOrderController {
if (StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("createTimeS")) ||
StringUtils.isBlank(object.getString("createTimeE")) ||
StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("sign"))
) {
@ -151,6 +158,8 @@ public class HighOrderController {
map.put("apiKey" , object.getString("apiKey"));
map.put("timetable" , object.getString("timetable"));
map.put("merchId" , object.getString("merchId"));
map.put("createTimeS" , object.getString("createTimeS"));
map.put("createTimeE" , object.getString("createTimeE"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
log.error("getRechargeProduct error!", "签名校验失败!");

Loading…
Cancel
Save