Merge remote-tracking branch 'origin/develop_1' into develop_1
This commit is contained in:
@@ -5,6 +5,7 @@ import com.adc.da.slrs.otSvpps.service.IOtSvppsService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -21,12 +22,8 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class SendStandMQService {
|
||||
@@ -73,19 +70,17 @@ public class SendStandMQService {
|
||||
String sarStandards = standMap.get("sarStandards").toString();
|
||||
JSONObject jsonobject = JSONObject.fromObject(sarStandards);
|
||||
SarStandardsInfo infoEO = (SarStandardsInfo) JSONObject.toBean(jsonobject,SarStandardsInfo.class);
|
||||
String attr = infoEO.getSarStandAttrEOStr();
|
||||
JSONObject jsonobject1 = JSONObject.fromObject(attr);
|
||||
Map<String,Object> map = (Map)jsonobject1;
|
||||
String GZZXX = String.valueOf(map.get("GZZXX"));
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
|
||||
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
|
||||
// 往索引表中插入数据
|
||||
String getCodeName = "";
|
||||
Map<String,Object> saveMap = new HashMap<>();
|
||||
String baseSearchContent = "";
|
||||
// 开始存放数据
|
||||
// 开始存放数据 -------- 国内外标准 -----------
|
||||
saveMap.put("id",infoEO.getId());
|
||||
saveMap.put("BYYBJ", map.getOrDefault("BYYBJ", ""));
|
||||
saveMap.put("BDTBH", map.getOrDefault("BDTBH", ""));
|
||||
saveMap.put("BYYBJ", attrInfoMap.getOrDefault("BYYBJ", ""));
|
||||
saveMap.put("BDTBH", attrInfoMap.getOrDefault("BDTBH", ""));
|
||||
saveMap.put("country",infoEO.getCountry());
|
||||
|
||||
if (StringUtils.isNotEmpty(infoEO.getCountry())) {
|
||||
@@ -109,41 +104,16 @@ public class SendStandMQService {
|
||||
saveMap.put("standEnName",infoEO.getStandEnName());
|
||||
saveMap.put("stand_en_name",infoEO.getStandEnName());
|
||||
|
||||
if ("1".equals(infoEO.getIsRelateAccess())) {
|
||||
saveMap.put("isRelateAccess","A" );
|
||||
}else{
|
||||
saveMap.put("isRelateAccess","B" );
|
||||
}
|
||||
if (StringUtils.isNotEmpty(infoEO.getStandState())) {
|
||||
String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getStandState());
|
||||
saveMap.put("standstateshow",codeName);
|
||||
}
|
||||
saveMap.put("issueTime",infoEO.getIssueTime());
|
||||
saveMap.put("issueTime",dateFormatToStr(infoEO.getIssueTime()));
|
||||
|
||||
String newDate = infoEO.getIssueTime();
|
||||
if (StringUtils.isNotBlank(infoEO.getIssueTime()) && StringUtils.isNotBlank(infoEO.getIssueTime().trim()) && infoEO.getIssueTime().trim().length()>10) {
|
||||
newDate = infoEO.getIssueTime().trim().substring(0,10);
|
||||
}
|
||||
|
||||
saveMap.put("issue_time",newDate);
|
||||
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(newDate+" 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",0L);
|
||||
}
|
||||
saveMap.put("synopsis",infoEO.getSynopsis());
|
||||
saveMap.put("standType",infoEO.getStandType());
|
||||
|
||||
// 自定义属性字段
|
||||
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
|
||||
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
if (attrInfoMap != null && !attrInfoMap.isEmpty()) {
|
||||
attrInfoMap = sysInfoEOService.changeSelectInfo(attrInfoMap, "stand",baseSearchContent);
|
||||
saveMap.putAll(attrInfoMap);
|
||||
@@ -154,109 +124,15 @@ public class SendStandMQService {
|
||||
saveMap.put("content",infoEO.getFileIds());
|
||||
saveMap.put("CHJL",infoEO.getCHJL());
|
||||
|
||||
String SVPPSSting = "";
|
||||
if (attrInfoMap != null) {
|
||||
if (attrInfoMap.containsKey("SVPPS")){
|
||||
String svpps = String.valueOf(attrInfoMap.get("SVPPS"));
|
||||
List<String> ids = new ArrayList<>(Arrays.asList(svpps.split(",")));
|
||||
for (String id: ids){
|
||||
String num = "";
|
||||
try {
|
||||
OtSvpps otSvppsEO = otSvppsEOService.getById(id);
|
||||
if (null != otSvppsEO) {
|
||||
if ("NA".equals(otSvppsEO.getTNum())) {
|
||||
if ("NA".equals(otSvppsEO.getSNum())) {
|
||||
num = otSvppsEO.getFNum();
|
||||
} else {
|
||||
num = otSvppsEO.getSNum();
|
||||
}
|
||||
} else {
|
||||
num = otSvppsEO.getTNum();
|
||||
}
|
||||
}
|
||||
if ("".equals(SVPPSSting)){
|
||||
SVPPSSting = num;
|
||||
}else {
|
||||
SVPPSSting = SVPPSSting + "," + num;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
saveMap.put("SVPPSName",SVPPSSting);
|
||||
}
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
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,""));
|
||||
}
|
||||
|
||||
|
||||
Date XCXSSRQ_data = null;
|
||||
if (StringUtils.isNotBlank(String.valueOf(saveMap.get("XCXSSRQ")))) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if (String.valueOf(saveMap.get("XCXSSRQ")).trim().length()>10) {
|
||||
XCXSSRQ_data = format.parse(String.valueOf(saveMap.get("XCXSSRQ")).trim().substring(0,10) + " 00:00:00");
|
||||
saveMap.put("XCXSSRQ",String.valueOf(saveMap.get("XCXSSRQ")).trim().substring(0,10));
|
||||
}else{
|
||||
XCXSSRQ_data = format.parse(String.valueOf(saveMap.get("XCXSSRQ")).trim() + " 00:00:00");
|
||||
saveMap.put("XCXSSRQ",String.valueOf(saveMap.get("XCXSSRQ")).trim());
|
||||
}
|
||||
} catch (ParseException ignored) {
|
||||
}
|
||||
}
|
||||
if (XCXSSRQ_data != null) {
|
||||
saveMap.put("XCXSSRQ_data",XCXSSRQ_data.getTime());
|
||||
}else{
|
||||
saveMap.put("XCXSSRQ_data",0L);
|
||||
}
|
||||
saveMap.put("XCXSSRQ",String.valueOf(saveMap.get("XCXSSRQ")+" "));
|
||||
|
||||
Date ZCCSSRQ_data = null;
|
||||
if (StringUtils.isNotBlank(String.valueOf(saveMap.get("ZCCSSRQ")))) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if (String.valueOf(saveMap.get("ZCCSSRQ")).trim().length()>10) {
|
||||
ZCCSSRQ_data = format.parse(String.valueOf(saveMap.get("ZCCSSRQ")).trim().substring(0, 10) + " 00:00:00");
|
||||
saveMap.put("ZCCSSRQ",String.valueOf(saveMap.get("ZCCSSRQ")).trim().substring(0, 10));
|
||||
}else {
|
||||
ZCCSSRQ_data = format.parse(String.valueOf(saveMap.get("ZCCSSRQ")).trim() + " 00:00:00");
|
||||
saveMap.put("ZCCSSRQ",String.valueOf(saveMap.get("ZCCSSRQ")).trim());
|
||||
}
|
||||
} catch (ParseException ignored) {
|
||||
}
|
||||
}
|
||||
if (ZCCSSRQ_data != null) {
|
||||
saveMap.put("ZCCSSRQ_data",ZCCSSRQ_data.getTime());
|
||||
}else{
|
||||
saveMap.put("ZCCSSRQ_data",0L);
|
||||
}
|
||||
saveMap.put("ZCCSSRQ",String.valueOf(saveMap.get("ZCCSSRQ")+" "));
|
||||
|
||||
Date EOPSSRQ_data = null;
|
||||
String ESSRQ= null;
|
||||
if (StringUtils.isNotBlank(String.valueOf(saveMap.get("EOPSSRQ")))) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if (String.valueOf(saveMap.get("EOPSSRQ")).trim().length()>10){
|
||||
ESSRQ = String.valueOf(saveMap.get("EOPSSRQ")).trim().substring(0,10);
|
||||
}else {
|
||||
ESSRQ = String.valueOf(saveMap.get("EOPSSRQ")).trim();
|
||||
}
|
||||
EOPSSRQ_data = format.parse(ESSRQ + " 00:00:00");
|
||||
} catch (ParseException ignored) {
|
||||
}
|
||||
map.put("EOPSSRQ",ESSRQ);
|
||||
}
|
||||
if (EOPSSRQ_data != null) {
|
||||
saveMap.put("EOPSSRQ_data",EOPSSRQ_data.getTime());
|
||||
}else{
|
||||
saveMap.put("EOPSSRQ_data",0L);
|
||||
}
|
||||
saveMap.put("EOPSSRQ",String.valueOf(saveMap.get("EOPSSRQ")+" "));
|
||||
|
||||
if (map.containsKey("DXBZ")){
|
||||
saveMap.put("DXBZ",map.get("DXBZ"));
|
||||
}else{
|
||||
saveMap.put("DXBZ","");
|
||||
}
|
||||
//当建立代替时,产生的没有文件的问题
|
||||
if (StringUtils.isBlank(String.valueOf(saveMap.get("content")))) {
|
||||
String context = String.valueOf(saveMap.get("FBGBJBD")) + ","
|
||||
@@ -265,13 +141,13 @@ public class SendStandMQService {
|
||||
+ String.valueOf(saveMap.get("BPG")) + ","
|
||||
+ String.valueOf(saveMap.get("CA")) + ","
|
||||
+ String.valueOf(saveMap.get("SSG")) + ","
|
||||
+ String.valueOf(saveMap.get("JDWJ")) + ","
|
||||
+ String.valueOf(saveMap.get("XGD")) + ","
|
||||
+ String.valueOf(saveMap.get("KWJ")) + ","
|
||||
+ String.valueOf(saveMap.get("ZBJBD"));
|
||||
context = context.replace(",,", ",");
|
||||
saveMap.put("content", context);
|
||||
}
|
||||
if (StringUtils.isNotBlank(String.valueOf(saveMap.get("FO"))) && !"null".equals(String.valueOf(saveMap.get("FO")))){
|
||||
saveMap.put("FO",String.valueOf(saveMap.get("FO"))+" ");
|
||||
}
|
||||
if("add".equals(addOrUpdate)){
|
||||
sarStandardsInfoService.insertIntoIndexForMap(saveMap);
|
||||
} else {
|
||||
@@ -279,6 +155,20 @@ public class SendStandMQService {
|
||||
}
|
||||
}
|
||||
|
||||
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,SarStandardsInfo infoEO,String getCodeName) {
|
||||
if(StringUtils.isNotEmpty(infoEO.getStandYear())){
|
||||
String number = getCodeName + " " + infoEO.getStandNumber() + "-" + infoEO.getStandYear();
|
||||
|
||||
+8
@@ -52,6 +52,14 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
return Result.success("200",publicList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "查询全部意见")
|
||||
@GetMapping("/checkIsShow")
|
||||
public ResponseMessage checkIsShow(DetAllStandDto detAllStandDto){
|
||||
String publicList =sarPublicIdeaAllImpl.checkIsShow(detAllStandDto);
|
||||
return Result.success("200",publicList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "增加意见")
|
||||
@PostMapping("/insetStand")
|
||||
public ResponseMessage addAllStand(SarPublicIdeaAll sar){
|
||||
|
||||
@@ -9,4 +9,5 @@ public class DetAllStandDto {
|
||||
String cid;
|
||||
String userId;
|
||||
String endTime;
|
||||
String Account;
|
||||
}
|
||||
|
||||
+1
@@ -26,4 +26,5 @@ public interface ISarPublicIdeaAllService extends IService<SarPublicIdeaAll> {
|
||||
String updateById(SarPublicIdeaAll sarPublicIdeaAll, String autUserid);
|
||||
String delete(DelStandDto delStandDto);
|
||||
String del(String id);
|
||||
String checkIsShow(DetAllStandDto detAllStandDto);
|
||||
}
|
||||
|
||||
+58
-32
@@ -3,17 +3,17 @@ package com.adc.da.slrs.sarStandIdea.service.Impl;
|
||||
|
||||
import com.adc.da.slrs.sarLawsDetailedList.Util.BeanConverUtil;
|
||||
import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaAllDao;
|
||||
import com.adc.da.slrs.sarStandIdea.entity.DelStandDto;
|
||||
import com.adc.da.slrs.sarStandIdea.entity.DetAllStandDto;
|
||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll;
|
||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAllSUD;
|
||||
import com.adc.da.slrs.sarStandIdea.entity.*;
|
||||
import com.adc.da.slrs.sarStandIdea.service.ISarPublicIdeaAllService;
|
||||
import com.adc.da.sys.entity.LoginInfoEO;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -38,10 +38,9 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
private SarPublicIdeaAllDao sarPublicIdeaAllDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<SarPublicIdeaAllSUD> selectAll(DetAllStandDto detAllStandDto){
|
||||
if (detAllStandDto.getEndTime()!=null){
|
||||
public IPage<SarPublicIdeaAllSUD> selectAll(DetAllStandDto detAllStandDto) {
|
||||
if (detAllStandDto.getEndTime() != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date Time = null;
|
||||
try {
|
||||
@@ -50,18 +49,24 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
e.printStackTrace();
|
||||
}
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("CID",detAllStandDto.getCid());
|
||||
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(),detAllStandDto.getSize());
|
||||
wrapper.eq("CID", detAllStandDto.getCid());
|
||||
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(), detAllStandDto.getSize());
|
||||
IPage<SarPublicIdeaAll> userIPage = sarPublicIdeaAllDao.selectPage(page, wrapper);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
List<SarPublicIdeaAll> list= userIPage.getRecords();
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
List<SarPublicIdeaAll> list = userIPage.getRecords();
|
||||
List<SarPublicIdeaAllSUD> list1 = new ArrayList<>();
|
||||
list1 = BeanConverUtil.converList(list, SarPublicIdeaAllSUD.class);
|
||||
for (SarPublicIdeaAllSUD sud:list1){
|
||||
if (Time.compareTo(new Date())>=0)sud.setIdeaKey(0);
|
||||
else {sud.setIdeaKey(1);}
|
||||
}
|
||||
List<SarPublicIdeaAllSUD> partTwo = new ArrayList<>();
|
||||
list.forEach(sarPublicIdeaAll -> {
|
||||
SarPublicIdeaAllSUD sarPublicIdeaAllSUD=new SarPublicIdeaAllSUD();
|
||||
BeanUtils.copyProperties(sarPublicIdeaAll,sarPublicIdeaAllSUD);
|
||||
if (sarPublicIdeaAll.getUserId().equals(detAllStandDto.getUserId())){
|
||||
list1.add(sarPublicIdeaAllSUD);
|
||||
}else {
|
||||
partTwo.add(sarPublicIdeaAllSUD);
|
||||
}
|
||||
});
|
||||
list1.addAll(partTwo);
|
||||
IPage<SarPublicIdeaAllSUD> userIPage1 = new Page<>();
|
||||
userIPage1.setPages(userIPage.getPages());
|
||||
userIPage1.setSize(userIPage.getSize());
|
||||
@@ -69,19 +74,26 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
userIPage1.setCurrent(userIPage.getCurrent());
|
||||
userIPage1.setRecords(list1);
|
||||
return userIPage1;
|
||||
}else {
|
||||
} else {
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("CID",detAllStandDto.getCid());
|
||||
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(),detAllStandDto.getSize());
|
||||
wrapper.eq("CID", detAllStandDto.getCid());
|
||||
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(), detAllStandDto.getSize());
|
||||
IPage<SarPublicIdeaAll> userIPage = sarPublicIdeaAllDao.selectPage(page, wrapper);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
List<SarPublicIdeaAll> list= userIPage.getRecords();
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
List<SarPublicIdeaAll> list = userIPage.getRecords();
|
||||
List<SarPublicIdeaAllSUD> list1 = new ArrayList<>();
|
||||
list1 = BeanConverUtil.converList(list, SarPublicIdeaAllSUD.class);
|
||||
for (SarPublicIdeaAllSUD sud:list1){
|
||||
sud.setIdeaKey(0);
|
||||
}
|
||||
List<SarPublicIdeaAllSUD> partTwo = new ArrayList<>();
|
||||
list.forEach(sarPublicIdeaAll -> {
|
||||
SarPublicIdeaAllSUD sarPublicIdeaAllSUD=new SarPublicIdeaAllSUD();
|
||||
BeanUtils.copyProperties(sarPublicIdeaAll,sarPublicIdeaAllSUD);
|
||||
if (sarPublicIdeaAll.getUserId().equals(detAllStandDto.getUserId())){
|
||||
list1.add(sarPublicIdeaAllSUD);
|
||||
}else {
|
||||
partTwo.add(sarPublicIdeaAllSUD);
|
||||
}
|
||||
});
|
||||
list1.addAll(partTwo);
|
||||
IPage<SarPublicIdeaAllSUD> userIPage1 = new Page<>();
|
||||
userIPage1.setPages(userIPage.getPages());
|
||||
userIPage1.setSize(userIPage.getSize());
|
||||
@@ -90,9 +102,23 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
userIPage1.setRecords(list1);
|
||||
return userIPage1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String checkIsShow(DetAllStandDto detAllStandDto) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date Time = null;
|
||||
try {
|
||||
Time = sdf.parse(detAllStandDto.getEndTime());
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (Time.compareTo(new Date()) >= 0) return "0";
|
||||
else {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,10 +131,10 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
|
||||
@Override
|
||||
public String updateById(SarPublicIdeaAll sar, String autUserid) {
|
||||
if(sar.getUserId().equals(autUserid)){
|
||||
if (sar.getUserId().equals(autUserid)) {
|
||||
sarPublicIdeaAllDao.updateById(sar);
|
||||
return "修改成功";
|
||||
}else {
|
||||
} else {
|
||||
return "修改失败";
|
||||
|
||||
}
|
||||
@@ -116,9 +142,9 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
|
||||
@Override
|
||||
public String delete(DelStandDto delStandDto) {
|
||||
if (delStandDto.getUserId().equals(delStandDto.getAutUserId())){
|
||||
if (delStandDto.getUserId().equals(delStandDto.getAutUserId())) {
|
||||
return del(delStandDto.getId());
|
||||
}else {
|
||||
} else {
|
||||
return "删除失败,不能删除别人的意见";
|
||||
}
|
||||
|
||||
|
||||
+25
-15
@@ -110,6 +110,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag; //ES是否启用
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao dao;
|
||||
|
||||
@@ -550,7 +553,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
Map<String, String> selectionMap = new HashMap<>();
|
||||
Map<String, String> fileMap = new HashMap<>();
|
||||
Map<String, String> multiTimeMap = new HashMap<>();
|
||||
String fileIds = "";
|
||||
List<String> fileIds = new ArrayList<>();
|
||||
for (Map.Entry<String, String> entry : sarStandAttrMap.entrySet()) {
|
||||
String attrKey = entry.getKey();
|
||||
String attrValue = String.valueOf(entry.getValue());
|
||||
@@ -571,7 +574,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
selectionMap.put(attrKey, attrValue);
|
||||
} else if (InitStandAttrUtil.fileFieldList.contains(attrKey)) {
|
||||
fileMap.put(attrKey, attrValue);
|
||||
fileIds += attrValue + ",";
|
||||
List<String> list= Arrays.asList(attrValue .split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
|
||||
fileIds.addAll(list);
|
||||
// String attrValueStr = String.join(",", list);
|
||||
// fileIds += attrValueStr + ",";
|
||||
if (attrKey.equals("XXZLXX")) {
|
||||
// this.saveMsgDynamicInfo(attrValue,sarStandardsInfoEO.getStandName(),sarStandardsInfoEO.getId(),sarStandardsInfoEO.getStandSort()+" "+sarStandardsInfoEO.getStandNumber()+"-"+sarStandardsInfoEO.getStandYear());
|
||||
}
|
||||
@@ -589,10 +595,14 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
attrValue = "'" + attrValue + "'";
|
||||
}
|
||||
valuesBuilder.append("," + attrValue);
|
||||
sarStandardsInfoEO.setFileIds(fileIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!fileIds.isEmpty()){
|
||||
sarStandardsInfoEO.setFileIds(String.join(",", fileIds));
|
||||
}else {
|
||||
sarStandardsInfoEO.setFileIds("");
|
||||
}
|
||||
String insertField = mustFields + fieldsBuilder.toString();
|
||||
String insertValue = mustValues + valuesBuilder.toString();
|
||||
int insertRes = sarStandAttrInfoEODao.insertStandAttr(insertField, insertValue);
|
||||
@@ -2062,8 +2072,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
for (int i = 0; i < attidlist.length; i++) {
|
||||
if(org.apache.commons.lang.StringUtils.isNotEmpty(attidlist[i]) ){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(attidlist[i]);
|
||||
//String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
// String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
try {
|
||||
// 判断文件是docx还是PDF
|
||||
if (null != attFileEO.getFileSuffix() && (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc") || attFileEO.getFileSuffix().equals("ppt") || attFileEO.getFileSuffix().equals("pptx"))) {
|
||||
@@ -2117,15 +2127,15 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}
|
||||
// 根据文件attid 读取文件内容
|
||||
if (org.apache.commons.lang.StringUtils.isNotEmpty(String.valueOf(attrInfoMap.get("content")))) {
|
||||
String[] attidlist = String.valueOf(attrInfoMap.get("content")).split(" , ");
|
||||
String[] attidlist = String.valueOf(attrInfoMap.get("content")).split(",");
|
||||
StringBuilder content = new StringBuilder("");
|
||||
for (int i = 0; i < attidlist.length; i++) {
|
||||
if(org.apache.commons.lang.StringUtils.isNotEmpty(attidlist[i]) && !"null".equals(attidlist[i])){
|
||||
if(StringUtils.isNotEmpty(attidlist[i]) && !"null".equals(attidlist[i])){
|
||||
AttFileEO attFileEO = attFileEOService.getFileInfo(attidlist[i]);
|
||||
//String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
String readFilePath = filePath + "/" + attFileEO.getFilePath() + attFileEO.getFileName();
|
||||
try {
|
||||
// 判断文件是docx还是PDF
|
||||
/*if (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc")) {
|
||||
if (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc")) {
|
||||
if(attFileEO.getFileSuffix().equals("doc")){
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
@@ -2148,12 +2158,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
// String[] lines = pdfFileInText.split("\\r?\\n");
|
||||
content.append(pdfFileInText);
|
||||
}
|
||||
}*/
|
||||
String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
String txt = wordExtractor.getText();
|
||||
content.append(txt);
|
||||
}
|
||||
// String readFilePath = "E:\\上汽企标流程总览.pdf";
|
||||
// FileInputStream fis = new FileInputStream(readFilePath);
|
||||
// WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
// String txt = wordExtractor.getText();
|
||||
// content.append(txt);
|
||||
} catch (Exception e) {
|
||||
logger.error("搜索中心修改数据读取文档内容时失败");
|
||||
logger.error(e.getMessage(),e);
|
||||
|
||||
+8
@@ -534,8 +534,16 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
|
||||
int rowCount = sarFileSplitInfoEODao.queryByCountOwn(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarFileSplitInfoEO> rows = sarFileSplitInfoEODao.queryByPageOwn(page);
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("CA","草稿");
|
||||
map.put("ZQYJG","征求意见稿");
|
||||
map.put("BPG","报批稿");
|
||||
map.put("SSG","送审稿");
|
||||
map.put("FBGBJBD","发布稿(必读)");
|
||||
|
||||
if (rows != null && !rows.isEmpty()) {
|
||||
for (SarFileSplitInfoEO infoEO : rows) {
|
||||
infoEO.setFileTypeShow(String.valueOf(map.get(infoEO.getFileType())));
|
||||
// if (!infoEO.getSplitStatus().equals("0") && infoEO.getShowNumber() == null){
|
||||
// SarLawsInfoEOPage sarLawsInfoEOPage = new SarLawsInfoEOPage();
|
||||
// sarLawsInfoEOPage.setId(infoEO.getStandId());
|
||||
|
||||
Reference in New Issue
Block a user