Merge remote-tracking branch 'origin/develop_1' into develop_1
This commit is contained in:
@@ -171,17 +171,18 @@ public class SendBussMQService {
|
||||
saveMap.put("validFlag","0");
|
||||
saveMap.put("content",infoEO.getFileIds());
|
||||
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
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 = "";
|
||||
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
|
||||
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
|
||||
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(field).toString();
|
||||
fieldValue = infoMap.get(fieldFilter).toString();
|
||||
}
|
||||
}
|
||||
saveMap.put(field+"Name",fieldValue);
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@@ -129,10 +129,15 @@ public class ScheduledJob {
|
||||
.setMark("3")
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
|
||||
//实施日期达到预警时间,但新车型实施日期不在时间内
|
||||
if (term.isTerm(warningEO.getXCXSSRQ())){
|
||||
warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
}
|
||||
|
||||
//实施日期达到预警时间,但在产车实施日期不在时间内
|
||||
/**
|
||||
* 2021/9/9取消限制
|
||||
*/
|
||||
// if (term.isTerm(warningEO.getXCXSSRQ())){
|
||||
// warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
// }
|
||||
warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
|
||||
}
|
||||
warningList.addAll(standInfoXCXSSRQ);
|
||||
@@ -150,9 +155,13 @@ public class ScheduledJob {
|
||||
.setMark("4")
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
//实施日期达到预警时间,但在产车实施日期不在时间内
|
||||
if (term.isTerm(warningEO.getZCCSSRQ())){
|
||||
warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
}
|
||||
/**
|
||||
* 2021/9/9取消限制
|
||||
*/
|
||||
// if (term.isTerm(warningEO.getZCCSSRQ())){
|
||||
// warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
// }
|
||||
warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
}
|
||||
warningList.addAll(standInfoZCCSSRQ);
|
||||
|
||||
@@ -215,47 +224,50 @@ public class ScheduledJob {
|
||||
//查询代替标准字段得到一个 被代替了的标准的id的键值对列表
|
||||
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH);
|
||||
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
||||
|
||||
|
||||
// 格式为 T/CSAE 175-2021
|
||||
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
replaceStandIdMaps.forEach(item->{
|
||||
if (item!=null){
|
||||
//此标准代替的标准的标准号的数组
|
||||
String DTBJHStr = item.get("DTBJH").toString();
|
||||
|
||||
//数据格式: (GB 123-2000,GB 4233434-2021,GB 423423423-2021)
|
||||
if (!DTBJHStr.equals("")){
|
||||
if (!DTBJHStr.equals("")) {
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
String[] sortAndNumberAndYear = DTBJH.split("\\s+");
|
||||
String sort = sortAndNumberAndYear[0];
|
||||
|
||||
String[] numberAndYear = sortAndNumberAndYear[1].split("\\-");
|
||||
String number=numberAndYear[0];
|
||||
String year=numberAndYear[1];
|
||||
if (!pattern.matcher(DTBJH).matches()){
|
||||
continue;
|
||||
}
|
||||
|
||||
String[] split = DTBJH.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
String sort = split[0];
|
||||
String number = split[1];
|
||||
String year = split[2];
|
||||
|
||||
QueryWrapper<SarStandardsInfo> infoWrapper = new QueryWrapper<>();
|
||||
infoWrapper.select("ID")
|
||||
.eq("STAND_SORT",sort)
|
||||
.eq("STAND_NUMBER",number)
|
||||
.eq("STAND_YEAR",year);
|
||||
.eq("STAND_SORT", sort)
|
||||
.eq("STAND_NUMBER", number)
|
||||
.eq("STAND_YEAR", year);
|
||||
|
||||
|
||||
List<Map<String, Object>> idMaps = sarStandardsInfoDao.selectMaps(infoWrapper);
|
||||
String standId = idMaps.get(0).get("ID").toString();
|
||||
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (replaceIdCountMap.containsKey(standId)) {
|
||||
replaceIdCountMap.replace(standId,2);
|
||||
}else {
|
||||
replaceIdCountMap.put(standId, 1);
|
||||
if (idMaps.size() > 0) {
|
||||
String standId = idMaps.get(0).get("ID").toString();
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (replaceIdCountMap.containsKey(standId)) {
|
||||
replaceIdCountMap.replace(standId, 2);
|
||||
} else {
|
||||
replaceIdCountMap.put(standId, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.adc.da.scheduled;
|
||||
|
||||
import com.adc.da.slrs.DataSync.DataSyncController;
|
||||
import com.adc.da.slrs.DataSync.service.IDataSyncService;
|
||||
import com.sun.org.apache.bcel.internal.generic.NEW;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* 定时同步用户和组织机构信息
|
||||
*/
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ScheduledSync {
|
||||
|
||||
@Autowired
|
||||
private IDataSyncService iDataSyncService;
|
||||
|
||||
|
||||
// @Scheduled(cron = "0 */40 * * * ?") //40分钟执行同步一次
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
|
||||
@Async
|
||||
public void syncSchedulingTasks() throws Exception {
|
||||
iDataSyncService.orgDataSync(); //时间短
|
||||
iDataSyncService.dataSync(); //时间长
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.adc.da.slrs.DataSync;
|
||||
|
||||
import com.adc.da.slrs.DataSync.service.IDataSyncService;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||
import com.adc.da.slrs.sarInstitution.service.impl.TsInstitutionServiceImpl;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarPosition.service.impl.TsPositionServiceImpl;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.sarUser.service.impl.TsUserServiceImpl;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
import com.adc.da.sys.dao.OrgEODao;
|
||||
import com.adc.da.sys.entity.OrgEO;
|
||||
import com.adc.da.sys.entity.UserOrgEO;
|
||||
import com.adc.da.sys.service.IOrgEOService;
|
||||
import com.adc.da.sys.service.impl.OrgEOServiceImpl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@Api(description = "|SarStandPutTime|")
|
||||
@RequestMapping("/${restPath}/DataSync")
|
||||
public class DataSyncController {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private IDataSyncService iDataSyncService;
|
||||
|
||||
|
||||
@ApiOperation("同步用户数据")
|
||||
@PostMapping("/importUserData")
|
||||
public String importUserData() throws Exception {
|
||||
return iDataSyncService.dataSync();
|
||||
}
|
||||
|
||||
@ApiOperation("同步组织机构")
|
||||
@PostMapping("/importOrgData")
|
||||
public String importOrgData() throws Exception {
|
||||
return iDataSyncService.orgDataSync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.adc.da.slrs.DataSync.service;
|
||||
|
||||
public interface IDataSyncService {
|
||||
|
||||
public String dataSync() throws Exception;
|
||||
|
||||
public String orgDataSync() throws Exception;
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
package com.adc.da.slrs.DataSync.service.impl;
|
||||
|
||||
import com.adc.da.slrs.DataSync.service.IDataSyncService;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
import com.adc.da.sys.entity.UserOrgEO;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class DataSyncServiceImpl implements IDataSyncService {
|
||||
|
||||
|
||||
@Autowired
|
||||
ITsPositionService tsPositionService;
|
||||
@Autowired
|
||||
ITsUserService tsUserService;
|
||||
@Autowired
|
||||
ITsInstitutionService tsInstitutionService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String dataSync() throws Exception {
|
||||
SyncUserService syncUserService = new SyncUserService();
|
||||
List<String> res = syncUserService.syncFotonUser();
|
||||
//存放岗位信息
|
||||
Map<String, String> positionMap = new HashMap<>();
|
||||
Map<String, String> useDistinct = new HashMap<>();
|
||||
TsPosition position = new TsPosition();
|
||||
position.setCurrent(1);
|
||||
position.setPageSize(100000);
|
||||
IPage<TsPosition> iPage = tsPositionService.getPosition(position);
|
||||
List<TsPosition> positions=iPage.getRecords();
|
||||
if (!positions.isEmpty()) {
|
||||
positions.forEach(tsPosition -> {
|
||||
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到数据时,删除系统表中所有用户信息
|
||||
*/
|
||||
if (res.size()>0){
|
||||
tsUserService.deleteUser();
|
||||
}
|
||||
for (String s : res) {
|
||||
//获取到所有用户数据
|
||||
List<TsUser> tsUsers = new ArrayList<>();
|
||||
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||
jsonArray.forEach(object -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
//先获取岗位以及岗位id
|
||||
TsUser tsUser = new TsUser();
|
||||
UserOrgEO userOrgEO = new UserOrgEO();
|
||||
//设置岗位
|
||||
if (null != jsonObject.getString("title")) {
|
||||
//通过岗位名称查询系统表中是否有岗位,有则设定用户的岗位为系统中的岗位,否则新增
|
||||
if (null == positionMap.get(jsonObject.getString("title"))) {
|
||||
TsPosition tsPosition = new TsPosition();
|
||||
tsPosition.setId(String.valueOf(UUID.randomUUID()));
|
||||
tsPosition.setName(jsonObject.getString("title"));
|
||||
tsPositionService.addPosition(tsPosition);
|
||||
//放入岗位的map集合中
|
||||
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||
//放入类中
|
||||
tsUser.setPositionName(tsPosition.getName());
|
||||
tsUser.setPositionId(tsPosition.getId());
|
||||
} else {
|
||||
tsUser.setPositionName(jsonObject.getString("title").trim());
|
||||
tsUser.setPositionId(positionMap.get(jsonObject.getString("title").trim()));
|
||||
}
|
||||
}
|
||||
//设置其他数据
|
||||
Timestamp createTime = new Timestamp(new Date().getTime());
|
||||
tsUser.setState(jsonObject.getString("userStatus"));
|
||||
tsUser.setUname(null!=jsonObject.getString("name")?jsonObject.getString("name"):"");
|
||||
tsUser.setValidFlag("0");
|
||||
tsUser.setDisableFlag("0");
|
||||
tsUser.setCreationTime(createTime);
|
||||
tsUser.setUserId(jsonObject.getString("userid"));
|
||||
tsUser.setAccount(jsonObject.getString("userid"));
|
||||
tsUser.setInstitutionId(null!=jsonObject.getString("orgNumber")?jsonObject.getString("orgNumber"):"" );
|
||||
tsUser.setInstitutionName(null!=jsonObject.getString("orgName")?jsonObject.getString("orgName"):"" );
|
||||
if (null == useDistinct.get(jsonObject.getString("userid"))) {
|
||||
tsUsers.add(tsUser);
|
||||
|
||||
}
|
||||
|
||||
// //测试数据删除
|
||||
// if (! "anbin".equals(jsonObject.getString("userid"))){
|
||||
//
|
||||
// //测试数据修改
|
||||
// if ("anbing".equals(jsonObject.getString("userid"))){
|
||||
// tsUser.setUname("DDDDDD");
|
||||
// tsUsers.add(tsUser);
|
||||
// } else if (null == useDistinct.get(jsonObject.getString("userid"))) {
|
||||
// tsUsers.add(tsUser);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
useDistinct.put(tsUser.getUserId(),tsUser.getUserId());
|
||||
});
|
||||
tsUserService.saveBatch(tsUsers);
|
||||
}
|
||||
|
||||
//测试数据添加
|
||||
// TsUser addUser = new TsUser();
|
||||
// addUser.setState("FFFFFFF");
|
||||
// addUser.setUname("zhaokaiyao");
|
||||
// addUser.setValidFlag("0");
|
||||
// addUser.setDisableFlag("0");
|
||||
// addUser.setCreationTime(new Timestamp(new Date().getTime()));
|
||||
// addUser.setUserId("FFFFFFF");
|
||||
// addUser.setAccount("zhaokaiyao");
|
||||
// addUser.setInstitutionId("10022745");
|
||||
// addUser.setInstitutionName("福田营销其他");
|
||||
//
|
||||
// List<TsUser> addUserList = Arrays.asList(addUser);
|
||||
// tsUserService.saveBatch(addUserList);
|
||||
return "1";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String orgDataSync() throws Exception {
|
||||
SyncUserService syncUserService = new SyncUserService();
|
||||
List<String> res = syncUserService.syncFotonOrg();
|
||||
|
||||
//获取到所有用户数据
|
||||
List<String> strings=new ArrayList<>();
|
||||
|
||||
tsInstitutionService.clearData();
|
||||
for (String s : res) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||
jsonArray.forEach(object -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
strings.add(jsonObject.getString("parentOrgNumber"));
|
||||
});
|
||||
}
|
||||
for (String s : res) {
|
||||
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||
jsonArray.forEach(object -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||
TsInstitution tsInstitution=new TsInstitution();
|
||||
tsInstitution.setId(jsonObject.getString("orgNumber"));
|
||||
tsInstitution.setName(jsonObject.getString("orgName"));
|
||||
tsInstitution.setHasChild(strings.contains(jsonObject.getString("orgNumber"))?"1":"0");
|
||||
tsInstitution.setParentId(jsonObject.getString("parentOrgNumber"));
|
||||
//部门为"null"的数据不保存
|
||||
if (!"null".equals(jsonObject.getString("orgName"))){
|
||||
tsInstitutions.add(tsInstitution);
|
||||
}
|
||||
});
|
||||
tsInstitutionService.saveBatch(tsInstitutions);
|
||||
}
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.adc.da.slrs.ImportExcelDatas.comment;
|
||||
|
||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||
import com.adc.da.utils.util.BussStandExportUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class ExclErrorOut {
|
||||
private static final Logger logger = LoggerFactory.getLogger(BussStandExportUtil.class);
|
||||
|
||||
public static Workbook exportDatas (List<ImportDto> datas,String header) {
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
try {
|
||||
|
||||
|
||||
//创建工作表对象
|
||||
Sheet sheet = workbook.createSheet();
|
||||
// 创建头部
|
||||
createHeader(workbook,sheet,header);
|
||||
// 创建数据
|
||||
createDatas(workbook,sheet,datas);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
|
||||
public static void createHeader(Workbook workbook, Sheet sheet, String header){
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
Row rowHeader = sheet.createRow(0);//开始创建标题行
|
||||
if (StringUtils.isNotBlank(header)) {
|
||||
String[] headerArr = header.split(",");
|
||||
for (int i=0;i < headerArr.length; i++) {
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
// rowHeader.createCell(i).setCellStyle(cellStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void createDatas(Workbook workbook,Sheet sheet,List<ImportDto> datas) throws Exception{
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
for (int i=0;i < datas.size(); i++) {
|
||||
ImportDto importDto = datas.get(i);
|
||||
Row row = sheet.createRow(i+1);
|
||||
|
||||
int sheetNum = 0;
|
||||
|
||||
Class cls = importDto.getClass();
|
||||
Field[] fields = cls.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true);
|
||||
if (field.get(importDto)!=null){
|
||||
String value = field.get(importDto).toString();
|
||||
row.createCell(sheetNum).setCellValue(value);
|
||||
}else {
|
||||
row.createCell(sheetNum).setCellValue("");
|
||||
}
|
||||
sheetNum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.adc.da.slrs.ImportExcelDatas.comment;
|
||||
|
||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class ExclExport extends ExclErrorOut {
|
||||
|
||||
|
||||
/**
|
||||
* 导出多个sheet页的excl
|
||||
*/
|
||||
public Workbook exportData(Map<String, List<ImportDto>> dataMap, String header) {
|
||||
Workbook workbook=new XSSFWorkbook();
|
||||
|
||||
try {
|
||||
for (Map.Entry<String, List<ImportDto>> entry : dataMap.entrySet()) {
|
||||
List<ImportDto> datas = entry.getValue();
|
||||
Sheet sheet = workbook.createSheet(entry.getKey());
|
||||
super.createHeader(workbook,sheet,header);
|
||||
super.createDatas(workbook,sheet,datas);
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return workbook;
|
||||
}
|
||||
}
|
||||
+46
-5
@@ -1,15 +1,23 @@
|
||||
package com.adc.da.slrs.ImportExcelDatas.controller;
|
||||
|
||||
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.entity.ImportDto;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.impl.ImportExcelServiceImpl;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStar;
|
||||
import com.adc.da.slrs.sarPersonalCenter.entity.SarUserStarEO;
|
||||
import com.adc.da.util.exception.AdcDaBaseException;
|
||||
import com.adc.da.util.utils.IOUtils;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.adc.da.utils.util.BussStandExportUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -17,6 +25,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -28,14 +40,43 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
@Autowired
|
||||
private ImportExcelService importExcelService;
|
||||
|
||||
@Autowired
|
||||
private ExclErrorOut exclErrorOut;
|
||||
|
||||
@ApiOperation("批量删除用户收藏")
|
||||
@PostMapping("/import")
|
||||
public ResponseMessage<Boolean> deleteList(MultipartFile file,MultipartFile file2) {
|
||||
public void deleteList(MultipartFile file, MultipartFile file2, HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||
Map<String, List<ImportDto>> mapMap=importExcelService.getExcelData(file,file2);
|
||||
ResponseMessage responseMessage=new ResponseMessage();
|
||||
responseMessage.setMessage(mapMap.toString());
|
||||
responseMessage.isOk();
|
||||
return responseMessage;
|
||||
List<ImportDto> errorList = importExcelService.storageExclData(mapMap);
|
||||
// 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 {
|
||||
|
||||
String exportName="错误表格";
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
|
||||
response.setContentType("application/force-download");
|
||||
//导出数据
|
||||
String headStr="标准号,标准名称,英文名称,发布时间,实施时间,标准状态,代替标准号,附件路径,错误原因";
|
||||
workbook = exclErrorOut.exportDatas(errorList,headStr);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// return responseMessage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,4 +22,7 @@ public class ImportDto extends BaseEntity {
|
||||
private String replaceId;
|
||||
// 附件路径
|
||||
private String path;
|
||||
|
||||
// 错误原因
|
||||
private String errorStr;
|
||||
}
|
||||
|
||||
+3
@@ -11,4 +11,7 @@ public interface ImportExcelService extends IService<ImportDto> {
|
||||
|
||||
Map<String, List<ImportDto>> getExcelData(MultipartFile file,MultipartFile file2);
|
||||
|
||||
|
||||
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap);
|
||||
|
||||
}
|
||||
|
||||
+492
-17
@@ -1,39 +1,77 @@
|
||||
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;
|
||||
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;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
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.regex.Pattern;
|
||||
|
||||
@Service
|
||||
public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDto> implements ImportExcelService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
// @Autowired
|
||||
// private CreateStandMQService createStandMQService;
|
||||
//
|
||||
// @Autowired
|
||||
// private SarStandardsInfoServiceImpl sarStandardsInfoService;
|
||||
//
|
||||
//
|
||||
//
|
||||
// @Autowired
|
||||
// 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," +
|
||||
"Q-AMSN,QB-NE,Q-IOUM,Q房/AYJ,KNT";
|
||||
private final static String DATE = "-2008,—2008,-2009,—2009,-2010,—2010,-2011,—2011,-2012,—2012,-2013,—2013," +
|
||||
"- 2008,— 2008,- 2009,— 2009,- 2010,— 2010,- 2011,— 2011,- 2012,— 2012,- 2013,— 2013" +
|
||||
",-2014,—2014,-2015,—2015,-2016,—2016,-2017,—2017,-2018,—2018,-2019,—2019,-2020,—2020,-2021,—2021" +
|
||||
",- 2014,— 2014,- 2015,— 2015,- 2016,— 2016,- 2017,— 2017,- 2018,— 2018,- 2019,— 2019,- 2020,— 2020,- 2021,— 2021";
|
||||
|
||||
|
||||
// file 为主 file2 为附件
|
||||
@Override
|
||||
public Map<String, List<ImportDto>> getExcelData(MultipartFile file, MultipartFile file2) {
|
||||
|
||||
List<String> dates = new ArrayList<>();
|
||||
for (int i = 1669; i < 2023; i++) {
|
||||
dates.add("-" + i);
|
||||
dates.add("—" + i);
|
||||
dates.add("- " + i);
|
||||
dates.add("— " + i);
|
||||
}
|
||||
|
||||
if (file == null || file.getSize() == 0) {
|
||||
log.error("文件上传错误,重新上传");
|
||||
}
|
||||
@@ -82,10 +120,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
datas.forEach(items -> {
|
||||
//判断是否是正确的数据
|
||||
String[] as = items.split(",");
|
||||
if (!inDate(as[0])) {
|
||||
if (!inDate(as[0], dates)) {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
error.add(importDto);
|
||||
middle.put(as[0].trim(), "error-"+error.size());
|
||||
middle.put(as[0].trim(), "error-" + error.size());
|
||||
} else {
|
||||
//数据二次拆解 针对标准进行拆解
|
||||
String[] step2 = as[0].trim().split(" ");
|
||||
@@ -93,15 +131,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[0].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[0].trim(), "QYBZ-" + QiBiao.size());
|
||||
} else {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
OutCountry.add(importDto);
|
||||
middle.put(as[0].trim(), "HWBZ-"+OutCountry.size());
|
||||
middle.put(as[0].trim(), "HWBZ-" + OutCountry.size());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -110,23 +148,22 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
res.put("QYBZ", QiBiao);
|
||||
res.put("HWBZ", OutCountry);
|
||||
|
||||
fujian.forEach(items2 ->{
|
||||
String[] fj=items2.split(",");
|
||||
if (fj.length>2) {
|
||||
fujian.forEach(items2 -> {
|
||||
String[] fj = items2.split(",");
|
||||
if (fj.length > 2) {
|
||||
if (null != middle.get(null != fj[2] ? fj[2].trim() : "")) {
|
||||
//对应数据位置
|
||||
String[] location = middle.get(fj[2].trim()).split("-");
|
||||
res.get(location[0]).get(Integer.parseInt(location[1])-1).setPath(fj[3]);
|
||||
res.get(location[0]).get(Integer.parseInt(location[1]) - 1).setPath(fj[3]);
|
||||
}
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
private boolean inDate(String as) {
|
||||
List<String> dates = new ArrayList<>(Arrays.asList(DATE.split(",")));
|
||||
private boolean inDate(String as, List<String> dates) {
|
||||
if (null != as && !"".equals(as)) {
|
||||
for (String s : dates) {
|
||||
if (s.equals(as.trim())) {
|
||||
@@ -227,4 +264,442 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private List<ImportDto> error = new ArrayList<>();
|
||||
|
||||
private List<ImportDto> fileError = new ArrayList<>();
|
||||
|
||||
@Autowired
|
||||
private ISarStandardsInfoService sarStandardsInfoService;
|
||||
|
||||
@Autowired
|
||||
private DicTypeEOServiceImpl dicTypeEOService;
|
||||
|
||||
@Autowired
|
||||
private ISarBussionessStandService sarBussionessStandService;
|
||||
@Override
|
||||
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap) {
|
||||
|
||||
|
||||
|
||||
error = importListMap.get("error");
|
||||
/**
|
||||
* 初始化国内外标准属性字段
|
||||
*/
|
||||
List<String> listStandField = InitStandAttrUtil.queryFieldList;
|
||||
Map<String,String> standAttrMap = new TreeMap<>();
|
||||
listStandField.forEach(item ->{
|
||||
standAttrMap.put(item,"");
|
||||
});
|
||||
|
||||
/**
|
||||
* 海外标准
|
||||
*/
|
||||
importListMap.get("HWBZ").forEach(item -> {
|
||||
|
||||
String standID = UUIDUtils.randomUUID20();
|
||||
|
||||
//使用初始化的属性字段映射 获得key值,value为""
|
||||
Map<String, String> mapField = standAttrMap;
|
||||
SarStandardsInfo ForeignEO = parseImportDtoToStandardsInfo(item,mapField, standID);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
if (one != null) {
|
||||
ForeignEO.setId(one.getId());
|
||||
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(ForeignEO);
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("标准更新失败");
|
||||
error.add(item);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
try {
|
||||
sarStandardsInfoService.createSarStandardsInfo(ForeignEO);
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("标准新增失败");
|
||||
error.add(item);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} 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) {
|
||||
|
||||
|
||||
InlandEO.setValidFlag("0");
|
||||
InlandEO.setStandType("INLAND");
|
||||
|
||||
|
||||
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||
standSaveWrapper
|
||||
.eq("STAND_SORT", InlandEO.getStandSort())
|
||||
.eq("STAND_NUMBER", InlandEO.getStandNumber())
|
||||
.eq("STAND_YEAR", InlandEO.getStandYear());
|
||||
|
||||
|
||||
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 {
|
||||
item.setErrorStr("标准号无法解析");
|
||||
error.add(item);
|
||||
importListMap.replace("error", error);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 企业标准
|
||||
*/
|
||||
|
||||
/**
|
||||
* 初始化企业标准属性字段
|
||||
*/
|
||||
List<String> listStandBussField = InitStandAttrUtil.queryFieldListBuss;
|
||||
Map<String,String> bussAttrMap = new TreeMap<>();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("数据格式错误");
|
||||
error.add(item);
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
error.addAll(fileError);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 整理为标准信息实体
|
||||
* @param importDto
|
||||
* @param fieldMap 属性字段
|
||||
* @param standId
|
||||
* @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);
|
||||
|
||||
|
||||
sarStandardsInfoEO.setStandSort(analysis.get("sort"));
|
||||
sarStandardsInfoEO.setStandNumber(analysis.get("number"));
|
||||
sarStandardsInfoEO.setStandYear(analysis.get("year"));
|
||||
|
||||
sarStandardsInfoEO.setStandName(importDto.getStandName());
|
||||
sarStandardsInfoEO.setStandEnName(importDto.getStandNameEN());
|
||||
|
||||
/**
|
||||
* 截取发布日期 年月日
|
||||
*/
|
||||
String issueDate = importDto.getPublishTime().substring(0, 19);
|
||||
sarStandardsInfoEO.setIssueTime(issueDate);//标准发布日期
|
||||
|
||||
String standStatus = importDto.getStandStatus();
|
||||
if ("有效".equals(standStatus)) {
|
||||
sarStandardsInfoEO.setTextStatus("vsaga7nwub");//现行有效
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准属性字段
|
||||
*/
|
||||
|
||||
fieldMap.put("DTBJH", importDto.getReplaceId());
|
||||
fieldMap.put("SSRQ", importDto.getImplementedTime().substring(0, 19));
|
||||
|
||||
|
||||
/**
|
||||
* 文件
|
||||
*/
|
||||
if (importDto.getPath() != null) {
|
||||
String path[] = importDto.getPath().split("/");
|
||||
String realPath = "";
|
||||
for (int i = 4; i < path.length; i++) {
|
||||
realPath = realPath + "/" + path[i];
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
|
||||
// File file = new File(importPath + realPath);
|
||||
File file = new File("/home/file/2021/" + realPath);
|
||||
if (file.exists()) {
|
||||
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
|
||||
|
||||
if (importDto.getImplementedTime() != null) {
|
||||
fieldMap.put("FBGJBD", fileInfo.getAttId());
|
||||
} else {
|
||||
fieldMap.put("GLWJ", fileInfo.getAttId());
|
||||
}
|
||||
|
||||
} else {
|
||||
importDto.setErrorStr("文件不存在");
|
||||
fileError.add(importDto);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
importDto.setErrorStr("文件打开失败");
|
||||
fileError.add(importDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
// attrInfoMap.put("")
|
||||
Gson gson = new Gson();
|
||||
String attrInfoJson = gson.toJson(fieldMap);
|
||||
sarStandardsInfoEO.setSarStandAttrEOStr(attrInfoJson);//新增修改时属性表信息
|
||||
|
||||
|
||||
return sarStandardsInfoEO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 整理为企业标准实体
|
||||
* @param importDto
|
||||
* @param standId
|
||||
* @return
|
||||
*/
|
||||
public SarBussionessStand parseImportDtoToSarBussionessStand(ImportDto importDto,Map<String,String> fieldMap, String standId) {
|
||||
|
||||
|
||||
HashMap<String, String> analysis = analysisStandId(importDto);
|
||||
if (analysis == null) {
|
||||
return null;
|
||||
} else {
|
||||
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||
sarBussionessStand.setId(standId);
|
||||
sarBussionessStand.setStandSort(analysis.get("sort"));
|
||||
sarBussionessStand.setStandYear(analysis.get("year"));
|
||||
sarBussionessStand.setStandCode(importDto.getStandId());
|
||||
sarBussionessStand.setStandName(importDto.getStandName());
|
||||
sarBussionessStand.setStandEnName(importDto.getStandNameEN());
|
||||
sarBussionessStand.setIssueTime(importDto.getPublishTime());
|
||||
sarBussionessStand.setPutTime(importDto.getImplementedTime());
|
||||
sarBussionessStand.setReplacedStandNum(importDto.getReplaceId());
|
||||
sarBussionessStand.setValidFlag(0);
|
||||
if ("有效".equals(importDto.getStandStatus())) {
|
||||
sarBussionessStand.setTextStatusBuss("vsaga7nwub");
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业标准属性字段
|
||||
*/
|
||||
|
||||
|
||||
if (importDto.getPath() != null) {
|
||||
String path[] = importDto.getPath().split("/");
|
||||
String realPath = "";
|
||||
for (int i = 4; i < path.length; i++) {
|
||||
realPath = realPath + "/" + path[i];
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
|
||||
// File file = new File(importPath + realPath);
|
||||
File file = new File("/home/file/2021/" + realPath);
|
||||
|
||||
if (file.exists()) {
|
||||
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
|
||||
|
||||
|
||||
if (importDto.getImplementedTime()!=null && importDto.getImplementedTime()!=""){
|
||||
fieldMap.put("FBGBUSS",fileInfo.getAttId());
|
||||
|
||||
}else {
|
||||
fieldMap.put("GLWJBUSS",fileInfo.getAttId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
importDto.setErrorStr("文件不存在");
|
||||
fileError.add(importDto);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
importDto.setErrorStr("路径错误!");
|
||||
fileError.add(importDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
String attrInfoJson = new Gson().toJson(fieldMap);
|
||||
sarBussionessStand.setSarStandAttrEOStr(attrInfoJson);//新增修改时属性表信息
|
||||
return sarBussionessStand;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析标准号,标准类别不存在则新增
|
||||
* @param importDto
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String, String> analysisStandId(ImportDto importDto) {
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
if (importDto.getStandId() == null) {
|
||||
importDto.setErrorStr("标准号为空");
|
||||
error.add(importDto);
|
||||
return null;
|
||||
} else {
|
||||
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()) {
|
||||
importDto.setErrorStr("标准号无法解析");
|
||||
error.add(importDto);
|
||||
return null;
|
||||
}
|
||||
|
||||
String sort = "";
|
||||
String number = "";
|
||||
String year = "";
|
||||
String[] split = importDto.getStandId().split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
|
||||
|
||||
// 多种格式(╯‵□′)╯︵┻━┻ Q-FL T015-2021 Q/ FL T015-2021 Q/FL T015-2021
|
||||
int length = split.length;
|
||||
number = split[length - 2];
|
||||
year = split[length - 1];
|
||||
for (int i = 0; i < length - 2; i++) {
|
||||
sort += split[i];
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
-1
@@ -14,7 +14,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -52,6 +52,9 @@ public class SarBussStandAttrInfo extends BaseEntity {
|
||||
@TableField("MODIFY_TIME")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String glwj;
|
||||
//
|
||||
// @TableField("SVPPS")
|
||||
// private String svpps;
|
||||
|
||||
+2
@@ -24,6 +24,8 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
||||
|
||||
SarBussionessStand updateSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception;
|
||||
|
||||
ResponseMessage<SarBussionessStand> createSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception;
|
||||
|
||||
List<SarBussionessStand> selectStandardsByStandNumber(String replaceStandNum);
|
||||
|
||||
SarBussionessStand selectStandardsInfoByKey(String id) throws Exception;
|
||||
|
||||
@@ -54,9 +54,12 @@ public interface TsInstitutionDao extends BaseMapper<TsInstitution> {
|
||||
* 查询根机构
|
||||
* @return List<TsInstitution>
|
||||
*/
|
||||
@Select("select * from ts_institution where parent_id not in (select id from ts_institution)")
|
||||
@Select("select * from ts_institution where parent_id not in (select id from ts_institution) order by name")
|
||||
List<TsInstitution> selectRoot();
|
||||
|
||||
@Select("select * from ts_institution order by rand() limit 1")
|
||||
TsInstitution selectRand();
|
||||
|
||||
int clearData();
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -42,4 +42,6 @@ public interface ITsInstitutionService extends IService<TsInstitution> {
|
||||
* @return
|
||||
*/
|
||||
public List<TsInstitution> getFirst();
|
||||
|
||||
int clearData();
|
||||
}
|
||||
|
||||
+5
@@ -213,4 +213,9 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
|
||||
return tsInstitutions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int clearData() {
|
||||
return tsInstitutionDao.clearData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-2
@@ -208,8 +208,12 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setZRBM(completedString);
|
||||
try {
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setZRBM(completedString);
|
||||
}catch (Exception e){
|
||||
System.out.println(e);
|
||||
}
|
||||
}else {
|
||||
for (Map<String, String> map1 : zrbn) {
|
||||
if (map1.get("value").equals(list1.getZRBM())) {
|
||||
|
||||
+13
-13
@@ -48,66 +48,66 @@ public class LawsDto {
|
||||
private String NYLX;
|
||||
|
||||
@ApiModelProperty(value = "标准年份")
|
||||
@ExcelProperty(value = "标准年份", index = 5)
|
||||
// @ExcelProperty(value = "标准年份", index = 5)
|
||||
private String standYear;
|
||||
|
||||
@ApiModelProperty(value = "标准类别")
|
||||
@ExcelProperty(value = "标准类别", index = 6)
|
||||
// @ExcelProperty(value = "标准类别", index = 6)
|
||||
private String standSortShow;
|
||||
|
||||
@ApiModelProperty(value = "标准发表日期")
|
||||
@ExcelProperty(value = "标准发表日期", index = 7)
|
||||
// @ExcelProperty(value = "标准发表日期", index = 7)
|
||||
private String issueTime;
|
||||
|
||||
@ColumnWidth(16)
|
||||
@ExcelProperty(value = "标准实施日期", index = 8)
|
||||
@ExcelProperty(value = "标准实施日期", index = 5)
|
||||
@ApiModelProperty(value = "标准实施日期")
|
||||
@DateTimeFormat("yyyy年MM月dd日")
|
||||
private String SSRQ;
|
||||
|
||||
@ColumnWidth(16)
|
||||
@ExcelProperty(value = "新车型实施日期", index = 9)
|
||||
@ExcelProperty(value = "新车型实施日期", index = 6)
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@DateTimeFormat("yyyy年MM月dd日")
|
||||
private String XCXSSRQGJ;
|
||||
|
||||
@ColumnWidth(16)
|
||||
@ExcelProperty(value = "在产车实施日期", index = 10)
|
||||
@ExcelProperty(value = "在产车实施日期", index = 7)
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@DateTimeFormat("yyyy年MM月dd日")
|
||||
private String ZCCSSRQGJ;
|
||||
|
||||
@ExcelProperty(value = "责任部门", index = 11)
|
||||
@ExcelProperty(value = "责任部门", index = 8)
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
private String ZRBM;
|
||||
|
||||
@ColumnWidth(14)
|
||||
@ExcelProperty(value = "适用产品线", index = 12)
|
||||
@ExcelProperty(value = "适用产品线", index = 9)
|
||||
@ApiModelProperty(value = "适用产品线")
|
||||
private String SYCPX;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车VPPS编码", index = 13)
|
||||
@ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
@ApiModelProperty(value = "乘用车VPPS编码")
|
||||
private String CYCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车vpps中文名称", index = 14)
|
||||
@ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
@ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
private String CYCVPPSCN;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车VPPS编码", index = 15)
|
||||
@ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
@ApiModelProperty(value = "卡车VPPS编码")
|
||||
private String KCCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车vpps中文名称", index = 16)
|
||||
@ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
@ApiModelProperty(value = "卡车vpps中文名称")
|
||||
private String KCCVPPSCN;
|
||||
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
@ExcelProperty(value = "责任工程师", index = 17)
|
||||
// @ExcelProperty(value = "责任工程师", index = 17)
|
||||
private String responsibleEngineer;
|
||||
|
||||
@ApiModelProperty(value = "1")
|
||||
|
||||
+28
-18
@@ -57,16 +57,19 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("stand_id",lawsDto.getId())
|
||||
.eq("detailed_list_id",sarFindDto.getId());
|
||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq())){
|
||||
lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq())){
|
||||
lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq())){
|
||||
lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
}
|
||||
/**
|
||||
*2021/9/13 摒弃使用清单实施日期,改用标准实施日期
|
||||
*/
|
||||
// List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);/
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq())){
|
||||
// lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
// }
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq())){
|
||||
// lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
// }
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq())){
|
||||
// lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
// }
|
||||
if ("INLAND".equals(lawsDto.getStandType()))lawsDto.setStandType("INLAND_STAND");
|
||||
if ("FOREIGN".equals(lawsDto.getStandType()))lawsDto.setStandType("FOREIGN_STAND");
|
||||
}
|
||||
@@ -281,18 +284,25 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
xcx = mapList.get("新车型实施日期("+s.getCountry()+")");
|
||||
zcc = mapList.get("在产车实施日期("+s.getCountry()+")");
|
||||
|
||||
}else {
|
||||
dateTime(mapList,s);
|
||||
}
|
||||
dateTime(mapList, putTime, xcx, zcc, s);
|
||||
|
||||
|
||||
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
private void dateTime(LinkedHashMap<String, List<String>> mapList, List<String> putTime, List<String> xcx, List<String> zcc, StandRegionalTimeDto s) {
|
||||
putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime()));
|
||||
xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
|
||||
zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
|
||||
mapList.put("实施日期("+s.getCountry()+")",putTime);
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")",xcx);
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")",zcc);
|
||||
private void dateTime(LinkedHashMap<String, List<String>> mapList, StandRegionalTimeDto s) {
|
||||
String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq());
|
||||
String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq());
|
||||
// putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
// xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
|
||||
// zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
|
||||
mapList.put("实施日期("+s.getCountry()+")", Collections.singletonList(putTime));
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")", Collections.singletonList(xcx));
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")", Collections.singletonList(zcc));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -599,6 +599,11 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
@Override
|
||||
public void standardToLaws(String countryArea,TimeDto timeDto) {
|
||||
|
||||
if (countryArea==null){
|
||||
countryArea="";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 加入对应"国家/地区"的清单列表
|
||||
*/
|
||||
|
||||
+25
-5
@@ -3,14 +3,18 @@ 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 io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
@@ -31,10 +35,14 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
|
||||
@Autowired
|
||||
private ISarModelTreeService iSarModelTreeService;
|
||||
|
||||
@Autowired
|
||||
private ISarModuleTreeService iSarModuleTreeService;
|
||||
|
||||
@ApiOperation("查询父所有资源")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<List<SarModelTree>> getAll(SarModelTree sarVppsTree){
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(sarVppsTree);
|
||||
public ResponseMessage<List<SarModelTree>> getAll(){
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
// List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@@ -46,4 +54,16 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("同步模块单元信息")
|
||||
@PostMapping("/save")
|
||||
public ResponseDto save(@RequestBody String json){
|
||||
//todo 实现解析并存储的到数据库
|
||||
Head head = iSarModuleTreeService.analysisJsonAndStorage(json);
|
||||
ResponseDto responseDto = new ResponseDto(head);
|
||||
return responseDto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.adc.da.slrs.sarModelTree.dao;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface SarModuleTreeDao extends BaseMapper<SarModuleTree> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.sarModelTree.entity;
|
||||
|
||||
/**
|
||||
* 同步数据时使用的返回给其他系统的结果
|
||||
*/
|
||||
public class ResponseResult {
|
||||
private String GUID; //序列号 业务主键
|
||||
|
||||
private String MESSAGE; //接口信息 失败时,详细的失败原因
|
||||
|
||||
private String STATUS; //接口状态 B(失败),S(成功)
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.adc.da.slrs.sarModelTree.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("sar_module_tree")
|
||||
public class SarModuleTree {
|
||||
|
||||
@SerializedName("GUID")
|
||||
@TableId
|
||||
private String guid;
|
||||
@SerializedName("FTVSTYPE1")
|
||||
@TableField("FTVSTYPE1")
|
||||
private String ftvstype1;
|
||||
|
||||
|
||||
@SerializedName("FTVSTYPE2")
|
||||
@TableField("FTVSTYPE2")
|
||||
private String ftvstype2;
|
||||
|
||||
@SerializedName("FTVSTYPE3")
|
||||
@TableField("FTVSTYPE3")
|
||||
private String ftvstype3;
|
||||
|
||||
@SerializedName("FTVSTYPE4")
|
||||
@TableField("FTVSTYPE4")
|
||||
private String ftvstype4;
|
||||
|
||||
@SerializedName("FTVSTYPE5")
|
||||
@TableField("FTVSTYPE5")
|
||||
private String ftvstype5;
|
||||
|
||||
@SerializedName("FTVSTYPE6")
|
||||
@TableField("FTVSTYPE6")
|
||||
private String ftvstype6;
|
||||
|
||||
@SerializedName("FTVSTYPE7")
|
||||
@TableField("FTVSTYPE7")
|
||||
private String ftvstype7;
|
||||
|
||||
@SerializedName("FTVSTYPE9")
|
||||
@TableField("FTVSTYPE9")
|
||||
private String ftvstype9;
|
||||
|
||||
@SerializedName("ACLUSERNAMES")
|
||||
@TableField("ACLUSERNAMES")
|
||||
private String aclusernames;
|
||||
|
||||
@SerializedName("CREATOR")
|
||||
@TableField("CREATOR")
|
||||
private String creator;
|
||||
|
||||
@SerializedName("SERIESID")
|
||||
@TableField("SERIESID")
|
||||
private String seriesid; //SF_ID
|
||||
|
||||
@SerializedName("RESERVED")
|
||||
@TableField("RESERVED")
|
||||
private String reserved; //SE_ID
|
||||
|
||||
@SerializedName("STARTED")
|
||||
@TableField("STARTED")
|
||||
private String started; //SU_ID
|
||||
|
||||
@SerializedName("CREATIONDATE")
|
||||
@TableField("CREATIONDATE")
|
||||
private String creationdate;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarModelTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISarModuleTreeService {
|
||||
|
||||
List<SarModelTree> getAll(SarModelTree sarModelTree);
|
||||
|
||||
List<SarModelTree> recursionGetChildren(SarModelTree parent);
|
||||
|
||||
public Head analysisJsonAndStorage(String json);
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.adc.da.slrs.sarModelTree.service.impl;
|
||||
|
||||
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.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarModuleTree> implements ISarModuleTreeService {
|
||||
|
||||
@Autowired()
|
||||
private SarModuleTreeServiceImpl sarModuleTreeService;
|
||||
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Head analysisJsonAndStorage(String json) {
|
||||
//获取头部 返回结果需要
|
||||
Head head = new Head();
|
||||
try{
|
||||
|
||||
//把字符串转换成对象
|
||||
JsonObject parse = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
|
||||
//要把jsonObject里的HEAD强转成JsonObject类型
|
||||
JsonObject HEAD = (JsonObject) parse.get("HEAD");
|
||||
//因为是最后要取的值了,所以就拿到之后把它转换成String类型
|
||||
HEAD.get("CONSUMER").getAsString();
|
||||
|
||||
head.setBIZTRANSACTIONID(HEAD.get("BIZTRANSACTIONID").getAsString());
|
||||
|
||||
//获取json中的list
|
||||
JsonArray list = (JsonArray)parse.get("LIST");
|
||||
Gson gson = new Gson();
|
||||
List<SarModuleTree> moduleTreeList = new LinkedList<>();
|
||||
list.forEach(item->{
|
||||
JsonObject objectJson=(JsonObject) item;
|
||||
SarModuleTree sarModuleTree = gson.fromJson(objectJson, SarModuleTree.class);
|
||||
sarModuleTree.setGuid(UUIDUtils.randomUUID20());
|
||||
moduleTreeList.add(sarModuleTree);
|
||||
});
|
||||
|
||||
|
||||
//进行全量覆盖即删除表中所有数据,之后插入新的数据
|
||||
sarModuleTreeService.remove(null);
|
||||
sarModuleTreeService.saveBatch(moduleTreeList);
|
||||
head.setSUCCESSCOUNT(String.valueOf(moduleTreeList.size()));
|
||||
}catch (Exception e){
|
||||
head.setERRORCODE("2");
|
||||
head.setRESULT("业务失败需要重做,失败原因: "+e.getMessage());
|
||||
return head;
|
||||
}
|
||||
|
||||
head.setERRORCODE("0");
|
||||
head.setRESULT("成功");
|
||||
return head;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -291,6 +291,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.eq("PARENT_ID",parent.getId());
|
||||
TsResourceQueryWrapper.in("ID",getMenuIdList);
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
|
||||
for(TsResource TsResource:children){
|
||||
TsResource.setChildren(recursionGetListChildren((TsResource),(getMenuIdList)));
|
||||
|
||||
+1
@@ -104,6 +104,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
if (!StringUtils.isEmpty(cid)){
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(SarPublicIdeaAll.CID,cid);
|
||||
wrapper.orderByAsc("part_code");
|
||||
data=sarPublicIdeaAllDao.selectList(wrapper);
|
||||
}
|
||||
List<GetExcelDto> standExcel=new ArrayList<>();
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/SelectAllPage")
|
||||
public ResponseMessage selectAllPage(@RequestParam(defaultValue="1")Integer page,@RequestParam(defaultValue="10")Integer size,String categorg, String cname,
|
||||
String start, String end){
|
||||
String start, String end,String type){
|
||||
Date startdate = null;
|
||||
Date enddate = null;
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
@@ -54,7 +54,7 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
IPage<SarPublicIdea> Publiclist =sarPublicIdeaService.selectAllP(page,size,categorg,cname,startdate,enddate);
|
||||
IPage<SarPublicIdea> Publiclist =sarPublicIdeaService.selectAllP(page,size,categorg,cname,startdate,enddate,type);
|
||||
return Result.success(Publiclist);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,5 +66,11 @@ public class SarPublicIdea extends BaseEntity {
|
||||
@TableField("uniques")
|
||||
private String uniques;
|
||||
|
||||
@TableField("files")
|
||||
private String files;
|
||||
|
||||
@TableField("files_name")
|
||||
private String filesName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,6 +20,6 @@ import java.util.Date;
|
||||
public interface ISarPublicIdeaService extends IService<SarPublicIdea> {
|
||||
|
||||
String add(SarPublicIdea sarPublicIdea);
|
||||
IPage<SarPublicIdea> selectAllP(Integer page, Integer size, String categorg, String cname, Date startdate, Date enddate);
|
||||
IPage<SarPublicIdea> selectAllP(Integer page, Integer size, String categorg, String cname, Date startdate, Date enddate, String type);
|
||||
IPage<SarPublicIdea> selectAllDynamic(SeByoDto seByoDto);
|
||||
}
|
||||
|
||||
+30
-25
@@ -1,7 +1,6 @@
|
||||
package com.adc.da.slrs.sarStandIdea.service.Impl;
|
||||
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaDao;
|
||||
|
||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
|
||||
@@ -22,7 +21,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -36,7 +35,7 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
||||
|
||||
@Override
|
||||
public String add(SarPublicIdea sarPublicIdea) {
|
||||
if (!sarPublicIdea.getId().isEmpty()){
|
||||
if (!sarPublicIdea.getId().isEmpty()) {
|
||||
sarPublicIdea.setId(UUIDUtils.randomUUID10());
|
||||
sarPublicIdeaDao.insert(sarPublicIdea);
|
||||
return "增加成功";
|
||||
@@ -45,22 +44,28 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SarPublicIdea> selectAllP(Integer p, Integer size, String category, String cname, Date start, Date end) {
|
||||
public IPage<SarPublicIdea> selectAllP(Integer p, Integer size, String category, String cname, Date start, Date end, String type) {
|
||||
QueryWrapper<SarPublicIdea> list = new QueryWrapper<>();
|
||||
list.like(StringUtils.isNotEmpty(category),"category",category)
|
||||
.like(StringUtils.isNotEmpty(cname),"cname",cname)
|
||||
.ge(start!=null,"start_time",start)
|
||||
.le(end!=null,"end_time",end)
|
||||
.orderByAsc("end_time");
|
||||
Page<SarPublicIdea> page = new Page<>(p,size);
|
||||
if ("1".equals(type)) {
|
||||
list.like(StringUtils.isNotEmpty(category), "category", category)
|
||||
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
||||
.ge(start != null, "start_time", start)
|
||||
.le(end != null, "end_time", end)
|
||||
.orderByDesc("start_time");
|
||||
} else {
|
||||
list.like(StringUtils.isNotEmpty(category), "category", category)
|
||||
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
||||
.ge("end_time", new Date())
|
||||
.orderByAsc("end_time");
|
||||
}
|
||||
Page<SarPublicIdea> page = new Page<>(p, size);
|
||||
IPage<SarPublicIdea> userIPage = sarPublicIdeaDao.selectPage(page, list);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param seByoDto
|
||||
* @return
|
||||
*/
|
||||
@@ -72,33 +77,33 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
try {
|
||||
if (seByoDto.getStartTime()!=null){
|
||||
if (seByoDto.getStartTime() != null) {
|
||||
sar.setStartTime(formater.parse(seByoDto.getStartTime()));
|
||||
}
|
||||
if (seByoDto.getEndTime()!=null){
|
||||
if (seByoDto.getEndTime() != null) {
|
||||
sar.setEndTime(formater.parse(seByoDto.getEndTime()));
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
QueryWrapper<SarPublicIdea> wrapper = new QueryWrapper<>();
|
||||
if (sar.getCategory()!=null&&sar.getCategory().length()!=0){
|
||||
wrapper.like("category",sar.getCategory());
|
||||
if (sar.getCategory() != null && sar.getCategory().length() != 0) {
|
||||
wrapper.like("category", sar.getCategory());
|
||||
}
|
||||
if (sar.getCname()!=null&&sar.getCname().length()!=0){
|
||||
wrapper.like("cname",sar.getCname());
|
||||
if (sar.getCname() != null && sar.getCname().length() != 0) {
|
||||
wrapper.like("cname", sar.getCname());
|
||||
}
|
||||
if (sar.getStartTime()!=null){
|
||||
wrapper.le("start_time",sar.getStartTime());
|
||||
if (sar.getStartTime() != null) {
|
||||
wrapper.le("start_time", sar.getStartTime());
|
||||
}
|
||||
if (sar.getEndTime()!=null){
|
||||
wrapper.gt("end_time",sar.getEndTime());
|
||||
if (sar.getEndTime() != null) {
|
||||
wrapper.gt("end_time", sar.getEndTime());
|
||||
}
|
||||
|
||||
Page<SarPublicIdea> page = new Page<>(seByoDto.getPage(), seByoDto.getSize());
|
||||
IPage<SarPublicIdea> userIPage = sarPublicIdeaDao.selectPage(page, wrapper);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
|
||||
|
||||
|
||||
+10
-1
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.slrs.sarStandItems.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -22,9 +23,13 @@ public class SarStandItemsDto {
|
||||
@ApiModelProperty(value = "条目编号")
|
||||
private String itemsNum;
|
||||
|
||||
@ApiModelProperty(value = "内容")
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String itemsName;
|
||||
|
||||
@ApiModelProperty(value = "内容")
|
||||
@TableField("TERMS_CONDITIONS")
|
||||
private String termsConditions;
|
||||
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
private String responsibleUnit;
|
||||
|
||||
@@ -48,4 +53,8 @@ public class SarStandItemsDto {
|
||||
|
||||
private String zccssrq;
|
||||
|
||||
private String technicalRequir;
|
||||
|
||||
private String changePoint;
|
||||
|
||||
}
|
||||
|
||||
+47
-3
@@ -19,8 +19,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -193,11 +192,56 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
}
|
||||
|
||||
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
|
||||
return dao.selectAllItemsByIds(type,ids);
|
||||
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
|
||||
List<SarStandItemsDto> res=new ArrayList<>();
|
||||
if (null == list || list.isEmpty()){
|
||||
return list;
|
||||
}else {
|
||||
List<Integer> integerList=new ArrayList<>();
|
||||
Map<Integer,List<SarStandItemsDto>> map=new HashMap<>();
|
||||
list.forEach(sarStandItemsDto -> {
|
||||
int a= sarStandItemsDto.getItemsNum().indexOf(".");
|
||||
String mark=sarStandItemsDto.getItemsNum();
|
||||
if (a>0){
|
||||
mark=mark.substring(0,a);
|
||||
}
|
||||
if (null != map.get(Integer.valueOf(mark))){
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
}else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle=new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark),middle);
|
||||
}
|
||||
});
|
||||
Collections.sort(integerList);
|
||||
integerList.forEach(integer -> {
|
||||
res.addAll(map.get(integer));
|
||||
});
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<SarStandItems> querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
|
||||
//排序
|
||||
if (page.getOrderBy()!=null && page.getOrder()!=null){
|
||||
|
||||
switch (page.getOrderBy()){
|
||||
case "itemsNum" : page.setOrderBy("ITEMS_NUM"); break;
|
||||
default:page.setOrderBy("ITEMS_NUM"); page.setOrder("DESC");
|
||||
}
|
||||
|
||||
switch (page.getOrder()){
|
||||
case "descending":page.setOrder("DESC");break;
|
||||
default:page.setOrder("ASC");
|
||||
}
|
||||
}else {
|
||||
page.setOrderBy("ITEMS_NUM");
|
||||
page.setOrder("DESC");
|
||||
}
|
||||
|
||||
//分页查询的总数
|
||||
Integer count=dao.sarItemCount(page);
|
||||
page.getPager().setRowCount(count);
|
||||
|
||||
+5
-1
@@ -14,6 +14,7 @@ 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.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
@@ -33,7 +34,8 @@ import java.util.*;
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandProjectLibrary|")
|
||||
@RequestMapping("/api/sarStandProjectLibrary")
|
||||
@RequestMapping("/${restPath}/sarStandProjectLibrary")
|
||||
@Slf4j
|
||||
public class SarStandProjectLibraryController extends BaseController<SarStandProjectLibrary> {
|
||||
@Resource
|
||||
private SarStandProjectLibraryServiceImpl sarStandProjectLibraryService;
|
||||
@@ -227,9 +229,11 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("同步车型项目数据")
|
||||
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("");
|
||||
|
||||
+11
-4
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class ResponseDto {
|
||||
@@ -17,14 +18,20 @@ public class ResponseDto {
|
||||
// }
|
||||
|
||||
|
||||
List<Company> LIST;
|
||||
List<?> LIST;
|
||||
|
||||
public ResponseDto(Head HEAD, List<Company> LIST) {
|
||||
public ResponseDto(Head HEAD, List<?> LIST) {
|
||||
this.HEAD = HEAD;
|
||||
this.LIST = LIST;
|
||||
}
|
||||
|
||||
public 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.HEAD=HEAD;
|
||||
}
|
||||
}
|
||||
|
||||
+13
-12
@@ -75,25 +75,25 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
//把刚刚拿到的值存到实体类里
|
||||
SarStandProjectLibrary projectInfo = new SarStandProjectLibrary();
|
||||
projectInfo
|
||||
.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());
|
||||
.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("target_end_on").getAsString();
|
||||
projectObject.get("projectEndDate").getAsString();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
|
||||
Date targetBeginOn = null;
|
||||
try {
|
||||
targetBeginOn = simpleDateFormat.parse(projectObject.get("target_begin_on").getAsString());
|
||||
targetBeginOn = simpleDateFormat.parse(projectObject.get("projectStartDate").getAsString());
|
||||
|
||||
Date targetEndOn = simpleDateFormat.parse(projectObject.get("target_end_on").getAsString());
|
||||
Date targetEndOn = simpleDateFormat.parse(projectObject.get("projectEndDate").getAsString());
|
||||
projectInfo
|
||||
.setProjectStartDate(targetBeginOn)
|
||||
.setProjectEndDate(targetEndOn);
|
||||
@@ -113,6 +113,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
head.setERRORCODE("2");
|
||||
head.setRESULT("业务失败需要重做");
|
||||
return head;
|
||||
|
||||
+13
-11
@@ -1,21 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandProjectTeam.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
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.SarStandProjectLibrary;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.service.ISarStandProjectTeamService;
|
||||
import com.google.gson.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.service.ISarStandProjectTeamService;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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;
|
||||
|
||||
@@ -30,7 +29,8 @@ import java.util.ArrayList;
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandProjectTeam|")
|
||||
@RequestMapping("/slrs/sar-stand-project-team")
|
||||
@RequestMapping("/${restPath}/sar-stand-project-team")
|
||||
@Slf4j
|
||||
public class SarStandProjectTeamController extends BaseController<SarStandProjectTeam> {
|
||||
|
||||
@Autowired
|
||||
@@ -39,8 +39,10 @@ public class SarStandProjectTeamController extends BaseController<SarStandProjec
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("同步PCMS组织信息")
|
||||
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("");
|
||||
|
||||
+1
@@ -75,6 +75,7 @@ public class SarStandProjectTeamServiceImpl extends ServiceImpl<SarStandProjectT
|
||||
}catch (Exception e){
|
||||
responseHead.setERRORCODE("2");
|
||||
responseHead.setRESULT("业务失败需要重做");
|
||||
e.printStackTrace();
|
||||
return responseHead;
|
||||
}
|
||||
responseHead.setERRORCODE("0")
|
||||
|
||||
+29
-24
@@ -36,7 +36,12 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("标准ID")
|
||||
@ExcelProperty("标准号")
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@TableField("STAND_SERIAL_NUMBER")
|
||||
private String standSerialNumber;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "标准ID")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
@@ -69,27 +74,27 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
@TableField("ITEMS_NAME")
|
||||
private String itemsName;
|
||||
|
||||
@ExcelProperty(value = "产品类型",converter = ProductTypeConverter.class)
|
||||
@ApiModelProperty(value = "产品类型(research为在研产品,product为在产产品)")
|
||||
@TableField("PRODUCT_TYPE")
|
||||
private String productType;
|
||||
|
||||
@ExcelProperty("产品线")
|
||||
@ApiModelProperty(value = "产品线")
|
||||
@TableField("PRODUCT_LINE")
|
||||
private String productLine;
|
||||
|
||||
@ExcelProperty("责任部门")
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
@TableField("RESPONSIBLE_UNIT")
|
||||
private String responsibleUnit;
|
||||
|
||||
@ExcelProperty("项目名称")
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
@TableField("PRODUCT_NAME")
|
||||
private String productName;
|
||||
|
||||
@ExcelProperty("创建部门")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "创建部门")
|
||||
@TableField("CREATE_DEPT_ID")
|
||||
private String createDeptId;
|
||||
|
||||
@ExcelProperty("创建人")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@TableField("CREATE_BY_ID")
|
||||
private String createById;
|
||||
@@ -113,17 +118,16 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
@TableField("ACTUAL_CLOSE_TIME")
|
||||
private Date actualCloseTime;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "计划关闭时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("PLAN_CLOSE_TIME")
|
||||
private Date planCloseTime;
|
||||
|
||||
@ExcelProperty("不合规项目")
|
||||
@ApiModelProperty(value = "未符合原因")
|
||||
@TableField("REASON")
|
||||
private String reason;
|
||||
|
||||
@ExcelProperty("责任部门")
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
@TableField("RESPONSIBLE_UNIT")
|
||||
private String responsibleUnit;
|
||||
|
||||
@ExcelProperty("质量工程师")
|
||||
@ApiModelProperty(value = "质量工程师")
|
||||
@TableField("QA_ENGINEER")
|
||||
@@ -139,33 +143,34 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
@TableField("DUTY_ENGINEER")
|
||||
private String dutyEngineer;
|
||||
|
||||
@ExcelProperty("标准编号")
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@TableField("STAND_SERIAL_NUMBER")
|
||||
private String standSerialNumber;
|
||||
|
||||
@ExcelProperty(value = "产品类型",converter = ProductTypeConverter.class)
|
||||
@ApiModelProperty(value = "产品类型(research为在研产品,product为在产产品)")
|
||||
@TableField("PRODUCT_TYPE")
|
||||
private String productType;
|
||||
@ExcelProperty("计划关闭时间")
|
||||
@ApiModelProperty(value = "计划关闭时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("PLAN_CLOSE_TIME")
|
||||
private Date planCloseTime;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "质量工程师")
|
||||
@TableField(exist=false)
|
||||
private String qaEngineerName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "认证工程师")
|
||||
@TableField(exist=false)
|
||||
private String authEngineerName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
@TableField(exist=false)
|
||||
private String dutyEngineerName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "国内OR海外")
|
||||
@TableField(exist=false)
|
||||
private String standType;
|
||||
|
||||
+4
@@ -6,6 +6,7 @@ import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarSarAccessInfo.entity.SarSarAccessInfo;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItemsDto;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.*;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretationForeignStandardService;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarInterpretationNationalStandardService;
|
||||
@@ -165,6 +166,9 @@ public class SarStandardComplianceAssessResultController {
|
||||
if (eo.getType() != null) queryWrapper.eq("type", eo.getType());
|
||||
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
|
||||
if (eo.getProductId() != null) queryWrapper.like("product_id", eo.getProductId());
|
||||
queryWrapper.orderByAsc("product_name");
|
||||
queryWrapper.orderByAsc("standard_item");
|
||||
|
||||
// if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
|
||||
|
||||
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
|
||||
|
||||
+4
-1
@@ -218,7 +218,10 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
int result = sarStandardsInfoEOService.deleteSarStandards(ids);
|
||||
if (result > 0) {
|
||||
return Result.success("0", "删除成功", result);
|
||||
} else {
|
||||
}else if(result == -1) {
|
||||
return Result.success("-1","所选的标准下挂有标准,无法删除");
|
||||
}
|
||||
else {
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
List<SarStandardsInfo> selectStandardsByStandnumber(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
List<SarStandardsInfo> queryStandInfoByList(@Param("limit") Integer limit);
|
||||
List<SarStandardsInfo> queryStandInfoByList(@Param("limit") Integer limit,@Param("typeCode") String typeCode);
|
||||
|
||||
Integer selectStandColumn(@Param("columnName") String columnName);
|
||||
|
||||
|
||||
+10
@@ -155,6 +155,8 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String standNatureShow; // 标准性质显示名称
|
||||
@TableField(exist = false)
|
||||
private String standTextStatusShow; // 标准文本状态显示名称
|
||||
@TableField(exist = false)
|
||||
private String sychronId; // 同步数据ID
|
||||
@TableField(exist = false)
|
||||
private List<DicTypeEO> dicTypeList = new ArrayList(); // 记录标准涉及到的所有数据字典数据
|
||||
@@ -607,5 +609,13 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
public void setStandSystemName(String standSystemName) {
|
||||
this.standSystemName = standSystemName;
|
||||
}
|
||||
|
||||
public String getStandTextStatusShow() {
|
||||
return standTextStatusShow;
|
||||
}
|
||||
|
||||
public void setStandTextStatusShow(String standTextStatusShow) {
|
||||
this.standTextStatusShow = standTextStatusShow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+67
-3
@@ -15,6 +15,8 @@ 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;
|
||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarLawsAttrDetailedList;
|
||||
import com.adc.da.slrs.sarLawsAttrDetailedList.service.impl.SarLawsAttrDetailedListServiceImpl;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsItemsEOPage;
|
||||
@@ -49,6 +51,10 @@ import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.slrs.tsDictionaryType.dao.TsDicTypeDao;
|
||||
import com.adc.da.slrs.tsDictionaryType.dao.TsDictionaryDao;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDicType;
|
||||
import com.adc.da.slrs.tsDictionaryType.entity.TsDictionary;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.adc.da.sys.constant.ValueStateEnum;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
@@ -203,6 +209,12 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Autowired
|
||||
private StandLawsSearchService standLawsSearchService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TsDictionaryDao tsDictionaryDao;
|
||||
|
||||
@Autowired
|
||||
private TsDicTypeDao tsDicTypeDao;
|
||||
// /**
|
||||
// * 反向操作标准
|
||||
// */
|
||||
@@ -439,11 +451,16 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void attrInfoShowDetails(List<SarStandardsInfo> sarlist) throws Exception {
|
||||
for (SarStandardsInfo row : sarlist) {
|
||||
attrInfoDetails(row);
|
||||
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
||||
if (getAttrMap != null && getAttrMap.size() > 0) {
|
||||
//存在的分解单文本名称列表
|
||||
LinkedList<String> itemExistList = new LinkedList<>();
|
||||
getAttrMap.put("itemExistList",itemExistList);
|
||||
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
String value = "";
|
||||
@@ -452,6 +469,15 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
|
||||
entry.setValue(fileObj);
|
||||
//以标准id和文本类型查询分解单表 有数据设标记为为 1
|
||||
FindSarItemsPageReqDTO sarItemCount = new FindSarItemsPageReqDTO();
|
||||
sarItemCount.setStandId(row.getId());
|
||||
sarItemCount.setFileType(name);
|
||||
Integer sarItemsCount = standItemsDao.sarItemCount(sarItemCount);
|
||||
if (sarItemsCount>0){
|
||||
//存在分解单的文本名称存入列表
|
||||
itemExistList.add(name);
|
||||
}
|
||||
}
|
||||
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
@@ -1261,13 +1287,32 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
SarLawsAttrDetailedListServiceImpl detailedListService;
|
||||
|
||||
public int deleteSarStandards(String ids) {
|
||||
QueryWrapper<SarLawsAttrDetailedList> detailedListQueryWrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
String[] idArr = ids.split(",");
|
||||
SarStandardsInfo sarStandardsInfoEO = new SarStandardsInfo();
|
||||
sarStandardsInfoEO.setValidFlag("1");
|
||||
sarStandardsInfoEO.setModifyTime(new Date());
|
||||
int countResult = 0;
|
||||
//如果清单下挂着标准A,在标准库里删除标准A的话,加个验证 不让删这个标准
|
||||
for (String id : idArr){
|
||||
detailedListQueryWrapper.eq("stand_id",id);
|
||||
|
||||
int count = detailedListService.count(detailedListQueryWrapper);
|
||||
if (count>0){
|
||||
countResult = -1;
|
||||
return countResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (String id : idArr) {
|
||||
|
||||
countResult++;
|
||||
//查询删除的标准信息(为删除代替关系)
|
||||
SarStandardsInfo getDelStandInfoList = dao.selectById(id);
|
||||
@@ -2018,9 +2063,28 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
return strhours;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<SarStandardsInfo> getStandInfoByList(String limit){
|
||||
return dao.queryStandInfoByList(Integer.valueOf(limit));
|
||||
|
||||
//查询文本状态为即将实施的
|
||||
QueryWrapper<TsDictionary> dictionaryWrapper = new QueryWrapper<>();
|
||||
dictionaryWrapper.select("ID")
|
||||
.eq("DICTIONARY_NAME","文本状态");
|
||||
List<Map<String, Object>> dicMaps = tsDictionaryDao.selectMaps(dictionaryWrapper);
|
||||
|
||||
|
||||
QueryWrapper<TsDicType> dicTypeWrapper = new QueryWrapper<>();
|
||||
dicTypeWrapper.select("DIC_TYPE_CODE")
|
||||
.eq("DIC_ID",dicMaps.get(0).get("ID").toString())
|
||||
.eq("DIC_TYPE_NAME","即将实施");
|
||||
|
||||
List<Map<String, Object>> typeMaps = tsDicTypeDao.selectMaps(dicTypeWrapper);
|
||||
|
||||
|
||||
List<SarStandardsInfo> standInfoList = dao.queryStandInfoByList(Integer.valueOf(limit), typeMaps.get(0).get("DIC_TYPE_CODE").toString());
|
||||
return standInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2162,8 +2226,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
// 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"))) {
|
||||
if(attFileEO.getFileSuffix().equals("doc")){
|
||||
if (null != attFileEO.getFileSuffix() && (attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("doc")|| attFileEO.getFileSuffix().equals("DOC")|| attFileEO.getFileSuffix().equals("DOCX") || attFileEO.getFileSuffix().equals("ppt") || attFileEO.getFileSuffix().equals("pptx"))) {
|
||||
if(attFileEO.getFileSuffix().equals("doc")||attFileEO.getFileSuffix().equals("docx") || attFileEO.getFileSuffix().equals("DOC")|| attFileEO.getFileSuffix().equals("DOCX")){
|
||||
FileInputStream fis = new FileInputStream(readFilePath);
|
||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||
String txt = wordExtractor.getText();
|
||||
|
||||
@@ -9,10 +9,12 @@ import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarUrl.dao.TsUrlDao;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionVO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -80,5 +82,12 @@ public class TsUserController extends BaseController<TsUser> {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询人接口悬浮窗")
|
||||
@GetMapping("/selectUp")
|
||||
public ResponseMessage<List<UpDTO>> selectUp(@Param("uname") String uname) throws Exception {
|
||||
return Result.success(tsUserService.selectByName(uname));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.adc.da.slrs.sarUser.dao;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,6 +17,9 @@ import java.util.List;
|
||||
*/
|
||||
public interface TsUserDao extends BaseMapper<TsUser> {
|
||||
|
||||
@Update("truncate table ts_user")
|
||||
void deleteUser();
|
||||
|
||||
/**
|
||||
* 查询用户已经绑定的岗位ID
|
||||
*/
|
||||
|
||||
@@ -143,9 +143,11 @@ public class TsUser extends BaseEntity {
|
||||
private List<TsPosition> positions;
|
||||
|
||||
@ApiModelProperty("当前页")
|
||||
@TableField(exist = false)
|
||||
private Integer current;
|
||||
|
||||
@ApiModelProperty("每页条数")
|
||||
@TableField(exist = false)
|
||||
private Integer size;
|
||||
|
||||
public TsUser() {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.sarUser.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UpDTO {
|
||||
|
||||
|
||||
|
||||
private String value;
|
||||
|
||||
private String id;
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sarResource.entity.TsResource;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -20,6 +21,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface ITsUserService extends IService<TsUser> {
|
||||
|
||||
void deleteUser();
|
||||
|
||||
/**
|
||||
* 通过机构ID查询人员
|
||||
@@ -74,4 +76,6 @@ public interface ITsUserService extends IService<TsUser> {
|
||||
void parseUser() throws Exception;
|
||||
|
||||
List<SarMenu> getSecondMenusByUserId(String userId);
|
||||
|
||||
List<UpDTO> selectByName(String name);
|
||||
}
|
||||
|
||||
+33
-1
@@ -14,6 +14,7 @@ import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import com.adc.da.slrs.sarUser.entity.SyncUser;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.entity.UserPositionVO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
@@ -31,6 +32,8 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -60,6 +63,11 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
@Autowired
|
||||
private TsPositionDao tsPositionDao;
|
||||
|
||||
|
||||
public void deleteUser(){
|
||||
tsUserDao.deleteUser();
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过机构ID查询人员
|
||||
* @return List<TsUser>
|
||||
@@ -70,7 +78,7 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
Page<TsUser> tsUserPage = new Page<>();
|
||||
System.out.println(tsUser.getCurrent());
|
||||
System.out.println(tsUser.getSize());
|
||||
List<TsUser> tsUserList = tsUserDao.getUserAndPositionPage((tsUser.getCurrent()-1)*tsUser.getSize(),1*tsUser.getSize(),tsUser);
|
||||
List<TsUser> tsUserList = tsUserDao.getUserAndPositionPage((tsUser.getCurrent()-1)*tsUser.getSize(),tsUser.getSize(),tsUser);
|
||||
Integer total = tsUserDao.getUserAndPositionCount(tsUser);
|
||||
tsUserPage.setRecords(tsUserList);
|
||||
tsUserPage.setCurrent(tsUser.getCurrent());
|
||||
@@ -145,6 +153,14 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
UserEO userEO=UserUtils.getUser();
|
||||
String userId= userEO.getUsid();
|
||||
List<String> positionIds=tsUserDao.selectPositionIds(userId);
|
||||
/**
|
||||
* 当用户没有所属岗位,默认给一个other岗位,适用于特定权限外的其他用户
|
||||
* 用户同步时需要将用户配置的系统内的岗位保留
|
||||
*/
|
||||
|
||||
if(positionIds == null || positionIds.isEmpty()){
|
||||
positionIds = Arrays.asList(new String[]{"other"});
|
||||
}
|
||||
List<String> roleIds=tsPositionService.getRoleIdsByPositionIds(positionIds);
|
||||
List<String> menuIds=tsRoleService.getMenuIdsByRoleIds(roleIds);
|
||||
return sarMenuService.getMenuByIds(menuIds);
|
||||
@@ -273,4 +289,20 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
List<String> menuIds=tsRoleService.getMenuIdsByRoleIds(roleIds);
|
||||
return sarMenuService.getSecondMenuByIds(menuIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UpDTO> selectByName(String name) {
|
||||
QueryWrapper<TsUser> tsUserQueryWrapper=new QueryWrapper<>();
|
||||
tsUserQueryWrapper.like("ACCOUNT",name);
|
||||
tsUserQueryWrapper.or().like("UNAME",name);
|
||||
List<TsUser> res= tsUserDao.selectList(tsUserQueryWrapper);
|
||||
List<UpDTO> result=new ArrayList<>();
|
||||
res.forEach(tsUser -> {
|
||||
UpDTO upDTO=new UpDTO();
|
||||
upDTO.setValue(tsUser.getUname()+"("+tsUser.getAccount()+")");
|
||||
upDTO.setId(tsUser.getUserId());
|
||||
result.add(upDTO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+55
-13
@@ -7,12 +7,18 @@ import java.util.List;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandItems.service.impl.SarStandItemsServiceImpl;
|
||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardsInfoEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEOPage;
|
||||
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarLawsInfoEO;
|
||||
import com.adc.da.slrs.standardSplit.service.*;
|
||||
import com.adc.da.sys.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -162,21 +168,56 @@ public class SarFileSplitInfoEOController extends BaseController<SarFileSplitInf
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private SarStandItemsServiceImpl ServiceImpl;
|
||||
@ApiOperation(value = "|SarFileSplitInfoEO|关联")
|
||||
@PostMapping("/connectToStandItems")
|
||||
public ResponseMessage connectToStandItems(@RequestBody List<SarFileSplitInfoEO> sarFileSplitInfoEOList) throws Exception {
|
||||
for (SarFileSplitInfoEO sarFileSplitInfoEO:sarFileSplitInfoEOList) {
|
||||
List<SarStandardsInfoEO> getList = new ArrayList<>();
|
||||
List<SarLawsInfoEO> sarLawsInfoEOList = new ArrayList<>();
|
||||
List<SarFileSplitItemsEO> querySame = null;
|
||||
|
||||
/**
|
||||
* 删除原来的分解单
|
||||
*/
|
||||
|
||||
QueryWrapper<SarStandItems> removeWrapper = new QueryWrapper<>();
|
||||
removeWrapper.eq("STAND_ID",sarFileSplitInfoEOList.get(0).getStandId())
|
||||
.eq("FILE_TYPE",sarFileSplitInfoEOList.get(0).getFileType());
|
||||
ServiceImpl.remove(removeWrapper);
|
||||
for (SarFileSplitInfoEO sarFileSplitInfoEO : sarFileSplitInfoEOList) {
|
||||
// List<SarStandardsInfoEO> getList = new ArrayList<>();
|
||||
// List<SarLawsInfoEO> sarLawsInfoEOList = new ArrayList<>();
|
||||
|
||||
querySame = sarFileSplitInfoEOService.querySame(sarFileSplitInfoEO);
|
||||
|
||||
/**
|
||||
* 使选定的拆分条款 插入分解单
|
||||
*/
|
||||
querySame.forEach(item->{
|
||||
QueryWrapper<SarStandItems> sarStandItemsQueryWrapper = new QueryWrapper<>();
|
||||
sarStandItemsQueryWrapper.eq("edit_flag",item.getEditFlag());
|
||||
SarStandItems sarStandItems = new SarStandItems();
|
||||
sarStandItems.setStandId(sarFileSplitInfoEO.getStandId());
|
||||
sarStandItems.setEditFlag(item.getEditFlag());
|
||||
sarStandItems.setItemsName(item.getItemsName());
|
||||
sarStandItems.setTermsConditions(item.getItermsConditions());
|
||||
sarStandItems.setItemsNum(item.getItemsNum());
|
||||
sarStandItems.setId(UUIDUtils.randomUUID20());
|
||||
sarStandItems.setFileType(sarFileSplitInfoEO.getFileType());
|
||||
ServiceImpl.saveOrUpdate(sarStandItems,sarStandItemsQueryWrapper);
|
||||
|
||||
});
|
||||
|
||||
|
||||
//根据标准号查询标准是否存在
|
||||
String standNum="";
|
||||
if (StringUtils.isNotEmpty(sarFileSplitInfoEO.getStandId())) {
|
||||
standNum=sarFileSplitInfoEO.getShowNumber();
|
||||
} else if(StringUtils.isNotEmpty(sarFileSplitInfoEO.getStandNumSplit())){
|
||||
standNum=sarFileSplitInfoEO.getStandNumSplit();
|
||||
}else{
|
||||
return Result.error("标准号不能为空");
|
||||
}
|
||||
// String standNum="";
|
||||
// if (StringUtils.isNotEmpty(sarFileSplitInfoEO.getStandId())) {
|
||||
// standNum=sarFileSplitInfoEO.getShowNumber();
|
||||
// } else if(StringUtils.isNotEmpty(sarFileSplitInfoEO.getStandNumSplit())){
|
||||
// standNum=sarFileSplitInfoEO.getStandNumSplit();
|
||||
// }else{
|
||||
// return Result.error("标准号不能为空");
|
||||
// }
|
||||
// if (sarFileSplitInfoEO.getFileType().equals("ZCWB") || sarFileSplitInfoEO.getFileType().equals("GCGJ")) {
|
||||
// SarLawsInfoEOPage page = new SarLawsInfoEOPage();
|
||||
// page.setLawsType("FOREIGN");
|
||||
@@ -201,7 +242,8 @@ public class SarFileSplitInfoEOController extends BaseController<SarFileSplitInf
|
||||
// return Result.error("0", "该条数据标准号在标准库中不存在");
|
||||
// }
|
||||
}
|
||||
return Result.error("0","关联失败");
|
||||
// return Result.error("0","关联失败");
|
||||
return Result.success(querySame);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarFileSplitInfoEO|标准拆分编辑")
|
||||
@@ -211,7 +253,7 @@ public class SarFileSplitInfoEOController extends BaseController<SarFileSplitInf
|
||||
if(null!=sarFileSplitInfoEO){
|
||||
sarFileSplitInfoEO.setModifyTime(new Date());
|
||||
if (null==sarFileSplitInfoEO.getSplitStatus())
|
||||
sarFileSplitInfoEO.setSplitStatus("0");
|
||||
sarFileSplitInfoEO.setSplitStatus("1");
|
||||
sarFileSplitInfoEOService.updateByPrimaryKeySelective(sarFileSplitInfoEO);
|
||||
return Result.success("0","编辑成功",null);
|
||||
}else{
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.adc.da.slrs.standardSplit.dao;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import java.util.List;
|
||||
@@ -36,4 +37,6 @@ public interface SarFileSplitInfoEODao extends BaseMapper<SarFileSplitInfoEO> {
|
||||
|
||||
int deleteByIds(SarFileSplitInfoEO sarFileSplitInfoEO);
|
||||
|
||||
List<SarFileSplitItemsEO> querySame (SarFileSplitInfoEO sarFileSplitInfoEO);
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -4,6 +4,7 @@ import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEOPage;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,4 +31,6 @@ public interface SarFileSplitInfoEOService {
|
||||
PersonMsgEO updateNew(PersonMsgEO val) throws Exception;
|
||||
|
||||
String getClauseBySplitId(String standNum, String fileType);
|
||||
|
||||
List<SarFileSplitItemsEO> querySame (SarFileSplitInfoEO sarFileSplitInfoEO);
|
||||
}
|
||||
|
||||
+23
-6
@@ -2,6 +2,7 @@ package com.adc.da.slrs.standardSplit.service.impl;
|
||||
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.slrs.sarStandAttrDetails.service.ISarStandAttrDetailsService;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.standardSplit.dao.*;
|
||||
import com.adc.da.slrs.standardSplit.service.SarLawsInfoEOService;
|
||||
@@ -10,8 +11,11 @@ import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.common.ReadWordTable;
|
||||
import com.adc.da.slrs.standardSplit.entity.*;
|
||||
import com.adc.da.slrs.standardSplit.service.SarFileSplitInfoEOService;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.adc.da.sys.util.LoginUserUtil;
|
||||
import com.adc.da.sys.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
@@ -46,6 +50,9 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarFileSplitInfoEOServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private ISarStandAttrDetailsService sarStandAttrDetailsEOService;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
@Value("${file.path}")
|
||||
@@ -335,7 +342,7 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
|
||||
middle=messageList;
|
||||
for (SarFileSplitItemsEO mis:messageList) {
|
||||
mis.setWorkFlowShow("1");
|
||||
if (mis.getItemsNum().equals("1") || mis.getItemsNum().startsWith("1.") || mis.getItemsNum().equals("2") || mis.getItemsNum().startsWith("2.") || mis.getItemsNum().equals("3") || mis.getItemsNum().startsWith("3.")){
|
||||
if (mis.getItemsNum().equals("2") || mis.getItemsNum().startsWith("2.") || mis.getItemsNum().equals("3") || mis.getItemsNum().startsWith("3.")){
|
||||
mis.setWorkFlowShow("0");
|
||||
}
|
||||
else {
|
||||
@@ -349,6 +356,11 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
|
||||
}
|
||||
}
|
||||
}
|
||||
messageList.forEach(sarFileSplitItemsEO -> {
|
||||
if (sarFileSplitItemsEO.getItemsNum().equals("1")){
|
||||
sarFileSplitItemsEO.setWorkFlowShow("1");
|
||||
}
|
||||
});
|
||||
sarFileSplitMenuEODao.insertForeach(treeList);
|
||||
sarFileSplitItemsEODao.insertForeach(messageList);
|
||||
sarFileSplitItemsValEODao.insertForeach(itemValList);
|
||||
@@ -583,11 +595,11 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
|
||||
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", "发布稿(必读)");
|
||||
|
||||
List<SelectionResult> selectionResults = sarStandAttrDetailsEOService.selectFileFieldForSel(null);
|
||||
selectionResults.forEach(detailsEO->{
|
||||
map.put(detailsEO.getValue(),detailsEO.getLabel());
|
||||
});
|
||||
|
||||
if (rows != null && !rows.isEmpty()) {
|
||||
for (SarFileSplitInfoEO infoEO : rows) {
|
||||
@@ -730,4 +742,9 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
|
||||
return rows.get(0).getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarFileSplitItemsEO> querySame (SarFileSplitInfoEO sarFileSplitInfoEO){
|
||||
return dao.querySame(sarFileSplitInfoEO);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class FieldConvertUtil {
|
||||
"文本状态,发布日期"; // 导出基础表字段 //删除 实施日期 2021-05-28
|
||||
|
||||
public static String exportBaseFieldNamesForeign = "标准类别,标准编号,标准年份,中文名称,英文名称," +
|
||||
"文本状态,发布日期,文本说明,是否纳入认证清单,体系类别,标签,适用产品线,适用认证,能源类型,责任工程师," +
|
||||
"文本状态,发布日期,是否纳入认证清单,体系类别,标签,适用认证,能源类型," +
|
||||
"关联文件,发布稿,增补件,勘误件,草案"; // 导出基础表字段
|
||||
|
||||
public static String exportAttrFieldNamesInland = "归口管理部门,发布机构,工作组信息,我司参与深度,适用车辆类型,要求类型," +
|
||||
|
||||
@@ -101,10 +101,14 @@ public class StandExportUtil {
|
||||
Map<String,Object> attrValueMap = sarStandardsInfoEO.getAttrInfoMap();
|
||||
switch (name) {
|
||||
case "标准性质":
|
||||
value = sarStandardsInfoEO.getStandNature();
|
||||
value = sarStandardsInfoEO.getStandNatureShow();
|
||||
break;
|
||||
case "是否纳入认证清单":
|
||||
value = sarStandardsInfoEO.getIsRelateAccess();
|
||||
switch (sarStandardsInfoEO.getIsRelateAccess()){
|
||||
case "0": value="否"; break;
|
||||
case "1": value="是"; break;
|
||||
default:value="";
|
||||
}
|
||||
break;
|
||||
case "标准体系":
|
||||
value = sarStandardsInfoEO.getStandSystem();
|
||||
@@ -137,8 +141,8 @@ public class StandExportUtil {
|
||||
case "英文名称":
|
||||
value = sarStandardsInfoEO.getStandEnName();
|
||||
break;
|
||||
case "标准状态":
|
||||
value = sarStandardsInfoEO.getStandStateShow();
|
||||
case "文本状态":
|
||||
value = sarStandardsInfoEO.getStandTextStatusShow();
|
||||
break;
|
||||
case "发布日期":
|
||||
if (sarStandardsInfoEO.getIssueTime() != null) {
|
||||
|
||||
@@ -408,12 +408,14 @@
|
||||
<select id="querySarItemAndInterpretation" resultMap="sarItemVOResultMap"
|
||||
parameterType="com.adc.da.slrs.sarStandItems.entity.FindSarItemsPageReqDTO">
|
||||
SELECT
|
||||
*
|
||||
sar_stand_items.*,split_pid(sar_stand_items.ITEMS_NUM,'.') as tt
|
||||
FROM
|
||||
sar_stand_items
|
||||
<include refid="sarItemWhere"/>
|
||||
LIMIT #{page},#{pageSize}
|
||||
|
||||
<if test="orderBy !=null and orderBy!=''">
|
||||
order by tt ${order}
|
||||
</if>
|
||||
LIMIT ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
|
||||
<!-- 查询SAR_STAND_ITEMS列表 -->
|
||||
@@ -729,7 +731,8 @@
|
||||
|
||||
|
||||
<select id="selectAllItemsByIds" resultType="com.adc.da.slrs.sarStandItems.entity.SarStandItemsDto">
|
||||
select ID,STAND_ID,ITEMS_NUM,ITEMS_NAME,RESPONSIBLE_UNIT,SVPPS,APPLY_ARCTIC,CLAIM_TYPE,BUS_STAND_COVER,DUTY_ENGINEER as responsibleEngineer,XCXSSRQ as xcxssrq,ZCCSSRQ as zccssrq
|
||||
select ID,STAND_ID,ITEMS_NUM,ITEMS_NAME,RESPONSIBLE_UNIT,SVPPS,APPLY_ARCTIC,CLAIM_TYPE,BUS_STAND_COVER,DUTY_ENGINEER as responsibleEngineer,XCXSSRQ as xcxssrq,ZCCSSRQ as zccssrq ,read_content as technicalRequir ,compared_with_previous as changePoint
|
||||
,TERMS_CONDITIONS as termsConditions
|
||||
from SAR_STAND_ITEMS
|
||||
where FILE_TYPE=#{type}
|
||||
<if test="ids != null">
|
||||
@@ -738,6 +741,7 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by ITEMS_NUM
|
||||
</select>
|
||||
<select id="selectStandTime" resultType="com.adc.da.slrs.sarStandItems.entity.StandsTimeDto">
|
||||
select STAND_ID,XCXSSRQ,ZCCSSRQ
|
||||
|
||||
+2
-2
@@ -136,7 +136,7 @@
|
||||
|
||||
<!-- 查询字段及对应数据-->
|
||||
<select id="selectStandFieldAndData" resultType="Map">
|
||||
SELECT ${fieldInfo}
|
||||
SELECT STAND_ID,${fieldInfo}
|
||||
FROM SAR_BUSS_STAND_ATTR_INFO
|
||||
WHERE valid_flag=0 and stand_id = #{standId}
|
||||
</select>
|
||||
@@ -161,4 +161,4 @@
|
||||
FROM SAR_BUSS_STAND_ATTR_INFO
|
||||
WHERE stand_id = #{standId} and valid_flag=0
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
+7
-20
@@ -45,22 +45,17 @@
|
||||
put_time, issue_time,stand_en_name,stand_name, stand_code, id,apply_country, stand_nature, stand_sort,text_status_buss
|
||||
</sql>
|
||||
<sql id="Base_Column_List_show" >
|
||||
stand_year,dicapplyCountry.DIC_TYPE_NAME as applyCountryShow,dicstandSort.DIC_TYPE_NAME as standSortShow,
|
||||
dicstandNature.DIC_TYPE_NAME as standNatrueShow,SAR_BUSSIONESS_STAND.modify_time,
|
||||
SAR_BUSSIONESS_STAND.modify_time,
|
||||
SAR_BUSSIONESS_STAND.creation_time, SAR_BUSSIONESS_STAND.valid_flag,
|
||||
SAR_BUSSIONESS_STAND.apply_country, SAR_BUSSIONESS_STAND.stand_nature,SAR_BUSSIONESS_STAND.stand_sort,
|
||||
stand_status, replaced_stand_num,replace_stand_num,put_time,issue_time,stand_en_name,
|
||||
stand_name, stand_code,SAR_BUSSIONESS_STAND.id,dicstandStatus.DIC_TYPE_NAME as standStatusShow,SAR_BUSSIONESS_STAND.text_status_buss
|
||||
stand_name, stand_code,SAR_BUSSIONESS_STAND.id,SAR_BUSSIONESS_STAND.text_status_buss
|
||||
</sql>
|
||||
|
||||
<sql id="Group_Column_List_show" >
|
||||
stand_year,dicapplyCountry.DIC_TYPE_NAME,dicstandSort.DIC_TYPE_NAME,dicstandNature.DIC_TYPE_NAME,SAR_BUSSIONESS_STAND.modify_time,
|
||||
SAR_BUSSIONESS_STAND.creation_time, SAR_BUSSIONESS_STAND.valid_flag,
|
||||
SAR_BUSSIONESS_STAND.apply_country, SAR_BUSSIONESS_STAND.stand_nature,
|
||||
SAR_BUSSIONESS_STAND.stand_sort,
|
||||
stand_status, replaced_stand_num, replace_stand_num,put_time,
|
||||
issue_time, stand_en_name, stand_name, stand_code,
|
||||
SAR_BUSSIONESS_STAND.id,dicstandStatus.DIC_TYPE_NAME
|
||||
SAR_BUSSIONESS_STAND.id
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -354,10 +349,6 @@
|
||||
|
||||
<!-- 分页查询条件 -->
|
||||
<sql id="SarBussionInfo_Where_Clause">
|
||||
left join TS_DICTYPE dicstandStatus ON ( dicstandStatus.dic_type_code = SAR_BUSSIONESS_STAND.TEXT_STATUS_BUSS AND dicstandStatus.dic_id IS NOT NULL and dicstandStatus.valid_flag = 0)
|
||||
left join TS_DICTYPE dicstandNature ON ( dicstandNature.dic_type_code = SAR_BUSSIONESS_STAND.STAND_NATURE AND dicstandNature.dic_id IS NOT NULL and dicstandNature.valid_flag = 0)
|
||||
left join TS_DICTYPE dicstandSort ON ( dicstandSort.dic_type_code = SAR_BUSSIONESS_STAND.STAND_SORT AND dicstandSort.dic_id IS NOT NULL and dicstandSort.valid_flag = 0)
|
||||
left join TS_DICTYPE dicapplyCountry ON ( dicapplyCountry.dic_type_code = SAR_BUSSIONESS_STAND.APPLY_COUNTRY AND dicapplyCountry.dic_id IS NOT NULL and dicapplyCountry.valid_flag = 0)
|
||||
left join SAR_BUSS_STAND_MENU ON SAR_BUSSIONESS_STAND.id = SAR_BUSS_STAND_MENU.buss_stand_id
|
||||
left join TS_RESOURCE on SAR_BUSS_STAND_MENU.menu_id = TS_RESOURCE.id
|
||||
left join SAR_BUSS_STAND_ATTR_INFO on (SAR_BUSS_STAND_ATTR_INFO.STAND_ID = SAR_BUSSIONESS_STAND.id and SAR_BUSS_STAND_ATTR_INFO.valid_flag=0)
|
||||
@@ -460,6 +451,9 @@
|
||||
<if test="standStatus != null" >
|
||||
and SAR_BUSSIONESS_STAND.STAND_STATUS = #{standStatus}
|
||||
</if>
|
||||
<if test="standEnName != null">
|
||||
and SAR_BUSSIONESS_STAND.STAND_EN_NAME like concat('%', #{standEnName},'%')
|
||||
</if>
|
||||
<if test="advanceSearchStr != null">
|
||||
and (${advanceSearchStr})
|
||||
</if>
|
||||
@@ -581,14 +575,7 @@
|
||||
<select id="getBussionessStandInfoPage" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage">
|
||||
select * from
|
||||
(select tmp_tb.* from
|
||||
(select <include refid="Base_Column_List_show" />,
|
||||
(case WHEN dicstandStatus.DIC_TYPE_NAME = '已发布' THEN 1
|
||||
WHEN dicstandStatus.DIC_TYPE_NAME = '计划修订' THEN 2
|
||||
WHEN dicstandStatus.DIC_TYPE_NAME = '修订中' THEN 3
|
||||
WHEN dicstandStatus.DIC_TYPE_NAME = '已修订' THEN 4
|
||||
WHEN dicstandStatus.DIC_TYPE_NAME = '被替代' THEN 5
|
||||
WHEN dicstandStatus.DIC_TYPE_NAME = '废止' THEN 6
|
||||
WHEN dicstandStatus.DIC_TYPE_NAME IS NULL THEN 7 END) AS paixu
|
||||
(select <include refid="Base_Column_List_show" />
|
||||
from SAR_BUSSIONESS_STAND
|
||||
<include refid="SarBussionInfo_Where_Clause"/>
|
||||
GROUP BY <include refid="Group_Column_List_show"/>
|
||||
|
||||
+6
-2
@@ -45,12 +45,12 @@
|
||||
left join ts_user u
|
||||
on i.id=u.institution_id
|
||||
<if test="userName == null">
|
||||
where i.parent_id not in (select id from ts_institution)
|
||||
where i.parent_id not in (select id from ts_institution) order by i.name
|
||||
</if>
|
||||
|
||||
<if test="userName != null">
|
||||
|
||||
where u.uname like concat('%','${userName}','%')
|
||||
where u.uname like concat('%','${userName}','%') or u.account like concat('%','${userName}','%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -68,4 +68,8 @@
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<delete id="clearData">
|
||||
delete from ts_institution
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
+50
-3
@@ -122,7 +122,31 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
group by a.ID
|
||||
|
||||
UNION
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||
<where>
|
||||
<if test="standName != null">
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
and
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
ssi.FILE_TYPE = #{fileType} and
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
a.STAND_TYPE = #{standType} and
|
||||
</if>
|
||||
a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
limit #{start},#{end}
|
||||
</select>
|
||||
|
||||
@@ -150,13 +174,36 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
group by a.ID
|
||||
UNION
|
||||
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||
a.ID = b.STAND_ID
|
||||
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||
<where>
|
||||
<if test="standName != null">
|
||||
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||
and
|
||||
</if>
|
||||
<if test="fileType !=null">
|
||||
ssi.FILE_TYPE = #{fileType} and
|
||||
</if>
|
||||
<if test="standType !=null">
|
||||
a.STAND_TYPE = #{standType} and
|
||||
</if>
|
||||
a.ID IN
|
||||
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
||||
SELECT
|
||||
b.country_area AS country,
|
||||
a.ssrq AS ssrq,
|
||||
a.ssrq AS putTime,
|
||||
a.xcxssrq AS xcxssrq,
|
||||
a.zccssrq AS zccssrq
|
||||
FROM
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
p.name like concat(concat('%',#{name}),'%')
|
||||
</if>
|
||||
</where>
|
||||
<if test=" null!= pageSize ">
|
||||
limit ${(current-1) * pageSize},${pageSize}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="pageTotal" resultType="Long">
|
||||
|
||||
+2
@@ -50,6 +50,7 @@
|
||||
</if>
|
||||
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
|
||||
and STAND_SERIAL_NUMBER like concat(concat('%',#{sar.standSerialNumber}),'%')
|
||||
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%')
|
||||
</if>
|
||||
limit #{start},#{end}
|
||||
</select>
|
||||
@@ -73,6 +74,7 @@
|
||||
</if>
|
||||
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
|
||||
and STAND_SERIAL_NUMBER like concat(concat('%',#{sar.standSerialNumber}),'%')
|
||||
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -8,13 +8,15 @@
|
||||
<result column="STAND_ID" property="standId"/>
|
||||
<result column="ITEMS_NAME" property="itemsName"/>
|
||||
<result column="ITEMS_NUM" property="itemsNum"/>
|
||||
<result column="STAND_NUMBER" property="standCode"/>
|
||||
<result column="STAND_NUMBER" property="standNum"/>
|
||||
<result column="STAND_NAME" property="standName"/>
|
||||
<result column="XCXSSRQ" property="XCXSSRQ"/>
|
||||
<result column="ZCCSSRQ" property="ZCCSSRQ"/>
|
||||
<result column="CLLX" property="applyType"/>
|
||||
<result column="STAND_TYPE" property="standType"/>
|
||||
<result column="DUTY_ENGINEER" property="dutyEngineer"/>
|
||||
<result column="STAND_SORT" property="standSort"/>
|
||||
<result column="STAND_YEAR" property="standYear"/>
|
||||
</resultMap>
|
||||
<!-- 查询条件 -->
|
||||
<select id="selectWithinTerm" resultMap="resultMap" parameterType="com.adc.da.scheduled.entity.DataDTO">
|
||||
@@ -25,6 +27,8 @@
|
||||
items.TERMS_CONDITIONS,
|
||||
items.DUTY_ENGINEER,
|
||||
items.STAND_ID,
|
||||
info.STAND_SORT,
|
||||
info.STAND_YEAR,
|
||||
info.STAND_NAME,
|
||||
info.STAND_TYPE,
|
||||
info.STAND_NUMBER,
|
||||
|
||||
+38
-41
@@ -60,8 +60,8 @@
|
||||
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
|
||||
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
|
||||
concat(SAR_STANDARDS_INFO.synopsis, '') as synopsis, concat(replace_stand_num, '') as replace_stand_num, replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,dicountry.DIC_TYPE_NAME as countryShow, dicstandSort.DIC_TYPE_NAME as standSortShow,
|
||||
dicstandState.DIC_TYPE_NAME as standStateShow,dicstandNature.DIC_TYPE_NAME as standNatureShow,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME as standSortShow,
|
||||
dicstandTextStatus.DIC_TYPE_NAME as standTextStatusShow,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
</sql>
|
||||
|
||||
<sql id="Group_Column_List_Show">
|
||||
@@ -69,8 +69,8 @@
|
||||
SAR_STANDARDS_INFO.stand_number, SAR_STANDARDS_INFO.stand_year, SAR_STANDARDS_INFO.stand_name, SAR_STANDARDS_INFO.stand_en_name,
|
||||
SAR_STANDARDS_INFO.stand_state, SAR_STANDARDS_INFO.stand_nature, SAR_STANDARDS_INFO.issue_time, SAR_STANDARDS_INFO.put_time,
|
||||
concat(SAR_STANDARDS_INFO.synopsis, ''), concat(replace_stand_num, ''), replaced_stand_num, SAR_STANDARDS_INFO.creation_user, SAR_STANDARDS_INFO.valid_flag,
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time,dicountry.DIC_TYPE_NAME, dicstandSort.DIC_TYPE_NAME,
|
||||
dicstandState.DIC_TYPE_NAME,dicstandNature.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
SAR_STANDARDS_INFO.creation_time, SAR_STANDARDS_INFO.modify_time, dicstandSort.DIC_TYPE_NAME,
|
||||
dicstandTextStatus.DIC_TYPE_NAME,is_relate_access,cite_stand,cited_stand,SAR_STANDARDS_INFO.text_status,SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
@@ -323,8 +323,8 @@
|
||||
<if test="textStatus != null" >
|
||||
text_status = #{textStatus},
|
||||
</if>
|
||||
<if test="standSystem != null" >
|
||||
stand_system = #{standSystem},
|
||||
<if test="standSystem != null" >
|
||||
stand_system = #{standSystem},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
@@ -372,14 +372,15 @@
|
||||
</select>
|
||||
|
||||
<sql id="SarStandardsInfo_Where_Clause">
|
||||
left join TS_DICTYPE dicountry on (dicountry.dic_type_code = SAR_STANDARDS_INFO.country and dicountry.dic_id is
|
||||
not null and dicountry.valid_flag = 0)
|
||||
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
|
||||
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
|
||||
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
|
||||
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
|
||||
left join TS_DICTYPE dicstandNature on (dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature and
|
||||
dicstandNature.dic_id is not null and dicstandNature.valid_flag = 0 )
|
||||
|
||||
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
|
||||
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
|
||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||
AND dicstandTextStatus.valid_flag = 0
|
||||
)
|
||||
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
|
||||
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
|
||||
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
|
||||
@@ -408,6 +409,9 @@
|
||||
<!-- 标准名称 -->
|
||||
<if test="standName != null and standName != ''">
|
||||
and stand_name like concat(concat('%',#{standName}),'%')
|
||||
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
|
||||
or STAND_YEAR like concat(concat('%',#{standName}),'%')
|
||||
or STAND_SORT like concat(concat('%',#{standName}),'%')
|
||||
</if>
|
||||
<if test="standEnName != null and standEnName != ''">
|
||||
and stand_en_name like concat(concat('%',#{standEnName}),'%')
|
||||
@@ -494,7 +498,7 @@
|
||||
<if test="standSort != null and standSort != ''" >
|
||||
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
|
||||
</if>
|
||||
<!--标准年份-->
|
||||
<!--标准年份-->
|
||||
<if test="standYear != null and standYear != ''">
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
|
||||
</if>
|
||||
@@ -547,19 +551,7 @@
|
||||
(select tmp_tb.* from
|
||||
(select
|
||||
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL,
|
||||
(case WHEN dicstandState.DIC_TYPE_NAME = '草稿' THEN 1
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '征求意见稿' THEN 2
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '送审稿' THEN 3
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '报批稿' THEN 4
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '发布稿' THEN 5
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '已实施' THEN 6
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '计划修订' THEN 7
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '修订中' THEN 8
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '已修订' THEN 9
|
||||
WHEN dicstandState.DIC_TYPE_NAME = '已作废' THEN 10
|
||||
WHEN dicstandState.DIC_TYPE_NAME IS NULL THEN 11
|
||||
WHEN dicstandState.DIC_TYPE_NAME ='' THEN 11
|
||||
END) AS paixu,
|
||||
|
||||
(
|
||||
CASE
|
||||
WHEN ZCCSSRQ = 'TBD' THEN '6999-01-01'
|
||||
@@ -595,7 +587,7 @@
|
||||
) AS issueTime
|
||||
from SAR_STANDARDS_INFO
|
||||
<include refid="SarStandardsInfo_Where_Clause"/>
|
||||
GROUP BY <include refid="Group_Column_List_Show"/>,CHJL,SAR_STAND_ATTR_INFO.XCXSSRQ,SAR_STAND_ATTR_INFO.ZCCSSRQ
|
||||
GROUP BY <include refid="Group_Column_List_Show"/>,CHJL,SAR_STAND_ATTR_INFO.XCXSSRQ,SAR_STAND_ATTR_INFO.ZCCSSRQ,SAR_STAND_ATTR_INFO.SSRQ
|
||||
order by
|
||||
${orderBy1} ${order1},SAR_STANDARDS_INFO.id
|
||||
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||
@@ -646,12 +638,19 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="queryStandInfoByList" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
||||
<select id="queryStandInfoByList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM sar_standards_info
|
||||
LEFT JOIN sar_stand_attr_info ssai ON ssai.STAND_ID = SAR_STANDARDS_INFO.ID
|
||||
WHERE DATE_FORMAT(ssai.SSRQ,'%Y-%m-%D') >= DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME,'%Y-%m-%D')
|
||||
WHERE
|
||||
DATE_FORMAT(ssai.SSRQ, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
SAR_STANDARDS_INFO.ISSUE_TIME,
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
AND
|
||||
sar_standards_info.VALID_FLAG='0'
|
||||
AND TEXT_STATUS=#{typeCode}
|
||||
ORDER BY SAR_STANDARDS_INFO.ISSUE_TIME DESC
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
@@ -731,14 +730,15 @@
|
||||
select
|
||||
<include refid="Base_Column_List_Show"/>
|
||||
from SAR_STANDARDS_INFO
|
||||
left join TS_DICTYPE dicountry on (dicountry.dic_type_code = SAR_STANDARDS_INFO.country and dicountry.dic_id is
|
||||
not null and dicountry.valid_flag = 0)
|
||||
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
|
||||
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
|
||||
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
|
||||
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
|
||||
left join TS_DICTYPE dicstandNature on (dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature and
|
||||
dicstandNature.dic_id is not null and dicstandNature.valid_flag = 0 )
|
||||
|
||||
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
|
||||
dicstandTextStatus.dic_type_code = SAR_STANDARDS_INFO.text_status
|
||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||
AND dicstandTextStatus.valid_flag = 0
|
||||
)
|
||||
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
|
||||
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
|
||||
where SAR_STANDARDS_INFO.id = #{id}
|
||||
@@ -849,14 +849,11 @@
|
||||
(select
|
||||
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL
|
||||
from SAR_STANDARDS_INFO
|
||||
left join TS_DICTYPE dicountry on (dicountry.dic_type_code = SAR_STANDARDS_INFO.country and dicountry.dic_id is
|
||||
not null and dicountry.valid_flag = 0)
|
||||
|
||||
left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = SAR_STANDARDS_INFO.stand_sort and
|
||||
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
|
||||
left join TS_DICTYPE dicstandState on (dicstandState.dic_type_code = SAR_STANDARDS_INFO.stand_state and
|
||||
dicstandState.dic_id is not null and dicstandState.valid_flag = 0 )
|
||||
left join TS_DICTYPE dicstandNature on (dicstandNature.dic_type_code = SAR_STANDARDS_INFO.stand_nature and
|
||||
dicstandNature.dic_id is not null and dicstandNature.valid_flag = 0 )
|
||||
|
||||
|
||||
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
|
||||
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
|
||||
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
|
||||
|
||||
@@ -50,7 +50,16 @@
|
||||
on u.usid=up.user_id
|
||||
left join ts_position p
|
||||
on up.position_id=p.id
|
||||
where u.institution_id=#{TsUser.institutionId}
|
||||
where 1=1
|
||||
<if test="TsUser.institutionId != null and TsUser.institutionId != '' ">
|
||||
and u.institution_id=#{TsUser.institutionId}
|
||||
</if>
|
||||
<if test="TsUser.uname != null and TsUser.uname != '' ">
|
||||
and u.uname like concat('%',#{TsUser.uname},'%')
|
||||
</if>
|
||||
<if test="TsUser.email != null and TsUser.email != '' ">
|
||||
and u.email like concat('%',#{TsUser.email},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getUserIdsByPositionIds" resultType="String">
|
||||
|
||||
+8
-2
@@ -195,7 +195,7 @@
|
||||
|
||||
<!-- 根据id查询 SAR_FILE_SPLIT_INFO -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_FILE_SPLIT_INFO
|
||||
where id = #{value}
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
|
||||
<select id="queryByCountOwn" resultType="java.lang.Integer" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEOPage">
|
||||
SELECT
|
||||
count(0)
|
||||
count(1)
|
||||
FROM
|
||||
SAR_FILE_SPLIT_INFO
|
||||
LEFT JOIN SAR_STANDARDS_INFO ON SAR_FILE_SPLIT_INFO.STAND_ID = SAR_STANDARDS_INFO.id
|
||||
@@ -334,4 +334,10 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="querySame" resultType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO">
|
||||
select * from SAR_FILE_SPLIT_ITEMS
|
||||
LEFT JOIN SAR_FILE_SPLIT_INFO ON SAR_FILE_SPLIT_ITEMS.INFO_ID = SAR_FILE_SPLIT_INFO.ID
|
||||
where SAR_FILE_SPLIT_INFO.ID = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user