diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java index 31106d19..b5ca0b0a 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java @@ -11,15 +11,13 @@ import com.hai.common.utils.RedisUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.HuiLianTongUnionCardConfig; import com.hai.entity.HighFleetOilCard; +import com.hai.entity.HighOilCard; import com.hai.entity.HighUser; import com.hai.entity.HighUserCard; import com.hai.enum_type.UserCardType; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; -import com.hai.service.HighFleetOilCardService; -import com.hai.service.HighUserCardService; -import com.hai.service.HighUserPayPasswordService; -import com.hai.service.HighUserService; +import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.catalina.User; @@ -59,6 +57,9 @@ public class HighUserCardController { @Resource private HighFleetOilCardService fleetOilCardService; + @Resource + private HighOilCardService oilCardService; + @RequestMapping(value = "/bindCard", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "绑卡") @@ -370,4 +371,22 @@ public class HighUserCardController { } } + + @RequestMapping(value = "/applyOilCard", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "申请个人加油卡") + public ResponseData applyOilCard(HttpServletRequest request) { + try { + // 用户 + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + return ResponseMsgUtil.success(oilCardService.applyOilCard(userInfoModel.getHighUser().getPhone())); + + } catch (Exception e) { + log.error("HighUserCardController --> applyOilCard() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-order/src/main/java/com/web/controller/OrderController.java b/hai-order/src/main/java/com/web/controller/OrderController.java index 057ccde4..9dc089a3 100644 --- a/hai-order/src/main/java/com/web/controller/OrderController.java +++ b/hai-order/src/main/java/com/web/controller/OrderController.java @@ -149,6 +149,12 @@ public class OrderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请选择收货地址!"); } + } else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) { + if (childModel.getGoodsSpecName() == null) { + log.error("OrderController -> create() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入卡号"); + } + } } diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java b/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java index e2a563ca..6510f10f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java @@ -43,20 +43,20 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { "org_id, org_name, card_no, ", "amount, amount_consume, ", "contact_name, contact_phone, ", - "`status`, bind_status, ", - "bind_time, create_time, ", - "update_time, op_user_id, ", - "op_user_name, ext_1, ", - "ext_2, ext_3)", + "`status`, get_type, ", + "bind_status, bind_time, ", + "create_time, update_time, ", + "op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3)", "values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", "#{orgId,jdbcType=BIGINT}, #{orgName,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, ", "#{amount,jdbcType=DECIMAL}, #{amountConsume,jdbcType=DECIMAL}, ", "#{contactName,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, ", - "#{status,jdbcType=INTEGER}, #{bindStatus,jdbcType=INTEGER}, ", - "#{bindTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{opUserId,jdbcType=BIGINT}, ", - "#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{status,jdbcType=INTEGER}, #{getType,jdbcType=INTEGER}, ", + "#{bindStatus,jdbcType=INTEGER}, #{bindTime,jdbcType=TIMESTAMP}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighOilCard record); @@ -78,6 +78,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Result(column="contact_name", property="contactName", jdbcType=JdbcType.VARCHAR), @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="get_type", property="getType", jdbcType=JdbcType.INTEGER), @Result(column="bind_status", property="bindStatus", jdbcType=JdbcType.INTEGER), @Result(column="bind_time", property="bindTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -93,7 +94,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Select({ "select", "id, company_id, company_name, org_id, org_name, card_no, amount, amount_consume, ", - "contact_name, contact_phone, `status`, bind_status, bind_time, create_time, ", + "contact_name, contact_phone, `status`, get_type, bind_status, bind_time, create_time, ", "update_time, op_user_id, op_user_name, ext_1, ext_2, ext_3", "from high_oil_card", "where id = #{id,jdbcType=BIGINT}" @@ -110,6 +111,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Result(column="contact_name", property="contactName", jdbcType=JdbcType.VARCHAR), @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="get_type", property="getType", jdbcType=JdbcType.INTEGER), @Result(column="bind_status", property="bindStatus", jdbcType=JdbcType.INTEGER), @Result(column="bind_time", property="bindTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -143,6 +145,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { "contact_name = #{contactName,jdbcType=VARCHAR},", "contact_phone = #{contactPhone,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", + "get_type = #{getType,jdbcType=INTEGER},", "bind_status = #{bindStatus,jdbcType=INTEGER},", "bind_time = #{bindTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java index 18184a00..91c5fae0 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java @@ -68,6 +68,10 @@ public class HighOilCardSqlProvider { sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); } + if (record.getGetType() != null) { + sql.VALUES("get_type", "#{getType,jdbcType=INTEGER}"); + } + if (record.getBindStatus() != null) { sql.VALUES("bind_status", "#{bindStatus,jdbcType=INTEGER}"); } @@ -124,6 +128,7 @@ public class HighOilCardSqlProvider { sql.SELECT("contact_name"); sql.SELECT("contact_phone"); sql.SELECT("`status`"); + sql.SELECT("get_type"); sql.SELECT("bind_status"); sql.SELECT("bind_time"); sql.SELECT("create_time"); @@ -194,6 +199,10 @@ public class HighOilCardSqlProvider { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); } + if (record.getGetType() != null) { + sql.SET("get_type = #{record.getType,jdbcType=INTEGER}"); + } + if (record.getBindStatus() != null) { sql.SET("bind_status = #{record.bindStatus,jdbcType=INTEGER}"); } @@ -249,6 +258,7 @@ public class HighOilCardSqlProvider { sql.SET("contact_name = #{record.contactName,jdbcType=VARCHAR}"); sql.SET("contact_phone = #{record.contactPhone,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("get_type = #{record.getType,jdbcType=INTEGER}"); sql.SET("bind_status = #{record.bindStatus,jdbcType=INTEGER}"); sql.SET("bind_time = #{record.bindTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); @@ -308,6 +318,10 @@ public class HighOilCardSqlProvider { sql.SET("`status` = #{status,jdbcType=INTEGER}"); } + if (record.getGetType() != null) { + sql.SET("get_type = #{getType,jdbcType=INTEGER}"); + } + if (record.getBindStatus() != null) { sql.SET("bind_status = #{bindStatus,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCard.java b/hai-service/src/main/java/com/hai/entity/HighOilCard.java index 4d667f71..eac3f0ba 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCard.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCard.java @@ -66,6 +66,11 @@ public class HighOilCard implements Serializable { */ private Integer status; + /** + * 获取类型 1:机构分配 2:客户申领 + */ + private Integer getType; + /** * 绑定状态 0:未绑定 1:已绑定 */ @@ -192,6 +197,14 @@ public class HighOilCard implements Serializable { this.status = status; } + public Integer getGetType() { + return getType; + } + + public void setGetType(Integer getType) { + this.getType = getType; + } + public Integer getBindStatus() { return bindStatus; } @@ -287,6 +300,7 @@ public class HighOilCard implements Serializable { && (this.getContactName() == null ? other.getContactName() == null : this.getContactName().equals(other.getContactName())) && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getGetType() == null ? other.getGetType() == null : this.getGetType().equals(other.getGetType())) && (this.getBindStatus() == null ? other.getBindStatus() == null : this.getBindStatus().equals(other.getBindStatus())) && (this.getBindTime() == null ? other.getBindTime() == null : this.getBindTime().equals(other.getBindTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) @@ -313,6 +327,7 @@ public class HighOilCard implements Serializable { result = prime * result + ((getContactName() == null) ? 0 : getContactName().hashCode()); result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getGetType() == null) ? 0 : getGetType().hashCode()); result = prime * result + ((getBindStatus() == null) ? 0 : getBindStatus().hashCode()); result = prime * result + ((getBindTime() == null) ? 0 : getBindTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); @@ -342,6 +357,7 @@ public class HighOilCard implements Serializable { sb.append(", contactName=").append(contactName); sb.append(", contactPhone=").append(contactPhone); sb.append(", status=").append(status); + sb.append(", getType=").append(getType); sb.append(", bindStatus=").append(bindStatus); sb.append(", bindTime=").append(bindTime); sb.append(", createTime=").append(createTime); diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java b/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java index 82478253..02b473b9 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java @@ -836,6 +836,66 @@ public class HighOilCardExample { return (Criteria) this; } + public Criteria andGetTypeIsNull() { + addCriterion("get_type is null"); + return (Criteria) this; + } + + public Criteria andGetTypeIsNotNull() { + addCriterion("get_type is not null"); + return (Criteria) this; + } + + public Criteria andGetTypeEqualTo(Integer value) { + addCriterion("get_type =", value, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeNotEqualTo(Integer value) { + addCriterion("get_type <>", value, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeGreaterThan(Integer value) { + addCriterion("get_type >", value, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("get_type >=", value, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeLessThan(Integer value) { + addCriterion("get_type <", value, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeLessThanOrEqualTo(Integer value) { + addCriterion("get_type <=", value, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeIn(List values) { + addCriterion("get_type in", values, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeNotIn(List values) { + addCriterion("get_type not in", values, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeBetween(Integer value1, Integer value2) { + addCriterion("get_type between", value1, value2, "getType"); + return (Criteria) this; + } + + public Criteria andGetTypeNotBetween(Integer value1, Integer value2) { + addCriterion("get_type not between", value1, value2, "getType"); + return (Criteria) this; + } + public Criteria andBindStatusIsNull() { addCriterion("bind_status is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/enum_type/OilCardGetTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/OilCardGetTypeEnum.java new file mode 100644 index 00000000..428be8c6 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/OilCardGetTypeEnum.java @@ -0,0 +1,36 @@ + +package com.hai.enum_type; + +/** + * 油卡获取类型 + * @author hurui + */ +public enum OilCardGetTypeEnum { + type1(1 , "机构分配"), + type2(2 , "个人申领"), + ; + + private Integer code; + private String name; + + OilCardGetTypeEnum(int status , String name) { + this.code = status; + this.name = name; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/OilCardRecordSourceTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/OilCardRecordSourceTypeEnum.java index 16cc66f2..4bf8eea4 100644 --- a/hai-service/src/main/java/com/hai/enum_type/OilCardRecordSourceTypeEnum.java +++ b/hai-service/src/main/java/com/hai/enum_type/OilCardRecordSourceTypeEnum.java @@ -9,6 +9,7 @@ public enum OilCardRecordSourceTypeEnum { type2(2 , "订单消费"), type3(3 , "订单退款"), type4(4 , "回收余额"), + type5(5 , "现金充值"), ; private Integer type; diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index ebb9cbf4..c4383b19 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -120,6 +120,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { @Resource private HighOrderService highOrderService; + @Resource + private HighOilCardService oilCardService; @Resource private HighOilCardOrderService highOilCardOrderService; @@ -248,6 +250,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { blxCouponHandle(order , childOrder); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE13.getNumber())) { blxOrderHandle(order); + } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) { + oilCardHandle(childOrder.getGoodsSpecName(), order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) { levelUp(order); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE17.getNumber())) { @@ -622,6 +626,10 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } + + private void oilCardHandle(String cardNo, HighOrder order) { + oilCardService.recharge(cardNo, order.getOrderNo()); + } private void levelUp(HighOrder order) { HighUserLevel userLevel = new HighUserLevel(); diff --git a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java index 9dc58cbb..4656d9a6 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java @@ -22,7 +22,8 @@ public enum OrderChildGoodsType { TYPE11(11, "实物商品购买"), TYPE12(12, "比邻星停车券"), TYPE13(13, "比邻星停车"), - TYPE14(14, "升级会员"), + TYPE14(14, "个人油卡充值"), + TYPE15(15, "升级会员"), TYPE17(17, "团购套餐"), ; diff --git a/hai-service/src/main/java/com/hai/service/HighOilCardService.java b/hai-service/src/main/java/com/hai/service/HighOilCardService.java index d9f334cb..37e31101 100644 --- a/hai-service/src/main/java/com/hai/service/HighOilCardService.java +++ b/hai-service/src/main/java/com/hai/service/HighOilCardService.java @@ -19,6 +19,20 @@ public interface HighOilCardService { */ void editData(HighOilCard oilCard); + /** + * 申请个人油卡 + * @param phone + * @return + */ + HighOilCard applyOilCard(String phone); + + /** + * 个人油卡现金充值 + * @param cardNo + * @param orderNo + */ + void recharge(String cardNo, String orderNo); + /** * 油卡充值 * @param cardNo 油卡卡号 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java index 6f7fc4d8..ac4ebe84 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java @@ -72,6 +72,97 @@ public class HighOilCardServiceImpl implements HighOilCardService { } } + @Override + @Transactional(rollbackFor=Exception.class,propagation= Propagation.REQUIRES_NEW) + public HighOilCard applyOilCard(String phone) { + if (getOilCardByPhone(phone) != null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法申领,手机号【"+phone+"】的油卡已存在"); + } + // 查询用户 + HighUser user = userService.findByPhone(phone); + if (user == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户不存在"); + } + // 查询部门信息,个人油卡部门 + BsOrganization organization = organizationService.findById(5L); + if (organization == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到部门"); + } + BsCompany company = companyService.getCompanyById(organization.getCompanyId()); + + // 生成油卡 + HighOilCard oilCard = new HighOilCard(); + oilCard.setCompanyId(organization.getCompanyId()); + oilCard.setCompanyName(company.getName()); + oilCard.setOrgId(organization.getId()); + oilCard.setOrgName(organization.getName()); + oilCard.setAmount(new BigDecimal("0")); + oilCard.setAmountConsume(new BigDecimal("0")); + oilCard.setCardNo(BankNumberUtil.getBrankNumber("8")); + oilCard.setOpUserId(user.getId()); + oilCard.setOpUserName(user.getName()); + oilCard.setCreateTime(new Date()); + oilCard.setUpdateTime(new Date()); + oilCard.setStatus(OilCardStatusEnum.status1.getStatus()); + oilCard.setBindStatus(OilCardBindStatusEnum.status1.getStatus()); + oilCard.setBindTime(new Date()); + oilCard.setGetType(OilCardGetTypeEnum.type2.getCode()); + editData(oilCard); + + // 绑定用户 + userCardService.bindCard(UserCardType.type2.getType(), oilCard.getCardNo(), user.getId()); + + return oilCard; + } + + @Override + @Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW) + public void recharge(String cardNo, String orderNo) { + // 查询订单 + HighOrder order = orderService.getOrderByOrderNo(orderNo); + if (order == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单"); + } + if (!order.getOrderStatus().equals(OrderStatusEnum.type2.getType())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); + } + + HighOilCard oilCard = getOilCardByCardNo(cardNo); + if (oilCard == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "油卡卡号错误"); + } + if (!oilCard.getStatus().equals(OilCardStatusEnum.status1.getStatus())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "油卡不处于正常状态"); + } + // 变更前金额 + BigDecimal beforeAmount = oilCard.getAmount(); + // 计算金额 + oilCard.setAmount(oilCard.getAmount().add(order.getTotalPrice())); + editData(oilCard); + // 变更后金额 + BigDecimal afterAmount = oilCard.getAmount(); + + HighOilCardRecord record = new HighOilCardRecord(); + record.setOilCardId(oilCard.getId()); + record.setCardNo(oilCard.getCardNo()); + record.setType(OilCardRecordTypeEnum.type1.getType()); + record.setAmount(order.getTotalPrice()); + record.setBeforeAmount(beforeAmount); + record.setAfterAmount(afterAmount); + record.setSourceType(OilCardRecordSourceTypeEnum.type5.getType()); + try { + record.setSourceOrderNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); + } catch (Exception e) { + e.printStackTrace(); + } + record.setSourceContent("充值油卡金额:" + record.getAmount()); + oilCardRecordService.insertRecord(record); + + order.setOrderStatus(OrderStatusEnum.type3.getType()); + order.setFinishTime(new Date()); + orderService.updateOrder(order); + } + @Override @Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW) public synchronized void recharge(String cardNo, BigDecimal price, Long orgId) { @@ -284,6 +375,7 @@ public class HighOilCardServiceImpl implements HighOilCardService { oilCard.setUpdateTime(new Date()); oilCard.setStatus(OilCardStatusEnum.status1.getStatus()); oilCard.setBindStatus(OilCardBindStatusEnum.status0.getStatus()); + oilCard.setGetType(OilCardGetTypeEnum.type1.getCode()); oilCardList.add(oilCard); } oilCardMapper.insertList(oilCardList);