|
@@ -6,9 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ruoyi.common.core.domain.PageQuery;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.helper.LoginHelper;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.common.utils.redis.RedisUtils;
|
|
|
import com.ruoyi.framework.handler.MonthTableNameHandler;
|
|
|
import com.ruoyi.zdsz.domain.ZEngiineeringPhoto;
|
|
|
import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
|
|
@@ -16,11 +19,14 @@ import com.ruoyi.zdsz.domain.bo.*;
|
|
|
import com.ruoyi.zdsz.domain.vo.ZEngiineeringPhotoVo;
|
|
|
import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryTypeVo;
|
|
|
import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
|
|
|
+import com.ruoyi.zdsz.mapper.ZEngineeringCivilMapper;
|
|
|
import com.ruoyi.zdsz.mapper.ZEngineeringIndustryMapper;
|
|
|
import com.ruoyi.zdsz.service.IZEngiineeringPhotoService;
|
|
|
import com.ruoyi.zdsz.service.IZEngineeringIndustryService;
|
|
|
import com.ruoyi.zdsz.service.IZEngineeringNodeService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
@@ -28,6 +34,9 @@ import org.springframework.util.ObjectUtils;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.lang.reflect.Method;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -53,6 +62,172 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
|
|
|
@Resource
|
|
|
private IZEngiineeringPhotoService photoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ZEngineeringCivilMapper zEngineeringCivilMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public TableDataInfo<Map<String, Object>> getByUserList(String type,String enginName,String enginType,String enginProcedure,String enginStatus,PageQuery pageQuery) {
|
|
|
+ Page<T> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
|
|
|
+ String leftJoin = null;
|
|
|
+ String szAndGy = null;
|
|
|
+ if ("1".equals(type)){
|
|
|
+ leftJoin = "z_engineering_pipe_jacking"; // 顶管
|
|
|
+ }
|
|
|
+ else if ("2".equals(type)){
|
|
|
+ leftJoin = "z_engineering_infrastructure"; // 基建
|
|
|
+ }
|
|
|
+ else if ("3".equals(type)){
|
|
|
+ leftJoin = "z_engineering_dangerous"; // 危险工程
|
|
|
+ }
|
|
|
+ else if ("4".equals(type)){
|
|
|
+ leftJoin = "z_engineering_industry"; // 市政工程
|
|
|
+ szAndGy = "gy";
|
|
|
+ }
|
|
|
+ else if ("5".equals(type)){
|
|
|
+ leftJoin = "z_engineering_industry"; // 工业工程
|
|
|
+ szAndGy = "sz";
|
|
|
+ }
|
|
|
+ else if ("6".equals(type)){
|
|
|
+ leftJoin = "z_engineering_air_wall"; // 工业工程
|
|
|
+ }
|
|
|
+ LinkedList<String> list = zEngineeringCivilMapper.getTableNames("z_engineering_info");
|
|
|
+ List DateList = new ArrayList();
|
|
|
+ list.removeLast();
|
|
|
+ list.stream().forEach(item -> {
|
|
|
+ DateList.add(item.substring(item.indexOf("2")));
|
|
|
+ });
|
|
|
+ String username = LoginHelper.getUsername();
|
|
|
+ Page<Map<String, Object>> listPage = baseMapper.getByUserList(DateList, username, leftJoin, szAndGy, page);
|
|
|
+
|
|
|
+ if ("1".equals(type)){ // 顶管
|
|
|
+ listPage.getRecords().forEach(item -> {
|
|
|
+
|
|
|
+ String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));
|
|
|
+ MonthTableNameHandler.setData(date);
|
|
|
+
|
|
|
+ List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
|
|
|
+ Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
|
+ List<SysDictData> municipalEngineeringNode = sysDictMap.get("pipe_jack");
|
|
|
+ mapList.forEach(ite -> {
|
|
|
+ String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
|
|
|
+ // "municipal_engineering_node";
|
|
|
+ ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
|
|
|
+ ite.put("reviewStatus", str);
|
|
|
+ });
|
|
|
+ municipalEngineeringNode.forEach(ite -> {
|
|
|
+ String dictLabel = ite.getDictLabel();
|
|
|
+ List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
|
|
|
+ if (type1.size() == 0) {
|
|
|
+ HashMap<String, String> objectObjectHashMap = new HashMap<>();
|
|
|
+ objectObjectHashMap.put("reviewStatus","未审核");
|
|
|
+ objectObjectHashMap.put("type",dictLabel);
|
|
|
+ mapList.add(objectObjectHashMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.put("status",mapList);
|
|
|
+ MonthTableNameHandler.removeData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if ("2".equals(type)){ // 基建
|
|
|
+ listPage.getRecords().forEach(item -> {
|
|
|
+ String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
|
|
|
+ MonthTableNameHandler.setData(date);
|
|
|
+ List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
|
|
|
+ Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
|
+ List<SysDictData> municipalEngineeringNode = sysDictMap.get("engineering_infrastructure");
|
|
|
+ mapList.forEach(ite -> {
|
|
|
+ String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
|
|
|
+ // "municipal_engineering_node";
|
|
|
+ ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
|
|
|
+ ite.put("reviewStatus", str);
|
|
|
+ });
|
|
|
+ municipalEngineeringNode.forEach(ite -> {
|
|
|
+ String dictLabel = ite.getDictLabel();
|
|
|
+ List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
|
|
|
+ if (type1.size() == 0) {
|
|
|
+ HashMap<String, String> objectObjectHashMap = new HashMap<>();
|
|
|
+ objectObjectHashMap.put("reviewStatus","未审核");
|
|
|
+ objectObjectHashMap.put("type",dictLabel);
|
|
|
+ mapList.add(objectObjectHashMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.put("status",mapList);
|
|
|
+ MonthTableNameHandler.removeData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if ("3".equals(type)){ // 危险工程
|
|
|
+ listPage.getRecords().forEach(item -> {
|
|
|
+ String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
|
|
|
+;
|
|
|
+ MonthTableNameHandler.setData(date);
|
|
|
+ List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
|
|
|
+ mapList.forEach(ite -> {
|
|
|
+ String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
|
|
|
+ ite.put("reviewStatus", str);
|
|
|
+ });
|
|
|
+ item.put("status",mapList);
|
|
|
+ MonthTableNameHandler.removeData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if ("4".equals(type)){ // 市政工程
|
|
|
+ listPage.getRecords().forEach(item -> {
|
|
|
+ String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
|
|
|
+;
|
|
|
+ MonthTableNameHandler.setData(date);
|
|
|
+ List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
|
|
|
+ Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
|
+ List<SysDictData> municipalEngineeringNode = sysDictMap.get("municipal_engineering_node");
|
|
|
+ mapList.forEach(ite -> {
|
|
|
+ String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
|
|
|
+ // "municipal_engineering_node";
|
|
|
+ ite.put("type",municipalEngineeringNode.stream().filter(ie-> ie.getDictValue() .equals(ite.get("type"))).collect(Collectors.toList()).get(0).getDictLabel());
|
|
|
+ ite.put("reviewStatus", str);
|
|
|
+ });
|
|
|
+ municipalEngineeringNode.forEach(ite -> {
|
|
|
+ String dictLabel = ite.getDictLabel();
|
|
|
+ List<Map<String, String>> type1 = mapList.stream().filter(it -> it.get("type").equals(dictLabel)).collect(Collectors.toList());
|
|
|
+ if (type1.size() == 0) {
|
|
|
+ HashMap<String, String> objectObjectHashMap = new HashMap<>();
|
|
|
+ objectObjectHashMap.put("reviewStatus","未审核");
|
|
|
+ objectObjectHashMap.put("type",dictLabel);
|
|
|
+ mapList.add(objectObjectHashMap);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.put("status",mapList);
|
|
|
+ MonthTableNameHandler.removeData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if ("5".equals(type)){ // 工业工程
|
|
|
+ listPage.getRecords().forEach(item -> {
|
|
|
+ String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
|
|
|
+;
|
|
|
+ MonthTableNameHandler.setData(date);
|
|
|
+ List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
|
|
|
+ mapList.forEach(ite -> {
|
|
|
+ String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
|
|
|
+ ite.put("reviewStatus", str);
|
|
|
+ });
|
|
|
+ item.put("status",mapList);
|
|
|
+ });
|
|
|
+ MonthTableNameHandler.removeData();
|
|
|
+ }
|
|
|
+ else if ("6".equals(type)){ // 工业工程
|
|
|
+ listPage.getRecords().forEach(item -> {
|
|
|
+ String date = new SimpleDateFormat("yyyy_MM").format(Date.from(((LocalDateTime)item.get("createTime")).atZone(ZoneId.systemDefault()).toInstant()));;
|
|
|
+;
|
|
|
+ MonthTableNameHandler.setData(date);
|
|
|
+ List<Map<String, String>> mapList = baseMapper.getReviewStatusByNodeId(item.get("id").toString());
|
|
|
+ mapList.forEach(ite -> {
|
|
|
+ String str = "2".equals(ite.get("reviewStatus"))?"未审核":"1".equals(ite.get("reviewStatus"))?"通过":"未通过";
|
|
|
+ ite.put("reviewStatus", str);
|
|
|
+ });
|
|
|
+ item.put("status",mapList);
|
|
|
+ });
|
|
|
+ MonthTableNameHandler.removeData();
|
|
|
+ }
|
|
|
+ return TableDataInfo.build(listPage);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询工业工程|市政工程
|
|
|
*/
|
|
@@ -439,6 +614,16 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public ZEngineeringIndustryVo query(String id) {
|
|
|
+ ZEngineeringIndustryVo zEngineeringIndustryVo = baseMapper.selectVoById(id);
|
|
|
+ ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
|
|
|
+ zEngineeringNodeBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
|
|
|
+ zEngineeringNodeBo.setCivliId(zEngineeringIndustryVo.getId());
|
|
|
+ zEngineeringIndustryVo.setZEngineeringNodeBo(izEngineeringNodeService.query(zEngineeringNodeBo));
|
|
|
+ return zEngineeringIndustryVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<ZEngineeringIndustryTypeVo> queryNameByType(ZEngineeringIndustryBo bo) {
|
|
|
LambdaQueryWrapper<ZEngineeringIndustry> zEngineeringIndustryBoLambdaQueryWrapper = buildListByType(bo);
|
|
|
zEngineeringIndustryBoLambdaQueryWrapper.orderByDesc(ZEngineeringIndustry::getCreateTime);
|