Merge remote-tracking branch 'origin/develop_3' into develop_1
This commit is contained in:
@@ -3,7 +3,6 @@ package com.adc.da.slrs.sarResource.dao;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -20,6 +19,4 @@ public interface TsResourceDao extends BaseMapper<TsResource> {
|
||||
|
||||
List<TsResource> selectMenuByRole(TsResource sarMenuEO);
|
||||
|
||||
int insertTsRoleResource(HashMap<String,Object> map);
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -28,6 +28,8 @@ public interface SarStandAttrInfoDao extends BaseMapper<SarStandAttrInfo> {
|
||||
|
||||
Map<String, Object> selectStandFieldAndData(@Param("fieldInfo") String fieldInfo, @Param("standId") String standId);
|
||||
|
||||
List<Map<String, Object>> selectStandFieldAndDataListMap(@Param("fieldInfo") String fieldInfo, @Param("ids") List<String> ids);
|
||||
|
||||
int insertStandAttr(@Param("fieldInfo") String fieldInfo, @Param("fieldValue") String fieldValue);
|
||||
|
||||
int deleteStandAttrByStandId(@Param("standId") String standId);
|
||||
|
||||
+1
-3
@@ -151,9 +151,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
page.setAdvanceSearchStr(null);
|
||||
}
|
||||
}
|
||||
if(page.getUserId() == null || page.getUserId().equals("")){
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
}
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
List<SarStandardsInfo> rows = sarStandardsInfoEOService.getSarStandardsInfoPage(page);
|
||||
return Result.success(getPageInfo(page.getPager(), rows));
|
||||
}
|
||||
|
||||
+8
@@ -94,6 +94,14 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
@TableField("REPLACED_STAND_NUM")
|
||||
private String replacedStandNum;
|
||||
|
||||
@ApiModelProperty(value = "代替部分标准号")
|
||||
@TableField("REPLACE_PART_STAND_NUM")
|
||||
private String replacePartStandNum;
|
||||
|
||||
@ApiModelProperty(value = "被代替部分标准号")
|
||||
@TableField("REPLACED_PART_STAND_NUM")
|
||||
private String replacedPartStandNum;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
|
||||
+2
@@ -17,6 +17,8 @@ import java.util.Map;
|
||||
*/
|
||||
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||
|
||||
void reverseQueryStand(List<String> ids, String standName,String type);
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
||||
|
||||
void createSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
|
||||
|
||||
+71
-6
@@ -9,7 +9,6 @@ import com.adc.da.http.Result;
|
||||
import com.adc.da.mq.service.CreateStandMQService;
|
||||
import com.adc.da.person.dao.PersonCollectEODao;
|
||||
import com.adc.da.person.dao.PersonShareEODao;
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.search.service.StandLawsSearchService;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
@@ -40,7 +39,6 @@ import com.adc.da.slrs.sarStandPutTime.entity.SarStandPutTime;
|
||||
import com.adc.da.slrs.sarStandVal.dao.SarStandValDao;
|
||||
import com.adc.da.slrs.sarStandVal.entity.SarStandVal;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
@@ -73,15 +71,24 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.beans.BeanInfo;
|
||||
import java.beans.IntrospectionException;
|
||||
import java.beans.Introspector;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.sql.Clob;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -187,6 +194,60 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Autowired
|
||||
private StandLawsSearchService standLawsSearchService;
|
||||
|
||||
/**
|
||||
* 反向操作标准
|
||||
*/
|
||||
@Override
|
||||
@Async
|
||||
public void reverseQueryStand(List<String> ids, String standName,String type){
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
if (StringUtils.isNotBlank(fieldInfo) && StringUtils.isNotBlank(type)) {
|
||||
List<Map<String, Object>> getAttrListMap = sarStandAttrInfoEODao.selectStandFieldAndDataListMap(fieldInfo, ids);
|
||||
getAttrListMap.forEach(attrMap -> {
|
||||
List<String> list = Collections.singletonList(attrMap.get(type).toString());
|
||||
list.add(standName);
|
||||
String reverseStandName = list.stream().map(String::toString).collect(Collectors.joining(","));
|
||||
attrMap.put(type,reverseStandName);
|
||||
SarStandAttrInfo sarStandAttrInfo = map2Object(attrMap,SarStandAttrInfo.class);
|
||||
sarStandAttrInfoEODao.updateById(sarStandAttrInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T map2Object(Map<String, Object> map, Class<T> clazz) {
|
||||
|
||||
T obj = null;
|
||||
try {
|
||||
BeanInfo bean = Introspector.getBeanInfo(clazz);
|
||||
PropertyDescriptor[] propertyDescriptorArr = bean.getPropertyDescriptors();
|
||||
for (int i = 0; i < propertyDescriptorArr.length; i++) {
|
||||
PropertyDescriptor propertyDescriptor = propertyDescriptorArr[i];
|
||||
String name = propertyDescriptor.getName();
|
||||
if(map.containsKey(name)) {
|
||||
Object value = map.get(name);
|
||||
if("null".equals(value)) {
|
||||
value = null;
|
||||
}
|
||||
Object[] objArr = new Object[0];
|
||||
objArr[0] = value;
|
||||
try {
|
||||
propertyDescriptor.getWriteMethod().invoke(obj, objArr);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IntrospectionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* @Description: 分页查询
|
||||
@@ -448,8 +509,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}
|
||||
//编写预警信息
|
||||
// writeWarnings(sarStandardsInfoEO);
|
||||
// updateCiteStand(sarStandardsInfoEO, null, "DTBJH", "BDTBZBH");
|
||||
// updateCiteStand(sarStandardsInfoEO, null, "YYBJ", "BYYBJ");
|
||||
updateCiteStand(sarStandardsInfoEO, null, "YYBJ", "BYYBJ");
|
||||
updateCiteStand(sarStandardsInfoEO, null, "BFDTBZ", "BBFDTBZ");
|
||||
// updateRelateStand(sarStandardsInfoEO, "CBBH");
|
||||
// 根据代替标准号修改被代替的标准的状态 修改为已修订状态
|
||||
replaseStandState(sarStandardsInfoEO);
|
||||
@@ -502,6 +563,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
sarStandardsInfoEO.setRelateStand(attrValue);
|
||||
} else if ("DTBJH".equals(attrKey)) {
|
||||
sarStandardsInfoEO.setReplaceStandNum(attrValue);
|
||||
}else if ("BFDTBZ".equals(attrKey)) {
|
||||
sarStandardsInfoEO.setReplacePartStandNum(attrValue);
|
||||
}
|
||||
// 多选项,文件类型需要单独处理 向子表添加数据
|
||||
if (InitStandAttrUtil.selectionFieldList.contains(attrKey)) {
|
||||
@@ -718,6 +781,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
newCiteStand = sarStandardsInfoEO.getRelateStand();
|
||||
} else if ("DTBJH".equals(upField)) {
|
||||
newCiteStand = sarStandardsInfoEO.getReplaceStandNum();
|
||||
}else if ("BFDTBZ".equals(upField)) {
|
||||
newCiteStand = sarStandardsInfoEO.getReplacePartStandNum();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(newCiteStand) && newCiteStand.split(",").length > 0) {
|
||||
// 主要逻辑处理新增的
|
||||
@@ -1016,8 +1081,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
//修改标准过程中,重新修改代替标准号对应的标准的被代替标准号
|
||||
// updateReplacedNumber(sarStandardsInfoEO,beforeSarStandardsInfo);
|
||||
// 根据引用标准修改其他被引用标准
|
||||
// updateCiteStand(sarStandardsInfoEO, beforeSarStandardsInfo, "DTBJH", "BDTBZBH");
|
||||
// updateCiteStand(sarStandardsInfoEO, beforeSarStandardsInfo, "YYBJ", "BYYBJ");
|
||||
updateCiteStand(sarStandardsInfoEO, null, "YYBJ", "BYYBJ");
|
||||
updateCiteStand(sarStandardsInfoEO, null, "BFDTBZ", "BBFDTBZ");
|
||||
// 根据对应其他标准修改其他对应其他标准
|
||||
// updateRelateStand(sarStandardsInfoEO, "CBBH");
|
||||
// 根据代替标准号修改被代替的标准的状态 修改为已修订状态
|
||||
|
||||
Reference in New Issue
Block a user