feat: There is no way the
This commit is contained in:
@@ -34,8 +34,10 @@ public class CreateStandMQService {
|
||||
}
|
||||
|
||||
public void sendLawsMQ(SarLawsStandInfo sarLawsStandInfo, String addOrUpdate) throws Exception{
|
||||
JSONObject json = JSONObject.fromObject(sarLawsStandInfo);
|
||||
String sarLawsInfoStr = json.toString();
|
||||
// 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);
|
||||
|
||||
@@ -1,271 +1,314 @@
|
||||
//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.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;
|
||||
//
|
||||
// @Autowired
|
||||
// private IOtSvppsService otSvppsEOService;
|
||||
//
|
||||
// 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("sarBuss").toString();
|
||||
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);
|
||||
|
||||
// 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();
|
||||
//
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// //修改索引信息表
|
||||
// // 往索引表中插入数据
|
||||
// String baseSearchContent = "";
|
||||
// String getCodeName = "";
|
||||
// Map<String,Object> saveMap = new HashMap<>();
|
||||
//
|
||||
// //发布日期 高级查询
|
||||
// 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("putTime",dateFormatToStr(infoEO.getPutTime()));
|
||||
// Date put_time_data = null;
|
||||
// if (StringUtils.isNotBlank(infoEO.getPutTime())) {
|
||||
// try {
|
||||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// put_time_data = format.parse(dateFormatToStr(infoEO.getPutTime())+" 00:00:00");
|
||||
// } catch (ParseException ignored) {
|
||||
// }
|
||||
// }
|
||||
// if (put_time_data != null) {
|
||||
// saveMap.put("put_time_data",put_time_data.getTime());
|
||||
// }else{
|
||||
// saveMap.put("put_time_data",-1000000000000000000L);
|
||||
// }
|
||||
//
|
||||
// saveMap.put("id",infoEO.getId());
|
||||
// saveMap.put("standSort",infoEO.getStandSort());
|
||||
// saveMap.put("stand_sort",infoEO.getStandSort());
|
||||
// if(StringUtils.isNotEmpty(infoEO.getStandSort())){
|
||||
// String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getStandSort());
|
||||
// saveMap.put("standSortShow",codeName);
|
||||
// getCodeName = codeName;
|
||||
// }
|
||||
// saveMap.put("standYear",infoEO.getStandYear());
|
||||
// saveMap.put("stand_year",infoEO.getStandYear());
|
||||
// saveMap.put("standNumber",infoEO.getStandCode());
|
||||
// saveMap.put("stand_code",infoEO.getStandCode());
|
||||
// saveMap = dealNumberMsg(saveMap,infoEO,getCodeName);
|
||||
// saveMap.put("nameshow",infoEO.getStandName());
|
||||
// saveMap.put("stand_name",infoEO.getStandName());
|
||||
// saveMap.put("standEnName",infoEO.getStandEnName());
|
||||
// saveMap.put("stand_en_name",infoEO.getStandEnName());
|
||||
// saveMap.put("replaceStandNum",infoEO.getReplaceStandNum());
|
||||
// saveMap.put("replace_stand_num",infoEO.getReplaceStandNum());
|
||||
// saveMap.put("replacedStandNum",infoEO.getReplacedStandNum());
|
||||
// saveMap.put("replaced_stand_num",infoEO.getReplacedStandNum());
|
||||
// saveMap.put("statecode",infoEO.getStandStatus());
|
||||
// saveMap.put("stand_status",infoEO.getStandStatus());
|
||||
// if (StringUtils.isNotEmpty(infoEO.getStandStatus())) {
|
||||
// String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getStandStatus());
|
||||
// saveMap.put("standstateshow",codeName);
|
||||
// }
|
||||
// String textStatusBussName = "";
|
||||
// if(infoEO.getTextStatusBuss() != null && StringUtils.isNotBlank(infoEO.getTextStatusBuss())){
|
||||
// List<String> valArr = Arrays.asList(infoEO.getTextStatusBuss().split(","));
|
||||
// textStatusBussName = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
// }
|
||||
// saveMap.put("textStatusBuss",infoEO.getTextStatusBuss());
|
||||
// saveMap.put("textStatusBussName",textStatusBussName);
|
||||
// //新加字段
|
||||
// saveMap.put("country",infoEO.getApplyCountry());
|
||||
// if(StringUtils.isNotEmpty(infoEO.getApplyCountry())){
|
||||
// String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getApplyCountry());
|
||||
// saveMap.put("countryShow",codeName);
|
||||
// }
|
||||
// // 自定义属性字段
|
||||
// if (attrInfoMap != null && !attrInfoMap.isEmpty()) {
|
||||
// attrInfoMap = sysInfoEOService.changeSelectInfo(attrInfoMap, "stand",baseSearchContent);
|
||||
// saveMap.putAll(attrInfoMap);
|
||||
// }
|
||||
//
|
||||
// saveMap.put("type","bussstand");
|
||||
// saveMap.put("validFlag","0");
|
||||
// saveMap.put("content",infoEO.getFileIds());
|
||||
//
|
||||
// String fieldInfo = InitStandAttrUtil.queryFieldBuss;
|
||||
// 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 (StringUtils.isBlank(String.valueOf(saveMap.get("content")))) {
|
||||
// String context = filterStringIsNotBlank(String.valueOf(saveMap.get("FBGBUSS")),true)
|
||||
// + filterStringIsNotBlank(String.valueOf(saveMap.get("BZSMBUSS")),true)
|
||||
// + filterStringIsNotBlank(String.valueOf(saveMap.get("LSBBBUSS")),true)
|
||||
// + filterStringIsNotBlank(String.valueOf(saveMap.get("QTWJBUSS")),true)
|
||||
// + filterStringIsNotBlank(String.valueOf(saveMap.get("GLWJBUSS")),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;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
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();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//修改索引信息表
|
||||
// 往索引表中插入数据
|
||||
String baseSearchContent = "";
|
||||
String getCodeName = "";
|
||||
Map<String,Object> saveMap = new HashMap<>();
|
||||
|
||||
//发布日期 高级查询
|
||||
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 (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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -865,10 +865,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)) {
|
||||
|
||||
@@ -17,9 +17,9 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarLawsFileDao extends BaseMapper<SarLawsFile> {
|
||||
|
||||
List<SarLawsFile> selectFileByStandId(String lawsId);
|
||||
List<SarLawsFile> selectFileBylawsId(String lawsId);
|
||||
|
||||
List<SarLawsFile> selectFileByStandIdAndId(SarLawsFile laws);
|
||||
List<SarLawsFile> selectFileBylawsIdAndId(SarLawsFile laws);
|
||||
|
||||
List<SarLawsFile> selectFileByAttId(String attId);
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface SarLawsFileDao extends BaseMapper<SarLawsFile> {
|
||||
|
||||
List<SarLawsFile> selectFileByResId(SarLawsFile sarBussStandFileEO);
|
||||
|
||||
int deleteByStandId(String standId);
|
||||
int deleteBylawsId(String standId);
|
||||
|
||||
int insertForeach(List<SarLawsFile> list); //批量新增
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ 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,6 +19,7 @@ import java.util.Set;
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@Repository
|
||||
public interface SarLawsItemsDao extends BaseMapper<SarLawsItems> {
|
||||
|
||||
Set<String> selectClaimTypesByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
|
||||
@@ -25,4 +27,6 @@ public interface SarLawsItemsDao extends BaseMapper<SarLawsItems> {
|
||||
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);
|
||||
}
|
||||
|
||||
+49
-9
@@ -14,6 +14,7 @@ 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;
|
||||
@@ -192,16 +193,55 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
return Result.success("","修改成功",sarLawsStandInfo);
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "|SarBussionessStandEO|删除")
|
||||
// @PostMapping("deleteSarBussionessStand")
|
||||
// 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;
|
||||
// }
|
||||
@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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+29
-34
@@ -24,119 +24,89 @@ import java.util.List;
|
||||
* @since 2021-10-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarLawsStandInfo对象", description="")
|
||||
public class SarLawsStandInfoPage extends BasePage {
|
||||
|
||||
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;
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
private String creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private DATE modifyTime;
|
||||
private String modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "参数1")
|
||||
@TableField("PARAM1")
|
||||
private Long param1;
|
||||
private String param1;
|
||||
|
||||
@ApiModelProperty(value = "参数2")
|
||||
@TableField("PARAM2")
|
||||
private String param2;
|
||||
|
||||
private String[] commentCycleDate;
|
||||
@@ -235,6 +205,31 @@ public class SarLawsStandInfoPage extends BasePage {
|
||||
|
||||
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 paixu;
|
||||
private String shunxu;
|
||||
|
||||
+3
-1
@@ -19,7 +19,9 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISarLawsStandInfoService extends IService<SarLawsStandInfo> {
|
||||
|
||||
// ResponseMessage<SarLawsStandInfo> deleteSarLawsStandInfo(SarLawsStandInfoPage page) throws Exception;
|
||||
List<SarLawsStandInfo> selectStandardsByStandNumber(String replaceStandNum);
|
||||
|
||||
ResponseMessage<SarLawsStandInfo> deleteSarLawsStandInfo(SarLawsStandInfoPage page) throws Exception;
|
||||
|
||||
SarLawsStandInfo updateSarLawsStandInfo(SarLawsStandInfo sarLawsStandInfo) throws Exception;
|
||||
|
||||
|
||||
+69
-20
@@ -5,6 +5,8 @@ import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.SarTypeEnum;
|
||||
import com.adc.da.common.SelectionTypeEnum;
|
||||
import com.adc.da.common.UseModuleEnum;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.mq.CreateMQService;
|
||||
import com.adc.da.mq.CreateStandMQService;
|
||||
@@ -12,6 +14,7 @@ import com.adc.da.person.dao.PersonCollectEODao;
|
||||
import com.adc.da.person.entity.TsPersonCollect;
|
||||
import com.adc.da.person.page.PersonCollectEOPage;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.search.entity.StandLawsEO;
|
||||
import com.adc.da.search.service.StandLawsSearchService;
|
||||
import com.adc.da.slrs.otConvertMq.dao.OtConvertMqDao;
|
||||
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||
@@ -26,6 +29,7 @@ import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
||||
import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
|
||||
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
|
||||
import com.adc.da.slrs.sarLawsInfo.dao.SarLawsInfoDao;
|
||||
import com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao;
|
||||
import com.adc.da.slrs.sarLawsMenu.dao.SarLawsMenuDao;
|
||||
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
|
||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||
@@ -89,9 +93,6 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
|
||||
@Autowired
|
||||
private SarBussionessStandDao sarLawsStandInfoDao;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@@ -132,7 +133,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
private SarLawsAttrInfoDao sarLawsAttrInfoDao;
|
||||
|
||||
@Autowired
|
||||
private SarBussStandItemsDao sarBussStandItemsEODao;
|
||||
private SarLawsItemsDao sarLawsItemsDao;
|
||||
|
||||
@Autowired
|
||||
private StandLawsSearchService standLawsSearchService;
|
||||
@@ -215,15 +216,15 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
}
|
||||
|
||||
public void attrInfoDetails (SarLawsStandInfo row) throws Exception {
|
||||
String fieldInfo = InitStandAttrUtil.queryFieldBuss;
|
||||
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
||||
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
||||
row.setCollectId(collectId);
|
||||
// 查询属性表数据
|
||||
if (StringUtils.isNotBlank(fieldInfo)) {
|
||||
Map<String, Object> getAttrMap = sarLawsAttrInfoDao.selectLawsFieldAndData(fieldInfo,row.getId());
|
||||
if (InitStandAttrUtil.clobFieldListBuss != null && !InitStandAttrUtil.clobFieldListBuss.isEmpty()) {
|
||||
if (InitStandAttrUtil.clobFieldListLaws != null && !InitStandAttrUtil.clobFieldListLaws.isEmpty()) {
|
||||
// 遍历修改所有clob类型的值
|
||||
for (String clobField : InitStandAttrUtil.clobFieldListBuss) {
|
||||
for (String clobField : InitStandAttrUtil.clobFieldListLaws) {
|
||||
Clob clobValue = (Clob) getAttrMap.get(clobField);
|
||||
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
|
||||
getAttrMap.put(clobField,fieldValue);
|
||||
@@ -240,7 +241,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
}
|
||||
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
|
||||
String value = entry.getValue().toString();
|
||||
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
|
||||
String selVal = InitStandAttrUtil.selectFieldMapLaws.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getOrgNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
@@ -348,7 +349,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
}
|
||||
}
|
||||
}
|
||||
page.setOrderBy("SAR_BUSSIONESS_STAND.issue_time is null,SAR_BUSSIONESS_STAND.issue_time desc,SAR_BUSSIONESS_STAND.id");
|
||||
page.setOrderBy("SAR_LAWS_ATTR_INFO.issue_time is null,SAR_LAWS_ATTR_INFO.issue_time desc,SAR_LAWS_ATTR_INFO.id");
|
||||
if(userId != null){
|
||||
page.setUserId(userId);
|
||||
}else {
|
||||
@@ -454,14 +455,14 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
sarLawsAttrInfoDao.deleteLawsAttrByStandId(standId);
|
||||
|
||||
//
|
||||
sarBussStandValEODao.deleteDataByStandId(standId);
|
||||
sarBussStandValEODao.deleteDataBylawsId(standId);
|
||||
|
||||
//删除文件详情表数据
|
||||
sarBussStandFileEODao.deleteByStandId(standId);
|
||||
sarBussStandFileEODao.deleteBylawsId(standId);
|
||||
SarLawsFile sarBussStandFileEO = new SarLawsFile();
|
||||
sarBussStandFileEO.setLawsId(standId);
|
||||
sarBussStandFileEO.setIdList(null);
|
||||
List<SarLawsFile> listFile = sarBussStandFileEODao.selectFileByStandIdAndId(sarBussStandFileEO);
|
||||
List<SarLawsFile> listFile = sarBussStandFileEODao.selectFileBylawsIdAndId(sarBussStandFileEO);
|
||||
if (listFile != null) {
|
||||
if (!listFile.isEmpty()) {
|
||||
for (int f = 0; f < listFile.size(); f++) {
|
||||
@@ -488,13 +489,13 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
public void attrInfoShowSearchDetails(SarLawsStandInfo 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)) {
|
||||
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
|
||||
if(StringUtils.isNotBlank(entry.getValue().toString())){
|
||||
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
|
||||
if(json instanceof org.json.JSONArray){
|
||||
@@ -515,7 +516,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
}
|
||||
|
||||
public void attrInfoSearchDetails(SarLawsStandInfo row,String type) throws Exception {
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
||||
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
||||
row.setCollectId(collectId);
|
||||
// 查询属性表数据
|
||||
@@ -540,7 +541,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
row.setAttrInfoCaseMap(transformUpperCase(getAttrMap));
|
||||
}
|
||||
|
||||
row.setAttrInfoMap(getAttrMap);
|
||||
// row.setAttrInfoMap(getAttrMap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,7 +599,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
*/
|
||||
public void createStandAttrInfo (SarLawsStandInfo sarBussionessStandEO) throws Exception {
|
||||
String sarStandAttrEOStr = sarBussionessStandEO.getSarStandAttrEOStr();
|
||||
String mustFields = FieldConvertUtil.mustFields;
|
||||
String mustFields = FieldConvertUtil.mustFieldsLaws;
|
||||
String mustValues = FieldConvertUtil.mustValues(sarBussionessStandEO.getId());
|
||||
// 将字符串转为map进行解析
|
||||
Map<String,String> sarStandAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
@@ -672,7 +673,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
sarStandValEO.setCreationTime(new Date());
|
||||
sarStandValEO.setModifyTime(new Date());
|
||||
sarStandValEO.setLawsId(standId);
|
||||
sarStandValEO.setId(com.adc.da.sys.util.UUIDUtils.randomUUID20());
|
||||
sarStandValEO.setId(UUIDUtils.randomUUID20());
|
||||
sarStandValEO.setPropertyType(field);
|
||||
sarStandValEO.setPropertyVal(val);
|
||||
standValList.add(sarStandValEO);
|
||||
@@ -752,12 +753,60 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
||||
convert.setAddOrUp("0");
|
||||
convert.setFileSuffix(fileInfo.getFileSuffix());
|
||||
convert.setStandFileClassify(field);
|
||||
convert.setConvertType(SarTypeEnum.BUSINESS.getValue());
|
||||
convert.setConvertType(SarTypeEnum.LAWS_STAND.getValue());
|
||||
convertMq.sendMQ(convert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<SarLawsStandInfo> deleteSarLawsStandInfo(SarLawsStandInfoPage page) throws Exception {
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
sarLawsStandInfo.setValidFlag(1);
|
||||
sarLawsStandInfo.setModifyTime(new Date());
|
||||
for (String id : page.getIdlist()) {
|
||||
//删除标准表
|
||||
sarLawsStandInfo.setId(id);
|
||||
this.baseMapper.updateById(sarLawsStandInfo);
|
||||
// 删除标准属性表
|
||||
sarLawsAttrInfoDao.deleteLawsAttrByStandId(id);
|
||||
// 删除条款
|
||||
sarLawsItemsDao.deleteByStandIdAndFileType(id,null);
|
||||
//删除收藏表中数据
|
||||
personCollectEODao.deleteByResId(id);
|
||||
//删除标准关联的value表
|
||||
sarBussStandValEODao.deleteDataBylawsId(id);
|
||||
List<SarLawsFile> listFile = sarBussStandFileEODao.selectFileBylawsId(id);
|
||||
if (listFile != null) {
|
||||
if (!listFile.isEmpty()) {
|
||||
for (int f = 0; f < listFile.size(); f++) {
|
||||
sarBussStandFileEODao.deleteByPrimaryKey(listFile.get(f).getId());
|
||||
//删除文件信息表数据
|
||||
// sarFileInfoEODao.deleteByfileId(listFile.get(f).getId());
|
||||
//删除转换表ot_convert数据
|
||||
otConvertEODao.deleteByAttId(listFile.get(f).getAttId());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(elasflag) {
|
||||
//删除成功后,将索引中对应数据删除
|
||||
StandLawsEO standLawsEO = new StandLawsEO();
|
||||
standLawsEO.setId(sarLawsStandInfo.getId());
|
||||
standLawsEO.setType("laws");
|
||||
standLawsSearchService.deleteStandLawsSearch(standLawsEO);
|
||||
}
|
||||
|
||||
}
|
||||
return Result.success("0", "删除成功", sarLawsStandInfo);
|
||||
}
|
||||
|
||||
public List<SarLawsStandInfo> selectStandardsByStandNumber(String replaceStandNum) {
|
||||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("LAWS_NUMBER",replaceStandNum);
|
||||
wrapper.eq("VALID_FLAG",0);
|
||||
return this.baseMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
public interface SarLawsValDao extends BaseMapper<SarLawsVal> {
|
||||
|
||||
//通过标准id删除表中数据
|
||||
int deleteDataByStandId(String standId);
|
||||
int deleteDataBylawsId(String standId);
|
||||
|
||||
int insertForeach(List<SarLawsVal> list); //批量新增
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user