Merge branch 'develop_master' into FOTON
This commit is contained in:
@@ -52,6 +52,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
addInterceptor.excludePathPatterns("/api/sys/user/getById");
|
addInterceptor.excludePathPatterns("/api/sys/user/getById");
|
||||||
addInterceptor.excludePathPatterns("/api/person/userInfo/getByUserInfoCode");
|
addInterceptor.excludePathPatterns("/api/person/userInfo/getByUserInfoCode");
|
||||||
addInterceptor.excludePathPatterns("/api/att/attFile/upload");
|
addInterceptor.excludePathPatterns("/api/att/attFile/upload");
|
||||||
|
// 标准拆分 模板下载
|
||||||
|
addInterceptor.excludePathPatterns("/api/att/attFile/uploadModalFile");
|
||||||
|
|
||||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/exportStandardsInfoExcel");
|
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/exportStandardsInfoExcel");
|
||||||
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInfo/exportStandardsInfoExcel");
|
addInterceptor.excludePathPatterns("/api/lawss/sarLawsInfo/exportStandardsInfoExcel");
|
||||||
// 提供自动发起复审流程 复审数据
|
// 提供自动发起复审流程 复审数据
|
||||||
|
|||||||
@@ -42,6 +42,18 @@ public class DataSyncController {
|
|||||||
private IDataSyncService iDataSyncService;
|
private IDataSyncService iDataSyncService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("国内外标准库代替被代替 数据补全")
|
||||||
|
@PostMapping("/dtAndBdtToStandData")
|
||||||
|
public void dtAndBdtToStandData() {
|
||||||
|
iDataSyncService.dtAndBdtToStandData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("企业标准库代替被代替 数据补全")
|
||||||
|
@PostMapping("/dtAndBdtToBussData")
|
||||||
|
public void dtAndBdtToBussData() {
|
||||||
|
iDataSyncService.dtAndBdtToBussData();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("同步用户数据")
|
@ApiOperation("同步用户数据")
|
||||||
@PostMapping("/importUserData")
|
@PostMapping("/importUserData")
|
||||||
public String importUserData() throws Exception {
|
public String importUserData() throws Exception {
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.adc.da.slrs.DataSync.service;
|
|||||||
|
|
||||||
public interface IDataSyncService {
|
public interface IDataSyncService {
|
||||||
|
|
||||||
|
void dtAndBdtToStandData();
|
||||||
|
void dtAndBdtToBussData();
|
||||||
|
|
||||||
public String dataSync();
|
public String dataSync();
|
||||||
|
|
||||||
public String orgDataSync();
|
public String orgDataSync();
|
||||||
|
|||||||
+210
@@ -2,10 +2,19 @@ package com.adc.da.slrs.DataSync.service.impl;
|
|||||||
|
|
||||||
import com.adc.da.login.util.UserUtils;
|
import com.adc.da.login.util.UserUtils;
|
||||||
import com.adc.da.slrs.DataSync.service.IDataSyncService;
|
import com.adc.da.slrs.DataSync.service.IDataSyncService;
|
||||||
|
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||||
|
import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||||
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
import com.adc.da.slrs.sarPosition.entity.TsPosition;
|
||||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||||
|
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||||
|
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||||
|
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||||
import com.adc.da.sync.service.SyncUserService;
|
import com.adc.da.sync.service.SyncUserService;
|
||||||
@@ -14,18 +23,22 @@ import com.adc.da.sys.entity.UserOrgEO;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import lombok.extern.log4j.Log4j;
|
import lombok.extern.log4j.Log4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.ibatis.jdbc.Null;
|
import org.apache.ibatis.jdbc.Null;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class DataSyncServiceImpl implements IDataSyncService {
|
public class DataSyncServiceImpl implements IDataSyncService {
|
||||||
@@ -37,10 +50,207 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
|||||||
ITsUserService tsUserService;
|
ITsUserService tsUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
ITsInstitutionService tsInstitutionService;
|
ITsInstitutionService tsInstitutionService;
|
||||||
|
@Autowired
|
||||||
|
private ISarStandardsInfoService iSarStandardsInfoService;
|
||||||
|
@Autowired
|
||||||
|
private ISarBussionessStandService iSarBussionessStandService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandAttrInfoDao sarStandAttrInfoEODao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarStandAttrInfoService iSarStandAttrInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarBussStandAttrInfoDao sarBussStandAttrInfoEODao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarBussStandAttrInfoService iSarBussStandAttrInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(DataSyncServiceImpl.class);
|
private static Logger logger = LoggerFactory.getLogger(DataSyncServiceImpl.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
|
@Async
|
||||||
|
public void dtAndBdtToStandData(){
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.select("sar_standards_info.*, r.DTBJH AS dtbzh, r.BDTBZH");
|
||||||
|
wrapper.last("LEFT JOIN sar_stand_attr_info r ON r.STAND_ID = sar_standards_info.ID WHERE sar_standards_info.VALID_FLAG = '0'");
|
||||||
|
List<SarStandardsInfo> standardsInfos = iSarStandardsInfoService.list(wrapper);
|
||||||
|
|
||||||
|
if(!standardsInfos.isEmpty()){
|
||||||
|
|
||||||
|
// 1. 遍历全部数据
|
||||||
|
standardsInfos.forEach(info -> {
|
||||||
|
// 1.1 判断代替标准号
|
||||||
|
if(StringUtils.isNotBlank(info.getDtbzh())){
|
||||||
|
// 1.1.1 找出当前代替标准版所有被代替标准
|
||||||
|
List<String> dtList = Arrays.stream(info.getDtbzh().split(",")).map(String::trim).collect(Collectors.toList());
|
||||||
|
if(!dtList.isEmpty()){
|
||||||
|
for (String s : dtList) {
|
||||||
|
|
||||||
|
if(s.contains("null")){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
List<SarStandardsInfo> bdtList = standardsInfos.stream().filter(info1 -> {
|
||||||
|
if(StringUtils.isNotBlank(info1.getDtbzh()) && info1.getDtbzh().contains(s)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
// 1.1.1.1合并被代替标准
|
||||||
|
if(!bdtList.isEmpty()){
|
||||||
|
// 1.1.1.1.1 获取需要更新的代替标准
|
||||||
|
List<SarStandardsInfo> updInfo = standardsInfos.stream().filter(info1 -> {
|
||||||
|
String addStrandNumber = "";
|
||||||
|
if (StringUtils.isNotEmpty(info1.getStandYear())) {
|
||||||
|
addStrandNumber = info1.getStandSort() + " " + info1.getStandNumber() + "-" + info1.getStandYear();
|
||||||
|
} else {
|
||||||
|
addStrandNumber = info1.getStandSort() + " " + info1.getStandNumber();
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(addStrandNumber) && s.trim().equals(addStrandNumber.trim())){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
// 1.1.1.1.2 是否存在需要更新的代替标准
|
||||||
|
if(!updInfo.isEmpty()){
|
||||||
|
// 1.1.1.1.2.1 拼接 被代替标准号
|
||||||
|
String btd = bdtList.stream().map(info1 -> {
|
||||||
|
String addStrandNumber = "";
|
||||||
|
if (StringUtils.isNotEmpty(info1.getStandYear())) {
|
||||||
|
addStrandNumber = info1.getStandSort() + " " + info1.getStandNumber() + "-" + info1.getStandYear();
|
||||||
|
} else {
|
||||||
|
addStrandNumber = info1.getStandSort() + " " + info1.getStandNumber();
|
||||||
|
}
|
||||||
|
return addStrandNumber;
|
||||||
|
}).collect(Collectors.joining(","));
|
||||||
|
System.out.println(btd);
|
||||||
|
|
||||||
|
// 1.1.1.1.2.2 找出已存在的被代替标准 及 去重, 如没找出,则使用最新被代替
|
||||||
|
List<String> notExBtdList = Arrays.stream(btd.split(",")).map(String::trim).collect(Collectors.toList());
|
||||||
|
if(StringUtils.isNotBlank(updInfo.get(0).getBDTBZH())){
|
||||||
|
List<String> exBdtList = Arrays.stream(updInfo.get(0).getBDTBZH().split(",")).map(String::trim).collect(Collectors.toList());
|
||||||
|
if(!exBdtList.isEmpty()){
|
||||||
|
exBdtList = exBdtList.stream().filter(String -> {
|
||||||
|
if(StringUtils.isNotBlank(String) && !String.contains("null")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
notExBtdList.addAll(exBdtList);
|
||||||
|
notExBtdList = notExBtdList.stream().distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String btdStr = notExBtdList.stream().map(String::toString).collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
// 1.1.1.1.2.3 更新
|
||||||
|
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||||
|
updateWrapper.eq("STAND_ID",updInfo.get(0).getId());
|
||||||
|
updateWrapper.set("BDTBZH",btdStr);
|
||||||
|
iSarStandAttrInfoService.update(updateWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
|
@Async
|
||||||
|
public void dtAndBdtToBussData(){
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.select("sar_bussioness_stand.*, r.DTQBBHBUSS, r.BDTQBBHBUSS");
|
||||||
|
wrapper.last("LEFT JOIN sar_buss_stand_attr_info r ON r.STAND_ID = sar_bussioness_stand.ID WHERE sar_bussioness_stand.VALID_FLAG = '0' and sar_bussioness_stand.id in ('021b0c0c9e774ba9a76abbf923d59f5','jdmygltv37qvyb5s87ea')");
|
||||||
|
List<SarBussionessStand> bussionessStands = iSarBussionessStandService.list(wrapper);
|
||||||
|
|
||||||
|
if(!bussionessStands.isEmpty()){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 1. 遍历全部数据
|
||||||
|
bussionessStands.forEach(info -> {
|
||||||
|
// 1.1 判断代替标准号
|
||||||
|
if(StringUtils.isNotBlank(info.getDTQBBHBUSS())){
|
||||||
|
// 1.1.1 找出当前代替标准版所有被代替标准
|
||||||
|
List<String> dtList = Arrays.stream(info.getDTQBBHBUSS().split(",")).map(String::trim).collect(Collectors.toList());
|
||||||
|
if(!dtList.isEmpty()){
|
||||||
|
for (String s : dtList) {
|
||||||
|
|
||||||
|
if(s.contains("null")){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
List<SarBussionessStand> bdtList = bussionessStands.stream().filter(info1 -> {
|
||||||
|
if(StringUtils.isNotBlank(info1.getDTQBBHBUSS()) && info1.getDTQBBHBUSS().contains(s)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
// 1.1.1.1合并被代替标准
|
||||||
|
if(!bdtList.isEmpty()){
|
||||||
|
// 1.1.1.1.1 获取需要更新的代替标准
|
||||||
|
List<SarBussionessStand> updInfo = bussionessStands.stream().filter(info1 -> {
|
||||||
|
if(StringUtils.isNotBlank(info1.getStandCode()) && s.trim().equals(info1.getStandCode().trim())){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
// 1.1.1.1.2 是否存在需要更新的代替标准
|
||||||
|
if(!updInfo.isEmpty()){
|
||||||
|
// 1.1.1.1.2.1 拼接 被代替标准号
|
||||||
|
String btd = bdtList.stream().map(info1 -> {
|
||||||
|
String addStrandNumber = "";
|
||||||
|
if (StringUtils.isNotEmpty(info1.getStandYear())) {
|
||||||
|
addStrandNumber = info1.getStandSort() + " " + info1.getStandNumber() + "-" + info1.getStandYear();
|
||||||
|
} else {
|
||||||
|
addStrandNumber = info1.getStandSort() + " " + info1.getStandNumber();
|
||||||
|
}
|
||||||
|
return addStrandNumber;
|
||||||
|
}).collect(Collectors.joining(","));
|
||||||
|
System.out.println(btd);
|
||||||
|
|
||||||
|
// 1.1.1.1.2.2 找出已存在的被代替标准 及 去重, 如没找出,则使用最新被代替
|
||||||
|
List<String> notExBtdList = Arrays.stream(btd.split(",")).map(String::trim).collect(Collectors.toList());
|
||||||
|
if(StringUtils.isNotBlank(updInfo.get(0).getBDTQBBHBUSS())){
|
||||||
|
List<String> exBdtList = Arrays.stream(updInfo.get(0).getBDTQBBHBUSS().split(",")).map(String::trim).collect(Collectors.toList());
|
||||||
|
if(!exBdtList.isEmpty()){
|
||||||
|
exBdtList = exBdtList.stream().filter(String -> {
|
||||||
|
if(StringUtils.isNotBlank(String) && !String.contains("null")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
notExBtdList.addAll(exBdtList);
|
||||||
|
notExBtdList = notExBtdList.stream().distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String btdStr = notExBtdList.stream().map(String::toString).collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
// 1.1.1.1.2.3 更新
|
||||||
|
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||||
|
updateWrapper.eq("STAND_ID",updInfo.get(0).getId());
|
||||||
|
updateWrapper.set("BDTQBBHBUSS",btdStr);
|
||||||
|
iSarBussStandAttrInfoService.update(updateWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
public String dataSync(){
|
public String dataSync(){
|
||||||
|
|||||||
+19
-5
@@ -2,12 +2,11 @@ package com.adc.da.slrs.StandardQA.controller;
|
|||||||
|
|
||||||
import com.adc.da.base.web.BaseController;
|
import com.adc.da.base.web.BaseController;
|
||||||
import com.adc.da.slrs.StandardQA.dao.AskQuestionsDao;
|
import com.adc.da.slrs.StandardQA.dao.AskQuestionsDao;
|
||||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
import com.adc.da.slrs.StandardQA.entity.*;
|
||||||
import com.adc.da.slrs.StandardQA.entity.AskQuestionsPage;
|
|
||||||
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
|
||||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
|
||||||
import com.adc.da.slrs.StandardQA.service.Impl.AskQuestionsServiceImpl;
|
import com.adc.da.slrs.StandardQA.service.Impl.AskQuestionsServiceImpl;
|
||||||
import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.SubscriptionServiceImpl;
|
||||||
|
import com.adc.da.util.LoginUserUtil;
|
||||||
import com.adc.da.util.UUIDUtils;
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.adc.da.util.http.ResponseMessage;
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
import com.adc.da.util.http.Result;
|
import com.adc.da.util.http.Result;
|
||||||
@@ -45,6 +44,9 @@ public class AskQuestionsController extends BaseController<AskQuestions> {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AskUserServiceImpl askUserService;
|
private AskUserServiceImpl askUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SubscriptionServiceImpl subscriptionService;
|
||||||
|
|
||||||
@GetMapping("/getAskQuestionsPage")
|
@GetMapping("/getAskQuestionsPage")
|
||||||
public ResponseMessage<IPage<AskQuestions>> getAskQuestionsPage(AskQuestionsPage askQuestions){
|
public ResponseMessage<IPage<AskQuestions>> getAskQuestionsPage(AskQuestionsPage askQuestions){
|
||||||
IPage<AskQuestions> iPage = new Page<>();
|
IPage<AskQuestions> iPage = new Page<>();
|
||||||
@@ -58,7 +60,19 @@ public class AskQuestionsController extends BaseController<AskQuestions> {
|
|||||||
|
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public ResponseMessage<IPage<AskQuestions>> getAskQuestionslistPage(@RequestBody AskQuestionsPage askQuestions){
|
public ResponseMessage<IPage<AskQuestions>> getAskQuestionslistPage(@RequestBody AskQuestionsPage askQuestions){
|
||||||
return Result.success(askQuestionsService.listPage(askQuestions));
|
IPage<AskQuestions> iPage = askQuestionsService.listPage(askQuestions);
|
||||||
|
if(!iPage.getRecords().isEmpty()){
|
||||||
|
iPage.getRecords().forEach(questions -> {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("ASK_ID",questions.getId());
|
||||||
|
queryWrapper.eq("USID", LoginUserUtil.getUserId());
|
||||||
|
List<Subscription> list = subscriptionService.list(queryWrapper);
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
questions.setSubState(list.get(0).getSubState());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Result.success(iPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+21
-3
@@ -7,6 +7,7 @@ import com.adc.da.slrs.StandardQA.service.Impl.SubscriptionServiceImpl;
|
|||||||
import com.adc.da.util.http.ResponseMessage;
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
import com.adc.da.util.http.Result;
|
import com.adc.da.util.http.Result;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: qk
|
* @Author: qk
|
||||||
* @Date: 2022/6/7 0007 11:18
|
* @Date: 2022/6/7 0007 11:18
|
||||||
@@ -31,14 +34,29 @@ public class SubscriptionController extends BaseController<Subscription> {
|
|||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq("ASK_ID",subscription.getAskId());
|
queryWrapper.eq("ASK_ID",subscription.getAskId());
|
||||||
queryWrapper.eq("USID",subscription.getUsId());
|
queryWrapper.eq("USID",subscription.getUsId());
|
||||||
int number = subscriptionService.count(queryWrapper);
|
List<Subscription> list = subscriptionService.list(queryWrapper);
|
||||||
if(number>0){
|
if(!list.isEmpty()){
|
||||||
return Result.success("200","此问题已订阅",null);
|
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||||
|
updateWrapper.eq("ASK_ID",subscription.getAskId());
|
||||||
|
updateWrapper.eq("USID",subscription.getUsId());
|
||||||
|
updateWrapper.set("SUB_STATE",subscription.getSubState());
|
||||||
|
if(subscriptionService.update(updateWrapper)){
|
||||||
|
if("y".equals(subscription.getSubState())){
|
||||||
|
return Result.success("200","订阅成功",null);
|
||||||
|
}else {
|
||||||
|
return Result.success("200","取消订阅成功",null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
return Result.success("-1","订阅失败",null);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
subscription.setSubState("y");
|
||||||
if(subscriptionService.save(subscription)){
|
if(subscriptionService.save(subscription)){
|
||||||
return Result.success("200","订阅成功",null);
|
return Result.success("200","订阅成功",null);
|
||||||
}else {
|
}else {
|
||||||
return Result.success("-1","订阅失败",null);
|
return Result.success("-1","订阅失败",null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,4 +101,7 @@ public class AskQuestions extends BaseEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String subscription;
|
private String subscription;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String subState;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,8 @@ public class Subscription extends BaseEntity {
|
|||||||
@TableField("USID")
|
@TableField("USID")
|
||||||
@ApiModelProperty(value = "用户ID")
|
@ApiModelProperty(value = "用户ID")
|
||||||
private String usId;
|
private String usId;
|
||||||
|
|
||||||
|
@TableField("SUB_STATE")
|
||||||
|
@ApiModelProperty(value = "订阅状态 默认 n 未订阅 y 已订阅")
|
||||||
|
private String subState;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -20,6 +20,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ISarBussionessStandService extends IService<SarBussionessStand> {
|
public interface ISarBussionessStandService extends IService<SarBussionessStand> {
|
||||||
|
|
||||||
|
void updateCiteStand(SarBussionessStand sarBussionessStandEO, SarBussionessStand beforeSarStandardsInfo, String upField, String beUpedField);
|
||||||
|
|
||||||
SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId);
|
SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId);
|
||||||
|
|
||||||
void attrInfoDetails (SarBussionessStand row) throws Exception;
|
void attrInfoDetails (SarBussionessStand row) throws Exception;
|
||||||
|
|||||||
+2
-1
@@ -757,7 +757,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 新增修改标准过程中,根据代替标准号,修改被代替标准号对应的标准
|
// 新增修改标准过程中,根据代替标准号,修改被代替标准号对应的标准
|
||||||
public void updateCiteStand(SarBussionessStand sarBussionessStandEO, SarBussionessStand beforeSarStandardsInfo, String upField, String beUpedField) throws Exception {
|
public void updateCiteStand(SarBussionessStand sarBussionessStandEO, SarBussionessStand beforeSarStandardsInfo, String upField, String beUpedField){
|
||||||
// 记录要被代替标准号的数据
|
// 记录要被代替标准号的数据
|
||||||
// SarStandardsInfoEO chageEO= new SarStandardsInfoEO();
|
// SarStandardsInfoEO chageEO= new SarStandardsInfoEO();
|
||||||
SarBussionessStand sarStandardsSelectEO = new SarBussionessStand();
|
SarBussionessStand sarStandardsSelectEO = new SarBussionessStand();
|
||||||
@@ -1734,6 +1734,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage){
|
public List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage){
|
||||||
|
sarBussionessStandEOPage.setValidFlag("0");
|
||||||
return this.baseMapper.queryByList(sarBussionessStandEOPage);
|
return this.baseMapper.queryByList(sarBussionessStandEOPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -288,16 +288,18 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
|
|||||||
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
||||||
List<TsInstitution> institutions = getTopChild(map,userVO.getInstitutionId(),topNum,tsInstitutions);
|
List<TsInstitution> institutions = getTopChild(map,userVO.getInstitutionId(),topNum,tsInstitutions);
|
||||||
if(!institutions.isEmpty()){
|
if(!institutions.isEmpty()){
|
||||||
if(institutions.size() >= topNum){
|
if(institutions.size() > topNum){
|
||||||
userVO.setTopUnitId(institutions.get(topNum).getId());
|
userVO.setTopUnitId(institutions.get(topNum).getId());
|
||||||
userVO.setTopUnit(institutions.get(topNum).getName());
|
userVO.setTopUnit(institutions.get(topNum).getName());
|
||||||
|
}else if(institutions.size() == topNum){
|
||||||
|
userVO.setTopUnitId(institutions.get(topNum-1).getId());
|
||||||
|
userVO.setTopUnit(institutions.get(topNum-1).getName());
|
||||||
}else {
|
}else {
|
||||||
userVO.setTopUnitId(institutions.get(institutions.size()-1).getId());
|
userVO.setTopUnitId(institutions.get(institutions.size()-1).getId());
|
||||||
userVO.setTopUnit(institutions.get(institutions.size()-1).getName());
|
userVO.setTopUnit(institutions.get(institutions.size()-1).getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
|||||||
|
|
||||||
@GetMapping("/queryProjectWorkFlow")
|
@GetMapping("/queryProjectWorkFlow")
|
||||||
@ApiOperation("车型/项目库-!!!")
|
@ApiOperation("车型/项目库-!!!")
|
||||||
public ResponseMessage queryMaintenanceProjectWorkFlow(@RequestParam(defaultValue = "1", value = "Page")int Page, @RequestParam(defaultValue = "10", value = "PageSize") int PageSize,SarStandProjectLibraryDto sarDto) {
|
public ResponseMessage queryMaintenanceProjectWorkFlow(int Page, int PageSize,SarStandProjectLibraryDto sarDto) {
|
||||||
IPage<SarStandProjectLibrary> MaintenanceList = sarStandProjectLibraryService.queryMaintenanceProjectWorkFlow(Page,PageSize,sarDto);
|
IPage<SarStandProjectLibrary> MaintenanceList = sarStandProjectLibraryService.queryMaintenanceProjectWorkFlow(Page,PageSize,sarDto);
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put("Maintenance",MaintenanceList);
|
map.put("Maintenance",MaintenanceList);
|
||||||
|
|||||||
+2
@@ -19,6 +19,8 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||||
|
|
||||||
|
void updateCiteStand(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo, String upField, String beUpedField);
|
||||||
|
|
||||||
// void reverseQueryStand(List<String> ids, String standName,String type);
|
// void reverseQueryStand(List<String> ids, String standName,String type);
|
||||||
|
|
||||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
||||||
|
|||||||
+1
-1
@@ -1538,7 +1538,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 新增修改标准过程中,根据代替标准号,修改被代替标准号对应的标准
|
// 新增修改标准过程中,根据代替标准号,修改被代替标准号对应的标准
|
||||||
public void updateCiteStand(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo, String upField, String beUpedField) throws Exception {
|
public void updateCiteStand(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo, String upField, String beUpedField){
|
||||||
// 记录要被代替标准号的数据
|
// 记录要被代替标准号的数据
|
||||||
// SarStandardsInfoEO chageEO= new SarStandardsInfoEO();
|
// SarStandardsInfoEO chageEO= new SarStandardsInfoEO();
|
||||||
SarStandardsInfo sarStandardsSelectEO = new SarStandardsInfo();
|
SarStandardsInfo sarStandardsSelectEO = new SarStandardsInfo();
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
LEFT JOIN subscription su ON su.ASK_ID = aq.ID and su.SUB_STATE = 'y'
|
||||||
<where>
|
<where>
|
||||||
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||||
AND su.USID = #{askQuestions.answerer}
|
AND su.USID = #{askQuestions.answerer}
|
||||||
@@ -172,7 +172,10 @@
|
|||||||
<if test="askQuestions.type == 'mySub'">
|
<if test="askQuestions.type == 'mySub'">
|
||||||
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||||
</if>
|
</if>
|
||||||
<where>
|
<where> 1=1
|
||||||
|
<if test="askQuestions.type == 'mySub'">
|
||||||
|
AND su.SUB_STATE = 'y'
|
||||||
|
</if>
|
||||||
<if test="askQuestions.questioner != null and askQuestions.questioner != ''">
|
<if test="askQuestions.questioner != null and askQuestions.questioner != ''">
|
||||||
AND aq.QUESTIONER =#{askQuestions.questioner}
|
AND aq.QUESTIONER =#{askQuestions.questioner}
|
||||||
</if>
|
</if>
|
||||||
@@ -214,7 +217,7 @@
|
|||||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
||||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
LEFT JOIN subscription su ON su.ASK_ID = aq.ID and su.SUB_STATE = 'y'
|
||||||
<where>
|
<where>
|
||||||
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||||
AND su.USID = #{askQuestions.answerer}
|
AND su.USID = #{askQuestions.answerer}
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@
|
|||||||
and stand_name ${standNameOperator} #{standName}
|
and stand_name ${standNameOperator} #{standName}
|
||||||
</if>
|
</if>
|
||||||
<if test="standCode != null" >
|
<if test="standCode != null" >
|
||||||
and stand_code ${standCodeOperator} #{standCode}
|
and trim(replace(stand_code,' ','')) ${standCodeOperator} trim(replace(#{standCode},' ',''))
|
||||||
</if>
|
</if>
|
||||||
<if test="id != null" >
|
<if test="id != null" >
|
||||||
and id ${idOperator} #{id}
|
and id ${idOperator} #{id}
|
||||||
|
|||||||
+6
@@ -455,6 +455,9 @@
|
|||||||
select sar_stand_project_library.* , ts_user.UNAME as uName from sar_stand_project_library
|
select sar_stand_project_library.* , ts_user.UNAME as uName from sar_stand_project_library
|
||||||
left join ts_user on ts_user.USID = sar_stand_project_library.project_manager
|
left join ts_user on ts_user.USID = sar_stand_project_library.project_manager
|
||||||
where 1=1
|
where 1=1
|
||||||
|
<if test="sarStandProjectLibrary.flag != null and sarStandProjectLibrary.flag != ''">
|
||||||
|
and sar_stand_project_library.flag=#{sarStandProjectLibrary.flag}
|
||||||
|
</if>
|
||||||
<if test="sarStandProjectLibrary.managementHostName != null and sarStandProjectLibrary.managementHostName != ''">
|
<if test="sarStandProjectLibrary.managementHostName != null and sarStandProjectLibrary.managementHostName != ''">
|
||||||
and sar_stand_project_library.management_host_name=#{sarStandProjectLibrary.managementHostName}
|
and sar_stand_project_library.management_host_name=#{sarStandProjectLibrary.managementHostName}
|
||||||
</if>
|
</if>
|
||||||
@@ -481,6 +484,9 @@
|
|||||||
select count(sar_stand_project_library.id) from sar_stand_project_library
|
select count(sar_stand_project_library.id) from sar_stand_project_library
|
||||||
left join ts_user on ts_user.USID = sar_stand_project_library.project_manager
|
left join ts_user on ts_user.USID = sar_stand_project_library.project_manager
|
||||||
where 1=1
|
where 1=1
|
||||||
|
<if test="sarStandProjectLibrary.flag != null and sarStandProjectLibrary.flag != ''">
|
||||||
|
and sar_stand_project_library.flag=#{sarStandProjectLibrary.flag}
|
||||||
|
</if>
|
||||||
<if test="sarStandProjectLibrary.managementHostName != null and sarStandProjectLibrary.managementHostName != ''">
|
<if test="sarStandProjectLibrary.managementHostName != null and sarStandProjectLibrary.managementHostName != ''">
|
||||||
and sar_stand_project_library.management_host_name=#{sarStandProjectLibrary.managementHostName}
|
and sar_stand_project_library.management_host_name=#{sarStandProjectLibrary.managementHostName}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user