| @@ -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 @@ | |||||
| alter table wx_order add index tenant_product(tenant_id,product_id); | |||||
| @@ -0,0 +1,3 @@ | |||||
| alter table wx_bill_rent drop index t_p, | |||||
| drop index r_m, | |||||
| add index t_p_r_s_c(tenant_id,is_preview,rent_shop_type,status,createtime); | |||||
| @@ -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); | |||||
| @@ -520,7 +520,7 @@ public class WxCarController extends BaseController { | |||||
| * 停车费 | * 停车费 | ||||
| * @param paramMap | * @param paramMap | ||||
| * @return | * @return | ||||
| */ | |||||
| */ | |||||
| @ApiOperation(value = "停车费", notes = "ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\"}\n输出\n{\n" + | @ApiOperation(value = "停车费", notes = "ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\"}\n输出\n{\n" + | ||||
| " \"carNumber\": \"渝****87\",\n" + | " \"carNumber\": \"渝****87\",\n" + | ||||
| " \"entranceTime\": \"2017-06-11 11:19:27\",\n" + | " \"entranceTime\": \"2017-06-11 11:19:27\",\n" + | ||||
| @@ -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); | ||||
| @@ -2,6 +2,7 @@ package com.iformall.interceptor; | |||||
| import com.iformall.utils.HashUtil; | import com.iformall.utils.HashUtil; | ||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| import com.iformall.utils.UrlCheck; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.dao.DataAccessException; | import org.springframework.dao.DataAccessException; | ||||
| @@ -46,13 +47,20 @@ public class RequestInterceptor extends HandlerInterceptorAdapter { | |||||
| logger.debug("preHandle start 1"); | logger.debug("preHandle start 1"); | ||||
| return true; | return true; | ||||
| } | } | ||||
| String ipaddress = IPUtil.getIpAddr(request); | |||||
| String url = request.getRequestURL().toString(); | |||||
| if (UrlCheck.checkUrl(url)) { | |||||
| // pvlog不检查幂等 | |||||
| // awsFileUpload不检查幂等 | |||||
| // stopFee | |||||
| return true; | |||||
| } | |||||
| StringBuilder sb = new StringBuilder(); | StringBuilder sb = new StringBuilder(); | ||||
| sb.append(request.getRequestURL().toString()); | |||||
| sb.append(url); | |||||
| sb.append("method=").append(request.getMethod()).append("&"); | sb.append("method=").append(request.getMethod()).append("&"); | ||||
| String ipaddress = IPUtil.getIpAddr(request); | |||||
| sb.append("ip=").append(ipaddress).append("&"); | sb.append("ip=").append(ipaddress).append("&"); | ||||
| final Enumeration parameterNames = request.getParameterNames(); | final Enumeration parameterNames = request.getParameterNames(); | ||||
| @@ -7,7 +7,8 @@ public class UrlCheck { | |||||
| public static boolean checkUrl(String url) { | public static boolean checkUrl(String url) { | ||||
| return url.contains("awsFileUpload") | return url.contains("awsFileUpload") | ||||
| || url.contains("awsFilesUpload"); | |||||
| || url.contains("awsFilesUpload") | |||||
| || url.contains("getCarStopFee"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -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()); | ||||
| @@ -106,7 +106,7 @@ | |||||
| </update> | </update> | ||||
| <update id="activityExpired"> | <update id="activityExpired"> | ||||
| update wx_activity_join set `status`=2 where `status`!=2 and activity_id in(select id from wx_activity where is_expired=1) | |||||
| update wx_activity_join set `status`=2,update_time=now() where `status`= 0 and activity_id in (select id from wx_activity where is_expired=1) | |||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||
| @@ -95,31 +95,31 @@ | |||||
| <select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap"> | <select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,m.`name` merchant_name, | |||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,r.merchant_name, | |||||
| s.shop_number,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,r.type as rent_type, | s.shop_number,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,r.type as rent_type, | ||||
| r.pay_ratio,br.`revenue`,br.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | r.pay_ratio,br.`revenue`,br.`late_pay_ratio`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | ||||
| d.receive_pay deposit,case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0 | d.receive_pay deposit,case when br.late_pay_status=2 then (case when br.late_pay_time is null then 0 | ||||
| else FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe)end) else br.late_pay_price end | else FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe)end) else br.late_pay_price end | ||||
| late_pay_price,d.`status` | late_pay_price,d.`status` | ||||
| deposit_status,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime | deposit_status,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime | ||||
| from wx_bill_rent br left join wx_merchant m on br.merchant_id=m.id | |||||
| from wx_bill_rent br | |||||
| left join wx_shop s on br.shop_id=s.id | left join wx_shop s on br.shop_id=s.id | ||||
| left join wx_rent_contract r on br.rent_contract_id=r.id | left join wx_rent_contract r on br.rent_contract_id=r.id | ||||
| left join wx_bill_rent_deposit d on br.rent_contract_id=d.rent_contract_id and br.merchant_id=d.merchant_id | left join wx_bill_rent_deposit d on br.rent_contract_id=d.rent_contract_id and br.merchant_id=d.merchant_id | ||||
| <where> | <where> | ||||
| br.is_preview = 0 | br.is_preview = 0 | ||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||||
| <if test=" null != depositStatus ">and d.`status` = #{depositStatus}</if> | |||||
| <if test=" null != id ">and br.`id` = #{id}</if> | <if test=" null != id ">and br.`id` = #{id}</if> | ||||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | ||||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | ||||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | ||||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if> | |||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||||
| <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> | <if test=" null != rentContractId ">and br.`rent_contract_id` = #{rentContractId}</if> | ||||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | ||||
| <if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> | <if test=" null != latePayStatus ">and br.`late_pay_status` = #{latePayStatus}</if> | ||||
| <if test=" null != depositStatus ">and d.`status` = #{depositStatus}</if> | |||||
| <if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime} | |||||
| </if> | |||||
| </where> | </where> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </select> | </select> | ||||
| @@ -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,16 +159,34 @@ | |||||
| </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( | |||||
| (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) | |||||
| 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') | |||||
| / | |||||
| (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | |||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | |||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | |||||
| where m.status = 1 and m.business_id = #{id} and m.tenant_id=#{tenantId}) | |||||
| /100,2) saleRate, | |||||
| round( | round( | ||||
| round(sum(mtd.trade_amt)/sum(ws.operation_area) /100,2)/ | |||||
| (select 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( | |||||
| (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 | |||||
| left join wx_merchant_shop wmt on wmt.merchant_id = m.id | |||||
| left join wx_shop ws on(wmt.shop_id = ws.id) | |||||
| where m.business_id=#{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) | |||||
| 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 if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) | |||||
| from wx_merchant m | |||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | |||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | |||||
| where m.status = 1 and m.business_id = #{id} and m.tenant_id=#{tenantId}) | |||||
| /100,2) | |||||
| ) | |||||
| ,2) devoteRate | ,2) devoteRate | ||||
| from wx_merchant m | from wx_merchant m | ||||
| @@ -176,9 +194,13 @@ | |||||
| left join wx_merchant_shop wmt on wmt.merchant_id = m.id | left join wx_merchant_shop wmt on wmt.merchant_id = m.id | ||||
| left join wx_shop ws on(wmt.shop_id = ws.id) | left join wx_shop ws on(wmt.shop_id = ws.id) | ||||
| where m.business_id=#{id} and m.tenant_id=#{tenantId} | where m.business_id=#{id} and m.tenant_id=#{tenantId} | ||||
| and m.status = 1 | |||||
| and mtd.create_date between #{startdate} and #{enddate} | and mtd.create_date between #{startdate} and #{enddate} | ||||
| group by m.id | group by m.id | ||||
| order by devoteRate desc | order by devoteRate desc | ||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||
| @@ -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> | ||||
| @@ -551,7 +551,7 @@ | |||||
| select o.* from wx_order o where o.type=0 and o.order_status in (0,2,3,1,4) and o.id in( | select o.* from wx_order o where o.type=0 and o.order_status in (0,2,3,1,4) and o.id in( | ||||
| select o.id from wx_order o left join wx_coupon_merchant cm | select o.id from wx_order o left join wx_coupon_merchant cm | ||||
| on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o | on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o | ||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | |||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id where o.tenant_id =#{tenantId} | |||||
| union all | union all | ||||
| select o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time, | select o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time, | ||||
| o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone | o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone | ||||
| @@ -561,13 +561,13 @@ | |||||
| select o.id from wx_order o left join wx_coupon_merchant cm | select o.id from wx_order o left join wx_coupon_merchant cm | ||||
| on o.product_id=cm.product_id group by o.id having count(o.id)>1) | on o.product_id=cm.product_id group by o.id having count(o.id)>1) | ||||
| ) o | ) o | ||||
| left join wx_coupon_merchant cm on o.product_id=cm.product_id | |||||
| left join wx_coupon_merchant cm on o.product_id=cm.product_id where o.tenant_id =#{tenantId} | |||||
| union all | union all | ||||
| select o.*,mbu.merchant_id from wx_order o | select o.*,mbu.merchant_id from wx_order o | ||||
| left join wx_merchant_b_user mbu on o.product_id=mbu.id | left join wx_merchant_b_user mbu on o.product_id=mbu.id | ||||
| where o.type in (1,2) and o.order_status in (0,2,3,1,4) ) o | where o.type in (1,2) and o.order_status in (0,2,3,1,4) ) o | ||||
| left join wx_merchant m on o.merchant_id=m.id | left join wx_merchant m on o.merchant_id=m.id | ||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | |||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id where o.tenant_id =#{tenantId} | |||||
| ) o | ) o | ||||
| <where> | <where> | ||||
| <if test="tenantId!=null"> | <if test="tenantId!=null"> | ||||