提交代码

dev
胡锐 2 months ago
parent 264ee4c947
commit 2550b407c6
  1. 2
      bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java
  2. 7
      service/src/main/java/com/hfkj/dao/BsDiscountUserMapperExt.java
  3. 18
      service/src/main/java/com/hfkj/sysenum/discount/DiscountStockCodeStatusEnum.java

@ -91,8 +91,6 @@ public class BsDiscountStockController {
} }
} }
@RequestMapping(value="/queryStockBatchCodeList",method = RequestMethod.GET) @RequestMapping(value="/queryStockBatchCodeList",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询库存批次优惠券code") @ApiOperation(value = "查询库存批次优惠券code")

@ -40,6 +40,11 @@ public interface BsDiscountUserMapperExt {
"</script>"}) "</script>"})
List<DiscountUserModel> queryUserDiscountList(@Param("param") Map<String,Object> param); List<DiscountUserModel> queryUserDiscountList(@Param("param") Map<String,Object> param);
@Update("<script>update bs_discount_user SET `status` = 3 where `status` = 1 <![CDATA[ and expiration_date <= NOW() ]]></script>") @Update("<script>" +
" update bs_discount_user a" +
" LEFT JOIN bs_discount_stock_code b on b.id = a.discount_stock_code " +
" SET a.`status` = 3,b.`status` = 4" +
" where a.`status` = 1 <![CDATA[ and a.expiration_date <= NOW() ]]>" +
" </script>")
void expiration(); void expiration();
} }

@ -7,10 +7,26 @@ import java.util.Objects;
* @author hurui * @author hurui
*/ */
public enum DiscountStockCodeStatusEnum { public enum DiscountStockCodeStatusEnum {
status0(0 , "删除"), /**
* 不可用
*/
status0(0 , "不可用"),
/**
* 未领取
*/
status1(1 , "未领取"), status1(1 , "未领取"),
/**
* 未使用
*/
status2(2 , "未使用"), status2(2 , "未使用"),
/**
* 已使用
*/
status3(3 , "已使用"), status3(3 , "已使用"),
/**
* 已过期
*/
status4(4 , "已过期"),
; ;
private Integer code; private Integer code;

Loading…
Cancel
Save