|
@@ -8,6 +8,7 @@ import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
import cn.cslg.pas.common.vo.business.ProductCategoryVO;
|
|
|
import cn.cslg.pas.domain.business.AssoProductCategoryFile;
|
|
|
+import cn.cslg.pas.domain.business.AssoProductCategoryPerson;
|
|
|
import cn.cslg.pas.domain.business.ProductCategory;
|
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
@@ -50,6 +51,9 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
private AssoProductCategoryFileService assoProductCategoryFileService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private AssoProductCategoryPersonService assoProductCategoryPersonService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private CacheUtils cacheUtils;
|
|
|
|
|
|
@Autowired
|
|
@@ -62,7 +66,7 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
|
|
|
@Override
|
|
|
public Object queryMessage(QueryRequest queryRequest) throws Exception {
|
|
|
- List<String> sqls = formatQueryService.reSqls(queryRequest);
|
|
|
+ List<String> sqls = formatQueryService.reSqls(queryRequest,"productCategory");
|
|
|
//根据sql查询产品类别信息
|
|
|
List<ProductCategoryVO> productCategoryVOS = productCategoryMapper.getProductCategory(sqls.get(0),sqls.get(1),sqls.get(2));
|
|
|
//查询总数
|
|
@@ -108,6 +112,33 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
|
|
|
ProductCategory productCategory = new ProductCategory();
|
|
|
BeanUtils.copyProperties(productCategoryDTO, productCategory);
|
|
|
productCategory.insert();
|
|
|
+ //判断可见类型:
|
|
|
+ Integer showType = productCategoryDTO.getShowType();
|
|
|
+ if(showType != 0 && showType != 1){
|
|
|
+ List<Integer> showPersonIds = productCategoryDTO.getShowPersonId();
|
|
|
+ //0所有人可见,1本人可见
|
|
|
+ if(showPersonIds !=null && showPersonIds.size() != 0){
|
|
|
+ List<AssoProductCategoryPerson> assoProductCategoryPeople = new ArrayList<>();
|
|
|
+ for (Integer showPersonId : showPersonIds) {
|
|
|
+ AssoProductCategoryPerson assoProductCategoryPerson = new AssoProductCategoryPerson();
|
|
|
+ assoProductCategoryPerson.setProductCategoryId(productCategory.getId());
|
|
|
+ assoProductCategoryPerson.setPersonId(showPersonId);
|
|
|
+ assoProductCategoryPerson.setCreateId(personnelVO.getId());
|
|
|
+ //2仅选定人可见
|
|
|
+ if (showType == 2) {
|
|
|
+ assoProductCategoryPerson.setRole(1);
|
|
|
+ } else if (showType == 3) {//3选定人不可见
|
|
|
+ assoProductCategoryPerson.setRole(2);
|
|
|
+ } else {
|
|
|
+ throw new XiaoShiException("可见类型错误");
|
|
|
+ }
|
|
|
+ assoProductCategoryPeople.add(assoProductCategoryPerson);
|
|
|
+ }
|
|
|
+ if(assoProductCategoryPeople != null && assoProductCategoryPeople.size() != 0){
|
|
|
+ assoProductCategoryPersonService.saveBatch(assoProductCategoryPeople);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//判断文件是否为空
|
|
|
if (files != null && files.size() != 0) {
|
|
|
try {
|