Merge branch 'develop_3' into 'develop_master'
Develop 3 See merge request LiuChao/foton-slrs-system-rest!152
This commit is contained in:
@@ -12,7 +12,9 @@ import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@@ -21,9 +23,9 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@@ -205,37 +207,84 @@ public class ScheduledJob {
|
||||
|
||||
|
||||
/**
|
||||
* 被多个标准代替的标准变为“被代替”,只有一个被代替的自动变为“废止”
|
||||
* 被多个标准代替的标准变为“被代替”,只被一个标准代替的自动变为“废止”
|
||||
*/
|
||||
QueryWrapper<SarStandAttrInfo> columns = new QueryWrapper<>();
|
||||
columns.select("DTBJH","STAND_ID");
|
||||
List<Map<String, Object>> mapsDTBZH = sarStandAttrInfoDao.selectMaps(columns);
|
||||
QueryWrapper<SarStandAttrInfo> columnForDTBJH = new QueryWrapper<>();
|
||||
|
||||
columnForDTBJH.select("DTBJH");
|
||||
//查询代替标准字段得到一个 被代替了的标准的id的键值对列表
|
||||
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH);
|
||||
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
||||
|
||||
|
||||
replaceStandIdMaps.forEach(item->{
|
||||
if (item!=null){
|
||||
//此标准代替的标准的标准号的数组
|
||||
String DTBJHStr = item.get("DTBJH").toString();
|
||||
|
||||
//数据格式: (GB 123-2000,GB 4233434-2021,GB 423423423-2021)
|
||||
if (!DTBJHStr.equals("")){
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
String[] sortOrNumberAndYear = DTBJH.split("\\s+");
|
||||
String sort = sortOrNumberAndYear[0];
|
||||
|
||||
String[] numberOrYear = sortOrNumberAndYear[1].split("\\-");
|
||||
String number=numberOrYear[0];
|
||||
String year=numberOrYear[1];
|
||||
|
||||
QueryWrapper<SarStandardsInfo> infoWrapper = new QueryWrapper<>();
|
||||
infoWrapper.select("ID")
|
||||
.eq("STAND_SORT",sort)
|
||||
.eq("STAND_NUMBER",number)
|
||||
.eq("STAND_YEAR",year);
|
||||
|
||||
|
||||
List<Map<String, Object>> idMaps = sarStandardsInfoDao.selectMaps(infoWrapper);
|
||||
String standId = idMaps.get(0).get("ID").toString();
|
||||
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (replaceIdCountMap.containsKey(standId)) {
|
||||
replaceIdCountMap.replace(standId,2);
|
||||
}else {
|
||||
replaceIdCountMap.put(standId, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
mapsDTBZH.forEach(item->{
|
||||
if (item.get("DTBJH")!=null && !item.get("DTBJH").toString().equals("")){
|
||||
String dtbzh = item.get("DTBJH").toString();
|
||||
String[] split = dtbzh.split(",");
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(item.get("STAND_ID").toString());
|
||||
|
||||
//一个被代替标准号时,文本状态更新为废止状态,两个及以上时更新为被代替状态
|
||||
switch (split.length){
|
||||
case 0 :
|
||||
break;
|
||||
case 1 :
|
||||
sarStandardsInfo.setTextStatus("chblaarg77");//废止状态
|
||||
break;
|
||||
default:
|
||||
sarStandardsInfo.setTextStatus("qke0ckro2p");//被代替状态
|
||||
}
|
||||
try {
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||
}catch (Exception e){
|
||||
System.out.println("代替标准状态更新:id为"+item.get("STAND_ID").toString()+"文本状态更新失败");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//一个被代替标准号时,文本状态更新为废止状态,两个及以上时更新为被代替状态
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
for (String key : replaceIdCountMap.keySet()) {
|
||||
switch (replaceIdCountMap.get(key)){
|
||||
case 1 :
|
||||
sarStandardsInfo.setTextStatus("chblaarg77");//废止状态
|
||||
sarStandardsInfo.setId(key);
|
||||
break;
|
||||
default :
|
||||
sarStandardsInfo.setTextStatus("qke0ckro2p");//被代替状态
|
||||
sarStandardsInfo.setId(key);
|
||||
break;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
try {
|
||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||
}catch (Exception e){
|
||||
System.out.println("代替标准状态更新:id为"+key+"文本状态更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -12,6 +12,16 @@ import java.util.List;
|
||||
*/
|
||||
public class SarBussionessStandEOPage extends BasePage {
|
||||
|
||||
private String textStatusBuss;
|
||||
|
||||
public String getTextStatusBuss() {
|
||||
return textStatusBuss;
|
||||
}
|
||||
|
||||
public void setTextStatusBuss(String textStatusBuss) {
|
||||
this.textStatusBuss = textStatusBuss;
|
||||
}
|
||||
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -101,14 +102,18 @@ public class BussStandExportUtil {
|
||||
case "英文名称":
|
||||
value = sarStandardsInfoEO.getStandEnName();
|
||||
break;
|
||||
case "标准状态":
|
||||
case "文本状态":
|
||||
value = sarStandardsInfoEO.getStandStatusShow();
|
||||
break;
|
||||
case "标准实施日期":
|
||||
if (sarStandardsInfoEO.getPutTime() != null) {
|
||||
String issueTime = sdf.format(sarStandardsInfoEO.getPutTime());
|
||||
value = issueTime;
|
||||
String putTime="";
|
||||
if (Date.class.equals(sarStandardsInfoEO.getPutTime())) {
|
||||
putTime = sdf.format(sarStandardsInfoEO.getPutTime());
|
||||
|
||||
}else {
|
||||
putTime=sarStandardsInfoEO.getPutTime();
|
||||
}
|
||||
value = putTime;
|
||||
break;
|
||||
case "代替企标编号":
|
||||
value = sarStandardsInfoEO.getReplaceStandNum();
|
||||
@@ -117,10 +122,13 @@ public class BussStandExportUtil {
|
||||
value = sarStandardsInfoEO.getReplacedStandNum();
|
||||
break;
|
||||
case "发布日期":
|
||||
if (sarStandardsInfoEO.getIssueTime() != null) {
|
||||
String issueTime = sdf.format(sarStandardsInfoEO.getIssueTime());
|
||||
value = issueTime;
|
||||
String issueTime="";
|
||||
if (Date.class.equals(sarStandardsInfoEO.getIssueTime().getClass())){
|
||||
issueTime = sdf.format(sarStandardsInfoEO.getIssueTime());
|
||||
}else {
|
||||
issueTime=sarStandardsInfoEO.getIssueTime();
|
||||
}
|
||||
value = issueTime;
|
||||
break;
|
||||
case "复审日期":
|
||||
String field1 = attrInfoMap.get(name);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class FieldConvertUtil {
|
||||
"个性化标签,政策文本,过程稿件,新车型实施日期(文本),在产车实施日期(文本),EOP实施日期(文本),SVPPS," +
|
||||
"相关部门,责任部门,FO,维护工程师,归口管理部门,发布机构,我司是否参与,相关资料";
|
||||
|
||||
public static String exportBaseFieldNamesBuss = "企标编号,中文名称,英文名称,标准状态,发布日期,标准实施日期," +
|
||||
public static String exportBaseFieldNamesBuss = "企标编号,中文名称,英文名称,文本状态,发布日期,标准实施日期," +
|
||||
"代替企标编号,被代替企标编号";
|
||||
|
||||
public static String exportAttrFieldNamesBuss = "SVPPS,规范性引用文件,废止日期,复审日期,密级,授权,相关部门," +
|
||||
|
||||
+11
@@ -363,6 +363,17 @@
|
||||
left join SAR_BUSS_STAND_ATTR_INFO on (SAR_BUSS_STAND_ATTR_INFO.STAND_ID = SAR_BUSSIONESS_STAND.id and SAR_BUSS_STAND_ATTR_INFO.valid_flag=0)
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
|
||||
<if test="putTime!=null">
|
||||
and put_time=#{putTime}
|
||||
</if>
|
||||
<if test="issueTime!=null">
|
||||
and issue_time=#{issueTime}
|
||||
</if>
|
||||
<if test="textStatusBuss!=null">
|
||||
and text_status_buss=#{textStatusBuss}
|
||||
</if>
|
||||
|
||||
<if test="standCode != null" >
|
||||
<!-- and (
|
||||
(concat(dicstandSort.DIC_TYPE_NAME, ' ', SAR_BUSSIONESS_STAND.STAND_CODE, '-', SAR_BUSSIONESS_STAND.STAND_YEAR)
|
||||
|
||||
Reference in New Issue
Block a user