diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighApproveController.java b/hai-bweb/src/main/java/com/bweb/controller/HighApproveController.java index 8b2286bd..5744b311 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighApproveController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighApproveController.java @@ -86,6 +86,7 @@ public class HighApproveController { } approve.setRemarks(remarks); + approve.setStatus(status); approve.setUpdateTime(new Date()); approve.setApproveOperatorId(userInfoModel.getSecUser().getId()); approve.setApproveOperatorName(userInfoModel.getSecUser().getUserName()); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java index 1110e41d..3447bd4e 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java @@ -49,9 +49,6 @@ public class HighGoodsPriceReferController { @Resource private HighGoodsPriceReferService highGoodsPriceReferService; - @Resource - private HighApproveService highApproveService; - @Resource private HighCouponService highCouponService; diff --git a/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java b/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java index e4632833..ab2312fb 100644 --- a/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java +++ b/hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java @@ -35,7 +35,7 @@ public interface HighGoodsPriceReferService { * @Description 提交审批 * @Date 2021/3/24 16:16 **/ - void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer); + void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) throws Exception; /** * @Author 胡锐 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java index c4c337a1..70183e1a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java @@ -44,6 +44,11 @@ public class HighApproveServiceImpl implements HighApproveService { if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) { highCouponService.upShelfApprove(highApprove.getObjectId()); } + + // 卡卷价格审批 + if (Objects.equals(highApprove.getObjectType(), ApproveType.COUPON_PRICE_APPROVE.getType())) { + // 暂时不需要调用接口 + } highApproveMapper.insert(highApprove); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index e829f393..8286da7b 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -255,7 +255,6 @@ public class HighCouponServiceImpl implements HighCouponService { if (highGoodsPriceRefer.getStatus() != 101) { throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); } - // 卡卷信息 HighCouponModel coupon = getCouponById(highGoodsPriceRefer.getObjectId()); if (coupon == null) { @@ -264,16 +263,15 @@ public class HighCouponServiceImpl implements HighCouponService { // 状态: 1:待审批 2:驳回 3:通过 // 价格类型 1:原价 2:折扣价 - if (highApprove.getStatus() == 1) { - + if (highApprove.getStatus() == 2) { // 及时生效 0:否 1:是 if (highGoodsPriceRefer.getPromptlyType() == true) { coupon.setCouponPrice(highGoodsPriceRefer.getNewSalePrice()); update(coupon); } - highGoodsPriceRefer.setStatus(2); + highGoodsPriceRefer.setStatus(3); } - if (highApprove.getStatus() == 2) { + if (highApprove.getStatus() == 3) { highGoodsPriceRefer.setStatus(102); } highGoodsPriceReferService.updatePriceRefer(highGoodsPriceRefer); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java index 11840472..27349a01 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java @@ -1,15 +1,20 @@ package com.hai.service.impl; +import com.hai.common.utils.DateUtil; import com.hai.dao.HighGoodsPriceReferMapper; -import com.hai.entity.HighGoodsPriceRefer; -import com.hai.entity.HighGoodsPriceReferExample; -import com.hai.entity.HighMerchant; +import com.hai.entity.*; +import com.hai.enum_type.ApproveType; +import com.hai.service.HighApproveService; +import com.hai.service.HighCouponService; import com.hai.service.HighGoodsPriceReferService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; @@ -24,6 +29,12 @@ public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferServic @Resource private HighGoodsPriceReferMapper highGoodsPriceReferMapper; + @Resource + private HighApproveService highApproveService; + + @Resource + private HighCouponService highCouponService; + @Override public void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer) { highGoodsPriceReferMapper.insert(highGoodsPriceRefer); @@ -35,9 +46,22 @@ public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferServic } @Override - public void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) { + @Transactional(propagation= Propagation.REQUIRES_NEW) + public void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) throws Exception { insertPriceRefer(highGoodsPriceRefer); + + HighApprove approve = new HighApprove(); + approve.setObjectType(ApproveType.UP_SHELF_APPROVE.getType()); + approve.setObjectId(highGoodsPriceRefer.getId()); + approve.setObjectName(highCouponService.getCouponById(highGoodsPriceRefer.getObjectId()).getCouponName()); + approve.setApproveSerialNo(DateUtil.date2String(new Date(), "yyyyMMddHHmmss")); + approve.setStatus(1); + approve.setCreateTime(new Date()); + approve.setUpdateTime(new Date()); + approve.setSubmitOperatorId(highGoodsPriceRefer.getOperatorId()); + approve.setSubmitOperatorName(highGoodsPriceRefer.getOperatorName()); + highApproveService.insertApprove(approve); } @Override