| @@ -188,7 +188,7 @@ public class WxCouponController extends BaseController { | |||||
| if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ | if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ | ||||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | ||||
| } | } | ||||
| if(wxCoupon.getInventory()!=null && wxCoupon.getInventory().intValue() <= coupon.getInventory().intValue() ){ | |||||
| if(wxCoupon.getInventory()!=null && wxCoupon.getInventory().intValue() < coupon.getInventory().intValue() ){ | |||||
| return new ResultData(ErrorCode.COUPON_STOCK_INV_ERR); | return new ResultData(ErrorCode.COUPON_STOCK_INV_ERR); | ||||
| } | } | ||||
| @@ -0,0 +1,115 @@ | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '456', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '789', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1001', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1002', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1003', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1004', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1005', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1006', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1007', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1008', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1009', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1010', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1011', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| INSERT INTO `wx_msg_validationcode_model` (`id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 19, '代办通知', '富茂', '{userName}提交了一个营销申请待您审批,电脑登陆{page} 查看您的待办。', '2019-04-24 12:42:33', 1, 0, 226, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 20, '审批通知', '富茂', '{userName}同意[{type}][{name}]的审批,已呈送至{toUserName},登录{page}查看审批进度。', '2019-05-21 13:41:33', 1, 0, 500, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 21, '通过审批通知', '富茂', '您申请的[{type}],[{name}]已通过审批,请登录{page} 跟进后续工作。', '2019-04-24 12:42:33', 1, 0, 228, NULL), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), '1012', 22, '驳回通知', '富茂', '您申请的[{type}],[{name}]被驳回,请登录{page} 查看审批明细。', '2019-05-21 13:41:33', 1, 0, 500, NULL); | |||||
| @@ -47,10 +47,9 @@ public class WxCouponChannelController extends BaseController { | |||||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.setTenantId(getTenantId()); | wxCouponChannel.setTenantId(getTenantId()); | ||||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); | |||||
| //过滤已作废 | |||||
| wxCouponChannel.setStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); | |||||
| wxCouponChannel.setCouponStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); | |||||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); | |||||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | ||||
| filterTimed(wxCouponChannel, page); | filterTimed(wxCouponChannel, page); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -74,6 +74,10 @@ public class WxCouponChannel extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="二维码",name="qrCode") | @io.swagger.annotations.ApiModelProperty(value="二维码",name="qrCode") | ||||
| private String qrCode; | private String qrCode; | ||||
| @Transient | |||||
| @io.swagger.annotations.ApiModelProperty(value="卷状态 0:可投放 1:作废",name="couponStatus") | |||||
| private Integer couponStatus; | |||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") | @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") | ||||
| private Integer creditPrice; | private Integer creditPrice; | ||||
| @@ -24,6 +24,12 @@ public enum EnumMsgModel { | |||||
| DELETE_SHARING_ACCOUNT_NOTIFY_MERCHANT(16, "商户分账账户删除提醒"), | DELETE_SHARING_ACCOUNT_NOTIFY_MERCHANT(16, "商户分账账户删除提醒"), | ||||
| TIME_LIMIT_CAMPAIGN_JOIN_SUCCESS(17, "限时活动报名成功"), | TIME_LIMIT_CAMPAIGN_JOIN_SUCCESS(17, "限时活动报名成功"), | ||||
| TIME_LIMIT_CAMPAIGN_NOTIFY(18, "限时活动参与提醒"), | TIME_LIMIT_CAMPAIGN_NOTIFY(18, "限时活动参与提醒"), | ||||
| //卷 | |||||
| FLOW_C_ASSIGNEE_NODIFY(19, "待办通知"), | |||||
| FLOW_C_APPLY_NODIFY(20, "审批通知"), | |||||
| FLOW_C_PASS_NODIFY(21, "通过审批通知"), | |||||
| FLOW_C_REJECT_NODIFY(22, "驳回通知"), | |||||
| ; | ; | ||||
| public static EnumMsgModel getEnum(Integer code) { | public static EnumMsgModel getEnum(Integer code) { | ||||
| @@ -629,6 +629,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| public WxCoupon findById(WxCoupon wxCoupon) { | public WxCoupon findById(WxCoupon wxCoupon) { | ||||
| WxCoupon query = new WxCoupon(); | WxCoupon query = new WxCoupon(); | ||||
| query.setId(wxCoupon.getId()); | query.setId(wxCoupon.getId()); | ||||
| query.setType(wxCoupon.getType()); | |||||
| List<WxCoupon> list = wxCouponMapper.findCouponList(query); | List<WxCoupon> list = wxCouponMapper.findCouponList(query); | ||||
| if(CollectionUtils.isNotEmpty(list)){ | if(CollectionUtils.isNotEmpty(list)){ | ||||
| return list.get(0); | return list.get(0); | ||||
| @@ -18,6 +18,7 @@ import com.iformall.mapper.*; | |||||
| import com.iformall.mq.MqBaseProducer; | import com.iformall.mq.MqBaseProducer; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import com.iformall.utils.JsonUtil; | import com.iformall.utils.JsonUtil; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| @@ -116,6 +117,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| Integer contractType = 0; | Integer contractType = 0; | ||||
| String str = (String)getVariableByKey(variables,"contractType"); | String str = (String)getVariableByKey(variables,"contractType"); | ||||
| Integer operateType = (Integer)getVariableByKey(variables,"approvalType"); | Integer operateType = (Integer)getVariableByKey(variables,"approvalType"); | ||||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| if(StringUtils.isNotBlank(str)){ | if(StringUtils.isNotBlank(str)){ | ||||
| contractType = Integer.parseInt(str); | contractType = Integer.parseInt(str); | ||||
| } | } | ||||
| @@ -206,28 +208,33 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| wxCoupon.setStockApplyStatus(applyStatus); | wxCoupon.setStockApplyStatus(applyStatus); | ||||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | ||||
| //减库存 | //减库存 | ||||
| if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { | |||||
| Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); | |||||
| Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); | |||||
| Integer type = getIngeter(getVariableByKey(variables, "type")); | |||||
| Integer validDays = getIngeter(getVariableByKey(variables, "validDays")); | |||||
| Integer validType = getIngeter(getVariableByKey(variables, "validType")); | |||||
| wxCoupon.setInventory(inventory); | |||||
| wxCoupon.setRemainInventory(remainInventory); | |||||
| wxCoupon.setType(type); | |||||
| Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); | |||||
| Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); | |||||
| Integer type = getIngeter(getVariableByKey(variables, "type")); | |||||
| Integer validDays = getIngeter(getVariableByKey(variables, "validDays")); | |||||
| Integer validType = getIngeter(getVariableByKey(variables, "validType")); | |||||
| String validStartDate = (String) getVariableByKey(variables, "validStartDate"); | |||||
| String validEndDate = (String) getVariableByKey(variables, "validEndDate"); | |||||
| try { | |||||
| if(validStartDate != null) { | |||||
| wxCoupon.setValidStartDate(sdf.parse(validStartDate)); | |||||
| } | |||||
| if(validEndDate != null){ | |||||
| wxCoupon.setValidEndDate(sdf.parse(validEndDate)); | |||||
| } | |||||
| }catch (Exception e){ | |||||
| e.printStackTrace(); | |||||
| } | |||||
| if(validDays != null){ | |||||
| wxCoupon.setValidDays(validDays); | wxCoupon.setValidDays(validDays); | ||||
| wxCoupon.setValidType(validType); | |||||
| wxCouponService.updateCouponStockAndEndTime(wxCoupon); | |||||
| }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ | |||||
| Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); | |||||
| wxCoupon.setRemainInventory(remainInventory); | |||||
| wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); | |||||
| }else if(EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)){ | |||||
| Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); | |||||
| wxCoupon.setInventory(inventory); | |||||
| wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); | |||||
| } | } | ||||
| wxCoupon.setInventory(inventory); | |||||
| wxCoupon.setRemainInventory(remainInventory); | |||||
| wxCoupon.setType(type); | |||||
| wxCoupon.setValidType(validType); | |||||
| wxCouponService.updateCouponStockAndEndTime(wxCoupon); | |||||
| } | } | ||||
| }else if(EnumCouponAppType.CANCLE.getCode().equals(operateType)){ | }else if(EnumCouponAppType.CANCLE.getCode().equals(operateType)){ | ||||
| wxCoupon.setCancleApplyStatus(applyStatus); | wxCoupon.setCancleApplyStatus(applyStatus); | ||||
| @@ -359,8 +366,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| dynamicContentMap.put("bustype","账单"); | dynamicContentMap.put("bustype","账单"); | ||||
| dynamicContentMap.put("contract", businessId.toString()); | dynamicContentMap.put("contract", businessId.toString()); | ||||
| }else if(isCoupon(flowType)){ | }else if(isCoupon(flowType)){ | ||||
| dynamicContentMap.put("bustype","有价券"); | |||||
| dynamicContentMap.put("contract",businessId.toString()); | |||||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_ASSIGNEE_NODIFY.getCode()); | |||||
| } | } | ||||
| wxMsgRecord.setDynamicContentMap(dynamicContentMap); | wxMsgRecord.setDynamicContentMap(dynamicContentMap); | ||||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | ||||
| @@ -863,8 +869,10 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| msgReplaceMap.put("bustype","账单"); | msgReplaceMap.put("bustype","账单"); | ||||
| msgReplaceMap.put("contract", businessId.toString()); | msgReplaceMap.put("contract", businessId.toString()); | ||||
| }else if(isCoupon(flowType)){ | }else if(isCoupon(flowType)){ | ||||
| msgReplaceMap.put("bustype","有价券"); | |||||
| msgReplaceMap.put("contract",businessId.toString()); | |||||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_APPLY_NODIFY.getCode()); | |||||
| WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId); | |||||
| msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage()); | |||||
| msgReplaceMap.put("name",wxCoupon.getTitle()); | |||||
| } | } | ||||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | wxMsgRecord.setDynamicContentMap(msgReplaceMap); | ||||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | ||||
| @@ -917,8 +925,10 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| msgReplaceMap.put("bustype","账单"); | msgReplaceMap.put("bustype","账单"); | ||||
| msgReplaceMap.put("contract", businessId.toString()); | msgReplaceMap.put("contract", businessId.toString()); | ||||
| }else if(isCoupon(flowType)){ | }else if(isCoupon(flowType)){ | ||||
| msgReplaceMap.put("bustype","有价券"); | |||||
| msgReplaceMap.put("contract",businessId.toString()); | |||||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_C_PASS_NODIFY.getCode()); | |||||
| WxCoupon wxCoupon = this.wxCouponMapper.selectByPrimaryKey(businessId); | |||||
| msgReplaceMap.put("type",EnumCouponType.getEnum(wxCoupon.getType()).getMessage()); | |||||
| msgReplaceMap.put("name",wxCoupon.getTitle()); | |||||
| } | } | ||||
| wxMsgRecord.setDynamicContentMap(msgReplaceMap); | wxMsgRecord.setDynamicContentMap(msgReplaceMap); | ||||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | ||||
| @@ -84,17 +84,17 @@ | |||||
| select b.id,b.title, | select b.id,b.title, | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| /100,2) volume, | /100,2) volume, | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| / | / | ||||
| (select sum(ws.operation_area) | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| @@ -103,13 +103,13 @@ | |||||
| round( | round( | ||||
| (select | (select | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | |||||
| (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m | |||||
| left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| + | + | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | |||||
| (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m | |||||
| left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| from dual) / | from dual) / | ||||
| (select sum(ws.operation_area) | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| @@ -118,11 +118,11 @@ | |||||
| round( | round( | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| / | / | ||||
| (select sum(ws.operation_area) | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| @@ -131,13 +131,13 @@ | |||||
| / | / | ||||
| round( | round( | ||||
| (select | (select | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | |||||
| (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m | |||||
| left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| + | + | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | |||||
| (select if(sum(br.receive_pay) is null,0,sum(br.receive_pay)) receive_pay from wx_merchant m | |||||
| left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | ||||
| from dual) / | from dual) / | ||||
| (select sum(ws.operation_area) | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| @@ -147,7 +147,7 @@ | |||||
| rentSaleRate, | rentSaleRate, | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) / | left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) / | ||||
| (select count(mtd.id) | (select count(mtd.id) | ||||
| @@ -159,13 +159,13 @@ | |||||
| </select> | </select> | ||||
| <select id="devoteList" parameterType="com.iformall.domain.po.WxBusiness" resultType="hashmap"> | <select id="devoteList" parameterType="com.iformall.domain.po.WxBusiness" resultType="hashmap"> | ||||
| select m.name merchantName,round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2) sale, | |||||
| select m.name merchantName,round(if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt))/if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) /100,2) sale, | |||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59') | left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59') | ||||
| / | / | ||||
| (select sum(ws.operation_area) | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| @@ -173,14 +173,14 @@ | |||||
| /100,2) saleRate, | /100,2) saleRate, | ||||
| round( | round( | ||||
| round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2)/ | |||||
| round(if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt))/if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) /100,2)/ | |||||
| ( | ( | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59') | left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = 9 and m.tenant_id=789 and mtd.create_date between '2019-07-01' and '2019-07-31 23:59:59') | ||||
| / | / | ||||
| (select sum(ws.operation_area) | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| @@ -25,6 +25,9 @@ | |||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1=1 | where 1=1 | ||||
| <if test="null != couponStatus"> | |||||
| and c.status = #{couponStatus} | |||||
| </if> | |||||
| <if test="null != status "> | <if test="null != status "> | ||||
| and cc.status = #{status} | and cc.status = #{status} | ||||
| </if> | </if> | ||||