| @@ -346,7 +346,6 @@ public class WxCouponController extends BaseController { | |||||
| @SystemControllerLog(description = "卡券兑换码-导出数据") | @SystemControllerLog(description = "卡券兑换码-导出数据") | ||||
| public void exportCouponPassword(@ModelAttribute WxCouponPassword wxCouponPassword, HttpServletRequest request, HttpServletResponse response) { | public void exportCouponPassword(@ModelAttribute WxCouponPassword wxCouponPassword, HttpServletRequest request, HttpServletResponse response) { | ||||
| wxCouponPassword.setTenantId(getTenantId()); | wxCouponPassword.setTenantId(getTenantId()); | ||||
| wxCouponPassword.setExpireDate(new Date()); | |||||
| if (wxCouponPassword.getCouponId() == null) { | if (wxCouponPassword.getCouponId() == null) { | ||||
| wxCouponPassword.setCouponId(0L); | wxCouponPassword.setCouponId(0L); | ||||
| } | } | ||||
| @@ -48,6 +48,9 @@ public class WxCarController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxMerchantService wxMerchantService; | WxMerchantService wxMerchantService; | ||||
| @Autowired | |||||
| WxCouponService couponService; | |||||
| @Autowired | @Autowired | ||||
| WxCouponOrderService wxCouponOrderService; | WxCouponOrderService wxCouponOrderService; | ||||
| @@ -661,44 +664,36 @@ public class WxCarController extends BaseController { | |||||
| * 停车费抵扣 | * 停车费抵扣 | ||||
| * | * | ||||
| */ | */ | ||||
| @ApiOperation(value = "停车费抵扣", notes = "{\"tradeId\":\"string\",\"deductionAmount\":\"string\",\"accountId\":\"string\",\"orderId\":\"string\"}\nresult\n{\n" + | |||||
| " \"timestamp\": \"1464235239561\",\n" + | |||||
| " \"returnCode\": \"T\",\n" + | |||||
| " \"errorMsg\": \"\",\n" + | |||||
| " \"returnMsg\": \"OK\",\n" + | |||||
| " \"isSuccess\": \"0\",\n" + | |||||
| " \"carId\": \"5836b8b52ada463ebc6199579f029561\"\n" + | |||||
| " }") | |||||
| @ApiOperation(value = "停车费抵扣", notes ="TJD: {\"tradeId\":\"string\",\"accountId\":\"string\",\"couponOrderId\":\"string\"}") | |||||
| @PostMapping("/deductionFee") | @PostMapping("/deductionFee") | ||||
| public ResultData deductionFee(@RequestBody Map<String, String > paramMap) { | public ResultData deductionFee(@RequestBody Map<String, String > paramMap) { | ||||
| /// 1, get mall's park | /// 1, get mall's park | ||||
| WxPark park = getCurrentPark(getTenantId()); | WxPark park = getCurrentPark(getTenantId()); | ||||
| if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | ||||
| String tradeId = paramMap.get("tradeId"); | String tradeId = paramMap.get("tradeId"); | ||||
| String deductionAmount = paramMap.get("deductionAmount"); | |||||
| String accountId = paramMap.get("accountId"); | String accountId = paramMap.get("accountId"); | ||||
| String outTradeNo = paramMap.get("orderId"); | |||||
| String outTradeNo = paramMap.get("couponOrderId"); | |||||
| if (StringUtils.isBlank(tradeId)) { | if (StringUtils.isBlank(tradeId)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tradeId为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tradeId为空"); | ||||
| } | } | ||||
| if (StringUtils.isBlank(deductionAmount)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "deductionAmount为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(accountId)) { | if (StringUtils.isBlank(accountId)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "accountId为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "accountId为空"); | ||||
| } | } | ||||
| if (StringUtils.isBlank(outTradeNo)) { | if (StringUtils.isBlank(outTradeNo)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId为空"); | |||||
| } | } | ||||
| WxCouponOrder couponOrder = wxCouponOrderService.getById(Long.valueOf(outTradeNo)); | |||||
| WxCoupon coupon = couponService.getById(couponOrder.getCouponId()); | |||||
| String params = park.getVendorParams(); | String params = park.getVendorParams(); | ||||
| JSONObject objParams = JSON.parseObject(params); | JSONObject objParams = JSON.parseObject(params); | ||||
| String url = objParams.getString("url"); | String url = objParams.getString("url"); | ||||
| String partner = objParams.getString("partner"); | String partner = objParams.getString("partner"); | ||||
| String key = objParams.getString("key"); | String key = objParams.getString("key"); | ||||
| String version = objParams.getString("version"); | String version = objParams.getString("version"); | ||||
| String ret = tjd.deductionNotSettle(url, partner, key, version, tradeId, deductionAmount, outTradeNo, accountId); | |||||
| String ret = tjd.deductionForDetail(url, partner, key, version, | |||||
| tradeId, accountId, couponOrder, coupon); | |||||
| JSONObject retObj = JSON.parseObject(ret); | JSONObject retObj = JSON.parseObject(ret); | ||||
| if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) { | |||||
| if (retObj.getString(TJDUtil.TJD_RETURN_CODE).equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } else { | } else { | ||||
| return new ResultData(ErrorCode.TJD_DEDUCE_FEE_FAIL.getCode(), "停车费抵扣失败"); | return new ResultData(ErrorCode.TJD_DEDUCE_FEE_FAIL.getCode(), "停车费抵扣失败"); | ||||
| @@ -13,6 +13,7 @@ import java.util.Date; | |||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxCouponPassword extends BaseEntity { | public class WxCouponPassword extends BaseEntity { | ||||
| @Excel(name = "ID", width = 20, orderNum = "1") | |||||
| protected Long id; | protected Long id; | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| @@ -21,22 +22,23 @@ public class WxCouponPassword extends BaseEntity { | |||||
| private Long couponId; | private Long couponId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡券短ID",name="couponShort") | @io.swagger.annotations.ApiModelProperty(value="卡券短ID",name="couponShort") | ||||
| private String couponShort; | private String couponShort; | ||||
| @Excel(name = "兑换码", width = 20, orderNum = "1") | |||||
| @Excel(name = "兑换码", width = 20, orderNum = "2") | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户名称",name="password") | @io.swagger.annotations.ApiModelProperty(value="商户名称",name="password") | ||||
| private String password; | private String password; | ||||
| @Excel(name = "状态", width = 20, replace = {"初始_0", "发送中_1", "已发出_2", "已使用_3", "不可用_4"}, orderNum = "3") | |||||
| @Excel(name = "状态", width = 20, replace = {"初始_0", "发送中_1", "已发出_2", "已使用_3", "不可用_4"}, orderNum = "4") | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡密状态: 0初始1信息发出中2信息已发出3已使用4已过期",name="status") | @io.swagger.annotations.ApiModelProperty(value="卡密状态: 0初始1信息发出中2信息已发出3已使用4已过期",name="status") | ||||
| private Integer status; | private Integer status; | ||||
| @Excel(name = "发送手机", width = 20, orderNum = "4") | |||||
| @Excel(name = "发送手机", width = 20, orderNum = "5") | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡密发送到手机",name="sendedPhone") | @io.swagger.annotations.ApiModelProperty(value="卡密发送到手机",name="sendedPhone") | ||||
| private String sendedPhone; | private String sendedPhone; | ||||
| @Excel(name = "会员卡号", width = 20, orderNum = "6") | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡包ID(coupon_order_id/card_id)",name="cardId") | @io.swagger.annotations.ApiModelProperty(value="卡包ID(coupon_order_id/card_id)",name="cardId") | ||||
| private Long cardId; | private Long cardId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| 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; | ||||
| @Excel(name="过期时间",width = 20,format="yyyy-MM-dd", orderNum = "2") | |||||
| @Excel(name="过期时间",width = 20,format="yyyy-MM-dd", orderNum = "3") | |||||
| @io.swagger.annotations.ApiModelProperty(value="过期时间",name="expireDate") | @io.swagger.annotations.ApiModelProperty(value="过期时间",name="expireDate") | ||||
| private Date expireDate; | private Date expireDate; | ||||
| @@ -13,7 +13,8 @@ public interface WxCouponPasswordMapper extends CommonMapper<WxCouponPassword, L | |||||
| List<WxCouponPassword> findAvaPasswordListByCouponId(WxCouponPassword wxCouponPassword); | List<WxCouponPassword> findAvaPasswordListByCouponId(WxCouponPassword wxCouponPassword); | ||||
| void insertCouponPasswds(List<WxCouponPassword> pwdlist); | void insertCouponPasswds(List<WxCouponPassword> pwdlist); | ||||
| int updateStatusByCouponId(Long couponId); | |||||
| int disableByCouponId(Long couponId); | |||||
| int downloadByCouponId(Long couponId); | |||||
| List<WxCouponPassword> findCouponGroupList(WxCouponPassword wxCouponPassword); | List<WxCouponPassword> findCouponGroupList(WxCouponPassword wxCouponPassword); | ||||
| List<WxCouponPasswordCountInfoVO> findCouponCountInfo(WxCouponPassword wxCouponPassword); | List<WxCouponPasswordCountInfoVO> findCouponCountInfo(WxCouponPassword wxCouponPassword); | ||||
| @@ -143,7 +143,6 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| newOne.setStatus(EnumCouponPasswordStatus.INIT.getCode()); | newOne.setStatus(EnumCouponPasswordStatus.INIT.getCode()); | ||||
| newOne.setCreateDate(curDate); | newOne.setCreateDate(curDate); | ||||
| newOne.setUpdateDate(curDate); | newOne.setUpdateDate(curDate); | ||||
| newOne.setExpireDate(DateUtils.getTimeAfterDays(30, curDate)); | |||||
| couponPasswords.add(newOne); | couponPasswords.add(newOne); | ||||
| } | } | ||||
| wxCouponPasswordMapper.insertCouponPasswds(couponPasswords); | wxCouponPasswordMapper.insertCouponPasswds(couponPasswords); | ||||
| @@ -151,6 +150,9 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| @Override | @Override | ||||
| public void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponPassword couponPassword) { | public void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponPassword couponPassword) { | ||||
| if (couponPassword.getCouponId() != null) { | |||||
| wxCouponPasswordMapper.downloadByCouponId(couponPassword.getCouponId()); | |||||
| } | |||||
| List<WxCouponPassword> pwdList = wxCouponPasswordMapper.findAvaPasswordListByCouponId(couponPassword); | List<WxCouponPassword> pwdList = wxCouponPasswordMapper.findAvaPasswordListByCouponId(couponPassword); | ||||
| excelService.exportExcel(pwdList, null, "兑换码", WxCouponPassword.class, "卡兑换码.xlsx", response, false); | excelService.exportExcel(pwdList, null, "兑换码", WxCouponPassword.class, "卡兑换码.xlsx", response, false); | ||||
| @@ -422,7 +422,7 @@ import java.util.stream.Collectors; | |||||
| // 卡下架后,转赠找不到卡相关信息,所以修改卡转赠状态为不可转赠 | // 卡下架后,转赠找不到卡相关信息,所以修改卡转赠状态为不可转赠 | ||||
| wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); | wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); | ||||
| // 卡券下架,未使用的卡密要下架 | // 卡券下架,未使用的卡密要下架 | ||||
| couponPasswordMapper.updateStatusByCouponId(record.getId()); | |||||
| couponPasswordMapper.disableByCouponId(record.getId()); | |||||
| } | } | ||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| wxCouponMapper.updateById(record); | wxCouponMapper.updateById(record); | ||||
| @@ -726,6 +726,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| if (coupon.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | if (coupon.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | ||||
| WxCouponPassword updateCPwd = new WxCouponPassword(); | WxCouponPassword updateCPwd = new WxCouponPassword(); | ||||
| updateCPwd.setId(couponPasswordId); | updateCPwd.setId(couponPasswordId); | ||||
| updateCPwd.setCardId(cardInfo.getId()); | |||||
| updateCPwd.setStatus(EnumCouponPasswordStatus.USED.getCode()); | updateCPwd.setStatus(EnumCouponPasswordStatus.USED.getCode()); | ||||
| couponPasswordMapper.updateById(updateCPwd); | couponPasswordMapper.updateById(updateCPwd); | ||||
| } | } | ||||
| @@ -2,6 +2,8 @@ package com.iformall.utils.car; | |||||
| import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.WxCouponOrder; | |||||
| import com.iformall.utils.MapUtil; | import com.iformall.utils.MapUtil; | ||||
| import org.apache.http.Consts; | import org.apache.http.Consts; | ||||
| import org.apache.http.HttpEntity; | import org.apache.http.HttpEntity; | ||||
| @@ -36,6 +38,7 @@ public class TJDUtil { | |||||
| public static final String TJD_VERSION = "version"; | public static final String TJD_VERSION = "version"; | ||||
| public static final String TJD_CHARSET = "charset"; | public static final String TJD_CHARSET = "charset"; | ||||
| public static final String TJD_UTF_8 = "utf-8"; | |||||
| public static final String TJD_RETURN_CODE = "returnCode"; | public static final String TJD_RETURN_CODE = "returnCode"; | ||||
| public static final String TJD_RETURN_SUCC = "T"; | public static final String TJD_RETURN_SUCC = "T"; | ||||
| @@ -56,6 +59,21 @@ public class TJDUtil { | |||||
| public static final String TJD_PAY_AMT = "payAmount"; | public static final String TJD_PAY_AMT = "payAmount"; | ||||
| public static final String TJD_PAY_DT = "payDt"; | public static final String TJD_PAY_DT = "payDt"; | ||||
| public static final String TJD_FREE_MINS = "freeMins"; | public static final String TJD_FREE_MINS = "freeMins"; | ||||
| public static final String TJD_ACCOUNT_ID = "accountId"; | |||||
| public static final String TJD_PREPAY_TYPE = "prePayType"; | |||||
| public static final String TJD_PREPAY_TYPE_3 = "3"; // 三方合作方支付 | |||||
| public static final String TJD_PREPAY_TYPE_20 = "20"; // 手机场内支付 | |||||
| public static final String TJD_DETAIL_LIST = "detailList"; | |||||
| public static final String TJD_OUT_TRADE_NO = "outTradeNo"; | |||||
| public static final String TJD_TYPE = "type"; | |||||
| public static final String TJD_TYPE_DISCOUNT = "0"; | |||||
| public static final String TJD_TYPE_COUPON = "1"; | |||||
| public static final String TJD_COUPON_TYPE = "couponType"; | |||||
| public static final String TJD_CHANNEL = "channel"; | |||||
| public static final String TJD_AMOUNT = "amount"; | |||||
| public static final String TJD_MINUTES = "minutes"; | |||||
| public static final String TJD_CREDIT = "integral"; | |||||
| public static final String TJD_MEMO = "memo"; | |||||
| public static final SimpleDateFormat dateInFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | public static final SimpleDateFormat dateInFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||||
| public static final SimpleDateFormat dateOutFormat = new SimpleDateFormat("yyyyMMddHHmmss"); | public static final SimpleDateFormat dateOutFormat = new SimpleDateFormat("yyyyMMddHHmmss"); | ||||
| @@ -177,7 +195,7 @@ public class TJDUtil { | |||||
| if (outCarId != null) { | if (outCarId != null) { | ||||
| paramMap.put("outCardId", outCarId); | paramMap.put("outCardId", outCarId); | ||||
| } | } | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -220,7 +238,7 @@ public class TJDUtil { | |||||
| Map<String, String> paramMap = MapUtil.getOrderMap(); | Map<String, String> paramMap = MapUtil.getOrderMap(); | ||||
| paramMap.put("carId", carId); | paramMap.put("carId", carId); | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -267,7 +285,7 @@ public class TJDUtil { | |||||
| //paramMap.put("pmParkId", ""); | //paramMap.put("pmParkId", ""); | ||||
| paramMap.put(TJD_FREE_MINS, freeMins); | paramMap.put(TJD_FREE_MINS, freeMins); | ||||
| //paramMap.put("tradeId", ""); | //paramMap.put("tradeId", ""); | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -299,40 +317,92 @@ public class TJDUtil { | |||||
| * @param partner | * @param partner | ||||
| * @param key // 密钥 | * @param key // 密钥 | ||||
| * @param version | * @param version | ||||
| * type 可选值:0=抵扣、1=优惠券 | |||||
| * couponType type=1时必填,可选值:0=金额、1=时长、2=全免、3=时间区间 | |||||
| * channel 可选值: type=0时:5013=微信、5014=支付宝、5015=抵扣其他 | |||||
| * type=1时:2202=会员等级、2203=会员积分、2204=会员卡券、2205=会员补贴、2206=会员其他 | |||||
| * amount: type=0时、couponType=0必填,单位(元),保留小数点后两位,金额类型使用 | |||||
| * minutes: couponType=1时必填,单位(分钟),时长类型使用 | |||||
| * integral: 大于等于0的整数值,积分类型使用,如果使用了积分兑换,可填写积分值 | |||||
| * expireDt: type=1时选填,格式:yyyyMMddHHmmss,如果不填,则永不过期,若填写,则出场时间在此 时间之后,认为此记录已经过期,不再使用 | |||||
| * membershipGrade: 调用方系统会员等级标识,如:LV1、VIP2、金卡等,长度不超过64位 | |||||
| * identityType: identityId非空时,此值必填,可选值:01=手机号、02=会员卡号、03=车牌号、04=身份证号 | |||||
| * identityId: identityType非空时,此值必填,对应身份标识类型的唯一值,长度不超过100位 | |||||
| * { | * { | ||||
| "service": "parkhub.order.deductionForDetail", | |||||
| "partner": "120a565de377427184de35ca0f320764", | |||||
| "sign": "3347b109a1e44f3fd5baa78b74a84948", | |||||
| "signType": "md5", | |||||
| "charset": "utf-8", | |||||
| "version": "1.0", | |||||
| "timestamp": "2016-05-26 11:30:10", | |||||
| "tradeId": "c39d3aac49d04e12a187681e6189f841", | |||||
| "accountId": "a9b2963c98344bb292e0fa3f7dd70946", | |||||
| "prePayType": "3", | |||||
| "giveFreeTimeOut": "false", | |||||
| "detailList":"[{ | |||||
| },{ | |||||
| },{ | |||||
| \"outTradeNo\":\"PLDKY01\", \"identityType\":\"01\", \"identityId\":\"17710111111\", \"membershipGrade\":\"LV1\", \"amount\":\"12.50\", \"type\":\"0\", \"channel\":\"5013\", \"memo\":\"批量抵扣-金额-微信\" | |||||
| \"outTradeNo\":\"PLDKY02\", \"identityType\":\"01\", \"identityId\":\"17710111111\", \"membershipGrade\":\"LV1\", \"couponType\":\"1\", \"minutes\":\"60\", \"type\":\"1\", \"channel\":\"2204\", \"memo\":\"批量抵扣-时长-会员卡券\" | |||||
| \"outTradeNo\":\"PLDKY03\", \"identityType\":\"01\", \"identityId\":\"17710111111\", \"membershipGrade\":\"LV1\", \"couponType\":\"3\", \"startDt\":\"20180901110000\", \"endDt\":\"20180901170000\", \"integral\":\"500\", | |||||
| \"type\":\"1\", | |||||
| \"channel\":\"2205\", \"memo\":\"批量抵扣-区间-积分-会员补贴\" | |||||
| }]" | |||||
| "service": "parkhub.order.deductionForDetail", | |||||
| "partner": "120a565de377427184de35ca0f320764", | |||||
| "sign": "3347b109a1e44f3fd5baa78b74a84948", | |||||
| "signType": "md5", | |||||
| "charset": "utf-8", | |||||
| "version": "1.0", | |||||
| "timestamp": "2016-05-26 11:30:10", | |||||
| "tradeId": "c39d3aac49d04e12a187681e6189f841", | |||||
| "accountId": "a9b2963c98344bb292e0fa3f7dd70946", | |||||
| "prePayType": "3", | |||||
| "giveFreeTimeOut": "false", | |||||
| "detailList":"[{ | |||||
| \"outTradeNo\":\"PLDKY01\", | |||||
| \"identityType\":\"01\", | |||||
| \"identityId\":\"17710111111\", | |||||
| \"membershipGrade\":\"LV1\", | |||||
| \"amount\":\"12.50\", | |||||
| \"type\":\"0\", | |||||
| \"channel\":\"5013\", | |||||
| \"memo\":\"批量抵扣-金额-微信\" | |||||
| },{ | |||||
| \"outTradeNo\":\"PLDKY02\", | |||||
| \"identityType\":\"01\", | |||||
| \"identityId\":\"17710111111\", | |||||
| \"membershipGrade\":\"LV1\", | |||||
| \"couponType\":\"1\", | |||||
| \"minutes\":\"60\", | |||||
| \"type\":\"1\", | |||||
| \"channel\":\"2204\", | |||||
| \"memo\":\"批量抵扣-时长-会员卡券\" | |||||
| },{ | |||||
| \"outTradeNo\":\"PLDKY03\", | |||||
| \"identityType\":\"01\", | |||||
| \"identityId\":\"17710111111\", | |||||
| \"membershipGrade\":\"LV1\", | |||||
| \"couponType\":\"3\", | |||||
| \"startDt\":\"20180901110000\", | |||||
| \"endDt\":\"20180901170000\", | |||||
| \"integral\":\"500\", | |||||
| \"type\":\"1\", | |||||
| \"channel\":\"2205\", \"memo\":\"批量抵扣-区间-积分-会员补贴\" | |||||
| }]" | |||||
| } | } | ||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| public static String deductionForDetail(String url, String partner, String key, String version, | |||||
| String tradeId, String outTradeNo, String accountId, String deductionAmount) { | |||||
| public static String deductionForDetail( | |||||
| String url, String partner, String key, String version, | |||||
| String tradeId, String accountId, | |||||
| WxCouponOrder couponOrder, WxCoupon coupon) { | |||||
| // 为指定订单抵扣停车费,如果此时车辆已经出场,返回isSuccess错误码为3,停简单系统不再接收此笔抵扣信息,对方系统 需要给用户发起退款。 | // 为指定订单抵扣停车费,如果此时车辆已经出场,返回isSuccess错误码为3,停简单系统不再接收此笔抵扣信息,对方系统 需要给用户发起退款。 | ||||
| String service = "parkhub.order.deductionNotSettle"; | |||||
| String service = "parkhub.order.deductionForDetail"; | |||||
| Map<String, String> paramMap = MapUtil.getOrderMap(); | Map<String, String> paramMap = MapUtil.getOrderMap(); | ||||
| paramMap.put(TJD_TRADE_ID, tradeId); | paramMap.put(TJD_TRADE_ID, tradeId); | ||||
| paramMap.put("deductionAmount", deductionAmount); | |||||
| paramMap.put("outTradeNo", outTradeNo); | |||||
| paramMap.put("accountId", accountId); | |||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_ACCOUNT_ID, accountId); | |||||
| paramMap.put(TJD_PREPAY_TYPE, TJD_PREPAY_TYPE_3); | |||||
| Map<String, String> detailMap = MapUtil.getOrderMap(); | |||||
| detailMap.put(TJD_OUT_TRADE_NO, String.valueOf(couponOrder.getId())); | |||||
| detailMap.put(TJD_TYPE, TJD_TYPE_COUPON); | |||||
| detailMap.put(TJD_CHANNEL, "2204"); | |||||
| String memo = "会员优惠券"; | |||||
| if (coupon.getUnit().equals(0)) { | |||||
| detailMap.put(TJD_COUPON_TYPE, "0"); | |||||
| detailMap.put(TJD_AMOUNT, coupon.getPriceStr()); | |||||
| memo += "-金额"; | |||||
| } else { | |||||
| detailMap.put(TJD_COUPON_TYPE, "1"); | |||||
| detailMap.put(TJD_MINUTES, String.valueOf(coupon.getPrice()*60)); | |||||
| memo += "-时长"; | |||||
| } | |||||
| detailMap.put(TJD_MEMO, memo); | |||||
| paramMap.put(TJD_DETAIL_LIST, JSON.toJSONString(detailMap)); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -380,7 +450,7 @@ public class TJDUtil { | |||||
| paramMap.put("deductionAmount", deductionAmount); | paramMap.put("deductionAmount", deductionAmount); | ||||
| paramMap.put("outTradeNo", outTradeNo); | paramMap.put("outTradeNo", outTradeNo); | ||||
| paramMap.put("accountId", accountId); | paramMap.put("accountId", accountId); | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -431,7 +501,7 @@ public class TJDUtil { | |||||
| paramMap.put("prePayType", prePayType); | paramMap.put("prePayType", prePayType); | ||||
| paramMap.put("minutes", minutes); | paramMap.put("minutes", minutes); | ||||
| paramMap.put("memo", memo); | paramMap.put("memo", memo); | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -487,7 +557,7 @@ public class TJDUtil { | |||||
| paramMap.put("EndDt", EndDt); | paramMap.put("EndDt", EndDt); | ||||
| paramMap.put("expireDt", expireDt); | paramMap.put("expireDt", expireDt); | ||||
| paramMap.put("memo", memo); | paramMap.put("memo", memo); | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -530,7 +600,7 @@ public class TJDUtil { | |||||
| Map<String, String> paramMap = MapUtil.getOrderMap(); | Map<String, String> paramMap = MapUtil.getOrderMap(); | ||||
| paramMap.put("tradeId", tradeId); | paramMap.put("tradeId", tradeId); | ||||
| paramMap.put("ticketid", ticketid); | paramMap.put("ticketid", ticketid); | ||||
| paramMap.put(TJD_CHARSET, "utf-8"); | |||||
| paramMap.put(TJD_CHARSET, TJD_UTF_8); | |||||
| paramMap.put(TJD_ACCOUNT, partner); | paramMap.put(TJD_ACCOUNT, partner); | ||||
| paramMap.put(TJD_VERSION, version); | paramMap.put(TJD_VERSION, version); | ||||
| @@ -108,10 +108,16 @@ | |||||
| </foreach> | </foreach> | ||||
| </insert> | </insert> | ||||
| <update id="updateStatusByCouponId" parameterType="Long"> | |||||
| <update id="disableByCouponId" parameterType="Long"> | |||||
| update wx_coupon_password | update wx_coupon_password | ||||
| set status=4, update_date=now() | set status=4, update_date=now() | ||||
| where status != 3 and tenant_id = #{tenantId} and coupon_id=#{couponId} | |||||
| where status != 3 and coupon_id=#{couponId} | |||||
| </update> | |||||
| <update id="downloadByCouponId" parameterType="Long"> | |||||
| update wx_coupon_password | |||||
| set status=1, update_date=now(), expire_date=date_add(now(),interval 30 DAY) | |||||
| where status=0 and coupon_id=#{couponId} | |||||
| </update> | </update> | ||||
| <select id="findCouponGroupList" parameterType="com.iformall.domain.po.WxCouponPassword" resultMap="BaseResultMap"> | <select id="findCouponGroupList" parameterType="com.iformall.domain.po.WxCouponPassword" resultMap="BaseResultMap"> | ||||