| @@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.enums.EnumRentStartType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| @@ -107,8 +108,13 @@ public class WxPropertyContractController extends BaseController { | |||
| WxBillProperty wxBillProperty = new WxBillProperty(); | |||
| wxBillProperty.setTenantId(super.getTenantId()); | |||
| wxBillPropertyService.updateBillStatus(wxBillProperty); | |||
| Map<String, Object> data = wxPropertyContractService.getById(id); | |||
| return new ResultData(data); | |||
| try { | |||
| Map<String, Object> data = wxPropertyContractService.getById(id); | |||
| return new ResultData(data); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } | |||
| @RequestMapping("/download") | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxActivity; | |||
| import com.iformall.enums.EnumActivityStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxActivityService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -54,7 +55,12 @@ public class WxActivityController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxActivityController::add"); | |||
| wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); | |||
| wxActivity.setTenantId(getTenantId()); | |||
| wxActivityService.saveOrUpdate(wxActivity); | |||
| try { | |||
| wxActivityService.saveOrUpdate(wxActivity); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @@ -63,7 +69,12 @@ public class WxActivityController extends BaseController { | |||
| @SystemControllerLog(description = "活动-id更新") | |||
| public ResultData update(@RequestBody WxActivity wxActivity) { | |||
| logger.debug("[" + getIpAddr() + "] WxActivityController::update"); | |||
| return wxActivityService.saveOrUpdate(wxActivity); | |||
| try { | |||
| return wxActivityService.saveOrUpdate(wxActivity); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @@ -179,6 +179,14 @@ public class WxCouponController extends BaseController { | |||
| if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | |||
| } | |||
| if((wxCoupon.getValidEndDate()!=null&&coupon.getValidEndDate()!=null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) | |||
| && wxCoupon.getInventory().equals(coupon.getInventory())) | |||
| || | |||
| (wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getInventory().equals(coupon.getInventory()) && | |||
| wxCoupon.getValidDays().equals(coupon.getValidDays())) | |||
| ){ | |||
| return new ResultData(ErrorCode.COUPON_STOCK_VALID_DATE_SETTING_ERR); | |||
| } | |||
| } | |||
| //启动审批流 | |||
| @@ -57,8 +57,7 @@ public class WxBillPropertyController extends BaseController { | |||
| @SystemControllerLog(description = "物业账单-更新") | |||
| public ResultData update(@RequestBody WxBillProperty wxBillProperty) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillPropertyController::update"); | |||
| wxBillPropertyService.saveOrUpdate(wxBillProperty, getUser()); | |||
| return new ResultData(); | |||
| return wxBillPropertyService.saveOrUpdate(wxBillProperty, getUser()); | |||
| } | |||
| @GetMapping("/del") | |||
| @@ -100,6 +100,10 @@ public class TenantInfoImpl implements TenantInfo { | |||
| return true; | |||
| if ("com.iformall.mapper.WxActivityJoinMapper.updateStatus".equals(ms.getId())) | |||
| return true; | |||
| if ("com.iformall.mapper.WxCouponMapper.findCouponList".equals(ms.getId())) | |||
| return true; | |||
| if ("com.iformall.mapper.WxCouponMapper.findCouponListCount".equals(ms.getId())) | |||
| return true; | |||
| return false; | |||
| } | |||
| } | |||
| @@ -0,0 +1,90 @@ | |||
| delete from wx_flow_config where name in('营销审批','拼团审批','有价卷审批','卡审批','砍价审批'); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560252222, 0, '789', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560253333, 0, '790', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560254444, 0, '1001', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560255555, 0, '1002', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560255556, 0, '1003', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560256666, 0, '1004', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560257777, 0, '1005', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560258888, 0, '1006', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560259999, 0, '1007', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560260000, 0, '1008', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||
| VALUES | |||
| (1560260001, 0, '1009', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), | |||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); | |||
| @@ -0,0 +1 @@ | |||
| update wx_flow_config set name = '有价券审批' where name ='有价卷审批'; | |||
| @@ -99,6 +99,7 @@ public class ActivitySchedule { | |||
| activity.setIsExpired(EnumActivityExpired.YES.getCode()); | |||
| activity.setUpdateTime(new Date()); | |||
| wxActivityMapper.activityExipred(activity); | |||
| wxActivityJoinMapper.activityExpired(); | |||
| } | |||
| /** | |||
| @@ -57,23 +57,23 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") | |||
| private String cUserPhone; | |||
| @Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "8") | |||
| @Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9") | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") | |||
| private Date createDate; | |||
| @Transient | |||
| @Excel(name = "面额(元)", width = 20, orderNum = "6") | |||
| @Excel(name = "面额(元)", width = 20, orderNum = "7") | |||
| private String priceStr; | |||
| @Transient | |||
| @Excel(name = "交易价格(元)", width = 20, orderNum = "5") | |||
| @Excel(name = "交易价格(元)", width = 20, orderNum = "6") | |||
| private String salePriceStr; | |||
| @Excel(name = "状态", width = 20, replace = {"可以退款_0", "已经使用_1", "已经过期_2", "已经退款_3"}, orderNum = "14") | |||
| @Excel(name = "状态", width = 20, replace = {"待使用_0", "已核销_1", "已过期_2", "已退款_3"}, orderNum = "14") | |||
| @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") | |||
| private Integer couponOrderStatus; | |||
| @Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9") | |||
| @Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") | |||
| private Date updateDate; | |||
| @@ -101,7 +101,7 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| return new BigDecimal(subsidyNum == null ? 0 : subsidyNum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); | |||
| } | |||
| @Excel(name = "补贴额(元)", width = 50, orderNum = "7") | |||
| @Excel(name = "补贴额(元)", width = 50, orderNum = "8") | |||
| @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNumStr") | |||
| private String subsidyNumStr; | |||
| @@ -112,11 +112,11 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| private String bUserName; | |||
| @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") | |||
| private String bUserPhone; | |||
| @Excel(name = "商户名", width = 50, orderNum = "3") | |||
| @Excel(name = "发券商户", width = 50, orderNum = "3") | |||
| @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") | |||
| private String merchantName; | |||
| @Excel(name = "商铺号", width = 50, orderNum = "4") | |||
| @Excel(name = "商铺号", width = 50, orderNum = "5") | |||
| @Transient | |||
| private String shopNumber; | |||
| @@ -141,9 +141,15 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| @Transient | |||
| private Long couponId; | |||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "积分券_50", "家积分停车券_51", "消费卡_100"}) | |||
| @Transient | |||
| private Integer couponType; | |||
| @Excel(name = "核销商户", width = 50, orderNum = "4") | |||
| @Transient | |||
| private String verifyMerchantName; | |||
| @Transient | |||
| private Integer floor; | |||
| @Transient | |||
| @@ -20,4 +20,5 @@ public interface WxActivityJoinMapper extends CommonMapper<WxActivityJoin, Long> | |||
| void updateStatus(List<WxActivity> wxActivity); | |||
| void activityExpired(); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.pay; | |||
| import com.iformall.utils.*; | |||
| import org.apache.commons.codec.digest.HmacAlgorithms; | |||
| import org.apache.commons.codec.digest.HmacUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -416,7 +417,7 @@ public class WxPayment { | |||
| params.remove("sign"); | |||
| String stringA = packageSign(params, false); | |||
| String stringSignTemp = stringA + "&key=" + partnerKey; | |||
| return HmacUtils.hmacSha256Hex(partnerKey, stringSignTemp).toUpperCase(); | |||
| return new HmacUtils(HmacAlgorithms.HMAC_SHA_256, partnerKey).hmacHex(stringSignTemp).toUpperCase(); | |||
| } | |||
| /** | |||
| @@ -172,7 +172,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| logger.error("添加租赁账单行为日志,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "更新租赁账单成功"); | |||
| return new ResultData(Result.SUCCESS, "更新租赁账单成功", wxBillRent); | |||
| } | |||
| } | |||
| @@ -84,14 +84,22 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| public ResultData queryData(Map<String, String> paramsMap) { | |||
| String tenantId = paramsMap.get("tenantId"); | |||
| Integer chart = Integer.valueOf(paramsMap.get("chart")); | |||
| String startdate = paramsMap.get("startdate") + " 00:00:00"; | |||
| String enddate = paramsMap.get("enddate") + " 23:59:59"; | |||
| String startdate = paramsMap.get("startdate"); | |||
| String enddate = paramsMap.get("enddate"); | |||
| if(chart == null){ | |||
| return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); | |||
| } | |||
| if (StringUtils.isEmpty(startdate)) { | |||
| startdate = DateUtils.getSystemTime("yyyy-MM-dd") + " 00:00:00" ; | |||
| } else { | |||
| startdate = startdate + " 00:00:00"; | |||
| } | |||
| if (StringUtils.isEmpty(enddate)) { | |||
| enddate = DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"; | |||
| } else { | |||
| enddate = enddate + " 23:59:59"; | |||
| } | |||
| //出租率 | |||
| @@ -279,6 +279,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| String filename = "券订单"; | |||
| List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); | |||
| list.parallelStream().forEach(c -> { | |||
| if (c.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) { | |||
| c.setUpdateDate(null); | |||
| } | |||
| if (!c.getMerchantId().equals(0L)) { | |||
| List<WxMerchantVo> merchantVoList = c.getMerchantVoList(); | |||
| if (!merchantVoList.isEmpty()) { | |||
| @@ -635,28 +638,30 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| // 6. get payOrder info | |||
| int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); | |||
| if(StringUtils.isBlank(order.getFormId()) || order.getFormId().equalsIgnoreCase("undefined")) { | |||
| // formId为空,获取prepayId | |||
| WxPayOrder payOrder = null; | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.setTenantId(couponOrder.getTenantId()); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ); | |||
| if (payList.size() > 0) { | |||
| payOrder = payList.get(0); | |||
| } | |||
| if (payOrder == null) { | |||
| logger.error("找不到payOrder信息"); | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); | |||
| } | |||
| if (payOrder.getPrepayId() == null) { | |||
| logger.error("payOrder信息中,prepay_id为空"); | |||
| throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); | |||
| } | |||
| dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime()); | |||
| if(curDate.before(dateAfter7Day)) { | |||
| formId = payOrder.getPrepayId(); | |||
| formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode(); | |||
| if(order.getPayment() > 0) { | |||
| // formId为空,获取prepayId | |||
| WxPayOrder payOrder = null; | |||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||
| payOrderQ.setTenantId(couponOrder.getTenantId()); | |||
| payOrderQ.setOrderId(order.getId()); | |||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||
| List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ); | |||
| if (payList.size() > 0) { | |||
| payOrder = payList.get(0); | |||
| } | |||
| if (payOrder == null) { | |||
| logger.error("找不到payOrder信息"); | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); | |||
| } | |||
| if (payOrder.getPrepayId() == null) { | |||
| logger.error("payOrder信息中,prepay_id为空"); | |||
| throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); | |||
| } | |||
| dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime()); | |||
| if (curDate.before(dateAfter7Day)) { | |||
| formId = payOrder.getPrepayId(); | |||
| formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode(); | |||
| } | |||
| } | |||
| } | |||
| @@ -204,8 +204,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| wxCoupon.setPutApplyStatus(applyStatus); | |||
| }else if(EnumCouponAppType.STOCK.getCode().equals(operateType)){ | |||
| wxCoupon.setStockApplyStatus(applyStatus); | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue() | |||
| ||EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { | |||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| //减库存 | |||
| if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { | |||
| Integer inventory = (Integer) getVariableByKey(variables, "inventory"); | |||
| @@ -262,6 +262,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED); | |||
| } | |||
| } else { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| if (null == record.getMerchantId() && record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId不能为空"); | |||
| @@ -365,7 +367,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| record.setRentalStartDate(wxPropertyContract.getRentalStartDate()); | |||
| record.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||
| record.setRentalEndDate(wxRentContract.getRentalEndDate()); | |||
| record.setStartDate(wxRentContract.getStartDate()); | |||
| record.setEndDate(wxRentContract.getEndDate()); | |||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| @@ -71,8 +72,12 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||
| wxPropertyContractQuery.setRentContractId(id); | |||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(wxPropertyContractQuery); | |||
| if (propertyContract != null) { | |||
| Map<String, Object> property = wxPropertyContractService.getById(propertyContract.getId()); | |||
| data.put("property", property); | |||
| try { | |||
| Map<String, Object> property = wxPropertyContractService.getById(propertyContract.getId()); | |||
| data.put("property", property); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| return new ResultData(data); | |||
| } | |||
| @@ -104,6 +104,9 @@ | |||
| #{activity.id} | |||
| </foreach> | |||
| </update> | |||
| <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> | |||
| </mapper> | |||
| @@ -53,45 +53,37 @@ | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments | |||
| from wx_bill_rent where is_preview = 0 | |||
| union | |||
| from wx_bill_rent where tenant_id=#{tenantId} and is_preview = 0 | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type,shop_info,NULL comments from wx_bill_rent_deposit | |||
| union | |||
| endtime,rent_shop_type,shop_info,NULL comments from wx_bill_rent_deposit where tenant_id=#{tenantId} | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments | |||
| from wx_bill_property where is_preview = 0 | |||
| union | |||
| from wx_bill_property where tenant_id=#{tenantId} and is_preview = 0 | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type,shop_info,NULL comments from wx_bill_property_deposit | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as | |||
| endtime,rent_shop_type,shop_info,NULL comments from wx_bill_property_deposit where tenant_id=#{tenantId} | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name, | |||
| case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value, | |||
| case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, | |||
| rent_shop_type,'[]' shop_info,NULL comments | |||
| from wx_bill_daily where type=1 | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, | |||
| rent_shop_type,'[]' shop_info,NULL comments | |||
| from wx_bill_daily where type=2 | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, | |||
| rent_shop_type,'[]' shop_info,NULL comments | |||
| from wx_bill_daily where type=3 | |||
| union | |||
| from wx_bill_daily where tenant_id=#{tenantId} | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, | |||
| rent_shop_type,'[]' shop_info,comments | |||
| from wx_bill_other | |||
| union | |||
| from wx_bill_other where tenant_id=#{tenantId} | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, | |||
| rent_shop_type,'[]' shop_info,comments | |||
| from wx_bill_other_deposit | |||
| from wx_bill_other_deposit where tenant_id=#{tenantId} | |||
| ) bill | |||
| left join wx_merchant m on bill.merchant_id=m.id | |||
| left join wx_shop s on bill.shop_id=s.id | |||
| @@ -130,34 +122,34 @@ | |||
| select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from ( | |||
| select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from | |||
| wx_bill_rent_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from | |||
| wx_bill_property where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from | |||
| wx_bill_property_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,5 bill_type_value,'水费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where | |||
| type=1 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where | |||
| type=2 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where | |||
| type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit | |||
| ) bill | |||
| @@ -185,34 +177,34 @@ | |||
| select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from ( | |||
| select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from | |||
| wx_bill_rent_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from | |||
| wx_bill_property where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from | |||
| wx_bill_property_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,5 bill_type_value,'水费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where | |||
| type=1 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where | |||
| type=2 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where | |||
| type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit | |||
| ) bill | |||
| @@ -237,42 +229,40 @@ | |||
| rentShopType from ( | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type | |||
| from wx_bill_rent where is_preview = 0 and rent_contract_id in (select id from wx_rent_contract where status in | |||
| from wx_bill_rent where is_preview = 0 and tenant_id=#{tenantId}and rent_contract_id in (select id from | |||
| wx_rent_contract where status in | |||
| (2,3,4)) | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type | |||
| from wx_bill_rent_deposit where rent_contract_id in (select id from wx_rent_contract where status in (2,3,4)) | |||
| union | |||
| from wx_bill_rent_deposit where tenant_id=#{tenantId} and rent_contract_id in (select id from wx_rent_contract | |||
| where status in (2,3,4)) | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type | |||
| from wx_bill_property where is_preview = 0 and property_contract_id in (select id from wx_property_contract | |||
| from wx_bill_property where is_preview = 0 and tenant_id=#{tenantId} and property_contract_id in (select id from | |||
| wx_property_contract | |||
| where status in(2,3,4)) | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type | |||
| from wx_bill_property_deposit where property_contract_id in (select id from wx_property_contract where status in | |||
| from wx_bill_property_deposit where tenant_id=#{tenantId} and property_contract_id in (select id from | |||
| wx_property_contract where status in | |||
| (2,3,4)) | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type, 0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=1 | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=2 | |||
| union | |||
| select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name, | |||
| case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value, | |||
| case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type, 0 as need_pay,receive_pay, | |||
| pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where tenant_id=#{tenantId} | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,7 bill_type_vaue,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other | |||
| union | |||
| from wx_bill_other where tenant_id=#{tenantId} | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other_deposit | |||
| from wx_bill_other_deposit where tenant_id=#{tenantId} | |||
| ) bill | |||
| left join wx_merchant m on bill.merchant_id=m.id | |||
| left join wx_shop s on bill.shop_id=s.id | |||
| @@ -323,35 +313,35 @@ | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=1 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=2 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other_deposit | |||
| @@ -370,35 +360,35 @@ | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=1 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=2 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other_deposit | |||
| @@ -417,11 +407,11 @@ | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property where is_preview = 0 | |||
| @@ -429,23 +419,23 @@ | |||
| select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=1 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=2 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other_deposit | |||
| @@ -468,35 +458,35 @@ | |||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_rent_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property where is_preview = 0 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' | |||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | |||
| endtime,rent_shop_type from wx_bill_property_deposit | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=1 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=2 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_daily where type=3 | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other | |||
| union | |||
| union all | |||
| select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as | |||
| need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type | |||
| from wx_bill_other_deposit | |||
| @@ -168,7 +168,7 @@ | |||
| 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}) | |||
| where m.business_id=#{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) | |||
| ,2) devoteRate | |||
| from wx_merchant m | |||
| @@ -176,6 +176,7 @@ | |||
| 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} | |||
| group by m.id | |||
| order by devoteRate desc | |||
| </select> | |||
| @@ -127,7 +127,7 @@ | |||
| <sql id="CouponCarColumns"> | |||
| c.id,c.tenant_id,c.type,c.cover_img,c.cover_picture,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, | |||
| car.vendor_type, car.vendor_params,c.credit_price | |||
| car.vendor_type, car.vendor_params,c.credit_price, c.`auto_refund` | |||
| </sql> | |||
| <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap"> | |||
| select <include refid="CouponCarColumns" /> | |||
| @@ -410,17 +410,16 @@ | |||
| <!--如果配置了审批模板,需要过滤投放审批状态--> | |||
| <if test="0 != filterCanPut or null ==filterCanPut "> | |||
| <if test=" null != pressModelId and 0l != pressModelId"> | |||
| and if(type=8,put_apply_status =2,1=1) | |||
| and if(type=8,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}) ,1=1) | |||
| </if> | |||
| <if test=" null != groupModelId and 0l != groupModelId"> | |||
| and if(type=9,put_apply_status =2,1=1) | |||
| and if(type=9,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}),1=1) | |||
| </if> | |||
| <if test=" null != cardModelId and 0l != cardModelId"> | |||
| and if(type=100,put_apply_status =2,1=1) | |||
| and if(type=100,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}),1=1) | |||
| </if> | |||
| <if test=" null != couponModelId and 0l != couponModelId"> | |||
| and if(type !=8 and type !=9 and type!=100,put_apply_status =2,1=1) | |||
| and if(type !=8 and type !=9 and type!=100,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}),1=1) | |||
| </if> | |||
| </if> | |||
| @@ -378,6 +378,8 @@ | |||
| <result column="phone" jdbcType="VARCHAR" property="cUserPhone" /> | |||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> | |||
| <result column="verify_merchant_name" jdbcType="VARCHAR" property="verifyMerchantName"/> | |||
| <collection column="{productId=coupon_id}" property="merchantVoList" | |||
| ofType="com.iformall.domain.vo.WxMerchantVo" | |||
| javaType="java.util.List" | |||
| @@ -393,7 +395,7 @@ | |||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, | |||
| (case when com.mc = 1 then (select m.id from wx_merchant m, | |||
| wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id = co.coupon_id | |||
| and cm.status = 0) else 0 end) as merchant_id,(select phone from wx_c_user where id=co.c_user_id) phone | |||
| and cm.status = 0) else 0 end) as merchant_id,cu.phone,bu.verify_merchant_name | |||
| </sql> | |||
| <sql id="allAdminCouponOrderDetailColumns"> | |||
| @@ -407,14 +409,19 @@ | |||
| <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | |||
| select <include refid="allAdminCouponOrderListColumns" /> | |||
| from | |||
| wx_coupon_order co, | |||
| wx_coupon c, | |||
| (select tco.id as tcoid, | |||
| (select count(*) from wx_coupon_merchant tcm | |||
| where tcm.product_id = tco.coupon_id | |||
| and tcm.status = 0) as mc | |||
| from wx_coupon_order tco) com | |||
| where com.tcoid = co.id | |||
| wx_coupon_order co inner join wx_coupon c on c.id = co.coupon_id | |||
| inner join (select tco.id as tcoid, | |||
| (select count(*) from wx_coupon_merchant tcm | |||
| where tcm.product_id = tco.coupon_id | |||
| and tcm.status = 0) as mc | |||
| from wx_coupon_order tco) com on com.tcoid = co.id | |||
| inner join wx_c_user cu on cu.id=co.c_user_id | |||
| left join ( | |||
| select bu.id as bu_id,m.name as verify_merchant_name | |||
| from wx_merchant_b_user bu inner join wx_merchant m on bu.merchant_id=m.id | |||
| where bu.tenant_id = #{tenantId} | |||
| ) bu on bu.bu_id = co.b_user_id | |||
| where 1=1 | |||
| <choose> | |||
| <when test=" null != couponType"> | |||
| and co.coupon_type = #{couponType} | |||
| @@ -423,7 +430,6 @@ | |||
| and co.coupon_type < 100 | |||
| </otherwise> | |||
| </choose> | |||
| and c.id = co.coupon_id | |||
| <if test=" null != tenantId "> | |||
| and co.tenant_id = #{tenantId} | |||
| </if> | |||
| @@ -468,6 +474,10 @@ | |||
| <if test=" null != business "> | |||
| and c.business = #{business} | |||
| </if> | |||
| <if test=" null != verifyMerchantName ''!= verifyMerchantName "> | |||
| and bu.verify_merchant_name = #{verifyMerchantName} | |||
| </if> | |||
| <if test="null!=building"> | |||
| and co.coupon_id in( | |||
| select cm.product_id from wx_merchant_shop ms left join wx_merchant m on ms.merchant_id=m.id | |||
| @@ -483,7 +493,7 @@ | |||
| ) | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null == sortColumns"> order by id desc </if> | |||
| <if test=" null == sortColumns">order by co.create_date desc,co.id desc</if> | |||
| </select> | |||
| @@ -566,7 +566,7 @@ | |||
| </where> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null == sortColumns">order by o.id desc</if> | |||
| <if test=" null == sortColumns">order by o.create_date desc, o.id desc</if> | |||
| </select> | |||
| @@ -348,7 +348,7 @@ | |||
| <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> | |||
| </where> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| <if test=" null == sortColumns">order by rc.id desc</if> | |||
| <if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if> | |||
| </select> | |||