Merge remote-tracking branch 'origin/develop_master' into develop_1

This commit is contained in:
yanyizhou
2021-11-07 10:25:32 +08:00
165 changed files with 9244 additions and 975 deletions
@@ -399,4 +399,7 @@ public interface workFlowFeignClient {
// @RequestMapping(value = "/bat-wkflow/findProcessNameByPrcNum",method = RequestMethod.POST)
// List<BusProcessName> findProcessNameByPrcNum(@RequestBody String taskId);
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlock",method = RequestMethod.GET)
List<BusProcessNew> everyDayTenOlock();
}
@@ -1,10 +1,18 @@
package com.adc.da.Timer;
import com.adc.da.FeignClient.workFlowFeignClient;
import com.adc.da.common.BusMes;
import com.adc.da.common.BusProcessName;
import com.adc.da.common.BusProcessNew;
import com.adc.da.common.Wrapper;
import com.adc.da.http.ResponseMessage;
import com.adc.da.sys.common.EmailUtils;
import com.adc.da.sys.entity.UserEO;
import com.adc.da.sys.service.IUserEOService;
import com.adc.da.workFlow.controller.WorkFlowController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
@@ -13,6 +21,7 @@ import org.springframework.stereotype.Component;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -23,6 +32,7 @@ import java.util.List;
*/
@Component
@EnableScheduling
@Slf4j
public class ProcessTimer {
@Autowired
@@ -34,6 +44,9 @@ public class ProcessTimer {
@Autowired
private IUserEOService userEOService;
@Autowired
private WorkFlowController workFlowController;
/***
* @Description: 自动催办,任务截至时间前3天开始每天催办
* @Author: yangxuenan
@@ -46,14 +59,14 @@ public class ProcessTimer {
// @Scheduled(cron = "0/20 * * * * ?")
public void urging() {
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
if(null != busProcessNames && 0 < busProcessNames.size()){
for (BusProcessName busProcessName : busProcessNames){
if (null != busProcessNames && 0 < busProcessNames.size()) {
for (BusProcessName busProcessName : busProcessNames) {
String type = busProcessName.getPrcType();
Integer typeInt = 99;
if (StringUtils.isNotEmpty(type)){
if (StringUtils.isNotEmpty(type)) {
typeInt = Integer.valueOf(type);
}
type = chooseType(typeInt,type);
type = chooseType(typeInt, type);
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
String[] array = userEO.getEmail().split(",");
@@ -64,30 +77,30 @@ public class ProcessTimer {
try {
dateTime = simpleDateFormat.parse(overTime);
Date now = new Date();
long daysBetween = (dateTime.getTime()-now.getTime()+1000000)/(60*60*24*1000);
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
num = Integer.valueOf(String.valueOf(daysBetween));
} catch (ParseException e) {
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
try {
dateTime = simpleDateFormat1.parse(overTime);
Date now = new Date();
long daysBetween = (dateTime.getTime()-now.getTime()+1000000)/(60*60*24*1000);
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
num = Integer.valueOf(String.valueOf(daysBetween));
} catch (ParseException e1) {
e.getMessage();
}
}
String msg = "您好,["+ busProcessName.getPrcNum() +"]-["+ busProcessName.getPrcName() +"] 您有待办任务未及时办理,距离截至日期还有["+ String.valueOf(num) +"]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
" ——来自 全球标准法规管理系统";
String title = "GSRM——【待办任务】["+ type +"] 您有未完成的待办任务";
mailUtil.sendMsgFeign(array,title,msg);
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
mailUtil.sendMsgFeign(array, title, msg);
}
}
}
public String chooseType(Integer typeInt,String type) {
public String chooseType(Integer typeInt, String type) {
switch (typeInt) {
case 1:
type = "法规入库及评估流程";
@@ -151,4 +164,31 @@ public class ProcessTimer {
}
return type;
}
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
// @Scheduled(cron = "*/20 * * * * ? ")//每天十点执行
public void everyDayTenOlockScan() {
List<BusProcessNew> busProcessNews=new ArrayList<>();
busProcessNews=workFlowFeignClient.everyDayTenOlock();
if (!busProcessNews.isEmpty()){
for (BusProcessNew bus:busProcessNews) {
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
jsonObject.put("auto","1");
ResponseMessage responseMessage = workFlowController.startProcessNew("19",jsonObject.getString("revisionId"),null);
BusMes busMes=new BusMes();
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
busMes.setJson(jsonObject.toJSONString());
busMes.setUserId(jsonObject.getString("revisionId"));
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
log.info("政策课题组会后流程已发起");
}
}
}
public static void main(String[]args){
ProcessTimer processTimer = new ProcessTimer();
processTimer.everyDayTenOlockScan();
}
}
@@ -25,6 +25,24 @@ public class ActDefineStartMap {
map.put("8","nonConformanceRectificationKey");
map.put("9","standardReadWkflow");
map.put("10","itemlistvalidationprocessKey");
// 政策入库
map.put("laws1","lawsLibraryWkflow");
//张超然
map.put("20","StandardApplyMeetProcess");
map.put("21","StandardMeetProcess");
map.put("22","StandardAfterMeetProcess");
//李奥
map.put("14","ParticipateRevisionFiling");
map.put("15","JoinStandardFiling");
map.put("16","RecommendedApprovalleo");
//孔维一
map.put("17","policyResearchGroupEnrollment");
map.put("18","policyResearchGroupAttendMeeting");
map.put("19","policyResearchGroupAfterMeeting");
return map.get(type);
}
}
@@ -0,0 +1,39 @@
package com.adc.da.workFlow.controller;
import com.adc.da.base.web.BaseController;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
import com.adc.da.workFlow.service.ActSarItemsEOService;
import com.adc.da.workFlow.service.ActSarItemsLawsEOService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/${restPath}/lawss/actSarItemsLaws")
@Api(description = "|ActSarItemsEO|")
public class ActSarItemsLawsEOController extends BaseController<ActSarItemsEO> {
@Autowired
private ActSarItemsLawsEOService actSarItemsEOService;
// private static final Logger logger = LoggerFactory.getLogger(AttFileEOController.class);
@ApiOperation(value = "|SarLawsStandInfo|政策入库流程")
@PostMapping("/processCreateLaws")
public ResponseMessage processCreateLaws(String infoJson) throws Exception {
if (StringUtils.isNotBlank(infoJson)) {
actSarItemsEOService.processCreateLaws(infoJson);
return Result.success("入库成功");
} else {
return Result.error("传入数据json不能为空");
}
}
}
@@ -122,6 +122,16 @@ public class WorkFlowController {
}
}
@ApiOperation(value = "定时任务启动流程-以流程定义id")
@GetMapping("/startProcessNew")
public ResponseMessage startProcessNew(@RequestParam("type") String type, @RequestParam(value="userId",required = false) String userId, @RequestParam(value="id",required = false) String id){
if(StringUtils.isNotBlank(type)){
return this.activiti_define_start(ActDefineStartMap.actDefineStartMap(type), userId,id);
}else {
return null;
}
}
@ApiOperation(value = "待办任务详情")
@GetMapping("/todotask")
public PageInfo<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId){
@@ -1,9 +1,11 @@
package com.adc.da.workFlow.dao;
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ActSarItemsEODao {
List<ActSarItemsEO> queryByPage(ActSarItemsEO actSarItemsEO);
@@ -0,0 +1,918 @@
package com.adc.da.workFlow.service;
import com.adc.da.common.PropertyTypeEnum;
import com.adc.da.common.SarConformStateEnum;
import com.adc.da.common.SarStateColorEnum;
import com.adc.da.common.SarTypeEnum;
import com.adc.da.login.util.UserUtils;
import com.adc.da.slrs.SarCompResAssess.entity.SarCompResAssess;
import com.adc.da.slrs.SarCompResAssess.service.ISarCompResAssessService;
import com.adc.da.slrs.SarCompStatusInfo.dao.SarCompStatusInfoDao;
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
import com.adc.da.slrs.SarFileSplitItems.entity.SarFileSplitItems;
import com.adc.da.slrs.SarFileSplitItems.service.ISarFileSplitItemsService;
import com.adc.da.slrs.SarStandItemVal.dao.SarStandItemValDao;
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
import com.adc.da.slrs.sarLawsAttrInfo.dao.SarLawsAttrInfoDao;
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
import com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao;
import com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao;
import com.adc.da.slrs.sarLawsItems.entity.SarLawsItems;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.sys.constant.ValueStateEnum;
import com.adc.da.util.UUIDUtils;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.workFlow.dao.ActSarItemsEODao;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
@Service("actSarItemsLawsEOService")
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class ActSarItemsLawsEOService {
private static final Logger logger = LoggerFactory.getLogger(ActSarItemsLawsEOService.class);
@Autowired
private ActSarItemsEODao actSarItemsEODao;
@Autowired
private SarLawsItemsDao sarLawsItemsDao;
@Autowired
private SysInfoEOService sysInfoEOService;
@Autowired
private ISarLawsStandInfoService sarLawsStandInfoService;
@Autowired
private ISarLawsAttrInfoService iSarLawsAttrInfoService;
@Autowired
private ISarUpdLogService sarUpdLogEOService;
@Autowired
private SarCompStatusInfoDao sarCompStatusInfoEODao;
@Autowired
private ISarCompResAssessService sarCompResAssessEOService;
@Autowired
private ISarFileSplitItemsService sarFileSplitItemsEOService;
@Autowired
private SarLawsItemValDao sarLawsItemValDao;
@Value("${elas.flag}")
private boolean elasflag;
/**
* 标准解读流程入库"
* @param standJson
* @throws Exception
*/
public void createStandardRead(String standJson) throws Exception{
JSONObject object = JSONObject.parseObject(standJson);
String fileName = object.getString("fileName");
String fileType = object.getString("fileType");
String creationTime = object.getString("creationTime");
String creationUser = object.getString("creationUser");
String standId = object.getString("standId");
//数组去重
JSONArray responUserList1 = object.getJSONArray("itemList");
for (Object obj:responUserList1) {
JSONObject object1 = (JSONObject) obj;
JSONArray preResponUserList = object1.getJSONArray("zxUserId");
String oldNumber = object1.getString("oldNumber");
String itemsNum = object1.getString("itemsNum");
String itemsName = object1.getString("itemsName");
String itemsTitle = object1.getString("itemsTitle");
String applyArcticId = object1.getString("applyArcticId");
String applyArctic = object1.getString("applyArctic");
String changePoint = object1.getString("changePoint");
String technicalRequir = object1.getString("technicalRequir");
String onlineData = object1.getString("onlineData");
String newData = object1.getString("newData");
String complianceRequir = object1.getString("complianceRequir");
String complianceState = object1.getString("complianceState");
}
}
/***
* @Description: 国内外标准流程入库"
* @Author: yangxuenan
* @Date: 2020/12/7 13:48
* @Param: [standJson]
* @Return: void
*/
public void processCreateLaws(String standJson) throws Exception{
Map<String,Object> standMap = new HashMap();
standMap = JSONObject.parseObject(standJson);
if (standMap != null && !standMap.isEmpty()) {
String prcNum = String.valueOf(standMap.get("prcNum"));
String prcName = String.valueOf(standMap.get("prcName"));
String standType = String.valueOf(standMap.get("standType"));
// String isJudge = String.valueOf(standMap.get("ifIn")); //是否经过技术评估
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
// if(standMap.containsKey("standId")) {
// if (standMap.get("standId") != null && !standMap.get("standId").toString().equals("")) {
// String resId = standMap.get("standId").toString();
// //此处说明是带入的形式
// sarStandardsInfoEO.setId(resId);
// SarCompResAssess assessInfoByResId = sarCompResAssessEOService.ssessInfoByResId(resId);
// if (assessInfoByResId != null) {
// assessInfoByResId.setProcessState("2");
// sarCompResAssessEOService.updateByPrimaryKeySelective(assessInfoByResId);
// }
// }
// }
Map<String,Object> attInfoMap = new HashMap<>();
List<String> jsonArray = new ArrayList<>();
Object breakVal = null;
Object itemList = null;
for (Map.Entry<String,Object> entry : standMap.entrySet()) {
String field = entry.getKey().toUpperCase();
Object value = entry.getValue();
if (InitStandAttrUtil.queryFieldListLaws.contains(field)) {
if (value != null && value instanceof JSONArray) {
String valStr = String.valueOf(value);
List<String> valueArr = JSONArray.parseArray(valStr,String.class);
if (valueArr != null && !valueArr.isEmpty()) {
String newValue = "";
for (String val : valueArr) {
newValue += val + ",";
}
newValue = newValue.substring(0,newValue.length()-1);
value = newValue;
}
}
attInfoMap.put(field,value);
} else {
createStandBaseField(sarLawsStandInfo,entry.getKey(),value);
}
}
//处理文件
//此处需要处理之前的文件信息,防止文件丢失
// attInfoMap = saveFileMsg(attInfoMap,sarStandardsInfoEO.getFileIds(),sarStandardsInfoEO.getTextStatus());
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
sarLawsStandInfo.setSarStandAttrEOStr(resData);
// 根据标准号判断数据是否已存在
//2021年4月9日 此处检查当前是否存在standId
String lawsNumber = "";
if(StringUtils.isNotBlank(sarLawsStandInfo.getLawsNumber()) && !"null".equals(sarLawsStandInfo.getLawsNumber())){
lawsNumber = sarLawsStandInfo.getLawsNumber();
}
List<SarLawsStandInfo> lawsList = sarLawsStandInfoService.selectStandardsByStandNumber(lawsNumber);
// if (StringUtils.isBlank(sarStandardsInfoEO.getMenuId()) && "INLAND".equals(sarStandardsInfoEO.getStandType())) {
// sarStandardsInfoEO.setMenuId("64df1d5522bb49c09af2");
// sarStandardsInfoEO.setCountry("CN");
// } else if (StringUtils.isBlank(sarStandardsInfoEO.getMenuId()) && "FOREIGN".equals(sarStandardsInfoEO.getStandType())) {
// sarStandardsInfoEO.setMenuId("22179d54d4e640098e29");
// }
//此处判断是否是带入的标准
if(StringUtils.isNotBlank(sarLawsStandInfo.getId())) {
SarLawsStandInfo query = new SarLawsStandInfo();
query.setId(sarLawsStandInfo.getId());
sarLawsStandInfoService.attrInfoDetails(query);
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
if(attInfoMap!=null && !attInfoMap.isEmpty()){
updateStandFileFieldData(attInfoMap,attrInfoMap);
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
sarLawsStandInfo.setSarStandAttrEOStr(resData);
}
// 查询原相关流程
String relatePro = iSarLawsAttrInfoService.selectFieldValByLawsId("XGLC",sarLawsStandInfo.getId());
if (StringUtils.isNotBlank(relatePro)) {
String[] processSplit = relatePro.split(",");
Set<String> processSet = new HashSet<>();
for(String sData:processSplit){
processSet.add(sData);
}
processSet.add(prcNum);
relatePro = StringUtils.join(processSet.toArray(), ",");
} else {
relatePro = prcNum;
}
// 编辑标准
sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
// 编辑相关流程
iSarLawsAttrInfoService.updateLawsInfo(sarLawsStandInfo.getId(),"XGLC",relatePro);
String content = "新增一条相关流程:" +prcName+" "+prcNum;
sarUpdLogEOService.createBaseLog(sarLawsStandInfo.getId(),standType+"_STAND",content);
}else if (lawsList != null && !lawsList.isEmpty()) {//Id不存在,但是标准号存在的情况
String standId = lawsList.get(0).getId();
SarLawsStandInfo query = new SarLawsStandInfo();
query.setId(standId);
sarLawsStandInfoService.attrInfoDetails(query);
Map<String, Object> attrInfoMap = query.getAttrInfoMap();
if(attInfoMap!=null && !attInfoMap.isEmpty()){
updateStandFileFieldData(attInfoMap,attrInfoMap);
resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
sarLawsStandInfo.setSarStandAttrEOStr(resData);
}
// 查询原相关流程
String relatePro = iSarLawsAttrInfoService.selectFieldValByLawsId("XGLC",standId);
if (StringUtils.isNotBlank(relatePro)) {
String[] processSplit = relatePro.split(",");
Set<String> processSet = new HashSet<>();
for(String sData:processSplit){
processSet.add(sData);
}
processSet.add(prcNum);
relatePro = StringUtils.join(processSet.toArray(), ",");
} else {
relatePro = prcNum;
}
// 编辑标准
sarLawsStandInfo.setId(standId);
sarLawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
// 编辑相关流程
iSarLawsAttrInfoService.updateLawsInfo(standId,"XGLC",relatePro);
String content = "新增一条相关流程:" +prcName+" "+prcNum;
sarUpdLogEOService.createBaseLog(standId,standType+"_STAND",content);
} else {//标准号、ID都不存在的情况
// 新增方法
sarLawsStandInfoService.createSarStandardsInfo(sarLawsStandInfo);
// 编辑相关流程
iSarLawsAttrInfoService.updateLawsInfo(sarLawsStandInfo.getId(),"XGLC",prcNum);
}
List<SarStandItems> allItems = new ArrayList<>();
//开始处理条款数据,从去重后的结果中直接处理即可
// if(itemData!=null && !itemData.isEmpty()){
// // allItems =
// saveStandItemsData(itemData, sarStandardsInfoEO);
// }
//技术评估结果入库 重构技术评估结果入库内容
// if ("0".equals(isJudge)) {
// saveCompStatusInfo(sarStandardsInfoEO,breakVal,allItems,prcNum);
// }
}
}
/***
* 标准法规入库流程中技术评估结果入库归档操作
* @param sarStandardsInfoEO
* @param allItems
* @param prcNum
*/
public void saveCompStatusInfo (SarStandardsInfo sarStandardsInfoEO,Object taskBreak,List<SarStandItems> allItems,String prcNum) throws Exception {
//首先将入库的标准条款通过之前的拆分库ID转换成入库后的条款的对应关系
Map<String,String> itemConvertDataMap = new HashMap<>();
if(allItems!=null && !allItems.isEmpty()){
for(SarStandItems itemsEO:allItems){
itemConvertDataMap.put(itemsEO.getOldId(),itemsEO.getId());
}
}
//获取本次入库的标准ID和类型
String standId = sarStandardsInfoEO.getId();//标准ID
//主要时区分国内、国外
String sarType = sarStandardsInfoEO.getStandType()+"_STAND";
//判断填写表单是哦服存在
if(taskBreak!=null){
List<SarCompStatusInfo> compStatusInfoEOS = new ArrayList<>();
//解析表单数据
String compResultStr = String.valueOf(taskBreak);
List<String> jsonArray = JSONArray.parseArray(compResultStr, String.class);
//判断数据是否正常
if (jsonArray != null && !jsonArray.isEmpty()) {
//当入库时只有标准时 itemList是空的
for (String jsonStr : jsonArray) {
if (StringUtils.isNotBlank(jsonStr)) {
Map<String, Object> jsonMap = JSONObject.parseObject(jsonStr);
if(jsonMap.containsKey("itemsList")){//开始读取条款集合数据处理结果
String itemsList = jsonMap.get("itemsList").toString();
//获取条款级别的评估集合列表
List<String> itemCompStrList = JSONArray.parseArray(itemsList, String.class);
if(itemCompStrList!=null && !itemCompStrList.isEmpty()){
for(String itemCompDataStr : itemCompStrList){
//解析每个人填写的具体评估结果
Map<String, Object> itemDataMap = JSONObject.parseObject(itemCompDataStr);
if(itemDataMap.containsKey("pgForm")){
String pgResult = itemDataMap.get("pgForm").toString();
//新旧条款ID转换
String oldItemId = itemDataMap.containsKey("id")?itemDataMap.get("id").toString():null;
//获取到评估表单
SarCompStatusInfo sarCompStatusInfoEO = JSONObject.parseObject(pgResult,SarCompStatusInfo.class);
sarCompStatusInfoEO.setId(UUIDUtils.randomUUID(32));
sarCompStatusInfoEO.setSarType(sarType);
sarCompStatusInfoEO.setSarId(standId);
//评估结果
sarCompStatusInfoEO.setSarState(itemDataMap.containsKey("jspg")?itemDataMap.get("jspg").toString():null);
//新旧条款号转换存储
if(StringUtils.isNotBlank(oldItemId)){
sarCompStatusInfoEO.setSarItemId(itemConvertDataMap.get(oldItemId));
sarCompStatusInfoEO.setSarItemState(sarCompStatusInfoEO.getSarState());
}
sarCompStatusInfoEO.setPrcNum(prcNum);
sarCompStatusInfoEO.setColor(convertColorByState(sarCompStatusInfoEO.getSarState()));//此处需要处理
sarCompStatusInfoEO.setPrcState(null);//技术评估不需要状态
sarCompStatusInfoEO.setCreationTime(new Date());
//评估人处理
sarCompStatusInfoEO.setCompPerson(itemDataMap.containsKey("foFillUser")?itemDataMap.get("foFillUser").toString():null);
sarCompStatusInfoEO.setCompTime(new Date());
compStatusInfoEOS.add(sarCompStatusInfoEO);
}
}
}else{
if(jsonMap.containsKey("pgForm")){
String pgResult = jsonMap.get("pgForm").toString();
//获取到评估表单
SarCompStatusInfo sarCompStatusInfoEO = JSONObject.parseObject(pgResult,SarCompStatusInfo.class);
sarCompStatusInfoEO.setId(UUIDUtils.randomUUID(32));
sarCompStatusInfoEO.setSarType(sarType);
sarCompStatusInfoEO.setSarId(standId);
sarCompStatusInfoEO.setSarState(jsonMap.containsKey("jspg")?jsonMap.get("jspg").toString():null);
sarCompStatusInfoEO.setPrcNum(prcNum);
sarCompStatusInfoEO.setColor(convertColorByState(sarCompStatusInfoEO.getSarState()));//此处需要处理
sarCompStatusInfoEO.setPrcState(null);//技术评估不需要状态
sarCompStatusInfoEO.setCreationTime(new Date());
sarCompStatusInfoEO.setCompPerson(jsonMap.containsKey("foFillUser")?jsonMap.get("foFillUser").toString():null);
sarCompStatusInfoEO.setCompTime(new Date());
compStatusInfoEOS.add(sarCompStatusInfoEO);
}
}
}else{//只有标准的情况下
//获取
if(jsonMap.containsKey("pgForm")){
String pgResult = jsonMap.get("pgForm").toString();
//获取到评估表单
SarCompStatusInfo sarCompStatusInfoEO = JSONObject.parseObject(pgResult,SarCompStatusInfo.class);
sarCompStatusInfoEO.setId(UUIDUtils.randomUUID(32));
sarCompStatusInfoEO.setSarType(sarType);
sarCompStatusInfoEO.setSarId(standId);
sarCompStatusInfoEO.setSarState(jsonMap.containsKey("jspg")?jsonMap.get("jspg").toString():null);
sarCompStatusInfoEO.setPrcNum(prcNum);
sarCompStatusInfoEO.setColor(convertColorByState(sarCompStatusInfoEO.getSarState()));//此处需要处理
sarCompStatusInfoEO.setPrcState(null);//技术评估不需要状态
sarCompStatusInfoEO.setCreationTime(new Date());
sarCompStatusInfoEO.setCompPerson(jsonMap.containsKey("foFillUser")?jsonMap.get("foFillUser").toString():null);
sarCompStatusInfoEO.setCompTime(new Date());
compStatusInfoEOS.add(sarCompStatusInfoEO);
}
}
}
}
}
//最后开始将评估结果入库同时将评估结果汇总后给出标准的评估结果
saveJSPGResultDataList(compStatusInfoEOS);
}
}
/**
* 入库技术评估结果
* @param compResultData
*/
private void saveJSPGResultDataList(List<SarCompStatusInfo> compResultData) throws Exception {
if(compResultData!=null && !compResultData.isEmpty()){
//1、将数据存储到记录表中
//2、汇总本次评估的结果 更新所有清单中的状态 此处有坑,如果标准评估后又在新的清单中添加的时候状态可能就是空的,
// 此时就会显示空,所以需要更换实现方法
//需要中间需要增加一层技术评估的结果,但是代价太大,2021年3月21日 无法在今天修改完,需要于2021年3月22日 整体想下这块,
// 目前的实现思路时有问题的
//正确逻辑时: 现将当前的评估结果记录到所有的技术评估结果中,然后汇总本次的评估结果内容到当前标准的技术评估汇总表中
//汇总后形成最新的评估内容,此时有2种做法 1、不记录上一次的状态 直接更新 2、记录上一次状态,新增一条整体评估结果记录
//在清单查询的时候 查询当前标准的最新一次评估结果,将评估结果不再清单中直接显示,而是在汇总表中的信息进行修改,这样能够达到
//单一标准不论在任何时间添加到清单的时候都可以查看,同时在标准的技术评估状态的时候也可以直接调用即可。不用每次评估完都需要更新
//技术清单的逻辑
/**
* 整体表关系如下:
* 基础库: 国内标准库 海外标准库 政策库
* 技术评估汇总表 资源的汇总结果记录
* 详细评估内容记录表 资源本身每次评估的详细记录
* 清单: 根据标准号到资源的汇总记录表中查询汇总结果 直接展现即可
* 目前缺少的就是资源的汇总结果记录缺失,导致查询的时候可能汇总结果会有问题
*/
//开始汇总数据以及状态变更
//首先先检查当前标准在汇总表中是否存在
Map<String,Map<String,Integer>> assessMap = new HashMap<>();
Map<String, SarCompResAssess> compResAssessEOMap = new HashMap<>();
for(SarCompStatusInfo data : compResultData){
//评估结果转换
String state = sysInfoEOService.changeCompStatus(data.getSarState());
String itemSate = sysInfoEOService.changeCompStatus(data.getSarItemState());
data.setSarState(state);
data.setSarItemState(itemSate);
if(StringUtils.equals("INLAND",data.getSarType())){
data.setSarType(SarTypeEnum.INLAND_STAND.getValue());
}else if(StringUtils.equals("FOREIGN",data.getSarType())){
data.setSarType(SarTypeEnum.FOREIGN_STAND.getValue());
}
SarCompResAssess info =null;
if(assessMap.containsKey(data.getSarId())){
info = compResAssessEOMap.get(data.getSarId());
}else{
info= sarCompResAssessEOService.getAssessInfoByResId(data.getSarId());
if(info==null){
info = new SarCompResAssess();
info.setId(UUIDUtils.randomUUID(32));
info.setAssessTime(new Date());
info.setCreatedTime(new Date());
info.setModifyTime(new Date());
info.setProcessNum(data.getPrcNum());
info.setResId(data.getSarId());
info.setResType(data.getSarType());
sarCompResAssessEOService.save(info);
}
compResAssessEOMap.put(data.getSarId(),info);
}
//汇总结果
if(!assessMap.containsKey(info.getResId())){
Map<String,Integer> accessData = new HashMap<>();
accessData.put(state,1);
assessMap.put(info.getResId(),accessData);
}else{
Map<String, Integer> accessData = assessMap.get(info.getResId());
if(accessData.containsKey(state)){
Integer stateNum = accessData.get(state);
accessData.put(state,stateNum+1);
assessMap.put(info.getResId(),accessData);
}else{
accessData.put(state,1);
assessMap.put(info.getResId(),accessData);
}
}
//入库操作
sarCompStatusInfoEODao.insert(data);
}
//开始遍历状态集合
for (Map.Entry entry : compResAssessEOMap.entrySet()) {
String compId = entry.getKey().toString();//汇总ID
SarCompResAssess compResAssessEO = (SarCompResAssess) entry.getValue();
Map<String, Integer> stringIntegerMap = assessMap.get(compId);
if(stringIntegerMap!=null){
if(stringIntegerMap.containsKey(SarConformStateEnum.UNFIT.getValue()+"")){//只要包含不符合的就是不符合
compResAssessEO.setAssessResult(SarConformStateEnum.UNFIT.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
}else if(stringIntegerMap.size() ==1){//只有一种情况的
if(stringIntegerMap.containsKey(SarConformStateEnum.FIT.getValue()+"")){
compResAssessEO.setAssessResult(SarConformStateEnum.FIT.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.GREEN.getValue());
}else if(stringIntegerMap.containsKey(SarConformStateEnum.CHECK.getValue()+"")){
compResAssessEO.setAssessResult(SarConformStateEnum.CHECK.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
}else if(stringIntegerMap.containsKey(SarConformStateEnum.NOT_INVOLVE.getValue()+"")){
compResAssessEO.setAssessResult(SarConformStateEnum.NOT_INVOLVE.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.NA.getValue());
}
}else if(stringIntegerMap.containsKey(SarConformStateEnum.CHECK.getValue()+"")){
compResAssessEO.setAssessResult(SarConformStateEnum.CHECK.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
}else if(stringIntegerMap.containsKey(SarConformStateEnum.NOT_INVOLVE.getValue()+"")){
compResAssessEO.setAssessResult(SarConformStateEnum.NOT_INVOLVE.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.NA.getValue());
}else{
compResAssessEO.setAssessResult(SarConformStateEnum.FIT.getValue());
compResAssessEO.setAssessColor(SarStateColorEnum.GREEN.getValue());
}
// else {//不包含不符合的并且单一情况并不存在的也就是说是 部分符合或者待确认的
// if(stringIntegerMap.containsKey(SarConformStateEnum.FIT.getValue()+"")){
// compResAssessEO.setAssessResult(SarConformStateEnum.PART_FIT.getValue());
// compResAssessEO.setAssessColor(SarStateColorEnum.YELLOW.getValue());
// }else{
// compResAssessEO.setAssessResult(SarConformStateEnum.CHECK.getValue());
// compResAssessEO.setAssessColor(SarStateColorEnum.NA.getValue());
// }
// }
}
compResAssessEO.setProcessState("2");
compResAssessEO.setModifyTime(new Date());
if(StringUtils.equals("INLAND",compResAssessEO.getResType())){
compResAssessEO.setResType(SarTypeEnum.INLAND_STAND.getValue());
}else if(StringUtils.equals("FOREIGN",compResAssessEO.getResType())){
compResAssessEO.setResType(SarTypeEnum.FOREIGN_STAND.getValue());
}
//更新汇总后的结果
sarCompResAssessEOService.updateById(compResAssessEO);
}
}
}
private String convertColorByState(String stateStr){
String colorStr = "";
switch (stateStr){
case "1":
colorStr = SarStateColorEnum.GREEN.getValue();
break;
case "2":
colorStr = SarStateColorEnum.YELLOW.getValue();
break;
case "3":
colorStr = SarStateColorEnum.YELLOW.getValue();
case "4":
colorStr = SarStateColorEnum.NA.getValue();
}
return colorStr;
}
public String changeStatus (String textStatus) {
String status = "";
switch (textStatus) {
case "草稿": status="CA";break;
case "征求意见稿": status="ZQYJG";break;
case "报批稿": status="BPG";break;
case "送审稿": status="SSG";break;
case "发布稿(必读)": status="FBGBJBD";break;
}
return status;
}
/**
* 处理条款信息转换
* @param itemsEO
* @param field
* @param value
* @throws Exception
*/
public void createItemsBaseField (SarLawsItems itemsEO,String field,Object value) throws Exception{
String valueStr = "";
if (value != null) {
valueStr = String.valueOf(value);
}
switch (field) {
case "itemsName": itemsEO.setItemsName(valueStr); break;
case "FO":
List<String> jsonArray = JSONArray.parseArray(valueStr,String.class);
String fo = "";
if (jsonArray != null && !jsonArray.isEmpty()) {
for (String json : jsonArray) {
fo += json + ",";
}
fo = fo.substring(0,fo.length()-1);
itemsEO.setFoUser(fo);
}
break;
case "itemsNum": itemsEO.setItemsNum(valueStr); break;
case "termsConditions": itemsEO.setTermsConditions(valueStr); break;
case "svpps": itemsEO.setSvpps(valueStr); break;
case "role": itemsEO.setDutyEngineer(valueStr); break;
case "parts": itemsEO.setResponsibleUnit(valueStr); break;
case "FORoleId": itemsEO.setFo(valueStr); break;
case "id": itemsEO.setOldId(valueStr); break;
case "jspg": itemsEO.setJspg(valueStr); break;
case "pgForm":
if (StringUtils.isNotBlank(valueStr)) {
SarCompStatusInfo list = JSONObject.parseObject(valueStr,SarCompStatusInfo.class);
itemsEO.setPgForm(list);
};
break;
default: break;
}
}
/**
* 处理保存标准条款信息数据
* @return
*/
// private List<SarLawsItems> saveStandItemsData(List<Map<String,Object>> itemDataList,SarLawsStandInfo sarStandardsInfoEO) throws Exception {
// String standId = sarStandardsInfoEO.getId();
// String fileType = changeStatus(sarStandardsInfoEO.getLawsTextState());
// List<SarLawsItems> itemsEOList = new ArrayList<>();//添加的条款信息
// List<SarLawsItems> upItemsEOList = new ArrayList<>();//更新的条款数据
// List<String> delValItemIds = new ArrayList<>();//需要删除重新添加的条款数据集合
// List<SarStandItemVal> itemValEOS = new ArrayList<>();//批量更新进去的条款参数集合
// List<SarFileSplitItems> UpSarFileSplitItemsList = new ArrayList<>();
// for(Map<String,Object> itemData:itemDataList){
// String itemStr = itemData.get("itemStr").toString();//条款的具体内容
// Map<String,String> itemAttrInfo = (Map<String, String>) itemData.get("itemAttrInfo");//条款的属性字段
// Map<String,Object> itemMap = new HashMap();
// //此处需要查询拆分库数据,将之前的拆分数据带入到当前标准中同时检查当前分解单中是否已经包含相关的条款信息,
// // 如果是则更新,如果没有则添加
// itemMap = JSONObject.parseObject(itemStr);;
// if (itemMap != null && !itemMap.isEmpty()) {
// if(itemMap.containsKey("resId")){
// //存在
// String splitItemId = String.valueOf(itemMap.get("resId"));
// if(StringUtils.isNotBlank(splitItemId)){
// SarFileSplitItems splitItemsEO = sarFileSplitItemsEOService.getById(splitItemId);
// if(splitItemsEO!=null){
// //拆分库有数据,检查当前的表单中是否有数据,如果有则直接获取后更新即可
// SarLawsItems nowItemEO = sarLawsItemsDao.selectById(splitItemId);
// if(nowItemEO!=null){
// //更新数据
// nowItemEO.setItemsNum(splitItemsEO.getItemsNum());
// nowItemEO.setItemsName(splitItemsEO.getItemsName());
// nowItemEO.setApplyArctic(splitItemsEO.getApplyArctic());
// nowItemEO.setLawsId(standId);
// nowItemEO.setTermsConditions(splitItemsEO.getItermsConditions());
// nowItemEO.setParts(splitItemsEO.getSvpps());
// nowItemEO.setCreationUser(UserUtils.getUserId());
// nowItemEO.setValidFlag(0);
// if(null!=fileType){
// nowItemEO.setFileType(fileType);
// }
// nowItemEO.setRemarks(splitItemsEO.getRemarks());
// nowItemEO.setModifyTime(new Date());
//
// nowItemEO.setClaimType(splitItemsEO.getClaimType());
// nowItemEO.setBusStandCover(splitItemsEO.getBusStandCover());
// nowItemEO.setResponsibleUnit(itemAttrInfo.get("ZRBM"));
// nowItemEO.setFo(itemAttrInfo.get("FO"));
// nowItemEO.setDutyEngineer(itemAttrInfo.get("XMPGJS"));
// nowItemEO.setSvpps(itemAttrInfo.get("SVPPS"));
// upItemsEOList.add(nowItemEO);
// }else{
// SarLawsItems itemsEO = new SarLawsItems();
// itemsEO.setId(splitItemId);
// itemsEO.setCreationTime(new Date());
// itemsEO.setModifyTime(new Date());
// itemsEO.setValidFlag(0);
// itemsEO.setLawsId(standId);
// itemsEO.setFileType(fileType);
// for (Map.Entry<String,Object> entry : itemMap.entrySet()) {
// String field = entry.getKey();
// Object value = entry.getValue();
// createItemsBaseField(itemsEO,field,value);
// }
// itemsEO.setItemsNum(splitItemsEO.getItemsNum());
// itemsEO.setItemsName(splitItemsEO.getItemsName());
// itemsEO.setApplyArctic(splitItemsEO.getApplyArctic());
// itemsEO.setTermsConditions(splitItemsEO.getItermsConditions());
// itemsEO.setParts(splitItemsEO.getSvpps());
// itemsEO.setCreationUser(UserUtils.getUserId());
// itemsEO.setRemarks(splitItemsEO.getRemarks());
// itemsEO.setClaimType(splitItemsEO.getClaimType());
// itemsEO.setBusStandCover(splitItemsEO.getBusStandCover());
// itemsEO.setResponsibleUnit(itemAttrInfo.get("ZRBM"));
// itemsEO.setFo(itemAttrInfo.get("FO"));
// itemsEO.setDutyEngineer(itemAttrInfo.get("XMPGJS"));
// itemsEO.setSvpps(itemAttrInfo.get("SVPPS"));
// //开始处理后续逻辑
// itemsEOList.add(itemsEO);
// }
// //apply数据
// if(StringUtils.isNotEmpty(splitItemsEO.getApplyArctic())){
// delValItemIds.add(splitItemsEO.getId());
// String[] applyarr = splitItemsEO.getApplyArctic().trim().split(",");
// for(String applya:applyarr){
// SarStandItemVal sarStandItemValEO = new SarStandItemVal();
// sarStandItemValEO.setValidFlag(ValueStateEnum.VALUE_TRUE.getValue());
// sarStandItemValEO.setCreationTime(new Date());
// sarStandItemValEO.setModifyTime(new Date());
// sarStandItemValEO.setItemId(splitItemsEO.getId());
// sarStandItemValEO.setId(UUIDUtils.randomUUID20());
// sarStandItemValEO.setPropertyType(PropertyTypeEnum.APPLY_ARCTIC.getValue());
// sarStandItemValEO.setPropertyVal(applya);
// itemValEOS.add(sarStandItemValEO);
// }
// }
// //TODO 开始处理拆分库数据
// splitItemsEO.setModifyTime(new Date());
// splitItemsEO.setResponsibleUnit(itemAttrInfo.get("ZRBM"));
// splitItemsEO.setFo(itemAttrInfo.get("FO"));
// splitItemsEO.setDutyEngineer(itemAttrInfo.get("XMPGJS"));
// splitItemsEO.setSvpps(itemAttrInfo.get("SVPPS"));
// UpSarFileSplitItemsList.add(splitItemsEO);
// }else{
// logger.error("拆分库中找不到对应数据了,数据不见了 /(ㄒoㄒ)/~~"+itemStr);
// }
// }else{
// logger.error("流程中携带的拆分库ID不见了 Σ(っ °Д °;)っ "+itemStr);
// }
// }else{
// //不存在 说明数据出现问题了
// logger.error("流程中携带的拆分库ID,数据不见了 /(ㄒoㄒ)/~~"+itemStr);
//
// }
// }
// }
// //更新拆分库数据
// if(UpSarFileSplitItemsList!=null && !UpSarFileSplitItemsList.isEmpty()){
// for(SarFileSplitItems items : UpSarFileSplitItemsList){
// sarFileSplitItemsEOService.updateById(items);
// }
// }
// //执行批量新增操作
// if(itemsEOList != null && !itemsEOList.isEmpty()){
// sarLawsItemsDao.insertForeach(itemsEOList);
//
// }
// //执行批量修改操作
// if(upItemsEOList != null && !upItemsEOList.isEmpty()){
// sarLawsItemsDao.updateForeach(upItemsEOList);
//
// }
// //执行适用车型批量操作
// if(itemValEOS != null && !itemValEOS.isEmpty()){
// sarLawsItemValDao.deleteByItemsIds(delValItemIds);
// sarLawsItemValDao.insertForeach(itemValEOS);
// }
// return itemsEOList;
// }
private void updateStandFileFieldData(Map<String,Object> addAttInfoMap,Map<String,Object> oldAttInfoMap){
if(oldAttInfoMap.containsKey("CA")){
String fileStr = (String) oldAttInfoMap.get("CA");
if(StringUtils.isNotBlank(fileStr)){
String newFileStr =addAttInfoMap.containsKey("CA")?(String)addAttInfoMap.get("CA"):null;
if(StringUtils.isNotBlank(newFileStr)){
String[] fileSplit = fileStr.split(",");
String[] newFileSplit = newFileStr.split(",");
Set<String> fileSet = new HashSet<>();
for(String sData:fileSplit){
fileSet.add(sData);
}
for(String sData:newFileSplit){
fileSet.add(sData);
}
addAttInfoMap.put("CA",StringUtils.join(fileSet.toArray(), ","));
}else{
addAttInfoMap.put("CA",fileStr);
}
}
}else if(oldAttInfoMap.containsKey("ZQYJG")){
String fileStr = (String) oldAttInfoMap.get("ZQYJG");
if(StringUtils.isNotBlank(fileStr)){
String newFileStr =addAttInfoMap.containsKey("ZQYJG")?(String)addAttInfoMap.get("ZQYJG"):null;
if(StringUtils.isNotBlank(newFileStr)){
String[] fileSplit = fileStr.split(",");
String[] newFileSplit = newFileStr.split(",");
Set<String> fileSet = new HashSet<>();
for(String sData:fileSplit){
fileSet.add(sData);
}
for(String sData:newFileSplit){
fileSet.add(sData);
}
addAttInfoMap.put("ZQYJG",StringUtils.join(fileSet.toArray(), ","));
}else{
addAttInfoMap.put("ZQYJG",fileStr);
}
}
}else if(oldAttInfoMap.containsKey("BPG")){
String fileStr = (String) oldAttInfoMap.get("BPG");
if(StringUtils.isNotBlank(fileStr)){
String newFileStr =addAttInfoMap.containsKey("BPG")?(String)addAttInfoMap.get("BPG"):null;
if(StringUtils.isNotBlank(newFileStr)){
String[] fileSplit = fileStr.split(",");
String[] newFileSplit = newFileStr.split(",");
Set<String> fileSet = new HashSet<>();
for(String sData:fileSplit){
fileSet.add(sData);
}
for(String sData:newFileSplit){
fileSet.add(sData);
}
addAttInfoMap.put("BPG",StringUtils.join(fileSet.toArray(), ","));
}else{
addAttInfoMap.put("BPG",fileStr);
}
}
}else if(oldAttInfoMap.containsKey("SSG")){
String fileStr = (String) oldAttInfoMap.get("SSG");
if(StringUtils.isNotBlank(fileStr)){
String newFileStr =addAttInfoMap.containsKey("SSG")?(String)addAttInfoMap.get("SSG"):null;
if(StringUtils.isNotBlank(newFileStr)){
String[] fileSplit = fileStr.split(",");
String[] newFileSplit = newFileStr.split(",");
Set<String> fileSet = new HashSet<>();
for(String sData:fileSplit){
fileSet.add(sData);
}
for(String sData:newFileSplit){
fileSet.add(sData);
}
addAttInfoMap.put("SSG",StringUtils.join(fileSet.toArray(), ","));
}else{
addAttInfoMap.put("SSG",fileStr);
}
}
}else if(oldAttInfoMap.containsKey("ZBJBD")){
String fileStr = (String) oldAttInfoMap.get("ZBJBD");
if(StringUtils.isNotBlank(fileStr)){
String newFileStr =addAttInfoMap.containsKey("ZBJBD")?(String)addAttInfoMap.get("ZBJBD"):null;
if(StringUtils.isNotBlank(newFileStr)){
String[] fileSplit = fileStr.split(",");
String[] newFileSplit = newFileStr.split(",");
Set<String> fileSet = new HashSet<>();
for(String sData:fileSplit){
fileSet.add(sData);
}
for(String sData:newFileSplit){
fileSet.add(sData);
}
addAttInfoMap.put("ZBJBD",StringUtils.join(fileSet.toArray(), ","));
}else{
addAttInfoMap.put("ZBJBD",fileStr);
}
}
}else if(oldAttInfoMap.containsKey("FBGBJBD")){
String fileStr = (String) oldAttInfoMap.get("FBGBJBD");
if(StringUtils.isNotBlank(fileStr)){
String newFileStr =addAttInfoMap.containsKey("FBGBJBD")?(String)addAttInfoMap.get("FBGBJBD"):null;
if(StringUtils.isNotBlank(newFileStr)){
String[] fileSplit = fileStr.split(",");
String[] newFileSplit = newFileStr.split(",");
Set<String> fileSet = new HashSet<>();
for(String sData:fileSplit){
fileSet.add(sData);
}
for(String sData:newFileSplit){
fileSet.add(sData);
}
addAttInfoMap.put("FBGBJBD",StringUtils.join(fileSet.toArray(), ","));
}else{
addAttInfoMap.put("FBGBJBD",fileStr);
}
}
}
}
public Map<String,Object> saveFileMsg (Map<String,Object> attInfoMap,String fileIds,String textStatus) {
switch (textStatus) {
case "草案": attInfoMap.put("CA",fileIds);break;
case "征求意见稿": attInfoMap.put("ZQYJG",fileIds);break;
case "报批稿": attInfoMap.put("BPG",fileIds);break;
case "送审稿": attInfoMap.put("SSG",fileIds);break;
case "增补件(必读)":attInfoMap.put("ZBJBD",fileIds);break;
case "发布稿(必读)": attInfoMap.put("FBGBJBD",fileIds);break;
}
return attInfoMap;
}
/**
* 处理标准基础库字段
* @param sarLawsStandInfo
* @param field
* @param value
* @throws Exception
*/
public void createStandBaseField (SarLawsStandInfo sarLawsStandInfo,String field,Object value) throws Exception{
String valueStr = "";
if (value != null) {
valueStr = String.valueOf(value);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
switch (field) {
case "country": sarLawsStandInfo.setCountry(valueStr); break;
case "id": sarLawsStandInfo.setId(valueStr); break;
case "lawsType": sarLawsStandInfo.setLawsType(valueStr); break;
case "lawsNumber": sarLawsStandInfo.setLawsNumber(valueStr); break;
case "lawsName": sarLawsStandInfo.setLawsName(valueStr); break;
case "lawsEnName": sarLawsStandInfo.setLawsEnName(valueStr); break;
case "lawsNo": sarLawsStandInfo.setLawsNo(valueStr); break;
case "issueTime":
if (StringUtils.isNotBlank(valueStr)) {
sarLawsStandInfo.setIssueTime(valueStr);
}
break;
case "issueCompany": sarLawsStandInfo.setIssueCompany(valueStr); break;
case "commentCycleStart":
if (StringUtils.isNotBlank(valueStr)) {
sarLawsStandInfo.setCommentCycleStart(valueStr);
}
break;
case "commentCycleEnd":
if (StringUtils.isNotBlank(valueStr)) {
sarLawsStandInfo.setCommentCycleEnd(valueStr);
}
break;
case "lawsTextState": sarLawsStandInfo.setLawsTextState(valueStr); break;
case "lawsSyqy": sarLawsStandInfo.setLawsSyqy(valueStr); break;
case "lawsSycx": sarLawsStandInfo.setLawsSycx(valueStr); break;
case "isRelateAccess": sarLawsStandInfo.setIsRelateAccess(valueStr); break;
case "lawsYear": sarLawsStandInfo.setLawsYear(valueStr); break;
case "lawsNotisyncNum": sarLawsStandInfo.setLawsNotisyncNum(valueStr); break;
case "lawsBulletin": sarLawsStandInfo.setLawsBulletin(valueStr); break;
case "lawsLabel": sarLawsStandInfo.setLawsLabel(valueStr); break;
case "lawsRemark": sarLawsStandInfo.setLawsRemark(valueStr); break;
case "prcNum": sarLawsStandInfo.setProcessNum(valueStr); break;
case "menuId": sarLawsStandInfo.setMenuId(valueStr); break;
case "fileWord":
if (StringUtils.isNotBlank(sarLawsStandInfo.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
valueStr = sarLawsStandInfo.getFileIds() + "," + valueStr;
}
sarLawsStandInfo.setFileIds(valueStr); break;
case "filePdf":
if (StringUtils.isNotBlank(sarLawsStandInfo.getFileIds()) && StringUtils.isNotBlank(valueStr)) {
valueStr = sarLawsStandInfo.getFileIds() + "," + valueStr;
}
sarLawsStandInfo.setFileIds(valueStr);
break;
default: break;
}
}
}
+6
View File
@@ -43,6 +43,12 @@
<version>5.5.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
@@ -0,0 +1,74 @@
package com.adc.da.util;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
* token 工具类
*
* @author ch
* @version 1.0.0
* @since 1.0.0
* <p>
* Created at 2020/7/30 2:23 下午
*/
@Component
public class JwtSysUtils {
// 过期时间
private static long expire = 6048000;
// 秘钥
private static String secret = "HSyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9";
/**
* 创建一个token
*
* @param userId
* @return
*/
public String generateToken(String userId) {
Date now = new Date();
Date expireDate = new Date(now.getTime() + expire);
return Jwts.builder().setHeaderParam("type", "JWT").setSubject(userId).setIssuedAt(now)
.setExpiration(expireDate).signWith(
SignatureAlgorithm.HS512, secret).compact();
}
/**
* 解析token
*/
public Claims getClaimsByToken(String token) {
Claims claims;
try {
claims = Jwts.parser()
.setSigningKey(secret) // 设置标识名
.parseClaimsJws(token) //解析token
.getBody();
} catch (ExpiredJwtException e) {
claims = e.getClaims();
}
return claims;
}
public String getUserIdByToken(){
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
String user = "";
if(attributes != null){
HttpServletRequest request = attributes.getRequest();
Claims claim = getClaimsByToken(request.getHeader("token"));
user = claim.getSubject();
}
return user;
}
}
@@ -15,21 +15,7 @@ public class LoginUserUtil {
*
*/
public static String getUserId() {
String userId = null;
try {
Subject subject = SecurityUtils.getSubject();
Object object=subject.getPrincipal();
if(object!=null){
String json = JSONObject.toJSONString(object);
if(json!=null && json.length()>0){
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
userId=userInfo.get("id").toString();
}
}
} catch (UnavailableSecurityManagerException e) {
} catch (InvalidSessionException e) {
}
return userId;
return UserSysUtils.getUserId();
}
public static String getUserParamValue() {
@@ -0,0 +1,97 @@
package com.adc.da.util;
import com.google.common.collect.Maps;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.UnavailableSecurityManagerException;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.session.InvalidSessionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
public class UserSysUtils {
private UserSysUtils() {
super();
}
private static Logger logger = LoggerFactory.getLogger(UserSysUtils.class);
/**
* 当前登陆用户
*/
public static final String CURRENT_USER = "currentUser";
/**
* 角色信息
*/
public static final String CACHE_ROLE_LIST = "roleList";
/**
* 菜单信息
*/
public static final String CACHE_MENU_LIST = "menuList";
public static final String CACHE_MENU_TREE = "menuTree";
public static final String CACHE_AREA_LIST = "areaList";
public static final String CACHE_OFFICE_LIST = "officeList";
/**
* @see JwtSysUtils
*/
private static JwtSysUtils jwtUtils = SpringContextHolder1.getBean(JwtSysUtils.class);
/**
* 退出
*/
public static void logout() {
try {
SecurityUtils.getSubject().logout();
} catch (UnavailableSecurityManagerException e) {
logger.error(e.getMessage(),e);
} catch (InvalidSessionException e) {
logger.error(e.getMessage(),e);
}
}
/**
* 获取当前登陆用户ID
* @throws Exception
*/
public static String getUserId() {
return jwtUtils.getUserIdByToken();
}
public static void flush() {
CacheUtils.removeCache(CURRENT_USER);
}
private static final class CacheUtils {
public static Object getCache(String key) {
return getCache(key, null);
}
public static Object getCache(String key, Object defaultValue) {
Object obj = getCacheMap().get(key);
return obj == null ? defaultValue : obj;
}
public static void putCache(String key, Object value) {
getCacheMap().put(key, value);
}
public static void removeCache(String key) {
getCacheMap().remove(key);
}
public static Map<String, Object> getCacheMap() {
Map<String, Object> map = Maps.newHashMap();
return map;
}
}
}
@@ -53,7 +53,7 @@ public class WaterMarkUtil {
under.setGState(gs);
under.restoreState();
under.beginText();
under.setFontAndSize(base, 13);
under.setFontAndSize(base, 25);
under.setTextMatrix(30, 30);
under.setColorFill(BaseColor.LIGHT_GRAY);
for (int y = 0; y < 10; y++) {
@@ -90,7 +90,7 @@ public class DocConverterPdf {
System.out.println("源文件不存在");
return;
}
SocketOpenOfficeConnection connection = new SocketOpenOfficeConnection("0.0.0.0", 8100);
SocketOpenOfficeConnection connection = new SocketOpenOfficeConnection("10.100.5.122", 8100);
// SocketOpenOfficeConnection connection = new SocketOpenOfficeConnection("10.10.66.176", 8100);
try {
connection.connect();
@@ -65,9 +65,9 @@ public class SendConvertMQService {
private static final Logger logger = LoggerFactory.getLogger(SendConvertMQService.class);
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "createConvertStandMQ_SQ_GSAR", durable = "true"),
exchange = @Exchange(value = "convert-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
key = "convert-key_SQ_GSAR"))
value = @Queue(value = "createConvertStandMQ_SQ_GSAR_RELEASE", durable = "true"),
exchange = @Exchange(value = "convert-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
key = "convert-key_SQ_GSAR_RELEASE"))
public void createMQ(Map<String,Object> convertInfo, Message message, Channel channel) throws Exception{
try{
try{
@@ -96,7 +96,7 @@ public class LoginRestController {
if(userEO.getDisableFlag()==1){
return Result.error("r0011", "帐号已禁用");
}
String token = jwtUtils.generateToken(account);
String token = jwtUtils.generateToken(userEO.getUsid());
userEO.setToken(token);
// 加密重要信息
BASE64Encoder encoder = new BASE64Encoder();
@@ -66,6 +66,12 @@ public class WebMvcConfig implements WebMvcConfigurer {
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSar");
//水印下载
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMark");
//企业标准导出
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
//OCR回调存储文件
addInterceptor.excludePathPatterns("/api/ocr/OCRRestful/OcrHandleResult");
// //测试接口使用
// addInterceptor.excludePathPatterns("/api/**");
@@ -1,4 +1,4 @@
# dev config
#=============================================
# 数据库配置
#=============================================
@@ -38,16 +38,14 @@ spring.mail.port=587
# ==============================================
# rabbitMQ
# ==============================================
#spring.rabbitmq.host=rabbitmq-cluster-01.vs.test.geely.svc
#spring.rabbitmq.host=10.2.186.93
#spring.rabbitmq.port=5672
#spring.rabbitmq.virtual-host=uat_pcms
#spring.rabbitmq.username=uat_pcms
#spring.rabbitmq.password=VxsBLL5bJruwzXfS
# spring.rabbitmq.publisher-confirms=true
spring.rabbitmq.host=62.234.136.153
#spring.rabbitmq.username=ca
#spring.rabbitmq.password=cs986432
spring.rabbitmq.host=62.234.118.181
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.username=admin
spring.rabbitmq.password=admin
spring.rabbitmq.listener.simple.acknowledge-mode= manual
# 生产者 默认关闭 发版 需改为 true
spring.rabbitmq.listener.direct.auto-startup=false
@@ -60,7 +58,6 @@ spring.rabbitmq.listener.simple.retry.initial-interval= 5000
spring.rabbitmq.listener.simple.retry.enabled= true
#最大重试5次
spring.rabbitmq.listener.simple.retry.max-attempts= 5
# ==============================================
# 文档存储路径指向
# ==============================================
file.path=/usr/laws/file/
@@ -69,7 +66,7 @@ file.path=/usr/laws/file/
#OCR请求识别URL地址
OCR.handleFileUrl = http://61.136.1.103:8091/WebService.asmx/FileConversion
# OCR回调接口地址 配置客户本地的IP及端口号
OCR.callBackUrl = http://62.234.136.153:10010/api/ocr/OCRRestful/OcrHandleResult
OCR.callBackUrl = http://62.234.136.153:8033/api/ocr/OCRRestful/OcrHandleResult
OCR.userId =dayuzhou1234
OCR.authCode =123456
OCR.publicKey =EC4KKA6ZDTCPAOCRBC5M
@@ -8,7 +8,7 @@
<!-- 项目名称 -->
<property name="PROJECT_NAME" value="adc-da" />
<!-- 定义日志文件的存储地址,勿在 LogBack的配置中使用相对路径 -->
<property name="LOG_HOME" value="/tmp/applog/pcms-rest" />
<property name="LOG_HOME" value="/tmp/applog/pcms-rest-system" />
<!-- <property name="LOG_HOME" value="../logs/pcms-rest" />-->
<!-- 定义系统日志文件的存储地址,勿在 LogBack的配置中使用相对路径 -->
<property name="LOG_HOME_SYSTEM" value="system" />
@@ -96,7 +96,11 @@ public class SearchCenterController extends BaseController<Map<String, Object>>
}
return Result.success(getPageInfo(searchInfoEO.getPager(), result));
} else {
result = searchCenterService.searchSarBykey(searchInfoEO);
if (searchInfoEO.getQueryStatus() != null && StringUtils.isNotBlank(searchInfoEO.getQueryStatus()) && searchInfoEO.getQueryStatus().equals("advancedSearch") && null != searchInfoEO.getSelectValue() && StringUtils.isNotBlank(searchInfoEO.getSelectValue())) {
result = searchCenterService.searchSarBykey(searchInfoEO);
}else {
result = searchCenterService.searchSarConditionBykey(searchInfoEO);
}
// 非动态消息的需要查询为我推荐
for (int i = 0; i < result.size(); i++) {
String collectId = personCollectEOService.queryCollectByUserAndId(result.get(i).get("id").toString());
@@ -31,6 +31,9 @@ public class SeniorSearchInfoEO extends BasePage {
@ApiModelProperty(value = "标准分类")
private String standType;
@ApiModelProperty(value = "搜索分类")
private String type;
@ApiModelProperty(value = "国家地区")
private String country;
@@ -239,6 +242,33 @@ public class SeniorSearchInfoEO extends BasePage {
private String stand_status;
private String isHigh;
private String queryStatus;
private String lawsType;
private String lawsNumber;
private String lawsName;
private String lawsEnName;
private String lawsNo;
private String issueCompany;
private String commentCycleDate;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date commentCycleStart;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date commentCycleEnd;
private String lawsTextState;
private String lawsSyqy;
private String lawsSycx;
private String lawsYear;
private String lawsNotisyncNum;
private String lawsBulletin;
private String lawsLabel;
private String lawsRemark;
private String CYSDLAWS;
private String NYLXCLASS;
@@ -11,6 +11,8 @@ public interface SearchCenterService {
List<Map<String, Object>> searchSarBykey(SeniorSearchInfoEO searchInfoEO) throws Exception;
List<Map<String, Object>> searchSarConditionBykey(SeniorSearchInfoEO searchInfoEO) throws Exception;
/**
* 查询结果集searchResponse装换成List形式
* @param searchResponse 需要转换的数据
@@ -243,34 +243,42 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
attrInfoMap.put(key, "null");
}
}
fullTextSearchEO.put("title",attrInfoMap.get("numbershow")+" "+attrInfoMap.get("nameshow"));
fullTextSearchEO.put("title",attrInfoMap.get("lawsNumber")+" "+attrInfoMap.get("lawsNumber"));
StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append("适用区域: ").append(attrInfoMap.get("countryShow")).append(" ");
contentBuilder.append("政策状态: ").append(attrInfoMap.get("standstateshow")).append(" ");
contentBuilder.append("政策号: ").append(attrInfoMap.get("numbershow")).append(" ");
contentBuilder.append("政策名称: ").append(attrInfoMap.get("nameshow")).append(" ");
contentBuilder.append("英文名称: ").append(attrInfoMap.get("standEnName")).append(" ");
contentBuilder.append("政策分类: ").append(attrInfoMap.get("lawsTypeName")).append(" ");
contentBuilder.append("政策编号: ").append(attrInfoMap.get("lawsNumber")).append(" ");
contentBuilder.append("中文名称: ").append(attrInfoMap.get("lawsName")).append(" ");
contentBuilder.append("英文名称: ").append(attrInfoMap.get("lawsEnName")).append(" ");
contentBuilder.append("政策文号: ").append(attrInfoMap.get("lawsNo")).append(" ");
// contentBuilder.append("发布日期:"+attrInfoMap.get("issueTime")+" ");
contentBuilder.append("纳入标准法规清单的国家/地区: ").append(attrInfoMap.get("accessCountry")).append(" ");
contentBuilder.append("代替政策编号: ").append(attrInfoMap.get("replaceLawsNum")).append(" ");
contentBuilder.append("重要度: ").append(attrInfoMap.get("isRelateAccess")).append(" ");
contentBuilder.append("要求类型: ").append(attrInfoMap.get("YQLXShow")).append(" ");
contentBuilder.append("适用车辆类型: ").append(attrInfoMap.get("SYCLLXShow")).append(" ");
// contentBuilder.append("监管类型:"+attrInfoMap.get("")+" ");
contentBuilder.append("监管类型: ").append(attrInfoMap.get("ZRLXShow")).append(" ");
contentBuilder.append("个性化标签: ").append(attrInfoMap.get("GXHBQShow")).append(" ");
contentBuilder.append("新车型实施日期(文本): ").append(attrInfoMap.get("XCXSSRQ")).append(" ");
contentBuilder.append("在产车实施日期(文本): ").append(attrInfoMap.get("ZCCSSRQ")).append(" ");
contentBuilder.append("EOP实施日期(文本): ").append(attrInfoMap.get("EOPSSRQ")).append(" ");
contentBuilder.append("维护工程师: ").append(attrInfoMap.get("ZCGCSShow")).append(" ");
contentBuilder.append("组织标准起草的执行机构/单位: ").append(attrInfoMap.get("FBJGShow")).append(" ");
contentBuilder.append("SVPPS: ").append(attrInfoMap.get("SVPPSName")).append(" ");
contentBuilder.append("相关部门: ").append(attrInfoMap.get("XGBMShow")).append(" ");
contentBuilder.append("责任部门: ").append(attrInfoMap.get("ZRBMShow")).append(" ");
contentBuilder.append("FO: ").append(attrInfoMap.get("FOShow")).append(" ");
contentBuilder.append("归口管理部门: ").append(attrInfoMap.get("GKGLBMShow")).append(" ");
contentBuilder.append("我司是否参与: ").append(attrInfoMap.get("WSSFCYShow")).append(" ");
contentBuilder.append("相关流程: ").append(attrInfoMap.get("XGLC")).append(" ");
contentBuilder.append("地区: ").append(attrInfoMap.get("country")).append(" ");
contentBuilder.append("发文日期: ").append(attrInfoMap.get("issueTime")).append(" ");
contentBuilder.append("发文单位: ").append(attrInfoMap.get("issueCompany")).append(" ");
contentBuilder.append("征集意见周期-起始时间: ").append(attrInfoMap.get("commentCycleStart")).append(" ");
contentBuilder.append("征集意见周期-结束时间: ").append(attrInfoMap.get("commentCycleEnd")).append(" ");
contentBuilder.append("文本状态: ").append(attrInfoMap.get("lawsTextStateName")).append(" ");
contentBuilder.append("适用区域: ").append(attrInfoMap.get("lawsSyqyName")).append(" ");
contentBuilder.append("适用车型: ").append(attrInfoMap.get("lawsSycxName")).append(" ");
contentBuilder.append("是否纳入认证清单: ").append(attrInfoMap.get("isRelateAccessName")).append(" ");
contentBuilder.append("年度: ").append(attrInfoMap.get("lawsYearName")).append(" ");
contentBuilder.append("福田转发通知文号: ").append(attrInfoMap.get("lawsNotisyncNum")).append(" ");
contentBuilder.append("信息简报: ").append(attrInfoMap.get("lawsBulletin")).append(" ");
contentBuilder.append("标签: ").append(attrInfoMap.get("lawsLabel")).append(" ");
contentBuilder.append("备注: ").append(attrInfoMap.get("lawsRemark")).append(" ");
contentBuilder.append("实施日期(文本): ").append(attrInfoMap.get("SSRQLAWSName")).append(" ");
contentBuilder.append("新车型实施日期(文本): ").append(attrInfoMap.get("XCXSSRQLAWSName")).append(" ");
contentBuilder.append("在产车实施日期(文本): ").append(attrInfoMap.get("ZCXSSRQLAWSName")).append(" ");
contentBuilder.append("发布机构: ").append(attrInfoMap.get("FBJGLAWSName")).append(" ");
contentBuilder.append("我司参与深度: ").append(attrInfoMap.get("CYSDLAWSName")).append(" ");
contentBuilder.append("投稿人: ").append(attrInfoMap.get("TGRLAWSName")).append(" ");
contentBuilder.append("投稿单位: ").append(attrInfoMap.get("TGRLAWSName")).append(" ");
contentBuilder.append("能源类型: ").append(attrInfoMap.get("NYLXLAWSName")).append(" ");
contentBuilder.append("适用认证: ").append(attrInfoMap.get("YYRZLAWSName")).append(" ");
contentBuilder.append("责任部门: ").append(attrInfoMap.get("ZRBMLAWSName")).append(" ");
contentBuilder.append("责任工程师: ").append(attrInfoMap.get("ZRGCSLAWSName")).append(" ");
contentBuilder.append("代替文件号: ").append(attrInfoMap.get("DTWJHLAWSName")).append(" ");
contentBuilder.append("被代替文件号: ").append(attrInfoMap.get("BDTWJHLAWSName")).append(" ");
contentBuilder.append("引用标准&政策: ").append(attrInfoMap.get("YYBZZCLAWSName")).append(" ");
// contentBuilder.append("相关资料:"+attrInfoMap.get("")+" ");
if (attrInfoMap.containsKey("content")){
if (null !=attrInfoMap.get("content") && StringUtils.isNotBlank(String.valueOf(attrInfoMap.get("content")))){
@@ -285,10 +293,10 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
StringBuilder textContent = replaceAll(contentBuilder, "null", "--");
fullTextSearchEO.put("textContent",textContent.toString());
if (null != attrInfoMap.get("issue_time") && !"".equals(attrInfoMap.get("issue_time")) && !"null".equals(attrInfoMap.get("issue_time"))) {
fullTextSearchEO.put("issue_time", attrInfoMap.get("issue_time"));
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", attrInfoMap.get("issueTime"));
}else {
fullTextSearchEO.put("issue_time", "");
fullTextSearchEO.put("issue_time", "--");
}
}else if ("bussstand".equals(attrInfoMap.get("type"))){
@@ -11,6 +11,7 @@ import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -37,9 +38,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
standTypeList.add(SarTypeEnum.STAND.getValue());
standTypeList.add(SarTypeEnum.INLAND_STAND.getValue());
standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue());
lawsTypeList.add(SarTypeEnum.LAWS.getValue());
lawsTypeList.add(SarTypeEnum.INLAND_LAWS.getValue());
lawsTypeList.add(SarTypeEnum.FOREIGN_LAWS.getValue());
lawsTypeList.add(SarTypeEnum.LAWS_STAND.getValue());
standStateList.add("DRAFT");
standStateList.add("ADVICE");
standStateList.add("RADYSUBMIT");
@@ -78,6 +77,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
public static List<String> numFieldListLaws = new ArrayList<>(); // 属性表数字类型字段
public static List<SarStandAttrDetails> lawsInlandAttrFieldList = new ArrayList<>(); // 属性表数字类型字段
public static List<SarStandAttrDetails> lawsForeignAttrFieldList = new ArrayList<>(); // 全部政策字段属性
public static List<SarStandAttrDetails> lawsStandAttrFieldList = new ArrayList<>(); // 全部政策字段属性
public static Map<String,String> selectFieldMapLaws = new HashMap<>(); // 下拉属性字段及选项值
// 企标属性字段信息
@@ -95,7 +95,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
logger.info("项目启动时加载-搜索中心-查询标准属性类!");
logger.info("项目启动时加载--查询标准属性类!");
// 属性表需要查询的字段
StringBuilder fieldInfoBuilder = new StringBuilder();
StringBuilder fieldInfoBuilderLaws = new StringBuilder();
@@ -108,7 +108,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
qw.orderByAsc("ORDER_NUM");
List<SarStandAttrDetails> getDetailsList = sarStandAttrDetailsEOService.list(qw);
if (getDetailsList != null && !getDetailsList.isEmpty()) {
logger.info("项目启动时加载-搜索中心-查询标准属性类--查询到" + getDetailsList.size() + "条属性字段数据!");
logger.info("项目启动时加载--查询标准属性类--查询到" + getDetailsList.size() + "条属性字段数据!");
for (SarStandAttrDetails detailsEO : getDetailsList) {
String sarType = detailsEO.getSarType();
String attrType = detailsEO.getAttrType();
@@ -137,12 +137,16 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
numFieldList.add(detailsEO.getAttrField());
}
} else if (lawsTypeList.contains(sarType)) {
if (!SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) {
lawsInlandAttrFieldList.add(detailsEO);
}
if (!SarTypeEnum.INLAND_LAWS.getValue().equals(sarType)) {
if (SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) {
lawsForeignAttrFieldList.add(detailsEO);
}
if (SarTypeEnum.LAWS_STAND.getValue().equals(sarType)) {
lawsStandAttrFieldList.add(detailsEO);
}
if (SarTypeEnum.INLAND_LAWS.getValue().equals(sarType)) {
lawsInlandAttrFieldList.add(detailsEO);
}
fieldInfoBuilderLaws.append(detailsEO.getAttrField() + ",");
fieldInfoNameBuilderLaws.append(detailsEO.getAttrName() + ",");
queryFieldListLaws.add(detailsEO.getAttrField());
@@ -193,9 +197,9 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
if (StringUtils.isNotBlank(queryFieldBuss)) {
queryFieldBuss = queryFieldBuss.substring(0,queryFieldBuss.length()-1);
}
logger.info("项目启动时加载-搜索中心-查询标准属性类--查询到属性字段为:" + queryField);
logger.info("项目启动时加载-搜索中心-查询政策属性类--查询到属性字段为:" + queryFieldLaws);
logger.info("项目启动时加载-搜索中心-查询企标属性类--查询到属性字段为:" + queryFieldBuss);
logger.info("项目启动时加载--查询标准属性类--查询到属性字段为:" + queryField);
logger.info("项目启动时加载--查询政策属性类--查询到属性字段为:" + queryFieldLaws);
logger.info("项目启动时加载--查询企标属性类--查询到属性字段为:" + queryFieldBuss);
queryFieldNames = fieldInfoNameBuilder.toString();
queryFieldNamesLaws = fieldInfoNameBuilderLaws.toString();
queryFieldNamesBuss = fieldInfoNameBuilderBuss.toString();
@@ -208,11 +212,11 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
if (StringUtils.isNotBlank(queryFieldNamesBuss)) {
queryFieldNamesBuss = queryFieldNamesBuss.substring(0,queryFieldNamesBuss.length()-1);
}
logger.info("项目启动时加载-搜索中心-查询标准属性类--查询到属性字段名称为:" + queryFieldNames);
logger.info("项目启动时加载-搜索中心-查询政策属性类--查询到属性字段名称为:" + queryFieldNamesLaws);
logger.info("项目启动时加载-搜索中心-查询企标属性类--查询到属性字段名称为:" + queryFieldNamesBuss);
logger.info("项目启动时加载--查询标准属性类--查询到属性字段名称为:" + queryFieldNames);
logger.info("项目启动时加载--查询政策属性类--查询到属性字段名称为:" + queryFieldNamesLaws);
logger.info("项目启动时加载--查询企标属性类--查询到属性字段名称为:" + queryFieldNamesBuss);
} else {
logger.error("项目启动时加载-搜索中心-查询标准属性类--未查询到属性字段数据!");
logger.error("项目启动时加载--查询标准属性类--未查询到属性字段数据!");
}
}
@@ -11,6 +11,7 @@ public enum SarTypeEnum {
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
STAND("STAND","国内外标准法规"),
LAWS("LAWS","国内外政策"),
LAWS_STAND("LAWS_STAND","国内外政策"),
BUSINESS("BUSINESS","企业标准"),
BUSS("BUSS","企业标准"),
SPLIT("SPLIT","标准拆分"),
@@ -11,6 +11,7 @@ public enum SarTypeEnum {
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
STAND("STAND","国内外标准法规"),
LAWS("LAWS","国内外政策"),
LAWS_STAND("LAWS_STAND","国内外政策"),
BUSINESS("BUSINESS","企业标准"),
BUSS("BUSS","企业标准"),
SPLIT("SPLIT","标准拆分"),
@@ -71,7 +71,7 @@ public class CreateMQService {
}
//发送消息队列
this.rabbitTemplate.convertAndSend("convert-exchange_SQ_GSAR", "convert-key_SQ_GSAR", convertInfo);
this.rabbitTemplate.convertAndSend("convert-exchange_SQ_GSAR_RELEASE", "convert-key_SQ_GSAR_RELEASE", convertInfo);
}
}
@@ -2,6 +2,7 @@ package com.adc.da.mq;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import net.sf.json.JSONObject;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,18 +30,20 @@ public class CreateStandMQService {
standMap.put("addOrUpdate", addOrUpdate);
//发送消息队列
this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR", "stand-key_SQ_GSAR", standMap);
this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR_RELEASE", "stand-key_SQ_GSAR_RELEASE", standMap);
}
public void sendLawsMQ(SarLawsInfo sarLawsInfoEO, String addOrUpdate) throws Exception{
JSONObject json = JSONObject.fromObject(sarLawsInfoEO);
String sarLawsInfoStr = json.toString();
public void sendLawsMQ(SarLawsStandInfo sarLawsStandInfo, String addOrUpdate) throws Exception{
// JSONObject json = JSONObject.fromObject(sarLawsStandInfo);
com.alibaba.fastjson.JSONObject object = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(sarLawsStandInfo);
String sarLawsInfoStr = object.toString();
Map<String,Object> lawsMap = new HashMap<String,Object>();
lawsMap.put("sarLaws", sarLawsInfoStr);
lawsMap.put("addOrUpdate", addOrUpdate);
//发送消息队列
this.rabbitTemplate.convertAndSend("laws-exchange_SQ_GSAR", "laws-key_SQ_GSAR", lawsMap);
this.rabbitTemplate.convertAndSend("laws-exchange_SQ_GSAR_RELEASE", "laws-key_SQ_GSAR_RELEASE", lawsMap);
}
public void sendBussStandMQ(Object sarBussionessStandEO, String addOrUpdate) throws Exception{
@@ -51,7 +54,7 @@ public class CreateStandMQService {
bussMap.put("addOrUpdate", addOrUpdate);
//发送消息队列
this.rabbitTemplate.convertAndSend("buss-exchange_SQ_GSAR", "buss-key_SQ_GSAR", bussMap);
this.rabbitTemplate.convertAndSend("buss-exchange_SQ_GSAR_RELEASE", "buss-key_SQ_GSAR_RELEASE", bussMap);
}
}
@@ -45,9 +45,9 @@ public class SendBussMQService {
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "createBussMQ_SQ_GSAR", durable = "true"),
exchange = @Exchange(value = "buss-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
key = "buss-key_SQ_GSAR"))
value = @Queue(value = "createBussMQ_SQ_GSAR_RELEASE", durable = "true"),
exchange = @Exchange(value = "buss-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
key = "buss-key_SQ_GSAR_RELEASE"))
public void createMQ(Map<String,Object> bussMap, Message message, Channel channel) throws Exception{
try{
try{
@@ -0,0 +1,324 @@
package com.adc.da.mq;
import com.adc.da.slrs.otSvpps.service.IOtSvppsService;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.alibaba.fastjson.JSON;
import com.rabbitmq.client.Channel;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.json.JSONTokener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Component
public class SendLawsMQService {
@Autowired
private ISarStandardsInfoService sarStandardsInfoService;
@Autowired
private SysInfoEOService sysInfoEOService;
@Autowired
private DicTypeEODao dicTypeEODao;
private static final Logger logger = LoggerFactory.getLogger(SendLawsMQService.class);
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "createLawsMQ_SQ_GSAR_RELEASE", durable = "true"),
exchange = @Exchange(value = "laws-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
key = "laws-key_SQ_GSAR_RELEASE"))
public void createMQ(Map<String,Object> bussMap, Message message, Channel channel) throws Exception{
try{
try{
Thread.sleep(5000);
insertOrUpdateBussInfo(bussMap);
}catch(InterruptedException e){
logger.error(e.toString());
Thread.currentThread().interrupt();
}
} catch (Exception e) {
logger.error("搜索中心国内外政策消息队列进入转换前失败!");
logger.error(e.getMessage(),e);
} finally {
Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
channel.basicAck(tag,false);
logger.debug("消息确认成功!!!!!!!!!");
}
}
public void insertOrUpdateBussInfo(Map<String,Object> bussMap) throws Exception {
String addOrUpdate = bussMap.get("addOrUpdate").toString();
String sarBuss = bussMap.get("sarLaws").toString();
JSONObject jsonobject = JSONObject.fromObject(sarBuss);
SarLawsStandInfo infoEO = com.alibaba.fastjson.JSONObject.parseObject(sarBuss,SarLawsStandInfo.class);
if(infoEO.getMapItems() == null || infoEO.getMapItems().isEmpty()){
if(jsonobject.get("mapItems") != null){
infoEO.setMapItems(net.sf.json.JSONObject.fromObject(jsonobject.get("mapItems")));
}
}
// SarLawsStandInfo infoEO = (SarLawsStandInfo) JSONObject.toBean(jsonobject,SarLawsStandInfo.class);
String FZRQFSRQ = null;
if ("updateFromAct".equals(addOrUpdate)){
addOrUpdate = "update";
FZRQFSRQ = "1";
}
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
Map<String,Object> infoMap = infoEO.getAttrInfoCaseMap();
Map<String,String> infoEOMapItems = infoEO.getMapItems();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//修改索引信息表
// 往索引表中插入数据
String baseSearchContent = "";
String getCodeName = "";
Map<String,Object> saveMap = new HashMap<>();
saveMap.put("standType","laws");
//发布日期 高级查询
saveMap.put("issueTime",dateFormatToStr(infoEO.getIssueTime()));
Date issue_time_data = null;
if (StringUtils.isNotBlank(infoEO.getIssueTime())) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
issue_time_data = format.parse(dateFormatToStr(infoEO.getIssueTime())+" 00:00:00");
} catch (ParseException ignored) {
}
}
if (issue_time_data != null) {
saveMap.put("issue_time_data",issue_time_data.getTime());
}else{
saveMap.put("issue_time_data",-1000000000000000000L);
}
//征集意见周期-起始时间
saveMap.put("commentCycleStart",dateFormatToStr(infoEO.getCommentCycleStart()));
Date commentCycleStart_data = null;
if (StringUtils.isNotBlank(infoEO.getCommentCycleStart())) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
commentCycleStart_data = format.parse(dateFormatToStr(infoEO.getCommentCycleStart())+" 00:00:00");
} catch (ParseException ignored) {
}
}
if (commentCycleStart_data != null) {
saveMap.put("commentCycleStart_data",commentCycleStart_data.getTime());
}else{
saveMap.put("commentCycleStart_data",-1000000000000000000L);
}
//征集意见周期-结束时间
saveMap.put("commentCycleEnd",dateFormatToStr(infoEO.getCommentCycleEnd()));
Date commentCycleEnd_data = null;
if (StringUtils.isNotBlank(infoEO.getCommentCycleStart())) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
commentCycleEnd_data = format.parse(dateFormatToStr(infoEO.getCommentCycleStart())+" 00:00:00");
} catch (ParseException ignored) {
}
}
if (commentCycleEnd_data != null) {
saveMap.put("commentCycleEnd_data",commentCycleEnd_data.getTime());
}else{
saveMap.put("commentCycleEnd_data",-1000000000000000000L);
}
saveMap.put("id",infoEO.getId());
String lawsTypeName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsType())){
List<String> valArr = Arrays.asList(infoEO.getLawsType().split(","));
lawsTypeName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsType",infoEO.getLawsType());
saveMap.put("lawsTypeName",lawsTypeName);
saveMap.put("lawsNumber",infoEO.getLawsNumber());
saveMap.put("lawsName",infoEO.getLawsName());
saveMap.put("lawsEnName",infoEO.getLawsEnName());
saveMap.put("lawsNo",infoEO.getLawsNo());
saveMap.put("issueCompany",infoEO.getIssueCompany());
String lawsSyqyName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsSyqy())){
List<String> valArr = Arrays.asList(infoEO.getLawsSyqy().split(","));
lawsSyqyName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsSyqy",infoEO.getLawsSyqy());
saveMap.put("lawsSyqyName",lawsSyqyName);
String lawsSycxName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsSycx())){
List<String> valArr = Arrays.asList(infoEO.getLawsSycx().split(","));
lawsSycxName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsSycx",infoEO.getLawsSycx());
saveMap.put("lawsSycxName",lawsSycxName);
String isRelateAccessName = "";
if(infoEO.getIsRelateAccess() != null && StringUtils.isNotBlank(infoEO.getIsRelateAccess())){
if(infoEO.getIsRelateAccess().equals("1")){
isRelateAccessName = "";
}else {
isRelateAccessName = "";
}
}
saveMap.put("isRelateAccess",infoEO.getIsRelateAccess());
saveMap.put("isRelateAccessName",isRelateAccessName);
String lawsYearName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsYear())){
List<String> valArr = Arrays.asList(infoEO.getLawsYear().split(","));
lawsYearName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsYear",infoEO.getLawsYear());
saveMap.put("lawsYearName",lawsYearName);
saveMap.put("lawsNotisyncNum",infoEO.getLawsNotisyncNum());
saveMap.put("lawsBulletin",infoEO.getLawsBulletin());
String lawsLabelName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsLabel())){
List<String> valArr = Arrays.asList(infoEO.getLawsLabel().split(","));
lawsLabelName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsLabel",infoEO.getLawsLabel());
saveMap.put("lawsLabelName",lawsLabelName);
saveMap.put("lawsRemark",infoEO.getLawsRemark());
String lawsTextStateName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsTextState())){
List<String> valArr = Arrays.asList(infoEO.getLawsTextState().split(","));
lawsTextStateName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsTextState",infoEO.getLawsTextState());
saveMap.put("lawsTextStateName",lawsTextStateName);
//新加字段
saveMap.put("country",infoEO.getCountry());
if(StringUtils.isNotEmpty(infoEO.getCountry())){
String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getCountry());
saveMap.put("countryShow",codeName);
}
// 自定义属性字段
if (attrInfoMap != null && !attrInfoMap.isEmpty()) {
attrInfoMap = sysInfoEOService.changeSelectInfo(attrInfoMap, "laws",baseSearchContent);
saveMap.putAll(attrInfoMap);
}
saveMap.put("type","laws");
saveMap.put("validFlag","0");
saveMap.put("content",infoEO.getFileIds());
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
List<String> fieldInfoList = Arrays.asList(fieldInfo .split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
// 动态存储属性字段
for (String field : fieldInfoList) {
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
String fieldValue = "";
String fieldFilter = field.toLowerCase();
if(infoMap.get(fieldFilter) != null && StringUtils.isNotBlank(infoMap.get(fieldFilter).toString())){
Object json= new JSONTokener(infoMap.get(fieldFilter).toString()).nextValue();
if(!json.toString().equals("null")){
fieldValue = infoMap.get(fieldFilter).toString();
}
}
saveMap.put(field+"Name",fieldValue);
}
if(infoEOMapItems != null && !infoEOMapItems.isEmpty()){
saveMap.put("mapItems",infoEOMapItems);
}
//当建立代替时,产生的没有文件的问题
if (StringUtils.isBlank(String.valueOf(saveMap.get("content")))) {
String context = filterStringIsNotBlank(String.valueOf(saveMap.get("ZCWBLAWS")),true)
+ filterStringIsNotBlank(String.valueOf(saveMap.get("GCWBLAWS")),true)
+ filterStringIsNotBlank(String.valueOf(saveMap.get("JDWJLAWS")),true)
+ filterStringIsNotBlank(String.valueOf(saveMap.get("GLWJLAWS")),true);
context = context.replace(",,", ",");
saveMap.put("content", context);
}
if("add".equals(addOrUpdate)){
sarStandardsInfoService.insertIntoIndexForMap(saveMap);
} else {
sarStandardsInfoService.updateIntoIndexForMap(saveMap);
}
}
private String filterStringIsNotBlank(String str,boolean boo){
String f = ",";
return (str == null || str.equals("") || str.equals("null")) ? "" : (boo ? str+f : str);
}
private String dateFormatToStr(String dateStr){
if(dateStr == null || dateStr.equals("")){
return "";
}
String dateToStr = "";
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateToStr = dateFormat.format(dateFormat.parse(dateStr.trim().substring(0,10)));
}catch (Exception e){
e.getMessage();
}
return dateToStr;
}
public Map<String,Object> dealNumberMsg (Map<String,Object> saveMap,SarBussionessStand infoEO,String getCodeName) {
/*if(StringUtils.isNotEmpty(infoEO.getStandYear())){
String num = getCodeName + " " + infoEO.getStandCode() + "-" + infoEO.getStandYear();
saveMap.put("numbershow",num);
int index = infoEO.getStandCode().indexOf(".");
int index1 = infoEO.getStandCode().indexOf(":");
String numberExpNull = "";
if(index > -1){
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + num.replaceAll(" ","")
+ "-" + getCodeName + infoEO.getStandCode().substring(0,index) + "-" + infoEO.getStandCode().substring(0,index);
}else if(index1 > -1){
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + num.replaceAll(" ","")
+ "-" + getCodeName + infoEO.getStandCode().substring(0,index1) + "-" + infoEO.getStandCode().substring(0,index1);
}else{
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + num.replaceAll(" ","");
}
} else {
String number = getCodeName + " " + infoEO.getStandCode();
saveMap.put("numbershow",number);
String numberExpNull = "";
int index = infoEO.getStandCode().indexOf(".");
if(index > -1){
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + number.replaceAll(" ","")
+ "-" + getCodeName + infoEO.getStandCode().substring(0,index) + "-" + infoEO.getStandCode().substring(0,index);
}else{
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + number.replaceAll(" ","");
}
saveMap.put("numberExpNull",numberExpNull);
}*/
String number = infoEO.getStandCode();
saveMap.put("numbershow",number);
String numberExpNull = "";
int index = infoEO.getStandCode().indexOf(".");
if(index > -1){
numberExpNull = infoEO.getStandCode() + "-" + number.replaceAll(" ","")
+ "-" + infoEO.getStandCode().substring(0,index) + "-" + infoEO.getStandCode().substring(0,index);
}else{
numberExpNull = infoEO.getStandCode() + "-" + number.replaceAll(" ","");
}
saveMap.put("numberExpNull",numberExpNull);
return saveMap;
}
}
@@ -46,9 +46,9 @@ public class SendStandMQService {
private static final Logger logger = LoggerFactory.getLogger(SendStandMQService.class);
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "createStandMQ_SQ_GSAR", durable = "true"),
exchange = @Exchange(value = "stand-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
key = "stand-key_SQ_GSAR"))
value = @Queue(value = "createStandMQ_SQ_GSAR_RELEASE", durable = "true"),
exchange = @Exchange(value = "stand-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
key = "stand-key_SQ_GSAR_RELEASE"))
public void createMQ(Map<String,Object> standMap, Message message, Channel channel) throws Exception{
try{
try{
@@ -4,6 +4,7 @@ import com.adc.da.base.web.BaseController;
import com.adc.da.common.ReadExcel;
import com.adc.da.http.ResponseMessage;
import com.adc.da.slrs.ImportExcelDatas.comment.ExclErrorOut;
import com.adc.da.slrs.ImportExcelDatas.comment.ExclExport;
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
import com.adc.da.slrs.ImportExcelDatas.service.impl.ImportExcelServiceImpl;
@@ -34,7 +35,7 @@ import java.util.Map;
@RestController
@Api(description = "|SarStandPutTime|")
@RequestMapping("/ImportExcel")
@RequestMapping("/api/ImportExcel")
public class ImportExcelController extends BaseController<ImportDto> {
@Autowired
@@ -43,14 +44,24 @@ public class ImportExcelController extends BaseController<ImportDto> {
@Autowired
private ExclErrorOut exclErrorOut;
@ApiOperation("批量删除用户收藏")
@ApiOperation("从excl中导入标准信息")
@PostMapping("/import")
public void deleteList(MultipartFile file, MultipartFile file2, HttpServletResponse response, HttpServletRequest request) throws IOException {
Map<String, List<ImportDto>> mapMap=importExcelService.getExcelData(file,file2);
/**
* 导入系统
*/
List<ImportDto> errorList = importExcelService.storageExclData(mapMap);
// mapMap.put("导入后的信息",errorList);
// List<ImportDto> guonei= mapMap.get("GNBZ");
// List<ImportDto> haiwai = mapMap.get("HWBZ");
// List<ImportDto> qibiao = mapMap.get("QYBZ");
/**
* 生成错误表格
*/
OutputStream os = null;
Workbook workbook = null;
try {
@@ -61,7 +72,11 @@ public class ImportExcelController extends BaseController<ImportDto> {
response.setContentType("application/force-download");
//导出数据
String headStr="标准号,标准名称,英文名称,发布时间,实施时间,标准状态,代替标准号,附件路径,错误原因";
workbook = exclErrorOut.exportDatas(errorList,headStr);
// workbook = exclErrorOut.exportDatas(guonei,headStr);
ExclExport exclExport = new ExclExport();
workbook = exclExport.exportData(mapMap, headStr);
os = response.getOutputStream();
workbook.write(os);
os.flush();
@@ -75,8 +90,8 @@ public class ImportExcelController extends BaseController<ImportDto> {
}
// return responseMessage;
}
}
@@ -2,7 +2,6 @@ package com.adc.da.slrs.ImportExcelDatas.service.impl;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.att.vo.AttFileVo;
import com.adc.da.http.Result;
import com.adc.da.slrs.ImportExcelDatas.dao.ImportExcelDao;
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
@@ -10,9 +9,7 @@ import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.sys.entity.DicTypeEO;
import com.adc.da.sys.entity.DictionaryEO;
import com.adc.da.sys.service.impl.DicTypeEOServiceImpl;
import com.adc.da.util.UUIDUtils;
import com.adc.da.utils.util.InitStandAttrUtil;
@@ -26,13 +23,13 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
@Service
@@ -54,7 +51,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
// private SarBussionessStandServiceImpl sarBussionessStandService;
/**
* 标准类别
*/
private final static String GN = "GB,GB/T,QC/T,GJB,JB,JT,HG,YV,SY,SH,GA,HJ,QB,JG,NB,JC,YS/T,FZ/T,TB/T,JJG,SJ/T,T/TBPS" +
",NB/T,CJ/T,YS/T,SJ/T,BB/T,SN/T,SB/T,MH/T,DB11,SZDB/Z,HKG,T/ZSA,CSAE,T/CAS,T/CADA,T/CHTS,T/ITS,T/BJQC";
private final static String QB = "Q/QCBFC,Q/FT,Q/FL,Q/QCFLC,Q/BQB,Q/SGT," +
@@ -70,6 +69,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
dates.add("" + i);
dates.add("- " + i);
dates.add("" + i);
dates.add("" + i);
}
if (file == null || file.getSize() == 0) {
@@ -118,12 +118,18 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
//中间的Map 判断标准号属于哪种类型
Map<String, String> middle = new HashMap<>();
datas.forEach(items -> {
System.out.print(".");
//判断是否是正确的数据
String[] as = items.split(",");
if (!inDate(as[0], dates)) {
if( as.length < 8){
ImportDto importDto = new ImportDto();
importDto.setErrorStr(items);
error.add(importDto);
} else if (!inDate(as[0], dates) ) {
ImportDto importDto = getImportDto(as);
error.add(importDto);
middle.put(as[0].trim(), "error-" + error.size());
middle.put(as[7].trim(), "error-" + error.size());
} else {
//数据二次拆解 针对标准进行拆解
String[] step2 = as[0].trim().split(" ");
@@ -131,15 +137,15 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
if (isCheck(GNS, step2[0].trim())) {
ImportDto importDto = getImportDto(as);
InCountry.add(importDto);
middle.put(as[0].trim(), "GNBZ-" + InCountry.size());
middle.put(as[7].trim(), "GNBZ-" + InCountry.size());
} else if (isCheck(QBS, step2[0].trim())) {
ImportDto importDto = getImportDto(as);
QiBiao.add(importDto);
middle.put(as[0].trim(), "QYBZ-" + QiBiao.size());
middle.put(as[7].trim(), "QYBZ-" + QiBiao.size());
} else {
ImportDto importDto = getImportDto(as);
OutCountry.add(importDto);
middle.put(as[0].trim(), "HWBZ-" + OutCountry.size());
middle.put(as[7].trim(), "HWBZ-" + OutCountry.size());
}
}
});
@@ -151,9 +157,11 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
fujian.forEach(items2 -> {
String[] fj = items2.split(",");
if (fj.length > 2) {
if (null != middle.get(null != fj[2] ? fj[2].trim() : "")) {
if (null != middle.get(null != fj[1] ? fj[1].trim() : "")) {
//对应数据位置
String[] location = middle.get(fj[2].trim()).split("-");
String[] location = middle.get(fj[1].trim()).split("-");
// List<ImportDto> importDtos = res.get(location[0]);
res.get(location[0]).get(Integer.parseInt(location[1]) - 1).setPath(fj[3]);
}
}
@@ -189,10 +197,15 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
}
/**
* 数据数组转换为实体类
* @param as
* @return
*/
//赋值方法
private ImportDto getImportDto(String[] as) {
ImportDto importDto = new ImportDto();
if (as.length == 7) {
if (as.length == 8) {
importDto.setStandId(null != as[0] ? as[0].trim() : "");
importDto.setStandName(null != as[1] ? as[1].trim() : "");
importDto.setStandNameEN(null != as[2] ? as[2].trim() : "");
@@ -200,7 +213,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
importDto.setImplementedTime(null != as[4] ? as[4].trim() : "");
importDto.setStandStatus(null != as[5] ? as[5].trim() : "");
importDto.setReplaceId(null != as[6] ? as[6].trim() : "");
} else if (as.length == 6) {
} else if (as.length == 7) {
importDto.setStandId(null != as[0] ? as[0].trim() : "");
importDto.setStandName(null != as[1] ? as[1].trim() : "");
importDto.setStandNameEN(null != as[2] ? as[2].trim() : "");
@@ -225,9 +238,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
HSSFSheet sheet = workbook.getSheetAt(i);
// 获取有多少行
int lastNum = sheet.getLastRowNum();
for (int j = 1; j <= lastNum; j++) {
for (int j = 0; j <= lastNum; j++) {
HSSFRow row = sheet.getRow(j);
if (null != row) {
System.out.println("正在读取第"+j+"行...");
strings.add(row.getCell(0).getStringCellValue());
}
}
@@ -248,11 +262,12 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
// 遍历sheet页
for (int i = 0; i <= sheetNum; i++) {
XSSFSheet sheet = workbook.getSheetAt(i);
// 获取有多少行
// 获取有多少行 0行开始
int lastNum = sheet.getLastRowNum();
for (int j = 1; j <= lastNum; j++) {
for (int j = 0; j <= lastNum; j++) {
XSSFRow row = sheet.getRow(j);
if (null != row) {
System.out.println("正在读取第"+j+"行...");
strings.add(row.getCell(0).getStringCellValue());
}
}
@@ -266,9 +281,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
private List<ImportDto> error = new ArrayList<>();
private List<ImportDto> fileError = new ArrayList<>();
@Autowired
private ISarStandardsInfoService sarStandardsInfoService;
@@ -278,12 +291,38 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
@Autowired
private ISarBussionessStandService sarBussionessStandService;
private List<ImportDto> error = new ArrayList<>();
private List<ImportDto> fileError = new ArrayList<>();
private HashSet<String> sarSort = new HashSet<>();
@Override
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap) {
//TODO 利用stream把list变为set
// List<DicTypeEO> list = dicTypeEOService.list();
// list.stream().flatMap(dicTypeEO -> {
// return dicTypeEO;
// }.co)
List<DicTypeEO> isExist = dicTypeEOService.getTypeIdByDicIdAndTypeName("JKSADFH564S", null, null, null);
isExist.forEach(item->{
sarSort.add(item.getDicTypeCode());
});
error = importListMap.get("error");
AtomicInteger QYBZcount= new AtomicInteger();
AtomicInteger QYBZcountUpdate= new AtomicInteger();
AtomicInteger HWBZcount= new AtomicInteger();
AtomicInteger HWBZcountUpdate= new AtomicInteger();
AtomicInteger GNBZcount= new AtomicInteger();
AtomicInteger GNBZcountUpdate= new AtomicInteger();
/**
* 初始化国内外标准属性字段
*/
@@ -296,24 +335,26 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
/**
* 海外标准
*/
importListMap.get("HWBZ").forEach(item -> {
String standID = UUIDUtils.randomUUID20();
//使用初始化的属性字段映射 获得key值,value为""
Map<String, String> mapField = standAttrMap;
SarStandardsInfo ForeignEO = parseImportDtoToStandardsInfo(item,mapField, standID);
/*importListMap.get("HWBZ").forEach(item -> {
if (true ) {
String standID = UUIDUtils.randomUUID20();
if (ForeignEO != null) {
ForeignEO.setValidFlag("0");
ForeignEO.setStandType("FOREIGN");
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
standSaveWrapper
.eq("STAND_SORT", ForeignEO.getStandSort())
.eq("STAND_NUMBER", ForeignEO.getStandNumber())
.eq("STAND_YEAR", ForeignEO.getStandYear());
//使用初始化的属性字段映射 获得key值,value为""
Map<String, String> mapField = standAttrMap;
SarStandardsInfo ForeignEO = parseImportDtoToStandardsInfo(item,mapField, standID);
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
if (ForeignEO != null) {
ForeignEO.setValidFlag("0");
ForeignEO.setStandType("FOREIGN");
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
standSaveWrapper
.eq("STAND_SORT", ForeignEO.getStandSort())
.eq("STAND_NUMBER", ForeignEO.getStandNumber())
.eq("STAND_YEAR", ForeignEO.getStandYear());
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
@@ -322,6 +363,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
try {
sarStandardsInfoService.updateSarStandardsInfo(ForeignEO);
HWBZcountUpdate.getAndIncrement();
HWBZcount.getAndIncrement();
System.out.println("海外标准执行更新===第: "+HWBZcount+"行");
} catch (Exception e) {
item.setErrorStr("标准更新失败");
error.add(item);
@@ -331,6 +375,8 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
} else {
try {
sarStandardsInfoService.createSarStandardsInfo(ForeignEO);
HWBZcount.getAndIncrement();
System.out.println("海外标准执行新增===第: "+HWBZcount+"行");
} catch (Exception e) {
item.setErrorStr("标准新增失败");
error.add(item);
@@ -340,72 +386,80 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
}
} else {
item.setErrorStr("标准号无法解析");
error.add(item);
} else {
item.setErrorStr("标准号无法解析");
error.add(item);
}
}
});
});*/
/**
* 国内标准
*/
importListMap.get("GNBZ").forEach(item -> {
String standID = UUIDUtils.randomUUID20();
//使用初始化的属性字段映射 获得key值,value为""
Map<String, String> mapStandField = standAttrMap;
SarStandardsInfo InlandEO = parseImportDtoToStandardsInfo(item, mapStandField,standID);
if (InlandEO != null) {
/*importListMap.get("GNBZ").forEach(item -> {
InlandEO.setValidFlag("0");
InlandEO.setStandType("INLAND");
if (true) {
String standID = UUIDUtils.randomUUID20();
//使用初始化的属性字段映射 获得key值,value为""
Map<String, String> mapStandField = standAttrMap;
SarStandardsInfo InlandEO = parseImportDtoToStandardsInfo(item, mapStandField, standID);
if (InlandEO != null) {
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
standSaveWrapper
.eq("STAND_SORT", InlandEO.getStandSort())
.eq("STAND_NUMBER", InlandEO.getStandNumber())
.eq("STAND_YEAR", InlandEO.getStandYear());
InlandEO.setValidFlag("0");
InlandEO.setStandType("INLAND");
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
if (one != null) {
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
standSaveWrapper
.eq("STAND_SORT", InlandEO.getStandSort())
.eq("STAND_NUMBER", InlandEO.getStandNumber())
.eq("STAND_YEAR", InlandEO.getStandYear());
InlandEO.setId(one.getId());
try {
sarStandardsInfoService.updateSarStandardsInfo(InlandEO);
} catch (Exception e) {
item.setErrorStr("国内标准更新失败");
error.add(item);
e.printStackTrace();
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
if (one != null) {
InlandEO.setId(one.getId());
try {
sarStandardsInfoService.updateSarStandardsInfo(InlandEO);
} catch (Exception e) {
item.setErrorStr("国内标准更新失败");
error.add(item);
e.printStackTrace();
}
} else {
try {
sarStandardsInfoService.createSarStandardsInfo(InlandEO);
} catch (Exception e) {
item.setErrorStr("国内标准新增失败");
error.add(item);
e.printStackTrace();
}
}
} else {
try {
sarStandardsInfoService.createSarStandardsInfo(InlandEO);
} catch (Exception e) {
item.setErrorStr("国内标准新增失败");
error.add(item);
e.printStackTrace();
}
item.setErrorStr("标准号无法解析");
error.add(item);
importListMap.replace("error", error);
}
} else {
item.setErrorStr("标准号无法解析");
error.add(item);
importListMap.replace("error", error);
}
});
});*/
/**
@@ -420,38 +474,61 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
listStandBussField.forEach(item->{
bussAttrMap.put(item,"");
});
importListMap.get("QYBZ").forEach(item -> {
String standId = UUIDUtils.randomUUID20();
SarBussionessStand BussEO = parseImportDtoToSarBussionessStand(item, bussAttrMap,standId);
if (BussEO != null) {
try {
QueryWrapper<SarBussionessStand> saveWrapper = new QueryWrapper<>();
saveWrapper.eq("STAND_CODE", item.getStandId());
SarBussionessStand one = sarBussionessStandService.getOne(saveWrapper);
if (one != null) {
BussEO.setId(one.getId());
sarBussionessStandService.updateSarBussionessStand(BussEO);
} else {
sarBussionessStandService.createSarBussionessStand(BussEO);
if (true){
// if (item.getStandId().contains("Q/FT T396—2021") ){
String standId = UUIDUtils.randomUUID20();
SarBussionessStand BussEO = parseImportDtoToSarBussionessStand(item, bussAttrMap,standId);
if (BussEO != null) {
try {
QueryWrapper<SarBussionessStand> saveWrapper = new QueryWrapper<>();
saveWrapper.eq("STAND_CODE", item.getStandId());
SarBussionessStand one = sarBussionessStandService.getOne(saveWrapper);
if (one != null) {
BussEO.setId(one.getId());
sarBussionessStandService.updateSarBussionessStand(BussEO);
QYBZcountUpdate.getAndIncrement();
QYBZcount.getAndIncrement();
System.out.println("企业标准执行更新====第: "+QYBZcount+"");
} else {
sarBussionessStandService.createSarBussionessStand(BussEO);
QYBZcount.getAndIncrement();
System.out.println("企业标准执行新增第: "+QYBZcount+"");
}
} catch (Exception e) {
item.setErrorStr("数据格式错误");
error.add(item);
e.printStackTrace();
}
} catch (Exception e) {
item.setErrorStr("数据格式错误");
error.add(item);
e.printStackTrace();
}
}
});
error.addAll(fileError);
System.out.println("执行结束");
System.out.println("执行国内标准"+GNBZcount+"");
System.out.println("国内标准执行更新"+GNBZcountUpdate+"");
System.out.println("执行国外标准"+HWBZcount+"");
System.out.println("海外标准执行更新"+HWBZcountUpdate+"");
System.out.println("执行企业标准"+QYBZcount+"");
System.out.println("企业标准执行更新"+QYBZcountUpdate+"");
return error;
}
@@ -464,13 +541,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
* @return
*/
public SarStandardsInfo parseImportDtoToStandardsInfo(ImportDto importDto,Map<String,String> fieldMap, String standId) {
HashMap<String, String> analysis = analysisStandId(importDto);
if (analysis == null) {
return null;
}
SarStandardsInfo sarStandardsInfoEO = new SarStandardsInfo();
sarStandardsInfoEO.setId(standId);
@@ -507,21 +581,21 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
if (importDto.getPath() != null) {
String path[] = importDto.getPath().split("/");
String realPath = "";
for (int i = 4; i < path.length; i++) {
for (int i = 3; i < path.length; i++) {
realPath = realPath + "/" + path[i];
}
try {
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\" + realPath);
// File file = new File(importPath + realPath);
File file = new File("/home/file/2021/" + realPath);
File file = new File("/data/from12/Attach_swf_bak" + realPath);
if (file.exists()) {
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
if (importDto.getImplementedTime() != null) {
fieldMap.put("FBGJBD", fileInfo.getAttId());
fieldMap.put("FBGBJBD", fileInfo.getAttId());
} else {
fieldMap.put("GLWJ", fileInfo.getAttId());
}
@@ -585,16 +659,16 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
if (importDto.getPath() != null) {
String path[] = importDto.getPath().split("/");
String realPath = "";
for (int i = 4; i < path.length; i++) {
for (int i = 3; i < path.length; i++) {
realPath = realPath + "/" + path[i];
}
try {
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\" + realPath);
// File file = new File(importPath + realPath);
File file = new File("/home/file/2021/" + realPath);
File file = new File("/data/from12/Attach_swf_bak" + realPath);
if (file.exists()) {
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
@@ -639,12 +713,14 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
*/
public HashMap<String, String> analysisStandId(ImportDto importDto) {
HashMap<String, String> result = new HashMap<>();
if (importDto.getStandId() == null) {
String standId = importDto.getStandId();
if (standId == null) {
importDto.setErrorStr("标准号为空");
error.add(importDto);
return null;
} else {
String standId = importDto.getStandId();
// String standId = importDto.getStandId();
//格式 非空格字符+空格+非空格字符+‘-’或‘—’或空格+年份 如Q/FT F003—2001
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
if (!pattern.matcher(standId).matches()) {
@@ -656,7 +732,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
String sort = "";
String number = "";
String year = "";
String[] split = importDto.getStandId().split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
String[] split = standId.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
// 多种格式(╯‵□′)╯︵┻━┻ Q-FL T015-2021 Q/ FL T015-2021 Q/FL T015-2021
@@ -670,25 +746,27 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
result.put("sort", sort);
result.put("number", number);
result.put("year", year);
//标准类别不存在,新增标准类别
List<DicTypeEO> isExist = dicTypeEOService.getTypeIdByDicIdAndTypeName("JKSADFH564S", null, sort, null);
if (isExist == null || isExist.isEmpty() || isExist.size()==0){
DicTypeEO dicTypeVO = new DicTypeEO();
dicTypeVO.setId(null);
dicTypeVO.setDicId("JKSADFH564S");
dicTypeVO.setDicTypeCode(sort);
dicTypeVO.setDicTypeName(sort);
dicTypeVO.setShowIndex(1);
Integer dicTypeEO = dicTypeEOService.saveDictype(dicTypeVO);
if (dicTypeEO>0){
importDto.setErrorStr("标准类别不存在,已新增");
}else {
importDto.setErrorStr("标准类别不存在,新增失败");
}
error.add(importDto);
}
/**
* 标准类别不存在,新增标准类别
*/
// List<DicTypeEO> isExist = dicTypeEOService.getTypeIdByDicIdAndTypeName("JKSADFH564S", null, sort, null);
// if (!sarSort.contains(sort)){
//
// DicTypeEO dicTypeVO = new DicTypeEO();
// dicTypeVO.setId(null);
// dicTypeVO.setDicId("JKSADFH564S");
// dicTypeVO.setDicTypeCode(sort);
// dicTypeVO.setDicTypeName(sort);
// dicTypeVO.setShowIndex(1);
// Integer dicTypeEO = dicTypeEOService.saveDictype(dicTypeVO);
// if (dicTypeEO>0){
// sarSort.add(sort);
// importDto.setErrorStr("标准类别不存在,已新增");
// }else {
// importDto.setErrorStr("标准类别不存在,新增失败");
// }
// error.add(importDto);
// }
@@ -2,6 +2,7 @@ package com.adc.da.slrs.SarCompStatusInfo.dao;
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author super_liu
* @since 2021-06-21
*/
@Repository
public interface SarCompStatusInfoDao extends BaseMapper<SarCompStatusInfo> {
}
@@ -194,6 +194,16 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
return Result.success(result);
}
@ApiOperation(value = "|SarBussionessStandEO|详情")
@GetMapping("/getStandInfoUpdateById")
//@RequiresPermissions("lawss:sarStandardsInfo:get")
public ResponseMessage<SarBussionessStand> getStandInfoUpdateById(String id) throws Exception {
SarBussionessStand result = sarBussionessStandEOService.selectStandardsInfoUpdateByKey(id);
String collectId = personCollectEOService.queryCollectByUserAndId(id);
result.setCollectId(collectId);
return Result.success(result);
}
/**
* 给指定标准配置目录
* @param standardsInfoEO
@@ -30,6 +30,8 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
SarBussionessStand selectStandardsInfoByKey(String id) throws Exception;
SarBussionessStand selectStandardsInfoUpdateByKey(String id) throws Exception;
SarBussionessStandEOPage updateStandardsMenu(SarBussionessStandEOPage standardsInfoEO);
List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage);
@@ -35,6 +35,7 @@ import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
@@ -60,6 +61,7 @@ import org.springframework.stereotype.Service;
import java.sql.Clob;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
@@ -218,7 +220,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
if (StringUtils.isNotBlank(sarBussionessStandEO.getStandYear())) {
number += "-" + sarBussionessStandEO.getStandYear();
}
String content = "新增" + number + "" + sarBussionessStandEO.getStandName() + "";
String content = "入库" + number + "" + sarBussionessStandEO.getStandName() + "";
sarUpdLogEOService.createBaseLog(sarBussionessStandEO.getId(),"BUSINESS",content);
if(elasflag) {
attrInfoShowSearchDetails(sarBussionessStandEO,"add");
@@ -277,7 +279,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
page.setUserId(LoginUserUtil.getUserId());
}
List<SarBussionessStand> getList = sarBussionessStandEODao.getSarBussionessStand(page);
attrInfoShow(getList);
attrInfoShowExport(getList);
return getList;
}
@@ -330,6 +332,55 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
}
}
public void attrInfoShowExport (List<SarBussionessStand> sarlist) throws Exception {
for(SarBussionessStand row : sarlist){
attrInfoDetailsExport(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
Map<String, Object> getNewMap = new LinkedHashMap<>();
if (getAttrMap != null && getAttrMap.size() > 0) {
String svppsTip = "";
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
if ("SVPPS".equals(name)) {
Object svpps = entry.getValue();
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
svppsTip = svpps.toString();
}
if (StringUtils.isNotBlank(svppsTip)) {
svppsTip = sysInfoEOService.getSvppsNamesTipByIds(svppsTip);
}
value = String.valueOf(getAttrMap.get("SVPPSName"));
entry.setValue(value);
} else if (entry.getValue() != null && InitStandAttrUtil.fileFieldListBuss != null && InitStandAttrUtil.fileFieldListBuss.size() > 0 && InitStandAttrUtil.fileFieldListBuss.contains(name)) {
value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
entry.setValue(fileObj);
}
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
if("ZYQCR".equals(name)||"QTQCR".equals(name)){
if(getAttrMap.get(name + "Name")!=null && !getAttrMap.get(name + "Name").equals("")){
value = String.valueOf(getAttrMap.get(name + "Name"));
}
}else{
value = String.valueOf(getAttrMap.get(name + "Name"));
}
} else {
List<String> valArr = Arrays.asList(value.split(","));
value = dicTypeEODao.getDicNamesByCodes(valArr);
}
entry.setValue(value);
}
}
getAttrMap.put("SVPPSTips",svppsTip);
}
}
}
public SarBussionessStand updateSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception {
String standId = sarBussionessStandEO.getId();
SarBussionessStand beforeStandEO = this.baseMapper.selectByPrimaryKey(standId);
@@ -708,6 +759,19 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
return sarBussionessStandEO;
}
@Override
public SarBussionessStand selectStandardsInfoUpdateByKey(String id) throws Exception{
List<SarBussionessStand> sarBussionessStandlist = this.baseMapper.selectStandardsInfoByKey(id);
SarBussionessStand sarBussionessStandEO = new SarBussionessStand();
if(!sarBussionessStandlist.isEmpty()) {
List<SarBussionessStand> newStandList = new ArrayList<>();
newStandList.add(sarBussionessStandlist.get(0));
attrInfo(newStandList);
sarBussionessStandEO = newStandList.get(0);
}
return sarBussionessStandEO;
}
public void attrInfoShowDetails(List<SarBussionessStand> sarlist) throws Exception {
for (SarBussionessStand row : sarlist) {
attrInfoDetails(row);
@@ -802,7 +866,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
Integer rowCount = this.baseMapper.getBussionessStandInfoCount(page);
page.getPager().setRowCount(rowCount);
List<SarBussionessStand> sarlist = this.baseMapper.getBussionessStandInfoPage(page);
attrInfo(sarlist);
attrInfoCollect(sarlist);
return sarlist;
}
@@ -817,6 +881,17 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
}
}
public void attrInfoCollect (List<SarBussionessStand> sarlist) throws Exception {
List<String> collectResIds = sarlist.stream().map(SarBussionessStand::getId).collect(Collectors.toList());
Map<String,String> collectMap = personCollectEOService.queryCollectByUserAndIds(collectResIds);
for (SarBussionessStand row : sarlist) {
if(collectMap != null && collectMap.get(row.getId()) != null){
row.setCollectId(collectMap.get(row.getId()));
}
}
}
public void attrInfo1 (SarBussionessStand row) throws Exception {
String fieldInfo = InitStandAttrUtil.queryFieldBuss;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
@@ -839,10 +914,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
public void attrInfoShowSearchDetails(SarBussionessStand row,String type) throws Exception {
if (row != null) {
attrInfoSearchDetails(row,type);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
Map<String, Object> getAttrMap = row.getAttrInfoCaseMap();
if (getAttrMap != null && getAttrMap.size() > 0) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String name = entry.getKey().toUpperCase();
String value = "";
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
@@ -939,13 +1014,55 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
if (value1 != null && value1.toString().equals("\"null\"")){
entry.setValue("");
}
if ("SVPPS".equals(name)) {
Object value = entry.getValue();
if (value != null && StringUtils.isNotBlank(value.toString())) {
value = sysInfoEOService.getSvppsNamesByIds(value.toString());
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
String value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getOrgNamesByIds(value);
newMap.put(name + "Name",value);
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getUserNamesByIds(value);
newMap.put(name + "Name",value);
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
value = sysInfoEOService.getRoleNamesByIds(value);
newMap.put(name + "Name",value);
}
newMap.put(name + "Name",value);
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
}
}
getAttrMap.putAll(newMap);
}
if (getAttrMap != null && !getAttrMap.isEmpty()) {
row.setAttrInfoCaseMap(transformUpperCase(getAttrMap));
}
row.setAttrInfoMap(getAttrMap);
}
}
public void attrInfoDetailsExport (SarBussionessStand row) throws Exception {
String fieldInfo = InitStandAttrUtil.queryFieldBuss;
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarBussStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId());
if (InitStandAttrUtil.clobFieldListBuss != null && !InitStandAttrUtil.clobFieldListBuss.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldListBuss) {
Clob clobValue = (Clob) getAttrMap.get(clobField);
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
getAttrMap.put(clobField,fieldValue);
}
}
// 组织机构和人员
Map<String,Object> newMap = new HashMap<>();
if(getAttrMap != null){
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
Object value1 = entry.getValue();
if (value1 != null && value1.toString().equals("\"null\"")){
entry.setValue("");
}
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
String value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
@@ -93,6 +93,14 @@ public class TsInstitutionController extends BaseController<TsInstitution> {
}
@ApiOperation("通过部门机构名称查询部门树形结构 废弃使用")
@GetMapping("/findInstitution")
public List<TsInstitution> findInstitution(String institutionName){
//TODO 调用业务接口
tsInstitutionService.findInstitutionTreeByName(institutionName);
return null;
}
public static void main(String[] args) {
// System.out.println(json);
}
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarInstitution.dao;
import com.adc.da.slrs.sarInstitution.entity.InstitutionAndUser;
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@@ -29,7 +30,7 @@ public interface TsInstitutionDao extends BaseMapper<TsInstitution> {
List<TsInstitution> selectNextUser(String institutionId);
List<TsInstitution> selectTreeByIds(@Param("rootIds") List<String> rootIds);
/**
* 查询最高级机构及其人员
@@ -11,6 +11,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@@ -73,4 +75,12 @@ public class TsInstitution extends BaseEntity {
this.parentId = parentId;
this.name = name;
}
// public void addChildren(TsInstitution node){
// if (this.children==null){
// this.children=Arrays.asList(node);
// }else {
// this.children.add(node);
// }
// }
}
@@ -43,5 +43,13 @@ public interface ITsInstitutionService extends IService<TsInstitution> {
*/
public List<TsInstitution> getFirst();
/**
* 根据机构部门名称查询机构树
* @param institutionName
* @return
*/
public List<TsInstitution> findInstitutionTreeByName(String institutionName);
int clearData();
}
@@ -6,6 +6,7 @@ import com.adc.da.slrs.sarInstitution.entity.SyncInstitution;
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
import com.adc.da.slrs.sarInstitution.entity.TsUserVO;
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
import com.adc.da.slrs.sarInstitution.util.TreeUtil;
import com.adc.da.sync.service.SyncUserService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@@ -15,8 +16,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
@@ -38,17 +39,21 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
*/
@Override
public List<TsInstitution> getInstitution() {
List<TsInstitution> institutionList = this.list();//查询所有的的数据
//查询第一层机构
List<TsInstitution> institutionRoot=tsInstitutionDao.selectRoot();
for(TsInstitution tsInstitution:institutionRoot){
tsInstitution.setChildren(recursionGetInstitution(tsInstitution));
}
return institutionRoot;
List<TsInstitution> root=tsInstitutionDao.selectRoot();
TreeUtil treeUtil = new TreeUtil();
List<TsInstitution> institutionTree = treeUtil.treeAsList(institutionList, root);
return institutionTree;
}
/**
* 递归获取子机构
* @param tsInstitution:父机构
@@ -109,21 +114,29 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
*/
@Override
public List<TsInstitution> getInstitutionAndUser(String userName) {
//查询第一层机构
List<TsInstitution> institutionRoot=tsInstitutionDao.selectRootAndUser(userName);
List<TsInstitution> tsInstitutions = new ArrayList<>();
//把查到的数据结构修改,把用户放
for(TsInstitution tsInstitution:institutionRoot){
tsInstitution.setDisabled(true);
tsInstitution.setChildren( recursionGetInstitutionAndUser(tsInstitution) );
for(TsUserVO user:tsInstitution.getUsers()){
if(tsInstitution.getChildren()==null){
tsInstitution.setChildren(new ArrayList<>());
//当条件为null时避免查询全部,直接返回第一级
if (userName==null||userName==""){
tsInstitutions=this.getFirst();
}else {
//查询第一层机构
tsInstitutions=tsInstitutionDao.selectRootAndUser(userName);
//把查到的数据结构修改,把用户放
for(TsInstitution tsInstitution:tsInstitutions){
tsInstitution.setDisabled(true);
// tsInstitution.setChildren( recursionGetInstitutionAndUser(tsInstitution) );
for(TsUserVO user:tsInstitution.getUsers()){
if(tsInstitution.getChildren()==null){
tsInstitution.setChildren(new ArrayList<>());
}
// tsInstitution.getChildren().add(user);
}
tsInstitution.getChildren().add(user);
}
}
return institutionRoot;
return tsInstitutions;
}
/**
@@ -213,6 +226,27 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
return tsInstitutions;
}
@Override
public List<TsInstitution> findInstitutionTreeByName(String institutionName) {
QueryWrapper<TsInstitution> tsInstitutionQuery = new QueryWrapper<>();
tsInstitutionQuery.select("id")
.like("name",institutionName);
/**
* 查询出id的数据集合并转换成String类型
*/
List<String> rootIds = this.listObjs(tsInstitutionQuery)
.stream()
.map(item -> item.toString())
.collect(Collectors.toList());
List<TsInstitution> tsInstitutions = tsInstitutionDao.selectTreeByIds(rootIds);
return null;
}
@Override
public int clearData() {
return tsInstitutionDao.clearData();
@@ -0,0 +1,132 @@
package com.adc.da.slrs.sarInstitution.util;
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.stream.Collectors;
@Component
public class TreeUtil {
public List<TsInstitution> treeAsList(List<TsInstitution> institutionList,List<TsInstitution> rootList){
//转换为hashSet
List<String> root = rootList.stream()
.map(item -> item.getId())
.collect(Collectors.toList());
HashSet<String> rootSet = new HashSet<>(root);
//获取父节点,0表示父节点
List<TsInstitution> tree = institutionList.stream()
.filter(e -> rootSet.contains(e.getId()))
.map(e -> {
List<TsInstitution> childNode = getChildNode(e, institutionList);
e.setChildren(new ArrayList<>(childNode));
return e;
}).collect(Collectors.toList());
return tree;
}
/**
* 递归查询子节点
* @param root
* @param contentKnowledgeList
* @return
*/
private List<TsInstitution> getChildNode(TsInstitution root, List<TsInstitution> contentKnowledgeList) {
List<TsInstitution> childrenList = contentKnowledgeList.stream()
.filter(e -> Objects.equals(e.getParentId(), root.getId()))
.map(e -> {
List<TsInstitution> childNode = getChildNode(e, contentKnowledgeList);
e.setChildren(new ArrayList<>(childNode));
return e;
}
).collect(Collectors.toList());
return childrenList;
}
// public List<TsInstitution> getChildAsHash(TsInstitution root, Map<String, TsInstitution> hashInstitution){
// String id = root.getId();
// if (hashInstitution.containsKey(id)){
//
// }
// return null;
// }
// //TODO 利用HashMap组装树结构
//
// public List<TsInstitution> treeAsHash(List<TsInstitution> institutionList,List<TsInstitution> rootList) {
//
// Map<String, TsInstitution> idMap = institutionList.stream()
// .collect(Collectors.toMap(TsInstitution::getId, tsInstitution -> tsInstitution));
//
// Map<String, TsInstitution> pid_institution = institutionList.stream()
// .collect(Collectors.toMap(TsInstitution::getParentId, institution -> institution));
//
// for (TsInstitution institution : rootList) {
//
// String id = institution.getId();
// if (pid_institution.containsKey(id)) {
// institution.addChildren(pid_institution.get(id));
//
// }
//
// }
//
//
// Set<String> rootSet = rootList.stream()
// .map(TsInstitution::getId)
// .collect(Collectors.toSet());
//
// Iterator<TsInstitution> it = institutionList.iterator();
//
// ArrayList<TsInstitution> resultList = new ArrayList<>();
//
//
// HashMap<String, TsInstitution> id_obj = new HashMap<>();
// while (it.hasNext()) {
// TsInstitution next = it.next();
//
// String parentId = next.getParentId();
// id_obj.put(next.getId(), next);
// if (rootSet.contains(parentId)) {
// id_obj.put(next.getId(), next);
// } else if (id_obj.containsKey(parentId)) {
// id_obj.get(parentId).addChildren(next);
// }
//
// }
// return null ;
//
// }
//
//
//
// List<TreeNodeDTO> list = dbMapper.getNodeList();
// ArrayList<TreeNodeDTO> rootNodes = new ArrayList<>();
// Map<Integer, TreeNodeDTO> map = new HashMap<>();
// for (TreeNodeDTO node :list) {
// map.put(node.getId(), node);
// Integer parentId = node.getParentId();
// // 判断是否有父节点 (没有父节点本身就是个父菜单)
// if (parentId.equals('0')){
// rootNodes.add(node);
// // 找出不是父级菜单的且集合中包括其父菜单ID
// } else if (map.containsKey(parentId)){
// map.get(parentId).getChildren().add(node);
// }
// }
//
// }
}
@@ -143,7 +143,13 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
}
}
}
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
/**
* 当""时索引异常
*/
String completedString="";
if (!"".equals(builder.toString())){
completedString = builder.delete(builder.length()-1,builder.length()).toString();
}
list1.setZRBM(completedString);
}
else {
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Map;
@@ -15,6 +16,7 @@ import java.util.Map;
* @author super_liu
* @since 2021-06-04
*/
@Repository
public interface SarLawsAttrInfoDao extends BaseMapper<SarLawsAttrInfo> {
void deleteLawsAttr(@Param("fieldInfo") String fieldInfo);
@@ -3,12 +3,16 @@ package com.adc.da.slrs.sarLawsAttrInfo.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
/**
* <p>
@@ -43,68 +47,80 @@ public class SarLawsAttrInfo extends BaseEntity {
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
private LocalDateTime creationTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
private LocalDateTime modifyTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
@TableField("SYCLLX")
private String sycllx;
@TableField("SSRQLAWS")
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String ssrqlaws;
@TableField("SVPPS")
private String svpps;
@TableField("XCXSSRQLAWS")
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String xcxssrqlaws;
@TableField("XCXSSRQ")
private String xcxssrq;
@TableField("ZCXSSRQLAWS")
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String zcxssrqlaws;
@TableField("ZCCSSRQ")
private String zccssrq;
@TableField("ZCWBLAWS")
private String zcwblaws;
@TableField("EOPSSRQ")
private String eopssrq;
@TableField("GCWBLAWS")
private String gcwblaws;
@TableField("XGBM")
private String xgbm;
@TableField("JDWJLAWS")
private String jdwjlaws;
@TableField("ZRBM")
private String zrbm;
@TableField("FBJGLAWS")
private String fbjglaws;
@TableField("FO")
private String fo;
@TableField("CYSDLAWS")
private String cysdlaws;
@TableField("ZRLX")
private String zrlx;
@TableField("TGRLAWS")
private String tgrlaws;
@TableField("YQLX")
private String yqlx;
@TableField("TGDWLAWS")
private String tgdwlaws;
@TableField("GXHBQ")
private String gxhbq;
@TableField("NYLXLAWS")
private String nylxlaws;
@TableField("ZCGCS")
private String zcgcs;
@TableField("YYRZLAWS")
private String yyrzlaws;
@TableField("GKGLBM")
private String gkglbm;
@TableField("ZRBMLAWS")
private String zrbmlaws;
@TableField("FBJG")
private String fbjg;
@TableField("ZRGCSLAWS")
private String zrgcslaws;
@TableField("WSSFCY")
private String wssfcy;
@TableField("DTWJHLAWS")
private String dtwjhlaws;
@TableField("ZCWB")
private String zcwb;
@TableField("BDTWJHLAWS")
private String bdtwjhlaws;
@TableField("GCGJ")
private String gcgj;
@TableField("GLWJ")
private String glwj;
@TableField("YYBZZCLAWS")
private String yybzzclaws;
@TableField("XGLC")
private String xglc;
@TableField("CHJLLAWS")
private String chjllaws;
@TableField("GLWJLAWS")
private String glwjlaws;
}
@@ -13,4 +13,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISarLawsAttrInfoService extends IService<SarLawsAttrInfo> {
String selectFieldValByLawsId(String field,String standId);
int updateLawsInfo(String standId,String field,String value);
}
@@ -17,4 +17,13 @@ import org.springframework.stereotype.Service;
@Service
public class SarLawsAttrInfoServiceImpl extends ServiceImpl<SarLawsAttrInfoDao, SarLawsAttrInfo> implements ISarLawsAttrInfoService {
@Override
public String selectFieldValByLawsId (String field,String standId) {
return this.baseMapper.selectFieldValByLawsId(field,standId);
}
@Override
public int updateLawsInfo(String standId,String field,String value){
return this.baseMapper.updateLawsInfo(standId,field,value);
}
}
@@ -0,0 +1,23 @@
package com.adc.da.slrs.sarLawsFile.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsFile|")
@RequestMapping("/sarLawsFile/sar-laws-file")
public class SarLawsFileController extends BaseController<SarLawsFile> {
}
@@ -0,0 +1,40 @@
package com.adc.da.slrs.sarLawsFile.dao;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsFileDao extends BaseMapper<SarLawsFile> {
List<SarLawsFile> selectFileBylawsId(String lawsId);
List<SarLawsFile> selectFileBylawsIdAndId(SarLawsFile laws);
List<SarLawsFile> selectFileByAttId(String attId);
List<SarLawsFile> selectFileMsgByAttId(String attId);
List<SarLawsFile> selectFileByResId(SarLawsFile sarBussStandFileEO);
int deleteBylawsId(String standId);
int insertForeach(List<SarLawsFile> list); //批量新增
int insertSelective(SarLawsFile sarBussStandFile);
int updateByPrimaryKeySelective(SarLawsFile sarBussStandFile);
int deleteByPrimaryKey(String value);
}
@@ -0,0 +1,98 @@
package com.adc.da.slrs.sarLawsFile.entity;
import com.adc.da.base.entity.BaseEntity;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsFile对象", description="")
public class SarLawsFile extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableField("ID")
private String id;
@ApiModelProperty(value = "政策ID")
@TableField("LAWS_ID")
private String lawsId;
@ApiModelProperty(value = "政策文件分类")
@TableField("LAWS_FILE_CLASSIFY")
private String lawsFileClassify;
@ApiModelProperty(value = "文件主键")
@TableField("ATT_ID")
private String attId;
@ApiModelProperty(value = "文件名称")
@TableField("FILE_NAME")
private String fileName;
@ApiModelProperty(value = "文件后缀")
@TableField("FILE_SUFFIX")
private String fileSuffix;
@ApiModelProperty(value = "使用模式(SOURCE_FILE原文件,WEB_FILE转换后文件)")
@TableField("USE_MODEL")
private String useModel;
@ApiModelProperty(value = "加密密码")
@TableField("PASSWORD")
private String password;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
@ApiModelProperty(value = "转换原文件id")
@TableField("ORI_ATT_ID")
private String oriAttId;
@TableField(exist = false)
private List<String> idList = new ArrayList<>();
@TableField(exist = false)
private String useModule;
@TableField(exist = false)
private String resId;
@TableField(exist = false)
private Integer pageCount;
@TableField(exist = false)
private String fileOldName;
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsFile.service;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsFileService extends IService<SarLawsFile> {
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsFile.service.impl;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
import com.adc.da.slrs.sarLawsFile.service.ISarLawsFileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsFileServiceImpl extends ServiceImpl<SarLawsFileDao, SarLawsFile> implements ISarLawsFileService {
}
@@ -2,9 +2,12 @@ package com.adc.da.slrs.sarLawsInfo.dao;
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
@@ -15,6 +18,7 @@ import java.util.List;
* @author super_liu
* @since 2021-06-01
*/
@Repository
public interface SarLawsInfoDao extends BaseMapper<SarLawsInfo> {
Integer selectLawsColumn(@Param("columnName") String columnName);
@@ -22,4 +26,85 @@ public interface SarLawsInfoDao extends BaseMapper<SarLawsInfo> {
List<SarLawsInfo> queryByPage(SarLawsInfoEOPage page);
Integer queryByCount(SarLawsInfoEOPage page);
/**
* @return com.adc.da.lawss.entity.SarLawsInfo
* @Author yangxuenan
* @Description 通过id查询详细信息
* Date 2018/9/21 16:42
* @Param [id]
**/
SarLawsInfo selectInfoById(String id);
/**
* @return java.util.List<com.adc.da.lawss.entity.SarLawsInfo>
* @Author yangxuenan
* @Description 分页查询配置法规
* Date 2018/9/30 17:02
* @Param [page]
**/
List<SarLawsInfo> queryConfigLawsByPage(SarLawsInfoEOPage page);
int queryConfigLawsByCount(SarLawsInfoEOPage page);
//liwenxuan:标准法规更新数量及清单:国内法规
Integer selectCounterLawsCountINLAND(Date visitTime);
//liwenxuan:标准法规更新数量及清单:国内法规All
Integer selectCounterLawsCountINLANDAll();
//liwenxuan:标准法规更新数量及清单:国外法规
Integer selectCounterLawsCountFOREIGN(Date visitTime);
//liwenxuan:标准法规更新数量及清单:国外法规All
Integer selectCounterLawsCountFOREIGNAll();
/**
* 功能描述: 通过文件号查询详细信息
*
* @param: [Number]
* @return: com.adc.da.lawss.entity.SarLawsInfo
* @auther: SYT
* @date: 2018/10/11 20:34
*/
List<SarLawsInfo> selectInfoByNumber(@Param("number") String number, @Param("resName") String resName, @Param("type") String type);
/**
* 搜索中心查询相关推荐
*
* @param:
* @auther: gaoyan
* @date: 2018/11/10 9:22
*/
List<RecommendVO> selectRecommendLaws(SarLawsInfoEOPage pagenew);
List<RecommendVO> selectCloseLaws(SarLawsInfoEOPage pagenew);
/**
* 功能描述: 查询所有小于当前时间的即将实施的条目
*
* @param: [lawsEO]
* @return: java.util.List<com.adc.da.lawss.entity.SarLawsInfo>
* @auther: SYT
* @date: 2018/11/16 15:24
*/
List<SarLawsInfo> queryByPutTimeList(SarLawsInfo lawsEO);
int updateSarStandReplaced(SarLawsInfo lawsInfoEO);
int updateRelacedNumByNumber(SarLawsInfoEOPage lawsInfoEO);
List<SarLawsInfo> selectLawsInfoByIdAndRole(SarLawsInfoEOPage lawsEOPage);
int queryByCountForES(SarLawsInfoEOPage lawsEOPage);
List<SarLawsInfo> queryByPageForES(SarLawsInfoEOPage lawsEOPage);
int updateByPrimaryKeyForSynchron(SarLawsInfo SarLawsInfo);
int deleteByPrimaryKeyFlag(String id);
SarLawsInfo selectByPrimaryKeyAndTime(SarLawsInfo lawsEO);
}
@@ -0,0 +1,23 @@
package com.adc.da.slrs.sarLawsItemVal.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsItemVal|")
@RequestMapping("/sarLawsItemVal/sar-laws-item-val")
public class SarLawsItemValController extends BaseController<SarLawsItemVal> {
}
@@ -0,0 +1,18 @@
package com.adc.da.slrs.sarLawsItemVal.dao;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsItemValDao extends BaseMapper<SarLawsItemVal> {
}
@@ -0,0 +1,59 @@
package com.adc.da.slrs.sarLawsItemVal.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsItemVal对象", description="")
public class SarLawsItemVal extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "法规条目ID")
@TableField("LAWS_ITEM_ID")
private String lawsItemId;
@ApiModelProperty(value = "参数类型")
@TableField("PROPERTY_TYPE")
private String propertyType;
@ApiModelProperty(value = "参数内容")
@TableField("PROPERTY_VAL")
private String propertyVal;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private BigDecimal validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
private LocalDateTime creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
private LocalDateTime modifyTime;
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsItemVal.service;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsItemValService extends IService<SarLawsItemVal> {
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsItemVal.service.impl;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao;
import com.adc.da.slrs.sarLawsItemVal.service.ISarLawsItemValService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsItemValServiceImpl extends ServiceImpl<SarLawsItemValDao, SarLawsItemVal> implements ISarLawsItemValService {
}
@@ -2,10 +2,12 @@ package com.adc.da.slrs.sarLawsItems.dao;
import com.adc.da.slrs.sarLawsInfo.page.SarLawsItemsEOPage;
import com.adc.da.slrs.sarLawsItems.entity.SarLawsItems;
import com.adc.da.slrs.sarStandItems.entity.FindSarItemsPageReqDTO;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.sarStandItems.page.SarStandItemsEOPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Set;
@@ -18,11 +20,16 @@ import java.util.Set;
* @author super_liu
* @since 2021-06-02
*/
@Repository
public interface SarLawsItemsDao extends BaseMapper<SarLawsItems> {
List<SarLawsItems> querySarItemAndInterpretation(FindSarItemsPageReqDTO page);
Set<String> selectClaimTypesByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
Set<String> selectSvppsByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
List<SarLawsItems> queryByList(SarLawsItemsEOPage page);
int deleteByStandIdAndFileType(@Param("standId") String standId, @Param("fileType") String fileType);
}
@@ -2,6 +2,8 @@ package com.adc.da.slrs.sarLawsItems.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
@@ -122,6 +124,16 @@ public class SarLawsItems extends BaseEntity {
@TableField("FILE_TYPE")
private String fileType;
@ApiModelProperty(value = "新车型实施日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField("XCXSSRQLAWS")
private Date xcxssrqlaws;
@ApiModelProperty(value = "在产车实施日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField("ZCXSSRQLAWS")
private Date zcxssrqlaws;
@TableField(exist = false)
private String applyArcticShow;
@TableField(exist = false)
@@ -155,5 +167,20 @@ public class SarLawsItems extends BaseEntity {
@TableField(exist = false)
private String wczrsh;
@TableField(exist = false)
private String emergyKindShow;
//新加字段
@TableField(exist = false)
private String foUser;//FO
//新加字段带show
@TableField(exist = false)
private String oldId;
@TableField(exist = false)
private SarCompStatusInfo pgForm;
//责任工程师
@TableField(exist = false)
private String responsibleEngineer;
}
@@ -0,0 +1,81 @@
package com.adc.da.slrs.sarLawsMenu.controller;
import com.adc.da.slrs.sarBussStandMenu.service.ISarBussStandMenuService;
import com.adc.da.slrs.sarLawsMenu.service.ISarLawsMenuService;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.sys.util.UUIDUtils;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsMenu|")
@RequestMapping("/${restPath}/lawss/sarLawsMenu")
public class SarLawsMenuController extends BaseController<SarLawsMenu> {
@Autowired
private ISarLawsMenuService lawsMenuService;
@Autowired
private ITsResourceService sarMenuEOService;
@ApiOperation(value = "|SarBussStandMenuEO|修改")
@PutMapping("/removeStandInfo")
// @RequiresPermissions("lawss:sarStandMenu:update")
public ResponseMessage removeStandInfo(@RequestBody SarLawsMenu standardsInfoEO) throws Exception {
String[] idList = standardsInfoEO.getIdlist();
int count = 0;
if(idList != null){
for(String id : idList){
SarLawsMenu menuEO = new SarLawsMenu();
menuEO.setLawsId(id);
menuEO.setMenuId(standardsInfoEO.getMenuId());
//删除所选目录下关联
String oldMenuId = standardsInfoEO.getOldMenuId();
if (StringUtils.isEmpty(oldMenuId)) {
oldMenuId = standardsInfoEO.getMenuId();
}
menuEO.setOldMenuId(oldMenuId);
count += lawsMenuService.deleteByMenuId(menuEO);
//查询是否还有与其他节点的关联,若没有则增加与根节点的关联
List<SarLawsMenu> getList = lawsMenuService.selectAllMenuByStandId(menuEO);
if (getList == null || getList.isEmpty()) {
// 查询根节点
TsResource sarMenuEO = new TsResource();
sarMenuEO.setSorDivide("LAWS_STAND");
List<TsResource> getRootMenu = sarMenuEOService.queryMenuByDis(sarMenuEO);
menuEO.setMenuId(getRootMenu.get(0).getId());
menuEO.setId(UUIDUtils.randomUUID20());
menuEO.setValidFlag(0);
lawsMenuService.save(menuEO);
}
}
}
if(count>0){
return Result.success("0","移除成功!",true);
} else {
return Result.error("移除失败!");
}
}
}
@@ -0,0 +1,37 @@
package com.adc.da.slrs.sarLawsMenu.dao;
import com.adc.da.slrs.sarBussStandMenu.entity.NewmenuOldmenuVO;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsMenuDao extends BaseMapper<SarLawsMenu> {
List<SarLawsMenu> selectByLawsInfo(SarLawsMenu sarLawsMenuEO);
int updateMenuidByMenuid(NewmenuOldmenuVO var1);
List<SarLawsMenu> selectByLawsId(String lawsId);
void deleteByLawsId(String lawsId);
List<SarLawsMenu> selectMenuByMenuParentId(SarLawsMenu sarLawsMenuEO);
int updateByLawsIdAndMenuId(SarLawsMenu sarLawsMenuEO);
int deleteByLawsIdAndMenuId(SarLawsMenu sarLawsMenuEO);
List<SarLawsMenu> selectAllMenuByStandId(SarLawsMenu sarStandMenuEO);
int deleteByMenuId(SarLawsMenu sarLawsMenuEO);
}
@@ -0,0 +1,57 @@
package com.adc.da.slrs.sarLawsMenu.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsMenu对象", description="")
public class SarLawsMenu extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "法规ID")
@TableField("LAWS_ID")
private String lawsId;
@ApiModelProperty(value = "目录ID")
@TableField("MENU_ID")
private String menuId;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@TableField(exist = false)
private String oldMenuId;
@TableField(exist = false)
private String[] idlist;
@TableField(exist = false)
private List<String> menuIds;
}
@@ -0,0 +1,87 @@
package com.adc.da.slrs.sarLawsMenu.entity;
import com.adc.da.sys.common.BasePage;
/**
* <b>功能:</b>SAR_LAWS_MENU SarLawsMenuEOPage<br>
* <b>作者:</b>code generator<br>
* <b>日期:</b> 2018-09-03 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/
public class SarLawsMenuEOPage extends BasePage {
private String validFlag;
private String validFlagOperator = "=";
private String menuId;
private String menuIdOperator = "=";
private String lawsId;
private String lawsIdOperator = "=";
private String id;
private String idOperator = "=";
public String getValidFlag() {
return this.validFlag;
}
public void setValidFlag(String validFlag) {
this.validFlag = validFlag;
}
public String getValidFlagOperator() {
return this.validFlagOperator;
}
public void setValidFlagOperator(String validFlagOperator) {
this.validFlagOperator = validFlagOperator;
}
public String getMenuId() {
return this.menuId;
}
public void setMenuId(String menuId) {
this.menuId = menuId;
}
public String getMenuIdOperator() {
return this.menuIdOperator;
}
public void setMenuIdOperator(String menuIdOperator) {
this.menuIdOperator = menuIdOperator;
}
public String getLawsId() {
return this.lawsId;
}
public void setLawsId(String lawsId) {
this.lawsId = lawsId;
}
public String getLawsIdOperator() {
return this.lawsIdOperator;
}
public void setLawsIdOperator(String lawsIdOperator) {
this.lawsIdOperator = lawsIdOperator;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getIdOperator() {
return this.idOperator;
}
public void setIdOperator(String idOperator) {
this.idOperator = idOperator;
}
}
@@ -0,0 +1,22 @@
package com.adc.da.slrs.sarLawsMenu.service;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsMenuService extends IService<SarLawsMenu> {
List<SarLawsMenu> selectAllMenuByStandId(SarLawsMenu sarStandMenuEO);
int deleteByMenuId (SarLawsMenu sarStandMenuEO);
}
@@ -0,0 +1,37 @@
package com.adc.da.slrs.sarLawsMenu.service.impl;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.adc.da.slrs.sarLawsMenu.dao.SarLawsMenuDao;
import com.adc.da.slrs.sarLawsMenu.service.ISarLawsMenuService;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsMenuServiceImpl extends ServiceImpl<SarLawsMenuDao, SarLawsMenu> implements ISarLawsMenuService {
@Autowired
private ITsResourceService sarMenuEOService;
public int deleteByMenuId (SarLawsMenu sarStandMenuEO){
List<String> menuIds = sarMenuEOService.getChildMenuList(sarStandMenuEO.getOldMenuId());
sarStandMenuEO.setMenuIds(menuIds);
return this.baseMapper.deleteByMenuId(sarStandMenuEO);
}
@Override
public List<SarLawsMenu> selectAllMenuByStandId(SarLawsMenu sarStandMenuEO){
return this.baseMapper.selectAllMenuByStandId(sarStandMenuEO);
}
}
@@ -0,0 +1,304 @@
package com.adc.da.slrs.sarLawsStandInfo.controller;
import com.adc.da.common.ReadExcel;
import com.adc.da.excel.poi.excel.ExcelExportUtil;
import com.adc.da.exception.AdcDaBaseException;
import com.adc.da.person.service.IPersonCollectEOService;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
import com.adc.da.http.PageInfo;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandardsInfo.entity.StandardsInfoExcelVO;
import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.sys.entity.DicTypeEO;
import com.adc.da.sys.service.IDicTypeEOService;
import com.adc.da.util.utils.StringUtils;
import com.adc.da.utils.util.LawsStandExportUtil;
import com.adc.da.utils.util.SarAdvanceSearchUtil;
import com.adc.da.utils.util.StandExportUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@RestController
@Api(description = "|SarLawsStandInfo|")
@RequestMapping("/${restPath}/lawss/sarLawsInfo")
public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo> {
private static final Logger logger = LoggerFactory.getLogger(SarLawsStandInfoController.class);
@Autowired
private ISarLawsStandInfoService sarLawsInfoEOService;
@Autowired
private IPersonCollectEOService personCollectEOService;
@Autowired
private ITsResourceService iTsResourceService;
@Autowired
private ITsUserService tsUserService;
@Autowired
private IDicTypeEOService dicTypeEOService;
@ApiOperation(value = "|SarLawsInfoEO|分页查询")
@GetMapping("/page")
/*@RequiresPermissions("lawss:sarLawsInfo:page")*/
public ResponseMessage<PageInfo<SarLawsStandInfo>> page(SarLawsStandInfoPage page) throws Exception {
if (null != page.getNowOrderBy()) {
switch (page.getNowOrderBy()) {
case 1:
page.setOrderByA("a.issueTime");//发布日期
break;
case 2:
page.setOrderByA("SAR_LAWS_ATTR_INFO.XCXSSRQLAWS");//新车型实施日期
break;
case 3:
page.setOrderByA("SAR_LAWS_ATTR_INFO.ZCXSSRQLAWS");//在产车实施日期
break;
case 4:
page.setOrderByA("a.LAWS_TEXT_STATE");//文本状态
break;
case 5:
page.setOrderByA("paixu");
break;
case 6:
page.setOrderByA("SAR_LAWS_ATTR_INFO.SSRQ");
break;
default:
page.setNowOrder(null);
break;
}
if (null != page.getNowOrder()) {
switch (page.getNowOrder()) {
case 1:
page.setOrder1("desc");
break;
case 2:
page.setOrder1("asc");
default:
page.setOrder1(null);
break;
}
}
}
if (com.adc.da.util.utils.StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
String advanceStr = SarAdvanceSearchUtil.createSql(searchList,"SAR_LAWS_ATTR_INFO");
if (StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
page.setAdvanceSearchStr(null);
}
}
List<SarLawsStandInfo> rows = sarLawsInfoEOService.getSarStandardsInfoPage(page);
return Result.success(getPageInfo(page.getPager(), rows));
}
@ApiOperation(value = "|SarLawsInfoEO|分页查询")
@GetMapping("/pageLaws")
/*@RequiresPermissions("lawss:sarLawsInfo:page")*/
public ResponseMessage<PageInfo<SarLawsStandInfo>> pageLaws(SarLawsStandInfoPage page) throws Exception {
if (null != page.getNowOrderBy()) {
switch (page.getNowOrderBy()) {
case 1:
page.setOrderByA("a.issueTime");//发布日期
break;
case 2:
page.setOrderByA("SAR_LAWS_ATTR_INFO.XCXSSRQLAWS");//新车型实施日期
break;
case 3:
page.setOrderByA("SAR_LAWS_ATTR_INFO.ZCXSSRQLAWS");//在产车实施日期
break;
case 4:
page.setOrderByA("a.LAWS_TEXT_STATE");//文本状态
break;
case 5:
page.setOrderByA("paixu");
break;
case 6:
page.setOrderByA("SAR_LAWS_ATTR_INFO.SSRQ");
break;
default:
page.setNowOrder(null);
break;
}
if (null != page.getNowOrder()) {
switch (page.getNowOrder()) {
case 1:
page.setOrder1("desc");
break;
case 2:
page.setOrder1("asc");
default:
page.setOrder1(null);
break;
}
}
}
if (com.adc.da.util.utils.StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
String advanceStr = SarAdvanceSearchUtil.createSql(searchList,"SAR_LAWS_ATTR_INFO");
if (StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
page.setAdvanceSearchStr(null);
}
}
List<SarLawsStandInfo> rows = sarLawsInfoEOService.getSarStandardsInfoPageBak(page);
return Result.success(getPageInfo(page.getPager(), rows));
}
@ApiOperation(value = "|SarLawsStandInfo|详情")
@GetMapping("/getStandInfoById")
//@RequiresPermissions("lawss:sarStandardsInfo:get")
public ResponseMessage<SarLawsStandInfo> find(String id) throws Exception {
SarLawsStandInfo result = sarLawsInfoEOService.selectStandardsInfoByKey(id);
return Result.success(result);
}
@ApiOperation(value = "|SarLawsStandInfo|详情")
@GetMapping("/getStandInfoUpdateById")
//@RequiresPermissions("lawss:sarStandardsInfo:get")
public ResponseMessage<SarLawsStandInfo> getStandInfoUpdateById(String id) throws Exception {
SarLawsStandInfo result = sarLawsInfoEOService.selectStandardsInfoUpdateByKey(id);
String collectId = personCollectEOService.queryCollectByUserAndId(id);
result.setCollectId(collectId);
return Result.success(result);
}
@ApiOperation(value = "|SarLawsStandInfo|导出excel")
@GetMapping(value = "/exportStandardsInfoExcel")
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
HttpServletRequest request) throws Exception {
OutputStream os = null;
Workbook workbook = null;
try {
if(StringUtils.isEmpty(exportName)||exportName.equals("null")){
exportName="政策库";
}
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
response.setContentType("application/force-download");
// 导出所有数据
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
workbook = LawsStandExportUtil.exportDatas(data);
os = response.getOutputStream();
workbook.write(os);
os.flush();
} catch (IOException e) {
logger.error(e.getMessage(), e);
throw new AdcDaBaseException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
}
@ApiOperation(value = "|SarLawsStandInfo|确认配置标准")
@PostMapping("/saveStandardsMenu")
//@RequiresPermissions("lawss:sarBussionessStand:saveStandardsMenu")
public ResponseMessage saveStandardsMenu(@RequestBody SarLawsStandInfoPage standardsInfoEO){
if ("wdsc".equals(standardsInfoEO.getMenuId()) || "gxhbq".equals(standardsInfoEO.getMenuId())) {
return Result.error("所选节点不支持配置标准");
} else {
SarLawsStandInfoPage standlist = sarLawsInfoEOService.updateStandardsMenu(standardsInfoEO);
return Result.success(standardsInfoEO);
}
}
@ApiOperation(value = "|SarLawsStandInfo|企业标准修改")
@PostMapping(value = "/updateSarLawsStandInfo")
public ResponseMessage<SarLawsStandInfo> updateSarLawsStandInfo(@RequestBody SarLawsStandInfo sarLawsStandInfo) throws Exception {
sarLawsStandInfo.setModifyTime(new Date());
sarLawsInfoEOService.updateSarLawsStandInfo(sarLawsStandInfo);
return Result.success("","修改成功",sarLawsStandInfo);
}
@ApiOperation(value = "|SarLawsStandInfo|删除")
@PostMapping("deleteSarLawsStandInfo")
public ResponseMessage delete(String ids) throws Exception {
SarLawsStandInfoPage sarLawsStandInfoPage = new SarLawsStandInfoPage();
sarLawsStandInfoPage.setIdlist(ids.split(","));
ResponseMessage<SarLawsStandInfo> result = sarLawsInfoEOService.deleteSarLawsStandInfo(sarLawsStandInfoPage);
logger.info("delete from SAR_BUSSIONESS_STAND where id = {}", ids);
return result;
}
/**
* 新增过程中验证标准号
*
* @param page
* @return
*/
@ApiOperation(value = "|SarLawsStandInfo|验证输入的标准号")
@PostMapping("/validateStandNumber")
//@RequiresPermissions("lawss:sarStandardsInfo:selectReplaceStandNum")
public ResponseMessage validateStandNumber(SarLawsStandInfoPage page) throws Exception {
String sortName = "";
String standNumShow = "";
List<DicTypeEO> getDicCode = dicTypeEOService.getDicEOByDicTypeCode(page.getStandSort());
if(getDicCode!= null && getDicCode.size()>0){
sortName = getDicCode.get(0).getDicTypeName();
}
if (StringUtils.isNotEmpty(page.getLawsNumber())) {
List<SarLawsStandInfo> standlist = sarLawsInfoEOService.selectStandardsByStandNumber(page.getLawsNumber());
if (standlist.size() > 0) {
if (StringUtils.isNotEmpty(page.getId())) {
// 如果是修改,判断id是否一样
for (int i = 0; i < standlist.size(); i++) {
if (standlist.get(i).getId().equals(page.getId())) {
continue;
} else {
return Result.error(standNumShow + "政策编号已存在");
}
}
return Result.success();
} else {
return Result.error(standNumShow + "政策编号已存在");
}
} else {
return Result.success();
}
} else {
return Result.success();
}
}
}
@@ -0,0 +1,30 @@
package com.adc.da.slrs.sarLawsStandInfo.dao;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Repository
public interface SarLawsStandInfoDao extends BaseMapper<SarLawsStandInfo> {
List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page);
int getSarStandardsInfoCount(SarLawsStandInfoPage page);
List<SarLawsStandInfo> selectStandardsInfoByKey(String id);
List<SarLawsStandInfo> getSarStandardsExportInfo(SarLawsStandInfoPage page);
}
@@ -0,0 +1,261 @@
package com.adc.da.slrs.sarLawsStandInfo.entity;
import com.adc.da.att.vo.AttFileVo;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.standardSplit.entity.SarStandAttrDetailsEO;
import com.adc.da.sys.entity.DicTypeEO;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import oracle.sql.DATE;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsStandInfo对象", description="")
public class SarLawsStandInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "政策分类 共四级,逐级选择-配置管理中维护")
@TableField("LAWS_TYPE")
private String lawsType;
@ApiModelProperty(value = "政策编号")
@TableField("LAWS_NUMBER")
private String lawsNumber;
@ApiModelProperty(value = "中文名称")
@TableField("LAWS_NAME")
private String lawsName;
@ApiModelProperty(value = "英文名称")
@TableField("LAWS_EN_NAME")
private String lawsEnName;
@ApiModelProperty(value = "政策文号")
@TableField("LAWS_NO")
private String lawsNo;
@ApiModelProperty(value = "发文日期")
@TableField("ISSUE_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTime;
@ApiModelProperty(value = "发文单位")
@TableField("ISSUE_COMPANY")
private String issueCompany;
@ApiModelProperty(value = "征集意见周期-起始时间")
@TableField("COMMENT_CYCLE_START")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleStart;
@ApiModelProperty(value = "征集意见周期-结束时间")
@TableField("COMMENT_CYCLE_END")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleEnd;
@ApiModelProperty(value = "文件状态-配置管理中维护")
@TableField("LAWS_TEXT_STATE")
private String lawsTextState;
@ApiModelProperty(value = "适用区域-配置管理中维护")
@TableField("LAWS_SYQY")
private String lawsSyqy;
@ApiModelProperty(value = "适用车型-配置管理中维护")
@TableField("LAWS_SYCX")
private String lawsSycx;
@ApiModelProperty(value = "是/否(选择否,只有政策、政策中文名称是必填项目)")
@TableField("IS_RELATE_ACCESS")
private String isRelateAccess;
@ApiModelProperty(value = "年度-可在配置管理中维护,根据发布日期自动带入可手动修改")
@TableField("LAWS_YEAR")
private String lawsYear;
@ApiModelProperty(value = "福田转发通知文号")
@TableField("LAWS_NOTISYNC_NUM")
private String lawsNotisyncNum;
@ApiModelProperty(value = "信息简报 xxx期次xxx板块")
@TableField("LAWS_BULLETIN")
private String lawsBulletin;
@ApiModelProperty(value = "标签-可在配置管理中维护")
@TableField("LAWS_LABEL")
private String lawsLabel;
@ApiModelProperty(value = "备注")
@TableField("LAWS_REMARK")
private String lawsRemark;
@ApiModelProperty(value = "国家地区")
@TableField("COUNTRY")
private String country;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
@ApiModelProperty(value = "参数1")
@TableField("PARAM1")
private Long param1;
@ApiModelProperty(value = "参数2")
@TableField("PARAM2")
private String param2;
// 非表字段
@ApiModelProperty(value = "代替文件号")
@TableField(exist = false)
private String replaceFileNum;
@ApiModelProperty(value = "被代替文件号")
@TableField(exist = false)
private String replacedFileNum;
@TableField(exist = false)
private String processNum;//流程编号
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private String firstPutTime;
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String putTimeShow;
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTimeShow;
@TableField(exist = false)
private String issueTimeStr;
@TableField(exist = false)
private String putTimeStr;
//目录ID 非标准信息表中的字段
@TableField(exist = false)
private String menuId;
@TableField(exist = false)
private String menuParentId;
@TableField(exist = false)
private String standStatusShow; // 标准状态下拉框 --单选
@TableField(exist = false)
private String standNatrueShow;
@TableField(exist = false)
private String standSortShow;
@TableField(exist = false)
private String applyCountryShow;
@TableField(exist = false)
private List<AttFileVo> standFileList = new ArrayList<AttFileVo>();
@TableField(exist = false)
private List<AttFileVo> opinionFilesList = new ArrayList<AttFileVo>();
@TableField(exist = false)
private List<AttFileVo> relevanceFileList = new ArrayList<AttFileVo>();
@TableField(exist = false)
private String collectId;
//文件的类型
@TableField(exist = false)
private String standFileClassify;
//文件的下载id
@TableField(exist = false)
private String attId;
//记录是否修改了替代文件号
@TableField(exist = false)
private int upReplaceNumFlag;
//记录是否修改了文件号
@TableField(exist = false)
private int upNumFlag;
// 数据库新加的字段
@TableField(exist = false)
private String remark;//备注
@TableField(exist = false)
private Map<String, Object> attrInfoMap = new LinkedHashMap<>(); //属性表字段与值
@TableField(exist = false)
private Map<String, Object> attrInfoCaseMap = new LinkedHashMap<>(); //属性表字段与值小写前端带入渲染
@TableField(exist = false)
private String sarStandAttrEOStr; //新增修改时属性表信息
@TableField(exist = false)
private String fileIds; //全部文件ID
@TableField(exist = false)
private List<SarStandAttrDetailsEO> attrInfoList = new ArrayList<>();
@TableField(exist = false)
private String standTextStatusShow; // 标准文本状态显示名称
// 以下为非表中字段
@TableField(exist = false)
private String countryShow; //国家地区显示名称
@TableField(exist = false)
private String standStateShow; // 标准状态显示名称
@TableField(exist = false)
private String standNatureShow; // 标准性质显示名称
@TableField(exist = false)
private List<DicTypeEO> dicTypeList = new ArrayList(); // 记录标准涉及到的所有数据字典数据
@TableField(exist = false)
private List<SarStandItems> itemsList = new ArrayList<>();
@ApiModelProperty(value = "分解单条款内容")
@TableField(exist = false)
private Map<String,String> mapItems = new TreeMap<>();
}
@@ -0,0 +1,277 @@
package com.adc.da.slrs.sarLawsStandInfo.entity;
import com.adc.da.base.entity.BaseEntity;
import com.adc.da.base.page.BasePage;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import oracle.sql.DATE;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Data
public class SarLawsStandInfoPage extends BasePage {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "政策分类 共四级,逐级选择-配置管理中维护")
private String lawsType;
@ApiModelProperty(value = "政策编号")
private String lawsNumber;
@ApiModelProperty(value = "中文名称")
private String lawsName;
@ApiModelProperty(value = "英文名称")
private String lawsEnName;
@ApiModelProperty(value = "政策文号")
private String lawsNo;
@ApiModelProperty(value = "发文日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTime;
@ApiModelProperty(value = "发文单位")
private String issueCompany;
@ApiModelProperty(value = "征集意见周期-起始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleStart;
@ApiModelProperty(value = "征集意见周期-结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleEnd;
@ApiModelProperty(value = "文件状态-配置管理中维护")
private String lawsTextState;
@ApiModelProperty(value = "适用区域-配置管理中维护")
private String lawsSyqy;
@ApiModelProperty(value = "适用车型-配置管理中维护")
private String lawsSycx;
@ApiModelProperty(value = "是/否(选择否,只有政策、政策中文名称是必填项目)")
private String isRelateAccess;
@ApiModelProperty(value = "年度-可在配置管理中维护,根据发布日期自动带入可手动修改")
private String lawsYear;
@ApiModelProperty(value = "福田转发通知文号")
private String lawsNotisyncNum;
@ApiModelProperty(value = "信息简报 xxx期次xxx板块")
private String lawsBulletin;
@ApiModelProperty(value = "标签-可在配置管理中维护")
private String lawsLabel;
@ApiModelProperty(value = "备注")
private String lawsRemark;
@ApiModelProperty(value = "国家地区")
private String country;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "是否有效")
private String validFlag;
@ApiModelProperty(value = "创建时间")
private String creationTime;
@ApiModelProperty(value = "修改时间")
private String modifyTime;
@ApiModelProperty(value = "参数1")
private String param1;
@ApiModelProperty(value = "参数2")
private String param2;
private String[] commentCycleDate;
private String modifyTime1;
private String modifyTime2;
private String modifyTimeOperator = "=";
private String creationTime1;
private String creationTime2;
private String creationTimeOperator = "=";
private String validFlagOperator = "=";
private String putUser;
private String putUserOperator = "=";
private String citationUser;
private String citationUserOperator = "=";
private String responsibleUnit;
private String responsibleUnitOperator = "=";
private String standFile;
private String standFileOperator = "=";
private String tags;
private String tagsOperator = "=";
private String standStatus;
private String standStatusOperator = "=";
private String replacedStandNum;
private String replacedStandNumOperator = "=";
private String replaceStandNum;
private String replaceStandNumOperator = "=";
private String quoteStand;
private String quoteStandOperator = "=";
private String firstPutTime;
private String firstPutTime1;
private String firstPutTime2;
private String firstPutTimeOperator = "=";
private String putYear;
private String putYear1;
private String putYear2;
private String putYearOperator = "=";
private String putTime;
private String putTime1;
private String putTime2;
private String putTimeOperator = "=";
private String issueTime1;
private String issueTime2;
private String issueTimeOperator = "=";
private String energyKind;
private String energyKindOperator = "=";
private String applyArctic;
private String applyArcticOperator = "=";
private String standEnName;
private String standEnNameOperator = "=";
private String standName;
private String standNameOperator = "=";
private String standCode;
private String standCodeOperator = "=";
private String classifyCode;
private String classifyCodeOperator = "=";
private String standSubclass;
private String standSubclassOperator = "=";
private String standGenera;
private String standGeneraOperator = "=";
private String idOperator = "=";
private String menuId;
private List<String> menuIdList;
private String[] idlist;
//为了在sql中区分修改操作
private String updateFlag;
// 数据库新增字段
private String applyCountry;
private String standYear;
private String applyCountryOperator = "=";
private String standNature;
private String standNatureOperator = "=";
private String synopsis;
private String synopsisOperator = "=";
private String standSort;
private String standSortOperator = "=";
private String opinionFile;
private String opinionFileOperator = "=";
private String relevanceFile;
private String relevanceFileOperator = "=";
private String remark;
private String remarkOperator = "=";
private List<String> roleIds;
private String rootMenuId;
private String orgName;
private List<String> menuRoleList;
private String[] replacedStandNumList;
private String numberName;
// 树结构增加搜索条件
private String collectMenuId;
private String advanceSearchVOStr;
private String advanceSearchStr;
private List<String> menuAllChildrenIdList;
private String userId;
private String zqcrId;
private String textStatusBuss;
// 新增字段
private String FZRQBUSS;
private String FSRQBUSS;
private String FBGBUSS;
private String BZSMBUSS;
private String LSBBBUSS;
private String QTWJBUSS;
private String QCDW;
private String QCRBUSS;
private String WJSCRYBUSS;
private String SYCXCLASS;
private String NYLXCLASS;
private String SYCPXCLASS;
private String TXLBBUSS;
private String VPPSBMBUSS;
private String VPPSCNBUSS;
private String DTQBBHBUSS;
private String BDTQBBHBUSS;
private String XGJLBUSS;
private String XGLC;
private String GLWJBUSS;
private String XCSJBUSS;
private String SSRQLAWS;
private String XCXSSRQLAWS;
private String ZCXSSRQLAWS;
private String ZCWBLAWS;
private String GCWBLAWS;
private String JDWJLAWS;
private String FBJGLAWS;
private String CYSDLAWS;
private String TGRLAWS;
private String TGDWLAWS;
private String NYLXLAWS;
private String YYRZLAWS;
private String ZRBMLAWS;
private String ZRGCSLAWS;
private String DTWJHLAWS;
private String BDTWJHLAWS;
private String YYBZZCLAWS;
private String CHJLLAWS;
private String GLWJLAWS;
//页面排序
private String paixu;
private String shunxu;
private String sql;
// 树结构增加搜索条件
@TableField(exist = false)
private String labelMenuId;
@TableField(exist = false)
private String ids;
@TableField(exist = false)
private String proType;
@TableField(exist = false)
private Integer nowOrder;
@TableField(exist = false)
private Integer nowOrderBy;
@TableField(exist = false)
private String orderByA = "a.issue_time";
@TableField(exist = false)
private String orderBy1 = "SAR_LAWS_STAND_INFO.issue_time";
@TableField(exist = false)
private String order1 = "desc";
}
@@ -0,0 +1,45 @@
package com.adc.da.slrs.sarLawsStandInfo.service;
import com.adc.da.http.ResponseMessage;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
public interface ISarLawsStandInfoService extends IService<SarLawsStandInfo> {
void createSarStandardsInfo(SarLawsStandInfo sarLawsStandInfo) throws Exception;
void attrInfoDetails (SarLawsStandInfo row) throws Exception;
List<SarLawsStandInfo> selectStandardsByStandNumber(String replaceStandNum);
ResponseMessage<SarLawsStandInfo> deleteSarLawsStandInfo(SarLawsStandInfoPage page) throws Exception;
SarLawsStandInfo updateSarLawsStandInfo(SarLawsStandInfo sarLawsStandInfo) throws Exception;
SarLawsStandInfoPage updateStandardsMenu(SarLawsStandInfoPage standardsInfoEO);
List<SarLawsStandInfo> getExportData(String exportType, String exportContent,String userId) throws Exception;
List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page) throws Exception;
List<SarLawsStandInfo> getSarStandardsInfoPageBak(SarLawsStandInfoPage page) throws Exception;
SarLawsStandInfo selectStandardsInfoByKey(String id) throws Exception;
SarLawsStandInfo selectStandardsInfoUpdateByKey(String id) throws Exception;
}
@@ -0,0 +1,23 @@
package com.adc.da.slrs.sarLawsVal.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsVal|")
@RequestMapping("/sarLawsVal/sar-laws-val")
public class SarLawsValController extends BaseController<SarLawsVal> {
}
@@ -0,0 +1,24 @@
package com.adc.da.slrs.sarLawsVal.dao;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsValDao extends BaseMapper<SarLawsVal> {
//通过标准id删除表中数据
int deleteDataBylawsId(String standId);
int insertForeach(List<SarLawsVal> list); //批量新增
}
@@ -0,0 +1,64 @@
package com.adc.da.slrs.sarLawsVal.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsVal对象", description="")
public class SarLawsVal extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "法规ID")
@TableField("LAWS_ID")
private String lawsId;
@ApiModelProperty(value = "参数类型")
@TableField("PROPERTY_TYPE")
private String propertyType;
@ApiModelProperty(value = "参数内容")
@TableField("PROPERTY_VAL")
private String propertyVal;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsVal.service;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsValService extends IService<SarLawsVal> {
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsVal.service.impl;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.adc.da.slrs.sarLawsVal.dao.SarLawsValDao;
import com.adc.da.slrs.sarLawsVal.service.ISarLawsValService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsValServiceImpl extends ServiceImpl<SarLawsValDao, SarLawsVal> implements ISarLawsValService {
}
@@ -3,13 +3,10 @@ package com.adc.da.slrs.sarModelTree.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarModelTree.entity.ResponseResult;
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
import com.adc.da.slrs.sarModelTree.service.impl.SarModuleTreeServiceImpl;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Company;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.ResponseDto;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -42,7 +39,7 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
@GetMapping("/list")
public ResponseMessage<List<SarModelTree>> getAll(){
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
// List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
return Result.success(tsResources);
}
@@ -1,7 +1,7 @@
package com.adc.da.slrs.sarModelTree.service;
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import java.util.List;
@@ -4,7 +4,7 @@ import com.adc.da.slrs.sarModelTree.dao.SarModuleTreeDao;
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@@ -25,27 +26,38 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
@Autowired()
private SarModuleTreeServiceImpl sarModuleTreeService;
/**
* @param sarModelTree
* @return 所有的根节点
*/
@Override
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.groupBy("FTVSTYPE1");
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
//把SarModuleTree类型的list集合转换为SarModelTree类型的list集合
List<SarModelTree> sarModelTreeList = moduleTreeList.stream().map(SarModuleTree -> {
SarModelTree modelTree = new SarModelTree();
modelTree.setId(SarModuleTree.getGuid());
modelTree.setName(SarModuleTree.getFtvstype1());
// modelTree.setModel("TS"+SarModuleTree.get);
return modelTree;
}).collect(Collectors.toList());
return sarModelTreeList;
//返回转换元素后的数组
return listTransform(moduleTreeList);
}
/**
* 根据根节点查询其所有的子节点
* @param parent
* @return
*/
@Override
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.eq("GUID",parent.getId());
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1));
collect.forEach((k, v)->{
SarModelTree modelTree = new SarModelTree();
//TODO 生成树型结构
// modelTree
});
return null;
}
@@ -93,5 +105,25 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
return head;
}
/**
* 把SarModuleTree类型的list集合转换为SarModelTree类型的list集合,这样就不用修改前端代码( ̀ ω ́ )
* --->对修改关闭,对扩展开放
* @param moduleTreeList
* @return
*/
public List<SarModelTree> listTransform(List<SarModuleTree> moduleTreeList){
return moduleTreeList.stream().map(SarModuleTree -> {
SarModelTree modelTree = new SarModelTree();
modelTree.setId(SarModuleTree.getGuid());
modelTree.setName(SarModuleTree.getFtvstype1());
modelTree.setModel("TS"
+SarModuleTree.getFtvstype2().substring(SarModuleTree.getFtvstype2().length()-2)
+SarModuleTree.getSeriesid()
+SarModuleTree.getReserved()
+SarModuleTree.getStarted()); //"TS"+SF_ID+SE_ID+SU_ID 拼接模块编号ID
return modelTree;
}).collect(Collectors.toList());
}
}
@@ -57,6 +57,14 @@ public interface TsPositionDao extends BaseMapper<TsPosition> {
*/
List<TsPosition> selectPositionAndRole(TsPosition tsPosition);
/**
* 总数
* @param tsPosition
* @return
*/
Integer countPositionAndRole(TsPosition tsPosition);
/**
* 通过岗位列表查询绑定的角色列表
* @param positionIds岗位列表
@@ -44,9 +44,10 @@ public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition
@Override
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
IPage page=new Page();
page.setTotal(tsPositionDao.pageTotal());
// page.setTotal(tsPositionDao.pageTotal());
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
page.setRecords(tsPositionDao.selectPositionAndRole(tsPosition));
page.setTotal(page.getTotal());
page.setCurrent(tsPosition.getCurrent());
page.setSize(tsPosition.getPageSize());
System.out.println(page.getTotal());
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarResource.dao;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
@@ -14,6 +15,7 @@ import java.util.List;
* @author zyl
* @since 2021-06-30
*/
@Repository
public interface TsResourceDao extends BaseMapper<TsResource> {
List<TsResource> queryMenuByDis(TsResource sarMenuEO);
@@ -151,6 +151,10 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
tsResourceQueryWrapper.eq("sor_divide",tsResource.getSorDivide());
}
tsResourceQueryWrapper.isNull("PARENT_ID");
List<String> list = new ArrayList<>();
list.add("INLAND_STAND");
list.add("FOREIGN_STAND");
tsResourceQueryWrapper.notIn("SOR_DIVIDE",list);
tsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
List<TsResource> TsResources=dao.selectList(tsResourceQueryWrapper);
for(TsResource TsResource:TsResources){
@@ -181,7 +185,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
TsResources=dao.selectList(tsResourceQueryWrapper);
for(TsResource TsResource:TsResources){
TsResource.setChildren(recursionGetListChildren((TsResource),(getMenuIdList)));
TsResource.setChildren(recursionGetListChildren((tsResource.getSorDivide()),(TsResource),(getMenuIdList)));
}
}
}
@@ -287,14 +291,18 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
* @param parent父节点
* @return List<TsResource>
*/
private List<TsResource> recursionGetListChildren(TsResource parent,List<String> getMenuIdList){
private List<TsResource> recursionGetListChildren(String sorDivide,TsResource parent,List<String> getMenuIdList){
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
TsResourceQueryWrapper.eq("PARENT_ID",parent.getId());
TsResourceQueryWrapper.in("ID",getMenuIdList);
if(StringUtils.isNotBlank(sorDivide)){
if(!sorDivide.equals("INLAND_STAND") && !sorDivide.equals("FOREIGN_STAND")){
TsResourceQueryWrapper.in("ID",getMenuIdList);
}
}
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
for(TsResource TsResource:children){
TsResource.setChildren(recursionGetListChildren((TsResource),(getMenuIdList)));
TsResource.setChildren(recursionGetListChildren((sorDivide),(TsResource),(getMenuIdList)));
}
return children;
}
@@ -77,6 +77,8 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
// 政策属性字段
List<SarStandAttrDetails> getLawsStandList = InitStandAttrUtil.lawsStandAttrFieldList;
resultMap.put(SarTypeEnum.LAWS_STAND.getValue(),getLawsStandList);
List<SarStandAttrDetails> getInlandLawsList = InitStandAttrUtil.lawsInlandAttrFieldList;
resultMap.put(SarTypeEnum.INLAND_LAWS.getValue(),getInlandLawsList);
List<SarStandAttrDetails> getForeignLawsList = InitStandAttrUtil.lawsForeignAttrFieldList;
@@ -66,6 +66,7 @@ public class SarStandAttrDetailsServiceImpl extends ServiceImpl<SarStandAttrDeta
standTypeList.add(SarTypeEnum.INLAND_STAND.getValue());
standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue());
lawsTypeList.add(SarTypeEnum.LAWS.getValue());
lawsTypeList.add(SarTypeEnum.LAWS_STAND.getValue());
lawsTypeList.add(SarTypeEnum.INLAND_LAWS.getValue());
lawsTypeList.add(SarTypeEnum.FOREIGN_LAWS.getValue());
}
@@ -10,6 +10,7 @@ import com.adc.da.slrs.sarStandardsInfo.controller.SarStandardsInfoController;
import com.adc.da.slrs.sarStandardsInfo.entity.ActSarItemsEO;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -39,7 +40,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
@Autowired
private SarLawsAttrDetailedListDao sarLawsAttrDetailedListDao;
@Autowired
private SarStandardsInfoController sarStandardsInfoController;
private ISarStandardsInfoService sarStandardsInfoService;
@Autowired
private SarStandItemsDao sarStandItemsDao;
@@ -155,7 +156,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
page.setUserId(null);
List<SarStandardsInfo> pageInfo = null;
try {
pageInfo = sarStandardsInfoController.getSarStandardsInfoPage(page).getData().getList();
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
} catch (Exception e) {
e.printStackTrace();
}
@@ -2,17 +2,13 @@ package com.adc.da.slrs.sarStandProjectLibrary.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
import com.adc.da.slrs.sarStandProjectLibrary.service.impl.SarStandProjectLibraryServiceImpl;
import com.adc.da.sys.util.UUIDUtils;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@@ -21,8 +17,6 @@ import com.adc.da.base.web.BaseController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* <p>
@@ -50,7 +44,7 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
**/
@GetMapping("/queryProject")
@ApiOperation("车型/项目库")
public ResponseMessage queryMaintenanceProject(@RequestParam(defaultValue = "1", value = "Page")int Page, @RequestParam(defaultValue = "10", value = "PageSize") int PageSize,
public ResponseMessage queryMaintenanceProject(@RequestParam(defaultValue = "1", required=false,value = "page")int Page, @RequestParam(defaultValue = "10", required=false,value = "pageSize") int PageSize,
SarStandProjectLibraryDto sarDto) {
IPage<SarStandProjectLibrary> MaintenanceList = sarStandProjectLibraryService.queryMaintenanceProject(Page,PageSize,sarDto);
IPage<SarStandProjectLibrary> notMaintenanceList = sarStandProjectLibraryService.queryNotMaintenanceProject(Page,PageSize,sarDto);
@@ -231,13 +225,9 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
public ResponseDto save(@RequestBody String jsonStr){
log.info(jsonStr);
Head head = sarStandProjectLibraryService.AnalysisJsonAndStorage(jsonStr);
ArrayList<Company> companies = new ArrayList<>();
ResponseDto responseDto = new ResponseDto(head,companies);
//todo 未确定返回内容
Company company = new Company();
company.setCOMPANY_CODE("");
company.setFISCAL_YEAR("");
companies.add(company);
ResponseDto responseDto = new ResponseDto(head);
return responseDto;
}
}
@@ -1,10 +0,0 @@
package com.adc.da.slrs.sarStandProjectLibrary.entity;
import lombok.Data;
@Data
public class Company {
private String COMPANY_CODE;
private String FISCAL_YEAR;
}
@@ -74,7 +74,6 @@ public class SarStandProjectLibrary extends BaseEntity {
private String projectManager;
@ApiModelProperty(value = "项目经理名称")
@TableField(exist = false)
private String uName;
@@ -1,6 +1,7 @@
package com.adc.da.slrs.sarStandProjectLibrary.entity;
package com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse;
import com.adc.da.base.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -24,4 +25,30 @@ public class Head extends BaseEntity {
}
public Head(){};
@JsonProperty("BIZTRANSACTIONID")
public String getBIZTRANSACTIONID() {
return BIZTRANSACTIONID;
}
@JsonProperty("RESULT")
public String getRESULT() {
return RESULT;
}
@JsonProperty("ERRORCODE")
public String getERRORCODE() {
return ERRORCODE;
}
@JsonProperty("ERRORINFO")
public String getERRORINFO() {
return ERRORINFO;
}
@JsonProperty("COMMENTS")
public String getCOMMENTS() {
return COMMENTS;
}
@JsonProperty("SUCCESSCOUNT")
public String getSUCCESSCOUNT() {
return SUCCESSCOUNT;
}
}
@@ -0,0 +1,24 @@
package com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class MyResult {
// private String COMPANY_CODE;
//
// private String FISCAL_YEAR;
private String msg;
private String code;
private boolean success;
public MyResult(){
this.msg="";
this.code="";
this.success=true;
}
}
@@ -1,9 +1,10 @@
package com.adc.da.slrs.sarStandProjectLibrary.entity;
package com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Data
public class ResponseDto {
@@ -26,12 +27,19 @@ public class ResponseDto {
}
public ResponseDto(Head HEAD) {
ArrayList<Company> companies = new ArrayList<>();
Company company = new Company();
company.setCOMPANY_CODE("");
company.setFISCAL_YEAR("");
companies.add(company);
this.LIST=companies;
this.LIST=Arrays.asList(new MyResult());
this.HEAD=HEAD;
}
@JsonProperty("HEAD")
public Head getHEAD() {
return HEAD;
}
@JsonProperty("LIST")
public List<?> getLIST() {
return LIST;
}
}
@@ -1,6 +1,7 @@
package com.adc.da.slrs.sarStandProjectLibrary.service;
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
import com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.slrs.sarStandProjectLibrary.service.SarStandProjectLibraryService;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
@@ -75,25 +76,23 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
//把刚刚拿到的值存到实体类里
SarStandProjectLibrary projectInfo = new SarStandProjectLibrary();
projectInfo
.setProjectPlatfor(projectObject.get("projectPlatfor").getAsString())
.setProjectNumber(projectObject.get("projectNumber").getAsString())
.setProjectName(projectObject.get("projectName").getAsString())
.setProjectClassification(projectObject.get("projectClassification").getAsString())
.setProjectStatus(projectObject.get("projectStatus").getAsString())
.setProjectGroup(projectObject.get("projectGroup").getAsString())
.setCurrentNode(projectObject.get("currentNode").getAsString())
.setProjectLevel(projectObject.get("projectLevel").getAsString())
.setProductLine(projectObject.get("productLine").getAsString());
projectObject.get("projectEndDate").getAsString();
.setProjectPlatfor(projectObject.get("eng_platform").getAsString())
.setProjectNumber(projectObject.get("code").getAsString())
.setProjectName(projectObject.get("name").getAsString())
.setProjectClassification(projectObject.get("catalog_name").getAsString())
.setProjectStatus(projectObject.get("project_status").getAsString())
.setProjectGroup(projectObject.get("project_group_name").getAsString())
.setCurrentNode(projectObject.get("project_current_milestone").getAsString())
.setProjectLevel(projectObject.get("project_level").getAsString())
.setProductLine(projectObject.get("eng_product_line").getAsString());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date targetBeginOn = null;
try {
targetBeginOn = simpleDateFormat.parse(projectObject.get("projectStartDate").getAsString());
Date targetEndOn = simpleDateFormat.parse(projectObject.get("projectEndDate").getAsString());
try {
Date targetBeginOn = simpleDateFormat.parse(projectObject.get("target_begin_on").getAsString());
Date targetEndOn = simpleDateFormat.parse(projectObject.get("target_end_on").getAsString());
projectInfo
.setProjectStartDate(targetBeginOn)
.setProjectEndDate(targetEndOn);
@@ -251,8 +250,9 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
@Override
public IPage<SarStandProjectLibrary> queryProjectManager(int current, int pageSize) {
QueryWrapper<SarStandProjectLibrary> wrapper = new QueryWrapper<>();
wrapper.select("distinct product_line","sar_stand_project_library.project_manager as projectManager","s.uName");
wrapper.last("inner join ts_user s on s.USID = sar_stand_project_library.project_manager");
wrapper.select("product_line","s.user_id as projectManager","s.NAME AS uName");
wrapper.last("inner join sar_stand_project_team s on s.project_code = sar_stand_project_library.project_number" +
" and sar_stand_project_library.product_line IS not NULL");
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
IPage<SarStandProjectLibrary> userIPage = sarStandProjectLibraryDao.selectPage(page, wrapper);
System.out.println("总条数"+userIPage.getTotal());
@@ -436,6 +436,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
IPage<SarStandProjectLibrary> userIPage = new Page<>();
if (3!=flag) {
//6922
List<SarStandProjectLibrary> sarStandProjectLibraries = sarStandProjectLibraryDao.selectPages(current, pageSize, wrapper, flag);
Integer count = sarStandProjectLibraryDao.selectCount(wrapper, flag);
userIPage.setCurrent(current);
@@ -445,6 +446,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
return userIPage;
}
else {
//6922
flag=2;
List<SarStandProjectLibrary> sarStandProjectLibraries = sarStandProjectLibraryDao.selectPagesWorkFlow(current, pageSize, wrapper, flag);
Integer count = sarStandProjectLibraryDao.selectCountWorkFlow(wrapper, flag);
@@ -2,9 +2,8 @@ package com.adc.da.slrs.sarStandProjectTeam.controller;
import com.adc.da.base.web.BaseController;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Company;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.ResponseDto;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
import com.adc.da.slrs.sarStandProjectTeam.service.ISarStandProjectTeamService;
import io.swagger.annotations.Api;
@@ -16,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
/**
* <p>
@@ -41,13 +38,8 @@ public class SarStandProjectTeamController extends BaseController<SarStandProjec
public ResponseDto save(@RequestBody String jsonStr){
log.info(jsonStr);
Head head = sarStandProjectTeamService.AnalysisJsonAndStorage(jsonStr);
ArrayList<Company> companies = new ArrayList<>();
//todo 未确定返回内容
Company company = new Company();
company.setCOMPANY_CODE("");
company.setFISCAL_YEAR("");
companies.add(company);
ResponseDto responseDto = new ResponseDto(head,companies);
ResponseDto responseDto = new ResponseDto(head);
return responseDto;
}
@@ -1,6 +1,6 @@
package com.adc.da.slrs.sarStandProjectTeam.service;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -1,15 +1,13 @@
package com.adc.da.slrs.sarStandProjectTeam.service.impl;
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
import com.adc.da.slrs.sarStandProjectTeam.dao.SarStandProjectTeamDao;
import com.adc.da.slrs.sarStandProjectTeam.service.ISarStandProjectTeamService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.springframework.stereotype.Service;
@@ -91,27 +91,27 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
@GetMapping("/getSarStandardsInfoPage")
//@RequiresPermissions("lawss:sarStandardsInfo:getSarStandardsInfoPage")
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPage(SarStandardsInfoEOPage page,@RequestParam(defaultValue = "0") String mark) throws Exception {
int isNull = -1;
if (null != page.getNowOrderBy()) {
switch (page.getNowOrderBy()) {
case 1:
page.setOrderBy1("issueTime");//发布日期
page.setOrderByA("issueTime");//发布日期
break;
case 2:
page.setOrderBy1("SAR_STAND_ATTR_INFO.ZCCSSRQ");//新车型实施日期
page.setOrderByA("SAR_STAND_ATTR_INFO.ZCCSSRQ");//新车型实施日期
break;
case 3:
page.setOrderBy1("SAR_STAND_ATTR_INFO.XCXSSRQ");//在产车实施日期
page.setOrderByA("SAR_STAND_ATTR_INFO.XCXSSRQ");//在产车实施日期
break;
case 4:
page.setOrderBy1("SAR_STANDARDS_INFO.text_status");//文本状态
page.setOrderByA("SAR_STANDARDS_INFO.text_status");//文本状态
break;
case 5:
page.setOrderBy1("paixu");
page.setOrderByA("paixu");
break;
case 6:
page.setOrderBy1("SAR_STAND_ATTR_INFO.SSRQ");
page.setOrderByA("SAR_STAND_ATTR_INFO.SSRQ");
break;
default:
page.setNowOrder(null);
@@ -183,6 +183,67 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
return Result.success(getPageInfo(page.getPager(), rows));
}
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
@GetMapping("/getSarStandardsInfoPageBak")
//@RequiresPermissions("lawss:sarStandardsInfo:getSarStandardsInfoPage")
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPageBak(SarStandardsInfoEOPage page,@RequestParam(defaultValue = "0") String mark) throws Exception {
// int isNull = -1;
// if (null != page.getNowOrderBy()) {
// switch (page.getNowOrderBy()) {
// case 1:
// page.setOrderByA("issueTime");//发布日期
// break;
// case 2:
// page.setOrderByA("SAR_STAND_ATTR_INFO.ZCCSSRQ");//新车型实施日期
// break;
// case 3:
// page.setOrderByA("SAR_STAND_ATTR_INFO.XCXSSRQ");//在产车实施日期
// break;
// case 4:
// page.setOrderByA("SAR_STANDARDS_INFO.text_status");//文本状态
// break;
// case 5:
// page.setOrderByA("paixu");
// break;
// case 6:
// page.setOrderByA("SAR_STAND_ATTR_INFO.SSRQ");
// break;
// default:
// page.setNowOrder(null);
// break;
// }
// if (null != page.getNowOrder()) {
// switch (page.getNowOrder()) {
// case 1:
// page.setOrder1("desc");
// break;
// case 2:
// page.setOrder1("asc");
// default:
// page.setOrder1(null);
// break;
// }
// }
// }
//
//
// if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
// List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
// String advanceStr = SarAdvanceSearchUtil.createStandSql(searchList);
// if (StringUtils.isNotBlank(advanceStr)) {
// page.setAdvanceSearchStr(advanceStr);
// } else {
// page.setAdvanceSearchStr(null);
// }
// }
//
// if(page.getUserId() == null || page.getUserId().equals("")){
// page.setUserId(LoginUserUtil.getUserId());
// }
List<SarStandardsInfo> rows = sarStandardsInfoEOService.getSarStandardsInfoPageBak(page);
return Result.success(getPageInfo(page.getPager(), rows));
}
@ApiOperation(value = "|SarStandardsInfoEO|新增")
@PostMapping("/addarStandardsInfo")
//401问题2021-03-31暂时注释掉 liuhuiwen
@@ -466,6 +527,14 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
return Result.success(result);
}
@ApiOperation(value = "|SarStandardsInfoEO|修改详情")
@GetMapping("/getStandInfoUpdateById")
//@RequiresPermissions("lawss:sarStandardsInfo:get")
public ResponseMessage<SarStandardsInfo> findUpdateById(String id) throws Exception {
SarStandardsInfo result = sarStandardsInfoEOService.selectStandardsInfoUpdateByKey(id);
return Result.success(result);
}
@ApiOperation(value = "|SarStandardsInfoEO|确认配置标准")
@PostMapping("/saveStandardsMenu")
//@RequiresPermissions("lawss:sarStandardsInfo:saveStandardsMenu")

Some files were not shown because too many files have changed in this diff Show More