|
@@ -1,10 +1,7 @@
|
|
|
package cn.cslg.pas.service.business;
|
|
|
|
|
|
import cn.cslg.pas.common.dto.business.ProductDTO;
|
|
|
-import cn.cslg.pas.common.model.cronModel.GroupVO;
|
|
|
-import cn.cslg.pas.common.model.cronModel.Personnel;
|
|
|
-import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
-import cn.cslg.pas.common.model.cronModel.SystemFile;
|
|
|
+import cn.cslg.pas.common.model.cronModel.*;
|
|
|
import cn.cslg.pas.common.model.request.GroupRequest;
|
|
|
import cn.cslg.pas.common.model.request.QueryRequest;
|
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
@@ -18,6 +15,7 @@ import cn.cslg.pas.factorys.businessFactory.Business;
|
|
|
import cn.cslg.pas.mapper.ProductMapper;
|
|
|
import cn.cslg.pas.service.common.FileManagerService;
|
|
|
import cn.cslg.pas.service.permissions.PermissionService;
|
|
|
+import cn.cslg.pas.service.query.FormatQueryService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -49,6 +47,9 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> implemen
|
|
|
private AssoProductFileService assoProductFileService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private FormatQueryService formatQueryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private CacheUtils cacheUtils;
|
|
|
|
|
|
@Autowired
|
|
@@ -57,9 +58,22 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> implemen
|
|
|
@Autowired
|
|
|
private PermissionService permissionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProductMapper productMapper;
|
|
|
+
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Object queryMessage(QueryRequest queryRequest) throws Exception {
|
|
|
- return null;
|
|
|
+ List<String> sqls = formatQueryService.reSqls(queryRequest);
|
|
|
+ //根据sql查询产品信息
|
|
|
+ List<ProductVO> productVOS = productMapper.getProduct(sqls.get(0), sqls.get(1), sqls.get(2));
|
|
|
+ this.loadProduct(productVOS);
|
|
|
+ Records records = new Records();
|
|
|
+ records.setCurrent(queryRequest.getCurrent());
|
|
|
+ records.setSize(queryRequest.getSize());
|
|
|
+ records.setData(productVOS);
|
|
|
+// records.setTotal();
|
|
|
+ return records;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -192,6 +206,11 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> implemen
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 装载productVO
|
|
|
+ * @param productVOS
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
private void loadProduct(List<ProductVO> productVOS) throws IOException {
|
|
|
List<Integer> createIds = new ArrayList<>();
|
|
|
List<Integer> ids = new ArrayList<>();
|