| @@ -0,0 +1 @@ | |||||
| update wx_flow_config set name = '有价券审批' where name ='有价卷审批'; | |||||
| @@ -99,6 +99,7 @@ public class ActivitySchedule { | |||||
| activity.setIsExpired(EnumActivityExpired.YES.getCode()); | activity.setIsExpired(EnumActivityExpired.YES.getCode()); | ||||
| activity.setUpdateTime(new Date()); | activity.setUpdateTime(new Date()); | ||||
| wxActivityMapper.activityExipred(activity); | wxActivityMapper.activityExipred(activity); | ||||
| wxActivityJoinMapper.activityExpired(); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -69,7 +69,7 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||||
| @Excel(name = "交易价格(元)", width = 20, orderNum = "5") | @Excel(name = "交易价格(元)", width = 20, orderNum = "5") | ||||
| private String salePriceStr; | 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") | @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") | ||||
| private Integer couponOrderStatus; | private Integer couponOrderStatus; | ||||
| @@ -141,9 +141,15 @@ public class WxCouponOrderBVo extends WxCouponOrder{ | |||||
| @Transient | @Transient | ||||
| private Long couponId; | private Long couponId; | ||||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "积分券_50", "家积分停车券_51", "消费卡_100"}) | |||||
| @Transient | @Transient | ||||
| private Integer couponType; | private Integer couponType; | ||||
| @Excel(name = "核销商户", width = 50, orderNum = "16") | |||||
| @Transient | |||||
| private String verifyMerchantName; | |||||
| @Transient | @Transient | ||||
| private Integer floor; | private Integer floor; | ||||
| @Transient | @Transient | ||||
| @@ -20,4 +20,5 @@ public interface WxActivityJoinMapper extends CommonMapper<WxActivityJoin, Long> | |||||
| void updateStatus(List<WxActivity> wxActivity); | void updateStatus(List<WxActivity> wxActivity); | ||||
| void activityExpired(); | |||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.pay; | package com.iformall.pay; | ||||
| import com.iformall.utils.*; | import com.iformall.utils.*; | ||||
| import org.apache.commons.codec.digest.HmacAlgorithms; | |||||
| import org.apache.commons.codec.digest.HmacUtils; | import org.apache.commons.codec.digest.HmacUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -416,7 +417,7 @@ public class WxPayment { | |||||
| params.remove("sign"); | params.remove("sign"); | ||||
| String stringA = packageSign(params, false); | String stringA = packageSign(params, false); | ||||
| String stringSignTemp = stringA + "&key=" + partnerKey; | 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()); | logger.error("添加租赁账单行为日志,e:" + e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "更新租赁账单成功"); | |||||
| return new ResultData(Result.SUCCESS, "更新租赁账单成功", wxBillRent); | |||||
| } | } | ||||
| } | } | ||||
| @@ -279,6 +279,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| String filename = "券订单"; | String filename = "券订单"; | ||||
| List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); | List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); | ||||
| list.parallelStream().forEach(c -> { | list.parallelStream().forEach(c -> { | ||||
| if (c.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) { | |||||
| c.setUpdateDate(null); | |||||
| } | |||||
| if (!c.getMerchantId().equals(0L)) { | if (!c.getMerchantId().equals(0L)) { | ||||
| List<WxMerchantVo> merchantVoList = c.getMerchantVoList(); | List<WxMerchantVo> merchantVoList = c.getMerchantVoList(); | ||||
| if (!merchantVoList.isEmpty()) { | if (!merchantVoList.isEmpty()) { | ||||
| @@ -635,28 +638,30 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| // 6. get payOrder info | // 6. get payOrder info | ||||
| int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); | int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); | ||||
| if(StringUtils.isBlank(order.getFormId()) || order.getFormId().equalsIgnoreCase("undefined")) { | 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(); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -104,6 +104,9 @@ | |||||
| #{activity.id} | #{activity.id} | ||||
| </foreach> | </foreach> | ||||
| </update> | </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> | </mapper> | ||||
| @@ -168,7 +168,7 @@ | |||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id | 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_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 mtd.create_date between #{startdate} and #{enddate}) | |||||
| ,2) devoteRate | ,2) devoteRate | ||||
| from wx_merchant m | from wx_merchant m | ||||
| @@ -176,6 +176,7 @@ | |||||
| 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 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> | ||||
| @@ -127,7 +127,7 @@ | |||||
| <sql id="CouponCarColumns"> | <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, | 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> | </sql> | ||||
| <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap"> | <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap"> | ||||
| select <include refid="CouponCarColumns" /> | select <include refid="CouponCarColumns" /> | ||||
| @@ -410,17 +410,16 @@ | |||||
| <!--如果配置了审批模板,需要过滤投放审批状态--> | <!--如果配置了审批模板,需要过滤投放审批状态--> | ||||
| <if test="0 != filterCanPut or null ==filterCanPut "> | <if test="0 != filterCanPut or null ==filterCanPut "> | ||||
| <if test=" null != pressModelId and 0l != pressModelId"> | <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> | ||||
| <if test=" null != groupModelId and 0l != groupModelId"> | <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> | ||||
| <if test=" null != cardModelId and 0l != cardModelId"> | <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> | ||||
| <if test=" null != couponModelId and 0l != couponModelId"> | <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> | ||||
| </if> | </if> | ||||
| @@ -378,6 +378,8 @@ | |||||
| <result column="phone" jdbcType="VARCHAR" property="cUserPhone" /> | <result column="phone" jdbcType="VARCHAR" property="cUserPhone" /> | ||||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> | <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> | ||||
| <result column="verify_merchant_name" jdbcType="VARCHAR" property="verifyMerchantName"/> | |||||
| <collection column="{productId=coupon_id}" property="merchantVoList" | <collection column="{productId=coupon_id}" property="merchantVoList" | ||||
| ofType="com.iformall.domain.vo.WxMerchantVo" | ofType="com.iformall.domain.vo.WxMerchantVo" | ||||
| javaType="java.util.List" | 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, | 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, | (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 | 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> | ||||
| <sql id="allAdminCouponOrderDetailColumns"> | <sql id="allAdminCouponOrderDetailColumns"> | ||||
| @@ -407,14 +409,19 @@ | |||||
| <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | ||||
| select <include refid="allAdminCouponOrderListColumns" /> | select <include refid="allAdminCouponOrderListColumns" /> | ||||
| from | 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> | <choose> | ||||
| <when test=" null != couponType"> | <when test=" null != couponType"> | ||||
| and co.coupon_type = #{couponType} | and co.coupon_type = #{couponType} | ||||
| @@ -423,7 +430,6 @@ | |||||
| and co.coupon_type < 100 | and co.coupon_type < 100 | ||||
| </otherwise> | </otherwise> | ||||
| </choose> | </choose> | ||||
| and c.id = co.coupon_id | |||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and co.tenant_id = #{tenantId} | and co.tenant_id = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -468,6 +474,10 @@ | |||||
| <if test=" null != business "> | <if test=" null != business "> | ||||
| and c.business = #{business} | and c.business = #{business} | ||||
| </if> | </if> | ||||
| <if test=" null != verifyMerchantName ''!= verifyMerchantName "> | |||||
| and bu.verify_merchant_name = #{verifyMerchantName} | |||||
| </if> | |||||
| <if test="null!=building"> | <if test="null!=building"> | ||||
| and co.coupon_id in( | 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 | 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> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </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> | </select> | ||||
| @@ -566,7 +566,7 @@ | |||||
| </where> | </where> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <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> | </select> | ||||
| @@ -347,7 +347,7 @@ | |||||
| <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> | <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> | ||||
| </where> | </where> | ||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <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> | </select> | ||||