Merge branch 'develop_master' into FOTON
This commit is contained in:
@@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -227,10 +229,14 @@ public class ScheduledJob {
|
|||||||
*/
|
*/
|
||||||
QueryWrapper<SarStandAttrInfo> columnForDTBJH = new QueryWrapper<>();
|
QueryWrapper<SarStandAttrInfo> columnForDTBJH = new QueryWrapper<>();
|
||||||
|
|
||||||
columnForDTBJH.select("DTBJH");
|
columnForDTBJH.select("DTBJH")
|
||||||
|
.eq("VALID_FLAG","0")
|
||||||
|
.ne("DTBJH","");
|
||||||
//查询代替标准字段得到一个 被代替了的标准的id的键值对列表
|
//查询代替标准字段得到一个 被代替了的标准的id的键值对列表
|
||||||
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH);
|
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH).subList(0,100);
|
||||||
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
// 格式为 T/CSAE 175-2021
|
// 格式为 T/CSAE 175-2021
|
||||||
/**
|
/**
|
||||||
* 国内外表准号格式不统一
|
* 国内外表准号格式不统一
|
||||||
@@ -286,22 +292,37 @@ public class ScheduledJob {
|
|||||||
|
|
||||||
|
|
||||||
//一个被代替标准号时,文本状态更新为废止状态,两个及以上时更新为被代替状态
|
//一个被代替标准号时,文本状态更新为废止状态,两个及以上时更新为被代替状态
|
||||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
|
||||||
for (String key : replaceIdCountMap.keySet()) {
|
for (String key : replaceIdCountMap.keySet()) {
|
||||||
|
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||||
|
String reasonMsg="";
|
||||||
switch (replaceIdCountMap.get(key)){
|
switch (replaceIdCountMap.get(key)){
|
||||||
case 1 :
|
case 1 :
|
||||||
sarStandardsInfo.setTextStatus("chblaarg77");//废止状态
|
//废止状态
|
||||||
|
sarStandardsInfo.setTextStatus("chblaarg77");
|
||||||
sarStandardsInfo.setId(key);
|
sarStandardsInfo.setId(key);
|
||||||
|
reasonMsg="该标准被一个标准代替";
|
||||||
break;
|
break;
|
||||||
default :
|
case 2 :
|
||||||
sarStandardsInfo.setTextStatus("qke0ckro2p");//被代替状态
|
//被代替状态
|
||||||
|
sarStandardsInfo.setTextStatus("qke0ckro2p");
|
||||||
sarStandardsInfo.setId(key);
|
sarStandardsInfo.setId(key);
|
||||||
|
reasonMsg="该标准被一个以上标准代替";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// sarUpdLogEOService.createUpdateLog(sarStandardsInfoEO.getStandType() + "_STAND", sarStandardsInfoEO.getId(), oldMap, newMap, content);
|
//更新日志
|
||||||
|
SarStandardsInfo beforeSarStandardsInfoEO = sarStandardsInfoDao.selectById(sarStandardsInfo.getId());
|
||||||
|
sarStandardsInfo.setStandType(beforeSarStandardsInfoEO.getStandType());
|
||||||
|
sarStandardsInfo.setStandSort(beforeSarStandardsInfoEO.getStandSort());
|
||||||
|
sarStandardsInfo.setStandNumber(beforeSarStandardsInfoEO.getStandNumber());
|
||||||
|
sarStandardsInfo.setStandYear(beforeSarStandardsInfoEO.getStandYear());
|
||||||
|
sarStandardsInfo.setStandName(beforeSarStandardsInfoEO.getStandName());
|
||||||
|
saveUpdateLog(sarStandardsInfo,beforeSarStandardsInfoEO,reasonMsg);
|
||||||
|
//更新日志
|
||||||
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
sarStandardsInfoDao.updateById(sarStandardsInfo);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
System.out.println("代替标准状态更新:id为"+key+"文本状态更新失败");
|
System.out.println("代替标准状态更新:id为"+key+"文本状态更新失败");
|
||||||
@@ -311,4 +332,24 @@ public class ScheduledJob {
|
|||||||
logger.info("==================================更新文本状态结束======================================");
|
logger.info("==================================更新文本状态结束======================================");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void saveUpdateLog(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo,String reasonMsg) throws Exception {
|
||||||
|
Map<String, Object> newMap = new HashMap<>();
|
||||||
|
Map<String, Object> oldMap = new HashMap<>();
|
||||||
|
String attrStr = sarStandardsInfoEO.getSarStandAttrEOStr();
|
||||||
|
if (StringUtils.isNotBlank(attrStr)) {
|
||||||
|
newMap = JSONObject.fromObject(attrStr);
|
||||||
|
}
|
||||||
|
newMap.put("textStatus",sarStandardsInfoEO.getTextStatus());
|
||||||
|
oldMap.put("textStatus",beforeSarStandardsInfo.getTextStatus());
|
||||||
|
// 增加关联事件
|
||||||
|
String number = sarStandardsInfoEO.getStandSort() + " " + sarStandardsInfoEO.getStandNumber();
|
||||||
|
if (StringUtils.isNotBlank(sarStandardsInfoEO.getStandYear())) {
|
||||||
|
number += "-" + sarStandardsInfoEO.getStandYear();
|
||||||
|
}
|
||||||
|
String content ="==定时任务执行修改==:" + number + " 《" + sarStandardsInfoEO.getStandName() + "》"+reasonMsg;
|
||||||
|
sarUpdLogEOService.createUpdateLog(sarStandardsInfoEO.getStandType() + "_STAND", sarStandardsInfoEO.getId(), oldMap, newMap, content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-15
@@ -8,6 +8,7 @@ import com.adc.da.slrs.customWorkGroup.service.IWorkGroupService;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import org.apache.commons.codec.language.Nysiis;
|
||||||
import org.apache.ibatis.annotations.Delete;
|
import org.apache.ibatis.annotations.Delete;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -37,18 +38,21 @@ public class WorkGroupController extends BaseController<WorkGroup> {
|
|||||||
@ApiModelProperty("新增工作组")
|
@ApiModelProperty("新增工作组")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResponseMessage addWorkGroup(WorkGroup workGroup) {
|
public ResponseMessage addWorkGroup(WorkGroup workGroup) {
|
||||||
String meg="";
|
ResponseMessage<Object> result = Result.success();
|
||||||
if (isDistinct(workGroup.getWorkGroup())){
|
|
||||||
|
if (isDistinct(workGroup.getWorkGroup(),null)){
|
||||||
if (iWorkGroupService.add(workGroup)){
|
if (iWorkGroupService.add(workGroup)){
|
||||||
meg="新增成功!";
|
result=Result.success("200","新增成功");
|
||||||
}else {
|
}else {
|
||||||
meg="新增失败!";
|
result=Result.error("201","新增失败");
|
||||||
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
meg="组名已存在!";
|
result=Result.error("202","组名已存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result.success("200",meg);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -72,32 +76,39 @@ public class WorkGroupController extends BaseController<WorkGroup> {
|
|||||||
@ApiModelProperty("修改工作组")
|
@ApiModelProperty("修改工作组")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public ResponseMessage updateWorkGroup(WorkGroup workGroup){
|
public ResponseMessage updateWorkGroup(WorkGroup workGroup){
|
||||||
String meg="";
|
|
||||||
if (isDistinct(workGroup.getWorkGroup())){
|
ResponseMessage<Object> result = Result.success();
|
||||||
|
|
||||||
|
if (isDistinct(workGroup.getWorkGroup(),workGroup.getId())){
|
||||||
if (iWorkGroupService.update(workGroup)){
|
if (iWorkGroupService.update(workGroup)){
|
||||||
meg="修改成功!";
|
result=Result.success("200", "修改成功");
|
||||||
}else {
|
}else {
|
||||||
meg="修改失败";
|
result=Result.error("201", "修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
meg="组名已存在!";
|
result=Result.error("202", "组名已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result.success("200",meg);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断提交的工作组名称是否重复
|
* 判断提交的工作组名称是否重复
|
||||||
* @param groupName
|
* @param groupName 条件
|
||||||
* @return true 没有重复 false 有重复
|
* @param id 排除id
|
||||||
|
* @returntrue 没有重复 false 有重复
|
||||||
*/
|
*/
|
||||||
private boolean isDistinct(String groupName){
|
private boolean isDistinct(String groupName,String id){
|
||||||
|
|
||||||
QueryWrapper<WorkGroup> ew = new QueryWrapper<>();
|
QueryWrapper<WorkGroup> ew = new QueryWrapper<>();
|
||||||
|
|
||||||
ew.eq("work_group_name",groupName);
|
ew.eq("work_group_name",groupName);
|
||||||
|
|
||||||
|
if (id!=null){
|
||||||
|
ew.ne("id",id);
|
||||||
|
}
|
||||||
|
|
||||||
List<WorkGroup> list = iWorkGroupService.list(ew);
|
List<WorkGroup> list = iWorkGroupService.list(ew);
|
||||||
return list.isEmpty();
|
return list.isEmpty();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -135,6 +135,7 @@ public class SarUpdLogServiceImpl extends ServiceImpl<SarUpdLogDao, SarUpdLog> i
|
|||||||
selectFieldMap.put("standSort","STANDCLASSIFY");
|
selectFieldMap.put("standSort","STANDCLASSIFY");
|
||||||
selectFieldMap.put("standState","STANDSTATE");
|
selectFieldMap.put("standState","STANDSTATE");
|
||||||
selectFieldMap.put("standNature","STANDNATURE");
|
selectFieldMap.put("standNature","STANDNATURE");
|
||||||
|
selectFieldMap.put("textStatus","TEXTSTATUS");
|
||||||
} else if (SarTypeEnum.INLAND_LAWS.getValue().equals(sarType) || SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) {
|
} else if (SarTypeEnum.INLAND_LAWS.getValue().equals(sarType) || SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) {
|
||||||
selectFieldMap = InitStandAttrUtil.selectFieldMapLaws;
|
selectFieldMap = InitStandAttrUtil.selectFieldMapLaws;
|
||||||
selectFieldMap.put("isRelateAccess","SHIFOUGL");
|
selectFieldMap.put("isRelateAccess","SHIFOUGL");
|
||||||
@@ -199,6 +200,7 @@ public class SarUpdLogServiceImpl extends ServiceImpl<SarUpdLogDao, SarUpdLog> i
|
|||||||
|
|
||||||
public String changeStandName (String field,String sarType) throws Exception{
|
public String changeStandName (String field,String sarType) throws Exception{
|
||||||
switch (field) {
|
switch (field) {
|
||||||
|
case "textStatus":return "文本状态";
|
||||||
case "country": return "适用区域";
|
case "country": return "适用区域";
|
||||||
case "isRelateAccess": return "重要度";
|
case "isRelateAccess": return "重要度";
|
||||||
case "issueTime": return "发布日期";
|
case "issueTime": return "发布日期";
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import io.swagger.annotations.Api;
|
|||||||
import com.adc.da.base.web.BaseController;
|
import com.adc.da.base.web.BaseController;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,9 +102,8 @@ public class TsUserController extends BaseController<TsUser> {
|
|||||||
@ApiOperation("调研流程查询人 部门专用接口")
|
@ApiOperation("调研流程查询人 部门专用接口")
|
||||||
@GetMapping("/selectDeptByDY")
|
@GetMapping("/selectDeptByDY")
|
||||||
public ResponseMessage<List<TsUser>> selectDeptByDY(@Param("ids") String ids) throws Exception {
|
public ResponseMessage<List<TsUser>> selectDeptByDY(@Param("ids") String ids) throws Exception {
|
||||||
QueryWrapper<TsUser> queryWrapper=new QueryWrapper<>();
|
List<String> strings=new ArrayList<>(Arrays.asList(ids.split(",")));
|
||||||
queryWrapper.in("USID",ids.split(","));
|
return Result.success(tsUserDao.selectDeptByDY(strings));
|
||||||
return Result.success(tsUserService.list(queryWrapper));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,4 +56,6 @@ public interface TsUserDao extends BaseMapper<TsUser> {
|
|||||||
* @return List<String>
|
* @return List<String>
|
||||||
*/
|
*/
|
||||||
List<String> getUserIdsByPositionIds(List<String> positionIds);
|
List<String> getUserIdsByPositionIds(List<String> positionIds);
|
||||||
|
|
||||||
|
List<TsUser> selectDeptByDY(@Param("list") List<String> strings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,4 +75,13 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDeptByDY" resultMap="UserPosition">
|
||||||
|
select ts_user.USID,ts_user.INSTITUTION_ID,ts_institution.name as institution_name from ts_user
|
||||||
|
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
|
||||||
|
where ts_user.USID in
|
||||||
|
<foreach item="msgId" collection="list" open="(" separator="," close=")" index="index">
|
||||||
|
#{msgId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user