dev-discount
胡锐 3 years ago
commit 9d5252170b
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/CmsContentController.java
  2. 22
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountPackageController.java
  3. 9
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  4. 27
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  5. 2
      hai-schedule/src/main/resources/dev/application.yml
  6. 2
      hai-service/src/main/java/com/hai/dao/CmsContentMapperExt.java
  7. 38
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  8. 20
      hai-service/src/main/java/com/hai/service/HighDiscountPackageActualService.java
  9. 4
      hai-service/src/main/java/com/hai/service/HighDiscountPackageDetailsService.java
  10. 1
      hai-service/src/main/java/com/hai/service/HighDiscountPackageService.java
  11. 11
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  12. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  13. 19
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageActualServiceImpl.java
  14. 1
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageDetailsServiceImpl.java
  15. 1
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java
  16. 5
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java

@ -216,6 +216,8 @@ public class CmsContentController {
} }
} }
@RequestMapping(value = "/updateStatusOfContent", method = RequestMethod.POST) @RequestMapping(value = "/updateStatusOfContent", method = RequestMethod.POST)
@ApiOperation(value = "更新 内容发布状态") @ApiOperation(value = "更新 内容发布状态")
@ResponseBody @ResponseBody

@ -27,6 +27,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -60,6 +61,9 @@ public class HighDiscountPackageController {
@Resource @Resource
private HighDiscountPackageRecordService discountPackageRecordService; private HighDiscountPackageRecordService discountPackageRecordService;
@Resource
private HighDiscountPackageActualService discountPackageActualService;
@RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET) @RequestMapping(value = "/getDiscountPackageList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "获取优惠券包列表") @ApiOperation(value = "获取优惠券包列表")
@ -83,7 +87,14 @@ public class HighDiscountPackageController {
map.put("salesType" , salesType); map.put("salesType" , salesType);
map.put("status" , status); map.put("status" , status);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highDiscountPackageService.getDiscountPackageList(map)));
List<HighDiscountPackage> list = highDiscountPackageService.getDiscountPackageList(map);
for (HighDiscountPackage data : list) {
data.setSurplusStock(discountPackageActualService.getDiscountPackageNum(data.getId()).intValue());
}
return ResponseMsgUtil.success(new PageInfo<>(list));
} catch (Exception e) { } catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e); log.error("HighOrderController --> getUserOrderList() error!", e);
@ -115,6 +126,7 @@ public class HighDiscountPackageController {
map.put("recordNo" , recordNo); map.put("recordNo" , recordNo);
map.put("phone" , phone); map.put("phone" , phone);
map.put("salesType" , salesType); map.put("salesType" , salesType);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highDiscountPackageService.getDiscountPackageRecordList(map))); return ResponseMsgUtil.success(new PageInfo<>(highDiscountPackageService.getDiscountPackageRecordList(map)));
@ -136,9 +148,9 @@ public class HighDiscountPackageController {
if (StringUtils.isBlank(highDiscountPackage.getTitle()) if (StringUtils.isBlank(highDiscountPackage.getTitle())
|| highDiscountPackage.getSalesType() == null || highDiscountPackage.getSalesType() == null
// || StringUtils.isBlank(highDiscountPackage.getBannerImg()) || StringUtils.isBlank(highDiscountPackage.getBannerImg())
// || StringUtils.isBlank(highDiscountPackage.getListImg()) || StringUtils.isBlank(highDiscountPackage.getListImg())
// || StringUtils.isBlank(highDiscountPackage.getDetailsImg()) || StringUtils.isBlank(highDiscountPackage.getDetailsImg())
) { ) {
log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误"); log.error("HighAgentController -> insertCouponPackageInfo() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -429,7 +441,7 @@ public class HighDiscountPackageController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
} }
if (highDiscountPackage.getSurplusStock() == null || highDiscountPackage.getSurplusStock() == 0 ) { if (discountPackageActualService.getDiscountPackageNum(object.getInteger("discountPackageId")) == 0 ) {
log.error("highCouponPackage -> upDiscountPackage() error!","当前库存不足"); log.error("highCouponPackage -> upDiscountPackage() error!","当前库存不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前库存不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前库存不足");
} }

@ -74,6 +74,8 @@ public class HighOrderController {
@Resource @Resource
private HighDiscountPackageActualService discountPackageActualService; private HighDiscountPackageActualService discountPackageActualService;
@Resource @Resource
private HighUserService highUserService; private HighUserService highUserService;
@ -243,6 +245,7 @@ public class HighOrderController {
if (childOrder.getGoodsType() == 7) { if (childOrder.getGoodsType() == 7) {
// 查询优惠券包 // 查询优惠券包
HighDiscountPackage discountPackage = discountPackageService.findDiscountPackageById(childOrder.getGoodsId().intValue()); HighDiscountPackage discountPackage = discountPackageService.findDiscountPackageById(childOrder.getGoodsId().intValue());
if (discountPackage == null) { if (discountPackage == null) {
log.error("HighOrderController --> addOrder() error!", ""); log.error("HighOrderController --> addOrder() error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到优惠券包"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到优惠券包");
@ -255,6 +258,12 @@ public class HighOrderController {
log.error("HighOrderController --> addOrder() error!", ""); log.error("HighOrderController --> addOrder() error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "库存数量不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "库存数量不足");
} }
if (discountPackage.getPurchaseNum() < discountPackageActualService.userPurchaseByUserId(userInfoModel.getHighUser().getId().intValue(), discountPackage.getId())) {
log.error("HighOrderController --> addOrder() error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "超过购买限制");
}
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
childOrder.setGoodsName(discountPackage.getTitle()); childOrder.setGoodsName(discountPackage.getTitle());
childOrder.setGoodsImg(discountPackage.getListImg()); childOrder.setGoodsImg(discountPackage.getListImg());

@ -6,8 +6,10 @@ import com.hai.config.QianZhuConfig;
import com.hai.config.WxOrderConfig; import com.hai.config.WxOrderConfig;
import com.hai.entity.HighChildOrder; import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OrderRefundModel; import com.hai.model.OrderRefundModel;
import com.hai.service.HighOrderService; import com.hai.service.HighOrderService;
import com.hai.service.OutRechargeOrderService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -33,6 +35,9 @@ public class HighOrderSchedule {
@Resource @Resource
private HighOrderService highOrderService; private HighOrderService highOrderService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 取消订单 15分钟 * @Description 取消订单 15分钟
@ -52,6 +57,28 @@ public class HighOrderSchedule {
} }
} }
/**
* @Author Sum1Dream
* @name cancelMobileOrder.java
* @Description // 取消话费订单
* @Date 3:33 下午 2021/12/10
* @Param []
* @return void
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void cancelMobileOrder() {
List<OutRechargeOrder> orderList = outRechargeOrderService.getOutRechargeOrderList();
if (orderList != null && orderList.size() > 0) {
for (OutRechargeOrder order : orderList) {
try {
outRechargeOrderService.cancelOrder(order.getId());
} catch (Exception e) {
log.error("HighCouponSchedule --> expiredCoupon() error!", e);
}
}
}
}
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 处理话费充值订单 * @Description 处理话费充值订单

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource

@ -44,7 +44,7 @@ public interface CmsContentMapperExt {
" AND cc.status = #{status}", " AND cc.status = #{status}",
" </when>", " </when>",
"</choose>", "</choose>",
"ORDER BY cc.sort_id ASC, cc.update_time DESC, cc.create_time DESC", "ORDER BY cc.category_code",
"</script>" "</script>"
}) })
@Results({ @Results({

@ -1,6 +1,8 @@
package com.hai.dao; package com.hai.dao;
import com.hai.entity.HighOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.model.OutOrderModel; import com.hai.model.OutOrderModel;
import com.hai.model.OutRechargeOrderModel; import com.hai.model.OutRechargeOrderModel;
import com.hai.model.OutUserOrderModel; import com.hai.model.OutUserOrderModel;
@ -101,4 +103,40 @@ public interface OutRechargeOrderMapperExt {
"</script>" "</script>"
}) })
List<OutRechargeOrderModel> selectOrderCount(@Param("map") Map<String,Object> map); List<OutRechargeOrderModel> selectOrderCount(@Param("map") Map<String,Object> map);
@Select({"SELECT * FROM out_recharge_order ho WHERE TIMESTAMPDIFF(MINUTE,ho.create_timed,SYSDATE()) > 15 AND ho.status = 1"})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT),
@Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
@Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_model", property="rechargeModel", jdbcType=JdbcType.INTEGER),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
@Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
@Result(column="id_card", property="idCard", jdbcType=JdbcType.VARCHAR),
@Result(column="create_timed", property="createTimed", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
@Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
@Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT)
})
List<OutRechargeOrder> getCloseOrder();
} }

@ -69,4 +69,24 @@ public interface HighDiscountPackageActualService {
*/ */
List<HighDiscountPackageActual> getListByPackageId(Integer packageId, Integer status); List<HighDiscountPackageActual> getListByPackageId(Integer packageId, Integer status);
/**
* @Author Sum1Dream
* @name getDiscountPackageNum.java
* @Description // 获取优惠券包实际库存数量
* @Date 9:59 上午 2021/12/10
* @Param [java.lang.Integer]
* @return java.lang.Integer
*/
Long getDiscountPackageNum(Integer discountPackageId);
/**
* @Author Sum1Dream
* @name userPurchaseByUserId.java
* @Description // 查询用户是否限购
* @Date 5:09 下午 2021/12/10
* @Param [java.lang.Integer, java.lang.Integer]
* @return java.lang.Long
*/
Long userPurchaseByUserId(Integer userId , Integer discountPackage);
} }

@ -1,6 +1,7 @@
package com.hai.service; package com.hai.service;
import com.hai.entity.HighDiscount; import com.hai.entity.HighDiscount;
import com.hai.entity.HighDiscountPackageActual;
import com.hai.entity.HighDiscountPackageDetails; import com.hai.entity.HighDiscountPackageDetails;
import java.util.List; import java.util.List;
@ -62,4 +63,7 @@ public interface HighDiscountPackageDetailsService {
*/ */
void updateDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails); void updateDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails);
} }

@ -89,5 +89,4 @@ public interface HighDiscountPackageService {
*/ */
void addDiscountPackageStock(HighDiscountPackage highDiscountPackage, UserInfoModel userInfoModel , Integer num); void addDiscountPackageStock(HighDiscountPackage highDiscountPackage, UserInfoModel userInfoModel , Integer num);
} }

@ -120,4 +120,15 @@ public interface OutRechargeOrderService {
* @param orderId * @param orderId
*/ */
void goldPayOrder(Long userId, Long orderId); void goldPayOrder(Long userId, Long orderId);
/**
* @Author Sum1Dream
* @name getOutRechargeOrderList.java
* @Description // 查询话费充值超过15分钟订单
* @Date 3:34 下午 2021/12/10
* @Param []
* @return java.util.List<com.hai.entity.OutRechargeOrder>
*/
List<OutRechargeOrder> getOutRechargeOrderList();
} }

@ -380,7 +380,7 @@ public class HighCouponServiceImpl implements HighCouponService {
criteria.andCouponSourceNotEqualTo(MapUtils.getInteger(map, "notCouponSource")); criteria.andCouponSourceNotEqualTo(MapUtils.getInteger(map, "notCouponSource"));
} }
example.setOrderByClause("create_time desc"); example.setOrderByClause("display_area desc");
List<HighCoupon> coupons = highCouponMapper.selectByExample(example); List<HighCoupon> coupons = highCouponMapper.selectByExample(example);
if (coupons != null && coupons.size() > 0) { if (coupons != null && coupons.size() > 0) {
for (HighCoupon highCoupon : coupons) { for (HighCoupon highCoupon : coupons) {

@ -10,6 +10,7 @@ import com.hai.service.HighDiscountPackageActualService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -79,4 +80,22 @@ public class HighDiscountPackageActualServiceImpl implements HighDiscountPackage
example.setOrderByClause("created_time"); example.setOrderByClause("created_time");
return discountPackageActualMapper.selectByExample(example); return discountPackageActualMapper.selectByExample(example);
} }
@Override
public Long getDiscountPackageNum(Integer discountPackageId) {
HighDiscountPackageActualExample example = new HighDiscountPackageActualExample();
HighDiscountPackageActualExample.Criteria criteria = example.createCriteria();
criteria.andDiscountPackageIdEqualTo(discountPackageId).andStatusEqualTo(1);
return discountPackageActualMapper.countByExample(example);
}
@Override
public Long userPurchaseByUserId(Integer userId, Integer discountPackage) {
List<Integer> statusList = new ArrayList<>();
statusList.add(2);
statusList.add(3);
HighDiscountPackageActualExample example = new HighDiscountPackageActualExample();
example.createCriteria().andDiscountPackageIdEqualTo(discountPackage).andUserIdEqualTo(userId).andStatusIn(statusList);
return discountPackageActualMapper.countByExample(example);
}
} }

@ -66,4 +66,5 @@ public class HighDiscountPackageDetailsServiceImpl implements HighDiscountPackag
public void updateDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails) { public void updateDiscountPackageDetails(HighDiscountPackageDetails highDiscountPackageDetails) {
highDiscountPackageDetailsMapper.updateByPrimaryKey(highDiscountPackageDetails); highDiscountPackageDetailsMapper.updateByPrimaryKey(highDiscountPackageDetails);
} }
} }

@ -222,4 +222,5 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
highDiscountPackage.setTotalStock(totalStock + num); highDiscountPackage.setTotalStock(totalStock + num);
highDiscountPackageMapper.updateByPrimaryKey(highDiscountPackage); highDiscountPackageMapper.updateByPrimaryKey(highDiscountPackage);
} }
} }

@ -340,4 +340,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
order.setPayTime(new Date()); // 支付时间 order.setPayTime(new Date()); // 支付时间
updateOrder(order); updateOrder(order);
} }
@Override
public List<OutRechargeOrder> getOutRechargeOrderList() {
return outRechargeOrderMapper.getCloseOrder();
}
} }

Loading…
Cancel
Save