'提交代码'

dev-discount
= 3 years ago
parent ac908d5de7
commit 27f65146f2
  1. 57
      hai-cweb/src/main/java/com/cweb/controller/HighCouponCodeOtherController.java
  2. 13
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  3. 106
      hai-cweb/src/main/java/com/cweb/controller/HighUserController.java
  4. 31
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  5. 55
      hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java
  6. 4
      hai-service/src/main/java/com/hai/common/exception/ErrorCode.java
  7. 13
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  8. 133
      hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapper.java
  9. 7
      hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherMapperExt.java
  10. 360
      hai-service/src/main/java/com/hai/dao/HighCouponCodeOtherSqlProvider.java
  11. 264
      hai-service/src/main/java/com/hai/entity/HighCouponCodeOther.java
  12. 1113
      hai-service/src/main/java/com/hai/entity/HighCouponCodeOtherExample.java
  13. 17
      hai-service/src/main/java/com/hai/service/HighCouponCodeOtherService.java
  14. 23
      hai-service/src/main/java/com/hai/service/HighUserPayPasswordService.java
  15. 38
      hai-service/src/main/java/com/hai/service/impl/HighCouponCodeOtherServiceImpl.java
  16. 23
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  17. 41
      hai-service/src/main/java/com/hai/service/impl/HighUserPayPasswordServiceImpl.java
  18. 23
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -0,0 +1,57 @@
package com.cweb.controller;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighUser;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/couponCodeOther")
@Api(value = "用户接口")
public class HighCouponCodeOtherController {
private static Logger log = LoggerFactory.getLogger(HighCouponCodeOtherController.class);
@Resource
private HighCouponCodeOtherService highCouponCodeOtherService;
@RequestMapping(value = "/getList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询卡券码列表")
public ResponseData getList(@RequestParam(name = "type", required = true) Integer type,
@RequestParam(name = "orderId", required = false) Long orderId,
@RequestParam(name = "childOrderId", required = false) Long childOrderId) {
try {
Map<String,Object> map = new HashMap<>();
map.put("type", type);
map.put("orderId", orderId);
map.put("childOrderId", childOrderId);
return ResponseMsgUtil.success(highCouponCodeOtherService.getList(map));
} catch (Exception e) {
log.error("HighCouponCodeOtherController --> getList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -195,6 +195,19 @@ public class HighTestController {
}
}
@RequestMapping(value = "/getCouState", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "测试")
public ResponseData getCouState(@RequestParam(name = "token", required = true) String token,
@RequestParam(name = "couNo", required = true) String couNo) {
try {
return ResponseMsgUtil.success(HuiLianTongConfig.getCouState(token,couNo));
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/couJointDist", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "测试")

@ -1,20 +1,20 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.security.VerifyCode;
import com.hai.common.security.VerifyCodeStorage;
import com.hai.common.security.*;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighOrder;
import com.hai.entity.HighUser;
import com.hai.entity.HighUserCoupon;
import com.hai.entity.HighUserPayPassword;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserCouponService;
import com.hai.service.HighUserPayPasswordService;
import com.hai.service.HighUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -24,10 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -57,6 +54,9 @@ public class HighUserController {
@Resource
private HighOrderService highOrderService;
@Resource
private HighUserPayPasswordService highUserPayPasswordService;
@RequestMapping(value = "/findUser", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
@ -114,4 +114,94 @@ public class HighUserController {
}
}
@RequestMapping(value = "/isSetPayPwd", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "用户是否设置支付密码")
public ResponseData isSetPayPwd(HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
if (highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId()) != null) {
return ResponseMsgUtil.success(true);
}
return ResponseMsgUtil.success(false);
} catch (Exception e) {
log.error("HighUserController --> setUserPayPwd() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/setUserPayPwd", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "设置用户支付密码")
public ResponseData setUserPayPwd(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
if (StringUtils.isBlank(body.getString("password"))
|| body.getString("password").length() != 6){
log.error("HighUserController --> setUserPayPwd() error!", "请设置6位支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请设置6支付密码");
}
// 查询用户密码
HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId());
if (userPayPassword != null) {
log.error("HighUserController --> setUserPayPwd() error!", "您已设置了支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REPEAT_SET_USER_PAY_PWD, "");
}
userPayPassword = new HighUserPayPassword();
userPayPassword.setUserId(userInfoModel.getHighUser().getId());
userPayPassword.setPassword(AESEncodeUtil.aesEncrypt(body.getString("password")));
highUserPayPasswordService.editUserPayPwd(userPayPassword);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighUserController --> setUserPayPwd() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateUserPayPwd", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改用户支付密码")
public ResponseData updateUserPayPwd(@RequestBody JSONObject body,HttpServletRequest request, HttpServletResponse response) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
if (StringUtils.isBlank(body.getString("password"))
|| StringUtils.isBlank(body.getString("newPassword"))) {
log.error("HighUserController --> setUserPayPwd() error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询用户密码
HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId());
if (userPayPassword == null) {
log.error("HighUserController --> setUserPayPwd() error!", "修改失败,未设置支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, "");
}
if (!AESEncodeUtil.aesEncrypt(body.getString("password")).equals(userPayPassword.getPassword())) {
log.error("HighUserController --> setUserPayPwd() error!", "修改失败,旧密码不一致");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "修改失败,旧密码不一致");
}
userPayPassword.setPassword(AESEncodeUtil.aesEncrypt(body.getString("newPassword")));
highUserPayPasswordService.editUserPayPwd(userPayPassword);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighUserController --> updateUserPayPwd() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -11,6 +11,7 @@ import com.hai.common.pay.WechatPayUtil;
import com.hai.common.pay.entity.OrderType;
import com.hai.common.pay.entity.WeChatPayReqInfo;
import com.hai.common.pay.util.MD5Util;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.security.Base64Util;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
@ -22,12 +23,15 @@ import com.hai.config.TuanYouConfig;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighCoupon;
import com.hai.entity.HighOrder;
import com.hai.entity.HighUserPayPassword;
import com.hai.model.HighCouponModel;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighCouponService;
import com.hai.service.HighOrderService;
import com.hai.service.HighQzOrderService;
import com.hai.service.HighUserPayPasswordService;
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
@ -92,6 +96,9 @@ public class OrderController {
@Resource
private HighQzOrderService highQzOrderService;
@Resource
private HighUserPayPasswordService highUserPayPasswordService;
/**
*
* @Title: orderToPay
@ -204,20 +211,42 @@ public class OrderController {
@RequestMapping(value="/orderToGoldPay",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "订单支付发起金币支付")
public ResponseData orderToGoldPay(@RequestBody String reqBodyStr) {
public ResponseData orderToGoldPay(@RequestBody String reqBodyStr,HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
if (StringUtils.isBlank(reqBodyStr)) {
log.error("orderToPay error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
JSONObject jsonObject = JSONObject.parseObject(reqBodyStr);
Long orderId = jsonObject.getLong("orderId");
String password = jsonObject.getString("password");
if (orderId == null) {
log.error("orderToPay error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (StringUtils.isBlank(password)) {
log.error("orderToPay error!", "未输入支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_ENTER_USER_PAY_PWD, "");
}
// 查询用户支付密码
HighUserPayPassword userPayPassword = highUserPayPasswordService.getDetailByUser(userInfoModel.getHighUser().getId());
if (userPayPassword == null) {
log.error("orderToPay error!", "未设置支付密码");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_SET_USER_PAY_PWD, "");
}
// 校验支付密码是否一直
if (!AESEncodeUtil.aesEncrypt(password).equals(userPayPassword.getPassword())) {
log.error("orderToPay error!", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_PAY_PWD_ERROR, "");
}
HighOrder order = highOrderService.getOrderById(orderId);
if(order == null) {
log.error("OrderController --> orderToPay() ERROR", "未找到订单信息");

@ -1,7 +1,14 @@
package com.hai.schedule;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighUserCoupon;
import com.hai.config.HuiLianTongConfig;
import com.hai.dao.HighCouponCodeOtherMapper;
import com.hai.entity.*;
import com.hai.service.HighOrderService;
import com.hai.service.HighUserCouponService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -24,6 +31,12 @@ public class HighCouponSchedule {
@Resource
private HighUserCouponService highUserCouponService;
@Resource
private HighCouponCodeOtherMapper highCouponCodeOtherMapper;
@Resource
private HighOrderService highOrderService;
/**
* @Author 胡锐
* @Description 处理过期的卡券
@ -41,4 +54,44 @@ public class HighCouponSchedule {
}
}
}
/**
* @Author 胡锐
* @Description 处理汇联卡券状态
* @Date 2021/4/4 22:44
**/
@Scheduled(cron="0 0/30 * * * ?") //每30分钟执行一次
public void handleCouponStatus() throws Exception {
HighCouponCodeOtherExample example = new HighCouponCodeOtherExample();
example.createCriteria().andStatusEqualTo(20).andTypeEqualTo(1);
List<HighCouponCodeOther> otherList = highCouponCodeOtherMapper.selectByExample(example);
// 获取token
JSONObject tokenObject = HuiLianTongConfig.getToken();
if (!tokenObject.getString("result").equals("success")) {
log.error("HighCouponController -> insertCoupon() error!","获取token失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取token失败");
}
for (HighCouponCodeOther couponCodeOther : otherList) {
JSONObject data = HuiLianTongConfig.getCouState(tokenObject.getString("data"), couponCodeOther.getCouNo());
if (data.getString("result").equals("success")) {
if (data.getJSONObject("data").getInteger("state") != 20) {
couponCodeOther.setStatus(data.getJSONObject("data").getInteger("state"));
highCouponCodeOtherMapper.updateByPrimaryKey(couponCodeOther);
}
// 查询订单中的汇联通卡券全部已处理
HighCouponCodeOtherExample otherExample = new HighCouponCodeOtherExample();
otherExample.createCriteria().andChildOrderIdEqualTo(couponCodeOther.getChildOrderId()).andStatusEqualTo(20).andTypeEqualTo(1);
if (highCouponCodeOtherMapper.selectByExample(example).size() == 0) {
highOrderService.childOrderComplete(couponCodeOther.getChildOrderId());
}
}
}
}
}

@ -109,6 +109,10 @@ public enum ErrorCode {
NOT_FOUND_AGENT("2126","未找到代理商信息"),
DISCOUNT_STOCK_COUNT_ERROR("2127","优惠券库存数量不足"),
RECHARGE_CLOSE("2128","系统已关闭,请稍后充值"),
REPEAT_SET_USER_PAY_PWD("2129","已设置支付密码"),
NOT_SET_USER_PAY_PWD("2130","未设置支付密码"),
NOT_ENTER_USER_PAY_PWD("2131","未输入支付密码"),
USER_PAY_PWD_ERROR("2132","支付密码错误"),
STATUS_ERROR("3000","状态错误"),
ADD_DATA_ERROR("3001","增加数据失败"),

@ -57,6 +57,19 @@ public class HuiLianTongConfig {
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getHuiliantongUrl()+"/coupon/api/coupon_corp/getCorpCouTypes", JSON.toJSONString(map));
}
/**
* 获取电子券类型列表
* @param token
* @return
* @throws Exception
*/
public static JSONObject getCouState(String token,String couNo) {
Map<String,Object> map = new HashMap<>();
map.put("token", token);
map.put("couNo", couNo);
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getHuiliantongUrl()+"/coupon/api/coupon_corp/getCouState", JSON.toJSONString(map));
}
/**
* 商户派发电子券

@ -0,0 +1,133 @@
package com.hai.dao;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighCouponCodeOtherExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface HighCouponCodeOtherMapper extends HighCouponCodeOtherMapperExt {
@SelectProvider(type=HighCouponCodeOtherSqlProvider.class, method="countByExample")
long countByExample(HighCouponCodeOtherExample example);
@DeleteProvider(type=HighCouponCodeOtherSqlProvider.class, method="deleteByExample")
int deleteByExample(HighCouponCodeOtherExample example);
@Delete({
"delete from high_coupon_code_other",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_coupon_code_other (`type`, order_id, ",
"child_order_id, cou_type_code, ",
"cou_no, `status`, active_time, ",
"valid_start_date, valid_end_date, ",
"create_time, ext_1, ",
"ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{orderId,jdbcType=BIGINT}, ",
"#{childOrderId,jdbcType=BIGINT}, #{couTypeCode,jdbcType=VARCHAR}, ",
"#{couNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{activeTime,jdbcType=TIMESTAMP}, ",
"#{validStartDate,jdbcType=TIMESTAMP}, #{validEndDate,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponCodeOther record);
@InsertProvider(type=HighCouponCodeOtherSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighCouponCodeOther record);
@SelectProvider(type=HighCouponCodeOtherSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="cou_type_code", property="couTypeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="cou_no", property="couNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="active_time", property="activeTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_start_date", property="validStartDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_end_date", property="validEndDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<HighCouponCodeOther> selectByExample(HighCouponCodeOtherExample example);
@Select({
"select",
"id, `type`, order_id, child_order_id, cou_type_code, cou_no, `status`, active_time, ",
"valid_start_date, valid_end_date, create_time, ext_1, ext_2, ext_3",
"from high_coupon_code_other",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="cou_type_code", property="couTypeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="cou_no", property="couNo", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="active_time", property="activeTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_start_date", property="validStartDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="valid_end_date", property="validEndDate", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
HighCouponCodeOther selectByPrimaryKey(Long id);
@UpdateProvider(type=HighCouponCodeOtherSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighCouponCodeOther record, @Param("example") HighCouponCodeOtherExample example);
@UpdateProvider(type=HighCouponCodeOtherSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighCouponCodeOther record, @Param("example") HighCouponCodeOtherExample example);
@UpdateProvider(type=HighCouponCodeOtherSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighCouponCodeOther record);
@Update({
"update high_coupon_code_other",
"set `type` = #{type,jdbcType=INTEGER},",
"order_id = #{orderId,jdbcType=BIGINT},",
"child_order_id = #{childOrderId,jdbcType=BIGINT},",
"cou_type_code = #{couTypeCode,jdbcType=VARCHAR},",
"cou_no = #{couNo,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"active_time = #{activeTime,jdbcType=TIMESTAMP},",
"valid_start_date = #{validStartDate,jdbcType=TIMESTAMP},",
"valid_end_date = #{validEndDate,jdbcType=TIMESTAMP},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighCouponCodeOther record);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface HighCouponCodeOtherMapperExt {
}

@ -0,0 +1,360 @@
package com.hai.dao;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighCouponCodeOtherExample.Criteria;
import com.hai.entity.HighCouponCodeOtherExample.Criterion;
import com.hai.entity.HighCouponCodeOtherExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighCouponCodeOtherSqlProvider {
public String countByExample(HighCouponCodeOtherExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_coupon_code_other");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighCouponCodeOtherExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_coupon_code_other");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighCouponCodeOther record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_coupon_code_other");
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getOrderId() != null) {
sql.VALUES("order_id", "#{orderId,jdbcType=BIGINT}");
}
if (record.getChildOrderId() != null) {
sql.VALUES("child_order_id", "#{childOrderId,jdbcType=BIGINT}");
}
if (record.getCouTypeCode() != null) {
sql.VALUES("cou_type_code", "#{couTypeCode,jdbcType=VARCHAR}");
}
if (record.getCouNo() != null) {
sql.VALUES("cou_no", "#{couNo,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getActiveTime() != null) {
sql.VALUES("active_time", "#{activeTime,jdbcType=TIMESTAMP}");
}
if (record.getValidStartDate() != null) {
sql.VALUES("valid_start_date", "#{validStartDate,jdbcType=TIMESTAMP}");
}
if (record.getValidEndDate() != null) {
sql.VALUES("valid_end_date", "#{validEndDate,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(HighCouponCodeOtherExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("`type`");
sql.SELECT("order_id");
sql.SELECT("child_order_id");
sql.SELECT("cou_type_code");
sql.SELECT("cou_no");
sql.SELECT("`status`");
sql.SELECT("active_time");
sql.SELECT("valid_start_date");
sql.SELECT("valid_end_date");
sql.SELECT("create_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("high_coupon_code_other");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
HighCouponCodeOther record = (HighCouponCodeOther) parameter.get("record");
HighCouponCodeOtherExample example = (HighCouponCodeOtherExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_coupon_code_other");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
}
if (record.getCouTypeCode() != null) {
sql.SET("cou_type_code = #{record.couTypeCode,jdbcType=VARCHAR}");
}
if (record.getCouNo() != null) {
sql.SET("cou_no = #{record.couNo,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getActiveTime() != null) {
sql.SET("active_time = #{record.activeTime,jdbcType=TIMESTAMP}");
}
if (record.getValidStartDate() != null) {
sql.SET("valid_start_date = #{record.validStartDate,jdbcType=TIMESTAMP}");
}
if (record.getValidEndDate() != null) {
sql.SET("valid_end_date = #{record.validEndDate,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_coupon_code_other");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("order_id = #{record.orderId,jdbcType=BIGINT}");
sql.SET("child_order_id = #{record.childOrderId,jdbcType=BIGINT}");
sql.SET("cou_type_code = #{record.couTypeCode,jdbcType=VARCHAR}");
sql.SET("cou_no = #{record.couNo,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("active_time = #{record.activeTime,jdbcType=TIMESTAMP}");
sql.SET("valid_start_date = #{record.validStartDate,jdbcType=TIMESTAMP}");
sql.SET("valid_end_date = #{record.validEndDate,jdbcType=TIMESTAMP}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
HighCouponCodeOtherExample example = (HighCouponCodeOtherExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighCouponCodeOther record) {
SQL sql = new SQL();
sql.UPDATE("high_coupon_code_other");
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getOrderId() != null) {
sql.SET("order_id = #{orderId,jdbcType=BIGINT}");
}
if (record.getChildOrderId() != null) {
sql.SET("child_order_id = #{childOrderId,jdbcType=BIGINT}");
}
if (record.getCouTypeCode() != null) {
sql.SET("cou_type_code = #{couTypeCode,jdbcType=VARCHAR}");
}
if (record.getCouNo() != null) {
sql.SET("cou_no = #{couNo,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getActiveTime() != null) {
sql.SET("active_time = #{activeTime,jdbcType=TIMESTAMP}");
}
if (record.getValidStartDate() != null) {
sql.SET("valid_start_date = #{validStartDate,jdbcType=TIMESTAMP}");
}
if (record.getValidEndDate() != null) {
sql.SET("valid_end_date = #{validEndDate,jdbcType=TIMESTAMP}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, HighCouponCodeOtherExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -0,0 +1,264 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* high_coupon_code_other
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighCouponCodeOther implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 类型 1 汇联通
*/
private Integer type;
/**
* 订单id
*/
private Long orderId;
/**
* 子订单id
*/
private Long childOrderId;
/**
* 卡券类型code
*/
private String couTypeCode;
/**
* 卡券号
*/
private String couNo;
/**
* 状态已核销4020已激活50 已作废
*/
private Integer status;
/**
* 激活时间
*/
private Date activeTime;
/**
* 有效期开始时间
*/
private Date validStartDate;
/**
* 有效期结束时间
*/
private Date validEndDate;
/**
* 创建时间
*/
private Date createTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getChildOrderId() {
return childOrderId;
}
public void setChildOrderId(Long childOrderId) {
this.childOrderId = childOrderId;
}
public String getCouTypeCode() {
return couTypeCode;
}
public void setCouTypeCode(String couTypeCode) {
this.couTypeCode = couTypeCode;
}
public String getCouNo() {
return couNo;
}
public void setCouNo(String couNo) {
this.couNo = couNo;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getActiveTime() {
return activeTime;
}
public void setActiveTime(Date activeTime) {
this.activeTime = activeTime;
}
public Date getValidStartDate() {
return validStartDate;
}
public void setValidStartDate(Date validStartDate) {
this.validStartDate = validStartDate;
}
public Date getValidEndDate() {
return validEndDate;
}
public void setValidEndDate(Date validEndDate) {
this.validEndDate = validEndDate;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
HighCouponCodeOther other = (HighCouponCodeOther) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
&& (this.getChildOrderId() == null ? other.getChildOrderId() == null : this.getChildOrderId().equals(other.getChildOrderId()))
&& (this.getCouTypeCode() == null ? other.getCouTypeCode() == null : this.getCouTypeCode().equals(other.getCouTypeCode()))
&& (this.getCouNo() == null ? other.getCouNo() == null : this.getCouNo().equals(other.getCouNo()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getActiveTime() == null ? other.getActiveTime() == null : this.getActiveTime().equals(other.getActiveTime()))
&& (this.getValidStartDate() == null ? other.getValidStartDate() == null : this.getValidStartDate().equals(other.getValidStartDate()))
&& (this.getValidEndDate() == null ? other.getValidEndDate() == null : this.getValidEndDate().equals(other.getValidEndDate()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
result = prime * result + ((getChildOrderId() == null) ? 0 : getChildOrderId().hashCode());
result = prime * result + ((getCouTypeCode() == null) ? 0 : getCouTypeCode().hashCode());
result = prime * result + ((getCouNo() == null) ? 0 : getCouNo().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getActiveTime() == null) ? 0 : getActiveTime().hashCode());
result = prime * result + ((getValidStartDate() == null) ? 0 : getValidStartDate().hashCode());
result = prime * result + ((getValidEndDate() == null) ? 0 : getValidEndDate().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", orderId=").append(orderId);
sb.append(", childOrderId=").append(childOrderId);
sb.append(", couTypeCode=").append(couTypeCode);
sb.append(", couNo=").append(couNo);
sb.append(", status=").append(status);
sb.append(", activeTime=").append(activeTime);
sb.append(", validStartDate=").append(validStartDate);
sb.append(", validEndDate=").append(validEndDate);
sb.append(", createTime=").append(createTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -0,0 +1,17 @@
package com.hai.service;
import com.hai.entity.HighCouponCodeOther;
import java.util.List;
import java.util.Map;
public interface HighCouponCodeOtherService {
/**
* 查询列表
* @param map
* @return
*/
List<HighCouponCodeOther> getList(Map<String,Object> map);
}

@ -0,0 +1,23 @@
package com.hai.service;
import com.hai.entity.HighUserPayPassword;
/**
* 用户支付密码
*/
public interface HighUserPayPasswordService {
/**
* 用户密码编辑
* @param highUserPayPassword
*/
void editUserPayPwd(HighUserPayPassword highUserPayPassword);
/**
* 根据用户查询密码
* @param userId
* @return
*/
HighUserPayPassword getDetailByUser(Long userId);
}

@ -0,0 +1,38 @@
package com.hai.service.impl;
import com.hai.dao.HighCouponCodeOtherMapper;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighCouponCodeOtherExample;
import com.hai.service.HighCouponCodeOtherService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service("highCouponCodeOtherService")
public class HighCouponCodeOtherServiceImpl implements HighCouponCodeOtherService {
@Resource
private HighCouponCodeOtherMapper highCouponCodeOtherMapper;
@Override
public List<HighCouponCodeOther> getList(Map<String, Object> map) {
HighCouponCodeOtherExample example = new HighCouponCodeOtherExample();
HighCouponCodeOtherExample.Criteria criteria = example.createCriteria();
if (MapUtils.getInteger(map,"type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map,"type"));
}
if (MapUtils.getLong(map,"orderId") != null) {
criteria.andOrderIdEqualTo(MapUtils.getLong(map,"orderId"));
}
if (MapUtils.getInteger(map,"childOrderId") != null) {
criteria.andChildOrderIdEqualTo(MapUtils.getLong(map,"childOrderId"));
}
return highCouponCodeOtherMapper.selectByExample(example);
}
}

@ -1,5 +1,6 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.QRCodeGenerator;
import com.hai.common.exception.ErrorCode;
@ -57,6 +58,9 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource
private HighCouponHandselService highCouponHandselService;
@Resource
private HighCouponCodeOtherMapper highCouponCodeOtherMapper;
@Resource
private HighUserService highUserService;
@ -195,7 +199,24 @@ public class HighOrderServiceImpl implements HighOrderService {
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(1);
couponCodeOther.setOrderId(highOrder.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
highCouponCodeOtherMapper.insert(couponCodeOther);
}
}
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setCreateTime(new Date());

@ -0,0 +1,41 @@
package com.hai.service.impl;
import com.hai.dao.HighUserPayPasswordMapper;
import com.hai.entity.HighUserPayPassword;
import com.hai.entity.HighUserPayPasswordExample;
import com.hai.service.HighUserPayPasswordService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service("highUserPayPasswordService")
public class HighUserPayPasswordServiceImpl implements HighUserPayPasswordService {
@Resource
private HighUserPayPasswordMapper highUserPayPasswordMapper;
@Override
public void editUserPayPwd(HighUserPayPassword highUserPayPassword) {
if (highUserPayPassword.getId() != null) {
highUserPayPassword.setUpdateTime(new Date());
highUserPayPasswordMapper.updateByPrimaryKey(highUserPayPassword);
} else {
highUserPayPassword.setCreateTime(new Date());
highUserPayPassword.setUpdateTime(new Date());
highUserPayPasswordMapper.insert(highUserPayPassword);
}
}
@Override
public HighUserPayPassword getDetailByUser(Long userId) {
HighUserPayPasswordExample example = new HighUserPayPasswordExample();
example.createCriteria().andUserIdEqualTo(userId);
List<HighUserPayPassword> list = highUserPayPasswordMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -1,5 +1,6 @@
package com.hai.service.pay.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
@ -10,6 +11,7 @@ import com.hai.common.utils.WxUtils;
import com.hai.config.CommonSysConst;
import com.hai.config.HuiLianTongConfig;
import com.hai.config.TuanYouConfig;
import com.hai.dao.HighCouponCodeOtherMapper;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.dao.HighUserCouponMapper;
import com.hai.entity.*;
@ -73,6 +75,9 @@ public class GoodsOrderServiceImpl implements PayService {
@Resource
private HighProfitSharingRecordService highProfitSharingRecordService;
@Resource
private HighCouponCodeOtherMapper highCouponCodeOtherMapper;
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void paySuccess(Map<String, String> map, String payType) throws Exception {
@ -126,6 +131,24 @@ public class GoodsOrderServiceImpl implements PayService {
// 推送给高速
JSONObject returnParam = HuiLianTongConfig.couJointDist(tokenObject.getString("data"), coupon.getCouponKey(), highChildOrder.getSaleCount(), highUser.getPhone(), highUser.getUnionId());
if (returnParam != null && returnParam.getString("result").equals("success")) {
JSONArray dataArray = returnParam.getJSONArray("data");
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
HighCouponCodeOther couponCodeOther = new HighCouponCodeOther();
couponCodeOther.setType(1);
couponCodeOther.setOrderId(order.getId());
couponCodeOther.setChildOrderId(highChildOrder.getId());
couponCodeOther.setCouTypeCode(dataObject.getString("couTypeCode"));
couponCodeOther.setCouNo(dataObject.getString("couNo"));
couponCodeOther.setStatus(20);
couponCodeOther.setCreateTime(new Date());
couponCodeOther.setActiveTime(dataObject.getDate("activeTime"));
couponCodeOther.setValidStartDate(dataObject.getDate("validStartDate"));
couponCodeOther.setValidEndDate(dataObject.getDate("validEndDate"));
highCouponCodeOtherMapper.insert(couponCodeOther);
}
}
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();

Loading…
Cancel
Save