|
|
@ -84,41 +84,42 @@ public class HighCouponSchedule { |
|
|
|
|
|
|
|
|
|
|
|
if (jsonObject.getString("respCode").equals("0000")) { |
|
|
|
if (jsonObject.getString("respCode").equals("0000")) { |
|
|
|
JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); |
|
|
|
JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); |
|
|
|
|
|
|
|
if (data.getString("respCode").equals("0000")) { |
|
|
|
if (data.getString("respCode").equals("0000") && data.getJSONObject("data").getInteger("state") != 20) { |
|
|
|
JSONObject responseObject = JSONObject.parseObject(data.getString("data")); |
|
|
|
couponCodeOther.setStatus(data.getJSONObject("data").getInteger("state")); |
|
|
|
if (responseObject.getInteger("state") != 20) { |
|
|
|
highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther); |
|
|
|
couponCodeOther.setStatus(responseObject.getInteger("state")); |
|
|
|
|
|
|
|
highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther); |
|
|
|
if (couponCodeOther.getCouponAgentCodeId() != null) { |
|
|
|
|
|
|
|
HighCouponAgentCode agentCode = highCouponAgentCodeMapper.selectByPrimaryKey(couponCodeOther.getCouponAgentCodeId()); |
|
|
|
if (couponCodeOther.getCouponAgentCodeId() != null) { |
|
|
|
if (agentCode == null) { |
|
|
|
HighCouponAgentCode agentCode = highCouponAgentCodeMapper.selectByPrimaryKey(couponCodeOther.getCouponAgentCodeId()); |
|
|
|
agentCode.setStatus(3); |
|
|
|
if (agentCode == null) { |
|
|
|
highCouponAgentCodeMapper.updateByPrimaryKey(agentCode); |
|
|
|
agentCode.setStatus(3); |
|
|
|
|
|
|
|
highCouponAgentCodeMapper.updateByPrimaryKey(agentCode); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (couponCodeOther.getChildOrderId() != null) { |
|
|
|
if (couponCodeOther.getChildOrderId() != null) { |
|
|
|
HighUserCouponExample userCouponExample = new HighUserCouponExample(); |
|
|
|
HighUserCouponExample userCouponExample = new HighUserCouponExample(); |
|
|
|
userCouponExample.createCriteria().andQrCodeImgEqualTo(couponCodeOther.getCouNo()).andStatusEqualTo(1); |
|
|
|
userCouponExample.createCriteria().andQrCodeImgEqualTo(couponCodeOther.getCouNo()).andStatusEqualTo(1); |
|
|
|
List<HighUserCoupon> list = highUserCouponMapper.selectByExample(userCouponExample); |
|
|
|
List<HighUserCoupon> list = highUserCouponMapper.selectByExample(userCouponExample); |
|
|
|
if (list.size() > 0) { |
|
|
|
if (list.size() > 0) { |
|
|
|
HighUserCoupon userCoupon = list.get(0); |
|
|
|
HighUserCoupon userCoupon = list.get(0); |
|
|
|
if (data.getJSONObject("data").getInteger("state") == 40) { |
|
|
|
if (responseObject.getInteger("state") == 40) { |
|
|
|
userCoupon.setStatus(2); |
|
|
|
userCoupon.setStatus(2); |
|
|
|
userCoupon.setConsumeTime(new Date()); |
|
|
|
userCoupon.setConsumeTime(new Date()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
userCoupon.setStatus(0); |
|
|
|
userCoupon.setStatus(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
highUserCouponMapper.updateByPrimaryKey(userCoupon); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询订单中的汇联通卡券全部已处理
|
|
|
|
|
|
|
|
HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample(); |
|
|
|
|
|
|
|
otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1); |
|
|
|
|
|
|
|
if (highCouponCodeOtherMapper.selectByExample(otherExample).size() == 0) { |
|
|
|
|
|
|
|
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId()); |
|
|
|
} |
|
|
|
} |
|
|
|
highUserCouponMapper.updateByPrimaryKey(userCoupon); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询订单中的汇联通卡券全部已处理
|
|
|
|
|
|
|
|
HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample(); |
|
|
|
|
|
|
|
otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1); |
|
|
|
|
|
|
|
if (highCouponCodeOtherMapper.selectByExample(otherExample).size() == 0) { |
|
|
|
|
|
|
|
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|