diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/SearchStandContext.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/SearchStandContext.java index 32df4b99..9484cace 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/SearchStandContext.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/SearchStandContext.java @@ -61,5 +61,7 @@ public class SearchStandContext implements Serializable { private String standCode; + private String standId; + } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/StandData.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/StandData.java index ad9897ba..228689eb 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/StandData.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/regulations/entity/StandData.java @@ -28,4 +28,7 @@ public class StandData { @ApiModelProperty(value = "标准分类+空格+标准号+空格+标准名称") private String documentName; + + @ApiModelProperty(value = "标准分类+空格+标准号+空格+标准名称") + private String standNum; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandAttrInfo/entity/SarBussStandAttrInfo.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandAttrInfo/entity/SarBussStandAttrInfo.java index 47b0f8ae..abe68add 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandAttrInfo/entity/SarBussStandAttrInfo.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandAttrInfo/entity/SarBussStandAttrInfo.java @@ -61,6 +61,10 @@ public class SarBussStandAttrInfo extends BaseEntity { @TableField("BDTQBBHBUSS") private String bdtqbbhbuss; + @ApiModelProperty(value = "被代替企标编号") + @TableField("DTQBBHBUSS") + private String dtqbbhbuss; + @TableField(exist = false) private String glwj; // diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsDetailedList/service/impl/SarLawsDetailedListServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsDetailedList/service/impl/SarLawsDetailedListServiceImpl.java index 89a0e15b..95df74ad 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsDetailedList/service/impl/SarLawsDetailedListServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsDetailedList/service/impl/SarLawsDetailedListServiceImpl.java @@ -951,10 +951,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl return "1"; } + + @ApiOperation(value = "国内海外数据处理接口") + @GetMapping("/replaceBdtbzhforDtbzh") + public String replaceBdtbzhforDtbzh(SarStandardsInfo sarStandardsInfo) { + sarStandardsInfoEOService.replaceBdtbzhforDtbzh(); + return "1"; + } + + @ApiOperation(value = "企标数据处理接口") + @GetMapping("/replaceBdtbzhforDtbzhQb") + public String replaceBdtbzhforDtbzhQb(SarStandardsInfo sarStandardsInfo) { + sarStandardsInfoEOService.replaceBdtbzhforDtbzhQb(); + return "1"; + } + @ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询") @GetMapping("/checkIsOnly") public ResponseMessage checkIsOnly (SarStandardsInfoEOPage page){ diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java index 62383c9f..e8ee8535 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/ISarStandardsInfoService.java @@ -60,4 +60,8 @@ public interface ISarStandardsInfoService extends IService { void insertIntoIndexForMap(Map attrInfoMap); void updateIntoIndexForMap(Map attrInfoMap); + + void replaceBdtbzhforDtbzh(); + + void replaceBdtbzhforDtbzhQb(); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java index 375253d1..4dc6e722 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java @@ -3,10 +3,19 @@ package com.adc.da.slrs.sarStandardsInfo.service.impl; import com.adc.da.att.entity.AttFileEO; import com.adc.da.person.entity.StandInfo; import com.adc.da.person.entity.TsPersonCollect; +import com.adc.da.slrs.regulations.dao.StandDataDao; +import com.adc.da.slrs.regulations.entity.SearchStandContext; +import com.adc.da.slrs.regulations.entity.StandData; +import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao; +import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo; +import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService; +import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand; +import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService; import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao; import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarFindDto; import com.adc.da.slrs.sarPosition.entity.TsPosition; import com.adc.da.slrs.sarPosition.service.ITsPositionService; +import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService; import com.adc.da.slrs.sarStandWarning.dao.WarningDateDao; import com.adc.da.slrs.sarStandWarning.entity.WarningDate; import com.adc.da.slrs.sarStandWarning.service.Impl.WarningDateServiceImpl; @@ -241,6 +250,25 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); + wrapper.isNotNull("DTBJH"); + wrapper.ne("DTBJH", ""); + wrapper.eq("valid_flag", "0"); + List sarStandAttrInfos = sarStandAttrInfoEODao.selectList(wrapper); + if (null != sarStandAttrInfos && !sarStandAttrInfos.isEmpty()) { + //获取数据以及更新自身 新查询当前标准数据并将格式化之后的数据更新到代替标准号中 + int i = 1; + for (SarStandAttrInfo sarStandAttrInfo : sarStandAttrInfos) { + String dtbzh = convertStandCodeHandle(sarStandAttrInfo.getDtbjh()); + logger.info("第" + i + "行数据代替标准号为" + dtbzh + "转换前标准号为" + sarStandAttrInfo.getDtbjh()); + logger.info("第" + i + "行数据为" + sarStandAttrInfo.toString()); + QueryWrapper wrapper2 = new QueryWrapper<>(); + wrapper2.eq("valid_flag", "0"); + wrapper2.eq("stand_id", sarStandAttrInfo.getStandId()); + List attrInfoList = sarStandAttrInfoEODao.selectList(wrapper2); + attrInfoList.get(0).setDtbjh(dtbzh); + sarStandAttrInfoEODao.update(attrInfoList.get(0), wrapper2); + + + //找到用来代替的标准号 + SearchStandContext searchStandContext1 = new SearchStandContext(); + searchStandContext1.setStandId(sarStandAttrInfo.getStandId()); + List list1 = standDataDao.searchStandDataThree(searchStandContext1); + if (null != list1 && list1.size() > 0) { + String bdtbzh = list1.get(0).getStandNum(); + + //现在针对处理一波代替标准号 根据标准号找到 + if (dtbzh.contains(",") && !dtbzh.isEmpty() && !"".equals(dtbzh) && !dtbzh.contains("null") && !dtbzh.contains("Q/FT")) { + //判定是不是多个 + List strings = new ArrayList<>(Arrays.asList(dtbzh.split(","))); + strings.forEach(s -> { + if (StringUtils.isNotBlank(s)) { + SearchStandContext searchStandContext = new SearchStandContext(); + searchStandContext.setStandCode(s); + List list = standDataDao.searchStandDataThree(searchStandContext); + if (null != list && list.size() > 0) { + QueryWrapper wrapper1 = new QueryWrapper<>(); + wrapper1.eq("valid_flag", "0"); + wrapper1.eq("stand_id", list.get(0).getStandId()); + List attrInfos = sarStandAttrInfoEODao.selectList(wrapper1); + if (null != attrInfos && attrInfos.size() > 0) { + if (null != attrInfos.get(0).getBdtbzh() && !"".equals(attrInfos.get(0).getBdtbzh())) { + if (!attrInfos.get(0).getBdtbzh().contains(bdtbzh)) { + attrInfos.get(0).setBdtbzh(attrInfos.get(0).getBdtbzh() + "," + bdtbzh); + } + } else { + attrInfos.get(0).setBdtbzh(bdtbzh); + } + sarStandAttrInfoEODao.update(attrInfos.get(0), wrapper1); + } + } + } + }); + + } else if (!dtbzh.isEmpty() && !"".equals(dtbzh) && !dtbzh.contains("null") && !dtbzh.contains("Q/FT")) { + //单个 + SearchStandContext searchStandContext = new SearchStandContext(); + searchStandContext.setStandCode(dtbzh); + List list = standDataDao.searchStandDataThree(searchStandContext); + if (null != list && list.size() > 0) { + QueryWrapper wrapper1 = new QueryWrapper<>(); + wrapper1.eq("valid_flag", "0"); + wrapper1.eq("stand_id", list.get(0).getStandId()); + List attrInfos = sarStandAttrInfoEODao.selectList(wrapper1); + if (null != attrInfos && attrInfos.size() > 0) { + if (null != attrInfos.get(0).getBdtbzh() && !"".equals(attrInfos.get(0).getBdtbzh())) { + if (!attrInfos.get(0).getBdtbzh().contains(bdtbzh)) { + attrInfos.get(0).setBdtbzh(attrInfos.get(0).getBdtbzh() + "," + bdtbzh); + } + } else { + attrInfos.get(0).setBdtbzh(bdtbzh); + } + sarStandAttrInfoEODao.update(attrInfos.get(0), wrapper1); + } + } + } + i++; + } + } + } + + } + + @Override + public void replaceBdtbzhforDtbzhQb() { + //第一步先处理国内海外数据 + //获取代替标准号不为空的数据 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.isNotNull("DTQBBHBUSS"); + wrapper.ne("DTQBBHBUSS", ""); + wrapper.eq("valid_flag", "0"); +// wrapper.eq("STAND_ID","ruxmkyu3d6bgdg7wehkv"); + List sarStandAttrInfos = standAttrInfoDao.selectList(wrapper); + if (null != sarStandAttrInfos && !sarStandAttrInfos.isEmpty()) { + //获取数据以及更新自身 新查询当前标准数据并将格式化之后的数据更新到代替标准号中 + int i = 1; + for (SarBussStandAttrInfo sarBussStandAttrInfo : sarStandAttrInfos) { + String dtbzh = convertStandCodeHandle(sarBussStandAttrInfo.getDtqbbhbuss()); + logger.info("第" + i + "行数据代替标准号为" + dtbzh + "转换前标准号为" + sarBussStandAttrInfo.getDtqbbhbuss()); + logger.info("第" + i + "行数据为" + sarBussStandAttrInfo.toString()); + QueryWrapper wrapper2 = new QueryWrapper<>(); + wrapper2.eq("valid_flag", "0"); + wrapper2.eq("stand_id", sarBussStandAttrInfo.getStandId()); + List attrInfoList = standAttrInfoDao.selectList(wrapper2); + attrInfoList.get(0).setDtqbbhbuss(dtbzh); + standAttrInfoDao.update(attrInfoList.get(0), wrapper2); + + + //找到用来代替的标准号 + SearchStandContext searchStandContext1 = new SearchStandContext(); + searchStandContext1.setStandId(sarBussStandAttrInfo.getStandId()); + List list1 = standDataDao.searchStandDataThree(searchStandContext1); + if (null != list1 && list1.size() > 0) { + String bdtbzh = list1.get(0).getStandNum(); + + //现在针对处理一波代替标准号 根据标准号找到 + if (dtbzh.contains(",") && !dtbzh.isEmpty() && !"".equals(dtbzh) ) { + //判定是不是多个 + List strings = new ArrayList<>(Arrays.asList(dtbzh.split(","))); + strings.forEach(s -> { + if (StringUtils.isNotBlank(s)) { + SearchStandContext searchStandContext = new SearchStandContext(); + searchStandContext.setStandCode(s); + List list = standDataDao.searchStandDataThree(searchStandContext); + if (null != list && list.size() > 0) { + QueryWrapper wrapper1 = new QueryWrapper<>(); + wrapper1.eq("valid_flag", "0"); + wrapper1.eq("stand_id", list.get(0).getStandId()); + List attrInfos = standAttrInfoDao.selectList(wrapper1); + if (null != attrInfos && attrInfos.size() > 0) { + if (null != attrInfos.get(0).getBdtqbbhbuss() && !"".equals(attrInfos.get(0).getBdtqbbhbuss())) { + if (!attrInfos.get(0).getBdtqbbhbuss().contains(bdtbzh)) { + attrInfos.get(0).setBdtqbbhbuss(attrInfos.get(0).getBdtqbbhbuss() + "," + bdtbzh); + } + } else { + attrInfos.get(0).setBdtqbbhbuss(bdtbzh); + } + standAttrInfoDao.update(attrInfos.get(0), wrapper1); + } + } + } + }); + + } else if (!dtbzh.isEmpty() && !"".equals(dtbzh) ) { + //单个 + SearchStandContext searchStandContext = new SearchStandContext(); + searchStandContext.setStandCode(dtbzh); + List list = standDataDao.searchStandDataThree(searchStandContext); + if (null != list && list.size() > 0) { + QueryWrapper wrapper1 = new QueryWrapper<>(); + wrapper1.eq("valid_flag", "0"); + wrapper1.eq("stand_id", list.get(0).getStandId()); + List attrInfos = standAttrInfoDao.selectList(wrapper1); + if (null != attrInfos && attrInfos.size() > 0) { + if (null != attrInfos.get(0).getBdtqbbhbuss() && !"".equals(attrInfos.get(0).getBdtqbbhbuss())) { + if (!attrInfos.get(0).getBdtqbbhbuss().contains(bdtbzh)) { + attrInfos.get(0).setBdtqbbhbuss(attrInfos.get(0).getBdtqbbhbuss() + "," + bdtbzh); + } + } else { + attrInfos.get(0).setBdtqbbhbuss(bdtbzh); + } + standAttrInfoDao.update(attrInfos.get(0), wrapper1); + } + } + } + i++; + } + } + } + + } + + private String convertStandCodeHandle(String standCode) { + if (StringUtils.isNotBlank(standCode)) { + standCode = standCode.replaceAll("—", "-"); + standCode = standCode.replaceAll(" -", "-"); + standCode = standCode.replaceAll("-", "-"); + standCode = standCode.replaceAll(" - ", "-"); + standCode = standCode.replaceAll(" ", " "); + standCode = standCode.replaceAll("—", "-"); + standCode = standCode.replaceAll("Q-QCBFC", "Q/QCBFC"); + standCode = standCode.replaceAll("Q-FT", "Q/FT"); + standCode = standCode.replaceAll("Q/ FT", "Q/FT"); + standCode = standCode.replaceAll(" -", "-"); + standCode = standCode.replaceAll("-", "-"); + standCode = standCode.replaceAll("Q/QCFLC", "Q/QCFLC"); + standCode = standCode.replaceAll(" ", " "); + standCode = standCode.replaceAll("—", "-"); + standCode = standCode.replaceAll("(", "("); + standCode = standCode.replaceAll(")", ")"); + standCode = standCode.replaceAll(" -", "-"); + standCode = standCode.replaceAll("-", "-"); + standCode = standCode.replaceAll(":", ":"); + standCode = standCode.replaceAll("Part", "PART"); + standCode = standCode.replaceAll(",", ","); + standCode = standCode.replaceAll("、", ","); +// standCode = standCode.replaceAll("--", ""); +// standCode = standCode.replaceAll("-", ""); +// standCode = standCode.replaceAll("_", ""); + if ("--".equals(standCode) || "-".equals(standCode) || "_".equals(standCode)) { + standCode = ""; + } + } + return standCode; + } + /*** * @Description: 分页查询 * @Author: super_liu @@ -306,13 +545,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception { //查询当前登录人角色拥有权限的菜单 - if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){ + if (page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())) { String treeType = page.getTreeType(); QueryWrapper qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); + qw.eq("ID", page.getMenuId()); qw.isNull("PARENT_ID"); List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)){ + if (children.isEmpty() && !page.getMenuId().equals("nomenu") && StringUtils.isNotBlank(treeType) && "tsr".equals(treeType)) { // List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); // if (getMenuIdList != null && !getMenuIdList.isEmpty()) { // page.setMenuRoleList(getMenuIdList); @@ -323,7 +562,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); // if (getMenuIdList != null && !getMenuIdList.isEmpty()) { // page.setMenuRoleList(getMenuIdList); @@ -334,7 +573,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); // if (getMenuIdList != null && !getMenuIdList.isEmpty()) { // page.setMenuRoleList(getMenuIdList); @@ -349,7 +588,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist = dao.getSarStandardsInfoPage(page,"0"); + List sarlist = dao.getSarStandardsInfoPage(page, "0"); attrInfoCollect(sarlist); return sarlist; } @@ -357,12 +596,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getSarStandardsInfoPageByWk1(SarStandardsInfoEOPage page) throws Exception { //查询当前登录人角色拥有权限的菜单 - if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){ + if (page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())) { QueryWrapper qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); + qw.eq("ID", page.getMenuId()); qw.isNull("PARENT_ID"); List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu")){ + if (children.isEmpty() && !page.getMenuId().equals("nomenu")) { // List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); // if (getMenuIdList != null && !getMenuIdList.isEmpty()) { // page.setMenuRoleList(getMenuIdList); @@ -377,7 +616,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist = dao.getSarStandardsInfoPage(page,"996"); + List sarlist = dao.getSarStandardsInfoPage(page, "996"); attrInfoCollect(sarlist); return sarlist; } @@ -385,12 +624,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getSarStandardsInfoPageBak(SarStandardsInfoEOPage page) throws Exception { //查询当前登录人角色拥有权限的菜单 - if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){ + if (page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())) { QueryWrapper qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); + qw.eq("ID", page.getMenuId()); qw.isNull("PARENT_ID"); List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu")){ + if (children.isEmpty() && !page.getMenuId().equals("nomenu")) { List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); if (getMenuIdList != null && !getMenuIdList.isEmpty()) { page.setMenuRoleList(getMenuIdList); @@ -405,7 +644,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist = dao.getSarStandardsInfoPage(page,"999"); + List sarlist = dao.getSarStandardsInfoPage(page, "999"); attrInfo(sarlist); return sarlist; } @@ -413,12 +652,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getSarStandardsInfoPageBak1(SarStandardsInfoEOPage page) throws Exception { //查询当前登录人角色拥有权限的菜单 - if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){ + if (page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())) { QueryWrapper qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); + qw.eq("ID", page.getMenuId()); qw.isNull("PARENT_ID"); List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu")){ + if (children.isEmpty() && !page.getMenuId().equals("nomenu")) { List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); if (getMenuIdList != null && !getMenuIdList.isEmpty()) { page.setMenuRoleList(getMenuIdList); @@ -433,7 +672,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist = dao.getSarStandardsInfoPage(page,"0"); + List sarlist = dao.getSarStandardsInfoPage(page, "0"); attrInfo(sarlist); return sarlist; } @@ -441,12 +680,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl selectHighLawsById(SarStandardsInfoEOPage page) throws Exception { //查询当前登录人角色拥有权限的菜单 - if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){ + if (page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())) { QueryWrapper qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); + qw.eq("ID", page.getMenuId()); qw.isNull("PARENT_ID"); List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu")){ + if (children.isEmpty() && !page.getMenuId().equals("nomenu")) { List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); if (getMenuIdList != null && !getMenuIdList.isEmpty()) { page.setMenuRoleList(getMenuIdList); @@ -459,10 +698,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl lawsIds=new ArrayList<>(); - if ("1".equals(page.getQdFlag())){ + List lawsIds = new ArrayList<>(); + if ("1".equals(page.getQdFlag())) { - SarFindDto sarFindDto=new SarFindDto(); + SarFindDto sarFindDto = new SarFindDto(); sarFindDto.setId(page.getQdid()); sarFindDto.setStandEnName(page.getStandEnName()); sarFindDto.setStandName(page.getStandName()); @@ -475,13 +714,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist = dao.selectHighLawsPage(page,"0",lawsIds); + List sarlist = dao.selectHighLawsPage(page, "0", lawsIds); attrInfo(sarlist); return sarlist; } @@ -501,9 +740,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist) throws Exception { List collectResIds = sarlist.stream().map(SarStandardsInfo::getId).collect(Collectors.toList()); - Map collectMap = personCollectEOService.queryCollectByUserAndIds(collectResIds); + Map collectMap = personCollectEOService.queryCollectByUserAndIds(collectResIds); for (SarStandardsInfo row : sarlist) { - if(collectMap != null && collectMap.get(row.getId()) != null){ + if (collectMap != null && collectMap.get(row.getId()) != null) { row.setCollectId(collectMap.get(row.getId())); } } @@ -606,17 +845,17 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getAttrMap = new TreeMap<>(); - if(type.equals("add")){ + if (type.equals("add")) { String sarStandAttrEOStr = row.getSarStandAttrEOStr(); getAttrMap = JSONObject.fromObject(sarStandAttrEOStr); - }else { + } else { getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId()); } if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) { @@ -647,7 +886,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl fileObj = attFileEOService.getMultiFileInfos(value); - if(!fileObj.isEmpty()){ + if (!fileObj.isEmpty()) { resultMap.put(newKey + "Name", fileObj.get(0).getOldFileName()); } } @@ -672,7 +911,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl itemExistList = sarFileSplitInfoEOS.stream() .map(item -> item.getFileType()) .collect(Collectors.toList()); - getAttrMap.put("itemExistList",itemExistList); + getAttrMap.put("itemExistList", itemExistList); for (Map.Entry entry : getAttrMap.entrySet()) { String name = entry.getKey(); @@ -683,43 +922,44 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl fileObj = attFileEOService.getMultiFileInfosOrderByDateDesc(value); entry.setValue(fileObj); } - }else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) { + } else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) { value = entry.getValue().toString(); List valArr = Arrays.asList(value.split(",")); - switch (name){ + switch (name) { //通过id绑定责任工程师名称 - case "ZRGCS":{ + case "ZRGCS": { QueryWrapper tsUserQW = new QueryWrapper<>(); tsUserQW.select("UNAME") - .in("USID",valArr); - List stringList = tsUserService.listObjs(tsUserQW, o ->o.toString()); - value= String.join(",", stringList.isEmpty() ? valArr : stringList); + .in("USID", valArr); + List stringList = tsUserService.listObjs(tsUserQW, o -> o.toString()); + value = String.join(",", stringList.isEmpty() ? valArr : stringList); break; } //通过id绑定责任部门师名称 - case "ZRBM":{ + case "ZRBM": { QueryWrapper tsPositionQW = new QueryWrapper<>(); tsPositionQW.select("name") - .in("id",valArr); + .in("id", valArr); List stringList = iTsPositionService.listObjs(tsPositionQW, o -> o.toString()); - value= String.join(",", stringList.isEmpty() ? valArr : stringList); + value = String.join(",", stringList.isEmpty() ? valArr : stringList); break; } - default:value = dicTypeEODao.getDicNamesByCodes(valArr,""); + default: + value = dicTypeEODao.getDicNamesByCodes(valArr, ""); } - entry.setValue(value == null ? String.join(",",valArr) : value); + entry.setValue(value == null ? String.join(",", valArr) : value); } } } } } - public void attrInfoShowSearchDetails(SarStandardsInfo row,String type) throws Exception { + public void attrInfoShowSearchDetails(SarStandardsInfo row, String type) throws Exception { if (row != null) { - attrInfoSearchDetails(row,type); + attrInfoSearchDetails(row, type); Map getAttrMap = row.getAttrInfoMap(); if (getAttrMap != null && getAttrMap.size() > 0) { for (Map.Entry entry : getAttrMap.entrySet()) { @@ -727,16 +967,16 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl valArr = new ArrayList<>(); if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) { - if(StringUtils.isNotBlank(entry.getValue().toString())){ - Object json= new JSONTokener(entry.getValue().toString()).nextValue(); - if(json instanceof org.json.JSONArray){ - valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class); - }else { + if (StringUtils.isNotBlank(entry.getValue().toString())) { + Object json = new JSONTokener(entry.getValue().toString()).nextValue(); + if (json instanceof org.json.JSONArray) { + valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(), String.class); + } else { value = entry.getValue().toString(); valArr = Arrays.asList(value.split(",")); } - if(!valArr.isEmpty()){ - value = dicTypeEODao.getDicNamesByCodes(valArr,""); + if (!valArr.isEmpty()) { + value = dicTypeEODao.getDicNamesByCodes(valArr, ""); } } entry.setValue(value); @@ -784,7 +1024,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl valArr = Arrays.asList(value.split(",")); - value = dicTypeEODao.getDicNamesByCodes(valArr,""); + value = dicTypeEODao.getDicNamesByCodes(valArr, ""); } } entry.setValue(value); @@ -795,13 +1035,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist) throws Exception { + public void attrInfoShowExport(List sarlist) throws Exception { //查询字典表,形成Hash映射提升速度 List dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name"); Map dicMap = dicInfo.stream() - .filter(item-> !item.getDicTypeCode().isEmpty()) - .collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2)); + .filter(item -> !item.getDicTypeCode().isEmpty()) + .collect(Collectors.toMap(DicTypeEO::getDicTypeCode, DicTypeEO::getDicTypeName, (value1, value2) -> value2)); for (SarStandardsInfo row : sarlist) { @@ -815,7 +1055,6 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl 0) { // 修改属性表数据 - List standAttrInfos = sarStandAttrInfoEODao.selectList(new QueryWrapper().eq("STAND_ID",sarStandardsInfoEO.getId())); - if(!standAttrInfos.isEmpty()){ + List standAttrInfos = sarStandAttrInfoEODao.selectList(new QueryWrapper().eq("STAND_ID", sarStandardsInfoEO.getId())); + if (!standAttrInfos.isEmpty()) { sarStandAttrInfoEODao.deleteStandAttrByStandId(standAttrInfos.get(0).getStandId()); } //编写预警信息 @@ -939,9 +1178,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo); - if(!sarItemVOS.isEmpty()){ - Map collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null) + if (!sarItemVOS.isEmpty()) { + Map collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null) .collect(Collectors.toMap(SarStandItems::getItemsNum, SarStandItems::getTermsConditions)); sarStandardsInfoEO.setMapItems(collectMap); } - createStandMQService.sendStandMQ(sarStandardsInfoEO,"add"); + createStandMQService.sendStandMQ(sarStandardsInfoEO, "add"); } } } @@ -994,7 +1233,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl list= Arrays.asList(attrValue .split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList()); + List list = Arrays.asList(attrValue.split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList()); fileIds.addAll(list); // String attrValueStr = String.join(",", list); // fileIds += attrValueStr + ","; @@ -1026,9 +1265,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl multiTimeMap) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (multiTimeMap != null && multiTimeMap.size() > 0) { @@ -1188,7 +1426,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl0){ + if (warningDateList != null && warningDateList.size() > 0) { QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq("law_id",standId); + wrapper.eq("law_id", standId); warningDateService.remove(wrapper); warningDateService.saveBatch(warningDateList); } @@ -1240,9 +1478,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl 0) { @@ -1499,7 +1737,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl str.toString()) .orElse(""); - if (!"".equals(DTBJH)){ + if (!"".equals(DTBJH)) { for (String s : DTBJH.split(",")) { @@ -1524,7 +1762,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl0){ + if (personCollectEOService.countPersonCollectByStandInfo(query) > 0) { TsPersonCollect tsPersonCollect = new TsPersonCollect(); tsPersonCollect.setId(UUIDUtils.randomUUID20()); @@ -1532,13 +1770,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl ew = new QueryWrapper<>(); - ew.eq("COLLECT_RES_ID",standInfo.getId()) - .eq("VALID_FLAG",'0'); - personCollectEOService.saveOrUpdate(tsPersonCollect,ew); + ew.eq("COLLECT_RES_ID", standInfo.getId()) + .eq("VALID_FLAG", '0'); + personCollectEOService.saveOrUpdate(tsPersonCollect, ew); break; } @@ -1568,8 +1806,6 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo); - if(!sarItemVOS.isEmpty()){ - Map collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null) + if (!sarItemVOS.isEmpty()) { + Map collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null) .collect(Collectors.toMap(SarStandItems::getItemsNum, SarStandItems::getTermsConditions)); sarStandardsInfoEO.setMapItems(collectMap); } - createStandMQService.sendStandMQ(sarStandardsInfoEO,"update"); + createStandMQService.sendStandMQ(sarStandardsInfoEO, "update"); } return result; } @@ -1672,9 +1908,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl map=new HashMap<>(); - map.put("1","是"); - map.put("2","否"); + Map map = new HashMap<>(); + map.put("1", "是"); + map.put("2", "否"); sarStandardsInfoEO.setIsRelateAccess(map.get(sarStandardsInfoEO.getIsRelateAccess())); beforeSarStandardsInfo.setIsRelateAccess(map.get(beforeSarStandardsInfo.getIsRelateAccess())); @@ -1691,7 +1927,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl changeMap(SarStandardsInfo sarStandardsInfoEO, Map map) { // map.put("country", sarStandardsInfoEO.getCountry()); - if(map == null){ + if (map == null) { map = new TreeMap(); } map.put("standSystem", verifyObj(sarStandardsInfoEO.getStandSystem())); @@ -1713,7 +1949,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl0){ + if (count > 0) { countResult = -1; return countResult; } @@ -1778,7 +2014,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getReplacedStands = dao.getSarStandardsInfoPage(sarStandardsInfoEOPage,"0"); + List getReplacedStands = dao.getSarStandardsInfoPage(sarStandardsInfoEOPage, "0"); if (getReplacedStands != null && !getReplacedStands.isEmpty()) { for (SarStandardsInfo stand : getReplacedStands) { SarStandardsInfo newStand = new SarStandardsInfo(); @@ -1849,12 +2085,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl qw = new QueryWrapper<>(); - qw.eq("ID",page.getMenuId()); + qw.eq("ID", page.getMenuId()); qw.isNull("PARENT_ID"); List children = iTsResourceService.list(qw); - if(children.isEmpty() && !page.getMenuId().equals("nomenu")){ + if (children.isEmpty() && !page.getMenuId().equals("nomenu")) { // List getMenuIdList = tsUserService.getResourceUserId(page.getUserId()); // if (getMenuIdList != null && !getMenuIdList.isEmpty()) { // page.setMenuRoleList(getMenuIdList); @@ -1875,7 +2111,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getStandInfoByList(String limit){ + public List getStandInfoByList(String limit) { // //查询文本状态为即将实施的 // QueryWrapper dictionaryWrapper = new QueryWrapper<>(); @@ -2598,9 +2833,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl attrInfoMap) { Set keys = attrInfoMap.keySet(); - for (String key:keys) { + for (String key : keys) { String value = String.valueOf(attrInfoMap.get(key)); - if (StringUtils.isNotBlank(value) && !"null".equals(value) && !"SVPPS".equals(key)){ - value = value.replace(" , ",","); - value = value.replace(","," , "); - attrInfoMap.put(key,value); + if (StringUtils.isNotBlank(value) && !"null".equals(value) && !"SVPPS".equals(key)) { + value = value.replace(" , ", ","); + value = value.replace(",", " , "); + attrInfoMap.put(key, value); } } // 根据文件attid 读取文件内容 @@ -2728,19 +2963,19 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl attrInfoMap) { Set keys = attrInfoMap.keySet(); - for (String key:keys) { + for (String key : keys) { String value = String.valueOf(attrInfoMap.get(key)); - if (com.adc.da.util.utils.StringUtils.isNotBlank(value) && !"null".equals(value) && !"SVPPS".equals(key) && !"content".equals(key)){ - value = value.replace(" , ",","); - value = value.replace(","," , "); - attrInfoMap.put(key,value); + if (com.adc.da.util.utils.StringUtils.isNotBlank(value) && !"null".equals(value) && !"SVPPS".equals(key) && !"content".equals(key)) { + value = value.replace(" , ", ","); + value = value.replace(",", " , "); + attrInfoMap.put(key, value); } } // 根据文件attid 读取文件内容 @@ -2788,27 +3022,27 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist = dao.getSarStandardsInfoPage(page,"0"); + List sarlist = dao.getSarStandardsInfoPage(page, "0"); attrInfo(sarlist); return sarlist; } diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/regulations/RegulationsMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/regulations/RegulationsMapper.xml index 0fc78990..9122daa3 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/regulations/RegulationsMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/regulations/RegulationsMapper.xml @@ -62,11 +62,14 @@