|
@@ -2,6 +2,9 @@ package com.platform.service.longyanpurchaseorder.impl;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.platform.common.bean.AbstractPageResultBean;
|
|
|
+import com.platform.common.bean.DictVO;
|
|
|
+import com.platform.common.cache.DictCache;
|
|
|
+import com.platform.common.exception.BusinessException;
|
|
|
import com.platform.common.model.UserInfo;
|
|
|
import com.platform.common.util.*;
|
|
|
import com.platform.dao.bean.MyPage;
|
|
@@ -36,6 +39,7 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
* @Description 龙岩采购单表 service 实现类
|
|
@@ -217,6 +221,22 @@ public class LongYanPurchaseOrderServiceImpl extends BaseServiceImpl<LongYanPurc
|
|
|
|
|
|
@Override
|
|
|
public LongYanPurchaseOrder saveModelByDTO(LongYanPurchaseOrderDTO model) {
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+
|
|
|
+ List<DictVO> dictVOS = DictCache.getChildren("CANNOT_MOD_NAMES");
|
|
|
+ List<String> codes = dictVOS.stream().map(DictVO::getCode).collect(Collectors.toList());
|
|
|
+ Boolean flag = false;
|
|
|
+ for (String code : codes) {
|
|
|
+ if (code.equals(userInfo.getUsername())) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag){
|
|
|
+ throw new BusinessException("对不起,您没有请购权限!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
List<LongYanPurchaseDetailDTO> detailDTOS = model.getDetailDTOS();
|
|
|
model.setStatus(LongYanPurchaseOrderStatusEnum.caogao.getValue());
|
|
|
BigDecimal countNum = mapper.getPurchaseOrderCount1(new LongYanPurchaseOrderDTO());
|
|
@@ -227,7 +247,6 @@ public class LongYanPurchaseOrderServiceImpl extends BaseServiceImpl<LongYanPurc
|
|
|
}
|
|
|
|
|
|
model.setPurchaseNo(IdGeneratorUtils.getPurchaseNo(count));
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
BigDecimal totalNum = new BigDecimal(0);
|
|
|
if(project != null){
|
|
|
for (LongYanPurchaseDetailDTO detailDTO : detailDTOS) {
|