developrelease_toaliyun_real
| @@ -6,14 +6,14 @@ import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxCouponCar; | |||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxPark; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.vo.WxCouponCarVo; | import com.iformall.domain.vo.WxCouponCarVo; | ||||
| import com.iformall.enums.EnumCarVendor; | import com.iformall.enums.EnumCarVendor; | ||||
| import com.iformall.enums.EnumCouponStatus; | |||||
| import com.iformall.enums.EnumETCPCode; | import com.iformall.enums.EnumETCPCode; | ||||
| import com.iformall.enums.EnumRentContractAppStatus; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxCouponMapper; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.ETCPUtil; | import com.iformall.utils.ETCPUtil; | ||||
| import com.iformall.utils.TJDCarUtil; | import com.iformall.utils.TJDCarUtil; | ||||
| @@ -57,6 +57,12 @@ public class WxCarController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCouponCarService wxCouponCarService; | WxCouponCarService wxCouponCarService; | ||||
| @Autowired | |||||
| WxFlowService wxFlowService; | |||||
| @Autowired | |||||
| WxCouponMapper wxCouponMapper; | |||||
| private WxPark getCurrentPark() { | private WxPark getCurrentPark() { | ||||
| WxPark parkQ = new WxPark(); | WxPark parkQ = new WxPark(); | ||||
| parkQ.setTenantId(getTenantId()); | parkQ.setTenantId(getTenantId()); | ||||
| @@ -239,6 +245,23 @@ public class WxCarController extends BaseController { | |||||
| wxCouponCarService.update(couponCar); | wxCouponCarService.update(couponCar); | ||||
| } | } | ||||
| //启动审批流 | |||||
| if (coupon.getFlowParams() != null && coupon.getFlowParams().size() > 0) { | |||||
| WxCoupon wc = new WxCoupon(); | |||||
| wc.setId(coupon.getId()); | |||||
| coupon.getFlowParams().put("businessId",coupon.getId()); | |||||
| wxFlowService.start(coupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); | |||||
| //作废审批 | |||||
| if (EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(coupon.getStatus())) { | |||||
| wc.setCancleApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||||
| }else{ | |||||
| //投放审批 | |||||
| wc.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||||
| } | |||||
| wxCouponMapper.updateByPrimaryKeySelective(wc); | |||||
| } | |||||
| return new ResultData(coupon.getId()); | return new ResultData(coupon.getId()); | ||||
| } | } | ||||
| @@ -329,12 +329,6 @@ public class WxCouponController extends BaseController { | |||||
| @SystemControllerLog(description = "券投放-砍价营销列表") | @SystemControllerLog(description = "券投放-砍价营销列表") | ||||
| public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | ||||
| Map<String,Object> result = new HashedMap(); | Map<String,Object> result = new HashedMap(); | ||||
| if(wxCoupon.getStartdate() == null){ | |||||
| wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth()); | |||||
| } | |||||
| if(wxCoupon.getEnddate() == null){ | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | |||||
| } | |||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,pageNum,pageSize); | PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,pageNum,pageSize); | ||||
| return new ResultData(pages); | return new ResultData(pages); | ||||
| @@ -33,5 +33,7 @@ public class WxCouponCar extends BaseEntity { | |||||
| private Date createDate; | private Date createDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| @Transient | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||||
| private Map<String, Object> flowParams; | |||||
| } | } | ||||
| @@ -22,4 +22,7 @@ public class WxCouponCarVo extends WxCoupon implements Serializable { | |||||
| private String vendorType; | private String vendorType; | ||||
| @io.swagger.annotations.ApiModelProperty(value="车场厂商相关信息",name="vendorParams") | @io.swagger.annotations.ApiModelProperty(value="车场厂商相关信息",name="vendorParams") | ||||
| private String vendorParams; | private String vendorParams; | ||||
| @Transient | |||||
| private Integer status; | |||||
| } | } | ||||
| @@ -156,12 +156,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| return new ResultData(Result.SUCCESS, "查询成功", data); | return new ResultData(Result.SUCCESS, "查询成功", data); | ||||
| } | } | ||||
| Long finalCouponId = couponId; | Long finalCouponId = couponId; | ||||
| int size = voList.size(); | |||||
| data.put("size", size); | |||||
| voList = voList.stream() | voList = voList.stream() | ||||
| .filter(wxCouponChannelVo -> !wxCouponChannelVo.getCouponId().equals(finalCouponId)) | .filter(wxCouponChannelVo -> !wxCouponChannelVo.getCouponId().equals(finalCouponId)) | ||||
| .collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
| int size = voList.size(); | |||||
| size = voList.size(); | |||||
| Random random = new Random(); | Random random = new Random(); | ||||
| data.put("size", size); | |||||
| data.put("data", voList.get(random.nextInt(size))); | data.put("data", voList.get(random.nextInt(size))); | ||||
| return new ResultData(Result.SUCCESS, "查询成功", data); | return new ResultData(Result.SUCCESS, "查询成功", data); | ||||
| } | } | ||||
| @@ -1052,7 +1052,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb); | needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb); | ||||
| }else{ | }else{ | ||||
| if(billTimeVo.getStartDate().before(endDate)){ | if(billTimeVo.getStartDate().before(endDate)){ | ||||
| needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), endDate, i, billTimeVoList.size(), saveDb); | |||||
| needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate,Calendar.DATE,-1), i, billTimeVoList.size(), saveDb); | |||||
| needpayAfter = getNeedPayMoney(wxRentContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb); | needpayAfter = getNeedPayMoney(wxRentContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb); | ||||
| }else{ | }else{ | ||||
| needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb); | needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb); | ||||
| @@ -2040,8 +2040,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //判断是否满足整月 | //判断是否满足整月 | ||||
| int startInt = Integer.parseInt(sdD.format(start)); | int startInt = Integer.parseInt(sdD.format(start)); | ||||
| int endInt = Integer.parseInt(sdD.format(end)); | |||||
| if(startInt == (endInt+1)){ | |||||
| int endInt = Integer.parseInt(sdD.format(DateUtils.getDaySet(end,Calendar.DATE,1))); | |||||
| if(startInt == endInt){ | |||||
| int months = getMonths(sdM.format(start)+"-01",sdM.format(end)+"-01"); | int months = getMonths(sdM.format(start)+"-01",sdM.format(end)+"-01"); | ||||
| return months * price; | return months * price; | ||||
| } | } | ||||
| @@ -654,23 +654,17 @@ | |||||
| <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | ||||
| select c.id, c.`cover_img`,c.`title`,c.`sale_price`,c.`price`, | select c.id, c.`cover_img`,c.`title`,c.`sale_price`,c.`price`, | ||||
| IFNULL(round((select count(o.id) from wx_order o where o.tenant_id = #{tenantId} and o.product_id = c.id and o.order_status = 1)/ | |||||
| (select count(op.id) from wx_order_press op where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id` and op.first = 1 )*100,2),0) change_rate, | |||||
| (select count(op.id) from wx_order_press op | |||||
| where op.`tenant_id` = #{tenantId} and op.first = 1 and op.coupon_id = c.id) as press_count, | |||||
| (select count(o.id) from wx_order o | |||||
| where o.`tenant_id` = #{tenantId} and o.product_id = c.id and o.order_status = 1) as press_succ_count, | |||||
| (select count(op.id) from wx_order_press op | |||||
| where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id`) as join_count, | |||||
| IFNULL(round((select count(wco.id) xcount from wx_coupon_order wco | |||||
| where wco.`tenant_id` = #{tenantId} and wco.coupon_id = c.id and wco.coupon_order_status = 1 | |||||
| )/(select count(op.id) from wx_order_press op | |||||
| where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id` and op.first = 1) | |||||
| *100,2),0) as payment_rate | |||||
| from wx_coupon c where c.type = 8 | |||||
| ifnull(op.press_count,0) as press_count, | |||||
| ifnull(o.press_succ_count,0) as press_succ_count, | |||||
| ifnull(op2.join_count,0) as join_count, | |||||
| ifnull(round(o.press_succ_count/op.press_count*100,2),0) as change_rate, | |||||
| ifnull(round(cop.xCount/op.press_count*100,2),0) as payment_rate | |||||
| FROM wx_coupon c | |||||
| left join (SELECT count(id) as press_count, coupon_id FROM wx_order_press WHERE `tenant_id` = #{tenantId} AND `first` = 1 group by coupon_id) op on op.coupon_id = c.id | |||||
| left join (SELECT count(id) as press_succ_count, product_id FROM wx_order WHERE `tenant_id` = #{tenantId} AND order_status = 1 group by product_id) o on o.product_id = c.id | |||||
| left join (SELECT count(id) as join_count, coupon_id FROM wx_order_press op WHERE `tenant_id` = #{tenantId} group by coupon_id) op2 on op2.coupon_id = c.id | |||||
| left join (SELECT count(id) as xCount, coupon_id FROM wx_coupon_order WHERE `tenant_id` = #{tenantId} AND coupon_order_status = 1 group by coupon_id) cop on cop.coupon_id = c.id | |||||
| where c.type = 8 | |||||
| <if test="tenantId != null"> | <if test="tenantId != null"> | ||||
| and c.tenant_id=#{tenantId} | and c.tenant_id=#{tenantId} | ||||
| </if> | </if> | ||||
| @@ -683,6 +677,7 @@ | |||||
| <if test=" null != startdate and null!=enddate"> | <if test=" null != startdate and null!=enddate"> | ||||
| and c.`create_date` between #{startdate} and #{enddate} | and c.`create_date` between #{startdate} and #{enddate} | ||||
| </if> | </if> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| <if test=" null == sortColumns">order by c.status asc,c.create_date desc</if> | <if test=" null == sortColumns">order by c.status asc,c.create_date desc</if> | ||||
| </select> | </select> | ||||
| @@ -956,7 +956,7 @@ | |||||
| <sql id="allCUserCardDetailColumns"> | <sql id="allCUserCardDetailColumns"> | ||||
| co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | ||||
| c.cover_img,c.title,c.sub_title,c.sale_price,c.price,c.unit,c.detail,c.remark, | c.cover_img,c.title,c.sub_title,c.sale_price,c.price,c.unit,c.detail,c.remark, | ||||
| a.amount,a.remaining_amount,a.support_transfer | |||||
| a.amount,a.remaining_amount,case when c.status=1 then 0 else a.support_transfer end support_transfer | |||||
| </sql> | </sql> | ||||