dev-discount
袁野 4 years ago
commit 6225ccc94e
  1. 1
      hai-bweb/src/main/java/com/bweb/controller/HighApproveController.java
  2. 3
      hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java
  3. 2
      hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java
  4. 5
      hai-service/src/main/java/com/hai/service/impl/HighApproveServiceImpl.java
  5. 8
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  6. 32
      hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java

@ -86,6 +86,7 @@ public class HighApproveController {
} }
approve.setRemarks(remarks); approve.setRemarks(remarks);
approve.setStatus(status);
approve.setUpdateTime(new Date()); approve.setUpdateTime(new Date());
approve.setApproveOperatorId(userInfoModel.getSecUser().getId()); approve.setApproveOperatorId(userInfoModel.getSecUser().getId());
approve.setApproveOperatorName(userInfoModel.getSecUser().getUserName()); approve.setApproveOperatorName(userInfoModel.getSecUser().getUserName());

@ -49,9 +49,6 @@ public class HighGoodsPriceReferController {
@Resource @Resource
private HighGoodsPriceReferService highGoodsPriceReferService; private HighGoodsPriceReferService highGoodsPriceReferService;
@Resource
private HighApproveService highApproveService;
@Resource @Resource
private HighCouponService highCouponService; private HighCouponService highCouponService;

@ -35,7 +35,7 @@ public interface HighGoodsPriceReferService {
* @Description 提交审批 * @Description 提交审批
* @Date 2021/3/24 16:16 * @Date 2021/3/24 16:16
**/ **/
void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer); void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) throws Exception;
/** /**
* @Author 胡锐 * @Author 胡锐

@ -44,6 +44,11 @@ public class HighApproveServiceImpl implements HighApproveService {
if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) { if (Objects.equals(highApprove.getObjectType(), ApproveType.UP_SHELF_APPROVE.getType())) {
highCouponService.upShelfApprove(highApprove.getObjectId()); highCouponService.upShelfApprove(highApprove.getObjectId());
} }
// 卡卷价格审批
if (Objects.equals(highApprove.getObjectType(), ApproveType.COUPON_PRICE_APPROVE.getType())) {
// 暂时不需要调用接口
}
highApproveMapper.insert(highApprove); highApproveMapper.insert(highApprove);
} }

@ -255,7 +255,6 @@ public class HighCouponServiceImpl implements HighCouponService {
if (highGoodsPriceRefer.getStatus() != 101) { if (highGoodsPriceRefer.getStatus() != 101) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
} }
// 卡卷信息 // 卡卷信息
HighCouponModel coupon = getCouponById(highGoodsPriceRefer.getObjectId()); HighCouponModel coupon = getCouponById(highGoodsPriceRefer.getObjectId());
if (coupon == null) { if (coupon == null) {
@ -264,16 +263,15 @@ public class HighCouponServiceImpl implements HighCouponService {
// 状态: 1:待审批 2:驳回 3:通过 // 状态: 1:待审批 2:驳回 3:通过
// 价格类型 1:原价 2:折扣价 // 价格类型 1:原价 2:折扣价
if (highApprove.getStatus() == 1) { if (highApprove.getStatus() == 2) {
// 及时生效 0:否 1:是 // 及时生效 0:否 1:是
if (highGoodsPriceRefer.getPromptlyType() == true) { if (highGoodsPriceRefer.getPromptlyType() == true) {
coupon.setCouponPrice(highGoodsPriceRefer.getNewSalePrice()); coupon.setCouponPrice(highGoodsPriceRefer.getNewSalePrice());
update(coupon); update(coupon);
} }
highGoodsPriceRefer.setStatus(2); highGoodsPriceRefer.setStatus(3);
} }
if (highApprove.getStatus() == 2) { if (highApprove.getStatus() == 3) {
highGoodsPriceRefer.setStatus(102); highGoodsPriceRefer.setStatus(102);
} }
highGoodsPriceReferService.updatePriceRefer(highGoodsPriceRefer); highGoodsPriceReferService.updatePriceRefer(highGoodsPriceRefer);

@ -1,15 +1,20 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.hai.common.utils.DateUtil;
import com.hai.dao.HighGoodsPriceReferMapper; import com.hai.dao.HighGoodsPriceReferMapper;
import com.hai.entity.HighGoodsPriceRefer; import com.hai.entity.*;
import com.hai.entity.HighGoodsPriceReferExample; import com.hai.enum_type.ApproveType;
import com.hai.entity.HighMerchant; import com.hai.service.HighApproveService;
import com.hai.service.HighCouponService;
import com.hai.service.HighGoodsPriceReferService; import com.hai.service.HighGoodsPriceReferService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -24,6 +29,12 @@ public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferServic
@Resource @Resource
private HighGoodsPriceReferMapper highGoodsPriceReferMapper; private HighGoodsPriceReferMapper highGoodsPriceReferMapper;
@Resource
private HighApproveService highApproveService;
@Resource
private HighCouponService highCouponService;
@Override @Override
public void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer) { public void insertPriceRefer(HighGoodsPriceRefer highGoodsPriceRefer) {
highGoodsPriceReferMapper.insert(highGoodsPriceRefer); highGoodsPriceReferMapper.insert(highGoodsPriceRefer);
@ -35,9 +46,22 @@ public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferServic
} }
@Override @Override
public void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) { @Transactional(propagation= Propagation.REQUIRES_NEW)
public void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) throws Exception {
insertPriceRefer(highGoodsPriceRefer); 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 @Override

Loading…
Cancel
Save