Merge branch 'develop_master' into develop_migration
This commit is contained in:
@@ -16,6 +16,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -48,6 +49,13 @@ public class ProcessTimer {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private WorkFlowController workFlowController;
|
private WorkFlowController workFlowController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置文件设置是否开启定时器
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Value("${isNotScheduled}")
|
||||||
|
private boolean isNotScheduled; //是否开启定时器
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* @Description: 自动催办,任务截至时间前3天开始每天催办
|
* @Description: 自动催办,任务截至时间前3天开始每天催办
|
||||||
* @Author: yangxuenan
|
* @Author: yangxuenan
|
||||||
@@ -59,44 +67,48 @@ public class ProcessTimer {
|
|||||||
// @Scheduled(cron = "*/5 * * * * ?")//每5秒执行一次
|
// @Scheduled(cron = "*/5 * * * * ?")//每5秒执行一次
|
||||||
// @Scheduled(cron = "0/20 * * * * ?")
|
// @Scheduled(cron = "0/20 * * * * ?")
|
||||||
public void urging() {
|
public void urging() {
|
||||||
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
|
if(isNotScheduled){
|
||||||
if (null != busProcessNames && 0 < busProcessNames.size()) {
|
log.info("=================================自动催办定时任务启动=====================================");
|
||||||
for (BusProcessName busProcessName : busProcessNames) {
|
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
|
||||||
String type = busProcessName.getPrcType();
|
if (null != busProcessNames && 0 < busProcessNames.size()) {
|
||||||
Integer typeInt = 99;
|
for (BusProcessName busProcessName : busProcessNames) {
|
||||||
if (StringUtils.isNotEmpty(type)) {
|
String type = busProcessName.getPrcType();
|
||||||
typeInt = Integer.valueOf(type);
|
Integer typeInt = 99;
|
||||||
}
|
if (StringUtils.isNotEmpty(type)) {
|
||||||
type = chooseType(typeInt, type);
|
typeInt = Integer.valueOf(type);
|
||||||
|
}
|
||||||
|
type = chooseType(typeInt, type);
|
||||||
|
|
||||||
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
|
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
|
||||||
String[] array = userEO.getEmail().split(",");
|
String[] array = userEO.getEmail().split(",");
|
||||||
String overTime = busProcessName.getOverTime();
|
String overTime = busProcessName.getOverTime();
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
Date dateTime = null;
|
Date dateTime = null;
|
||||||
Integer num = 3;
|
Integer num = 3;
|
||||||
try {
|
|
||||||
dateTime = simpleDateFormat.parse(overTime);
|
|
||||||
Date now = new Date();
|
|
||||||
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
|
||||||
num = Integer.valueOf(String.valueOf(daysBetween));
|
|
||||||
} catch (ParseException e) {
|
|
||||||
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
|
|
||||||
try {
|
try {
|
||||||
dateTime = simpleDateFormat1.parse(overTime);
|
dateTime = simpleDateFormat.parse(overTime);
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||||
num = Integer.valueOf(String.valueOf(daysBetween));
|
num = Integer.valueOf(String.valueOf(daysBetween));
|
||||||
} catch (ParseException e1) {
|
} catch (ParseException e) {
|
||||||
e.getMessage();
|
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
|
||||||
|
try {
|
||||||
|
dateTime = simpleDateFormat1.parse(overTime);
|
||||||
|
Date now = new Date();
|
||||||
|
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||||
|
num = Integer.valueOf(String.valueOf(daysBetween));
|
||||||
|
} catch (ParseException e1) {
|
||||||
|
e.getMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
|
String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
|
||||||
" ——来自 全球标准法规管理系统";
|
" ——来自 全球标准法规管理系统";
|
||||||
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
|
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
|
||||||
mailUtil.sendMsgFeign(array, title, msg);
|
mailUtil.sendMsgFeign(array, title, msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
log.info("=================================自动催办定时任务结束=====================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,20 +181,24 @@ public class ProcessTimer {
|
|||||||
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
|
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
|
||||||
// @Scheduled(cron = "*/20 * * * * ? ")//每天十点执行
|
// @Scheduled(cron = "*/20 * * * * ? ")//每天十点执行
|
||||||
public void everyDayTenOlockScan() {
|
public void everyDayTenOlockScan() {
|
||||||
List<BusProcessNew> busProcessNews=new ArrayList<>();
|
if(isNotScheduled){
|
||||||
busProcessNews=workFlowFeignClient.everyDayTenOlock();
|
log.info("=================================政策课题组会后流程定时任务启动=====================================");
|
||||||
if (!busProcessNews.isEmpty()){
|
List<BusProcessNew> busProcessNews=new ArrayList<>();
|
||||||
for (BusProcessNew bus:busProcessNews) {
|
busProcessNews=workFlowFeignClient.everyDayTenOlock();
|
||||||
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
|
if (!busProcessNews.isEmpty()){
|
||||||
jsonObject.put("auto","1");
|
for (BusProcessNew bus:busProcessNews) {
|
||||||
ResponseMessage responseMessage = workFlowController.startProcessNew("19",jsonObject.getString("revisionId"),null);
|
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
|
||||||
BusMes busMes=new BusMes();
|
jsonObject.put("auto","1");
|
||||||
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
|
ResponseMessage responseMessage = workFlowController.startProcessNew("19",jsonObject.getString("revisionId"),null);
|
||||||
busMes.setJson(jsonObject.toJSONString());
|
BusMes busMes=new BusMes();
|
||||||
busMes.setUserId(jsonObject.getString("revisionId"));
|
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
|
||||||
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
|
busMes.setJson(jsonObject.toJSONString());
|
||||||
log.info("政策课题组会后流程已发起");
|
busMes.setUserId(jsonObject.getString("revisionId"));
|
||||||
|
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
|
||||||
|
log.info("政策课题组会后流程已发起");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
log.info("=================================政策课题组会后流程定时任务启动=====================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,36 +206,33 @@ public class ProcessTimer {
|
|||||||
// @Scheduled(cron = "0 0 0/1 * * ? ")//每天十点执行
|
// @Scheduled(cron = "0 0 0/1 * * ? ")//每天十点执行
|
||||||
// @Scheduled(cron = "*/40 * * * * ? ")//20s
|
// @Scheduled(cron = "*/40 * * * * ? ")//20s
|
||||||
public void everyDayTenOlockScanSAM() {
|
public void everyDayTenOlockScanSAM() {
|
||||||
List<BusProcessNew> busProcessNews=new ArrayList<>();
|
if(isNotScheduled){
|
||||||
busProcessNews=workFlowFeignClient.everyDayTenOlockSAM();
|
log.info("=================================标准化活动参会流程定时任务启动=====================================");
|
||||||
if (!busProcessNews.isEmpty()){
|
List<BusProcessNew> busProcessNews=new ArrayList<>();
|
||||||
for (BusProcessNew bus:busProcessNews) {
|
busProcessNews=workFlowFeignClient.everyDayTenOlockSAM();
|
||||||
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
|
if (!busProcessNews.isEmpty()){
|
||||||
String taskInfo = bus.getTaskInfo();
|
for (BusProcessNew bus:busProcessNews) {
|
||||||
String result = jsonObject.getJSONObject("roleList").getString("dockUser");
|
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
|
||||||
result = result.split(",")[0];
|
String taskInfo = bus.getTaskInfo();
|
||||||
jsonObject.put("member",result);
|
String result = jsonObject.getJSONObject("roleList").getString("dockUser");
|
||||||
if(taskInfo.equals("标准化活动参会流程-流程结束")){
|
result = result.split(",")[0];
|
||||||
jsonObject.put("auto","1");
|
jsonObject.put("member",result);
|
||||||
ResponseMessage responseMessage = workFlowController.startProcessNew("22",result,null);
|
if(taskInfo.equals("标准化活动参会流程-流程结束")){
|
||||||
BusMes busMes=new BusMes();
|
jsonObject.put("auto","1");
|
||||||
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
|
ResponseMessage responseMessage = workFlowController.startProcessNew("22",result,null);
|
||||||
busMes.setJson(jsonObject.toJSONString());
|
BusMes busMes=new BusMes();
|
||||||
busMes.setUserId(result);
|
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
|
||||||
|
busMes.setJson(jsonObject.toJSONString());
|
||||||
|
busMes.setUserId(result);
|
||||||
|
|
||||||
|
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
|
||||||
|
System.out.println("标准化活动会后流程自动发起");
|
||||||
|
}
|
||||||
|
|
||||||
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
|
|
||||||
System.out.println("标准化活动会后流程自动发起");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
log.info("=================================标准化活动参会流程定时任务启动=====================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[]args){
|
|
||||||
ProcessTimer processTimer = new ProcessTimer();
|
|
||||||
processTimer.everyDayTenOlockScan();
|
|
||||||
processTimer.everyDayTenOlockScanSAM();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.adc.da.sys.service.IUserEOService;
|
|||||||
import com.adc.da.util.Encodes;
|
import com.adc.da.util.Encodes;
|
||||||
import com.adc.da.util.PasswordUtils;
|
import com.adc.da.util.PasswordUtils;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -127,7 +128,9 @@ public class LoginRestController {
|
|||||||
@PostMapping(value = "/getTokenToWeLink")
|
@PostMapping(value = "/getTokenToWeLink")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseMessage getIftappCodeByWelinkCode(HttpServletRequest request, WeLinkVO linkVO) throws UnsupportedEncodingException {
|
public ResponseMessage getIftappCodeByWelinkCode(HttpServletRequest request, WeLinkVO linkVO) throws UnsupportedEncodingException {
|
||||||
|
log.info(JSONObject.toJSONString(linkVO));
|
||||||
String account = weLinkUtil.getIftappCodeByWelinkCode(linkVO);
|
String account = weLinkUtil.getIftappCodeByWelinkCode(linkVO);
|
||||||
|
log.info("userAccount:" +account);
|
||||||
if(StringUtils.isBlank(account)){
|
if(StringUtils.isBlank(account)){
|
||||||
return Result.error("r0011", "用户不存在");
|
return Result.error("r0011", "用户不存在");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,11 +18,15 @@ public class WeLinkUtil {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OkHttpUtil okHttpUtil;
|
private OkHttpUtil okHttpUtil;
|
||||||
|
|
||||||
private final String access_url = "https://iftappwelink.foton.com.cn/devserver/welink/";
|
|
||||||
|
// 测试环境地址
|
||||||
|
private final String access_url = "https://iftappdev.foton.com.cn/devservertest/welink/";
|
||||||
|
//正式环境地址
|
||||||
|
// private final String access_url = "https://iftappwelink.foton.com.cn/devserver/welink/";
|
||||||
|
|
||||||
public String getIftappCodeByWelinkCode(WeLinkVO linkVO){
|
public String getIftappCodeByWelinkCode(WeLinkVO linkVO){
|
||||||
try{
|
try{
|
||||||
String access_token = "";
|
String authCode = "";
|
||||||
Map<String,String> param = new HashMap<>();
|
Map<String,String> param = new HashMap<>();
|
||||||
param.put("code",linkVO.getCode());
|
param.put("code",linkVO.getCode());
|
||||||
param.put("name",linkVO.getName().replace("-"," "));
|
param.put("name",linkVO.getName().replace("-"," "));
|
||||||
@@ -32,28 +36,30 @@ public class WeLinkUtil {
|
|||||||
if(StringUtils.isNotBlank(linkVO.getCorpCode())){
|
if(StringUtils.isNotBlank(linkVO.getCorpCode())){
|
||||||
param.put("corpCode",linkVO.getCorpCode());
|
param.put("corpCode",linkVO.getCorpCode());
|
||||||
}
|
}
|
||||||
|
log.debug("第一个接口请求地址:"+access_url+"getIftappCodeByWelinkCode");
|
||||||
|
log.debug("请求参数为:"+ JSONObject.fromObject(param).toString());
|
||||||
String access_token_str = okHttpUtil.post(access_url+"getIftappCodeByWelinkCode",param,new HashMap<>());
|
String access_token_str = okHttpUtil.post(access_url+"getIftappCodeByWelinkCode",param,new HashMap<>());
|
||||||
JSONObject atJsonObj = JSONObject.fromObject(access_token_str);
|
JSONObject atJsonObj = JSONObject.fromObject(access_token_str);
|
||||||
System.out.println("AccessTokenJSON:" + atJsonObj);
|
log.info("AccessTokenJSON: "+access_token_str);
|
||||||
if (atJsonObj.has("data")) {
|
if (atJsonObj.has("data")) {
|
||||||
System.out.println("data:" + atJsonObj.get("data"));
|
|
||||||
JSONObject obj = JSONObject.fromObject(atJsonObj.getOrDefault("data",""));
|
JSONObject obj = JSONObject.fromObject(atJsonObj.getOrDefault("data",""));
|
||||||
|
|
||||||
if(obj.has("access_token")){
|
if(obj.has("authCode")){
|
||||||
access_token = obj.getOrDefault("access_token","").toString();
|
authCode = obj.getOrDefault("authCode","").toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(access_token)){
|
if(StringUtils.isBlank(authCode)){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
Map<String,String> param_p = new HashMap<>();
|
Map<String,String> param_p = new HashMap<>();
|
||||||
param_p.put("code",access_token);
|
param_p.put("code",authCode);
|
||||||
|
log.debug("第二个接口请求地址:"+access_url+"getUserInfoByAuthCode");
|
||||||
|
log.debug("请求参数为:"+JSONObject.fromObject(param_p).toString());
|
||||||
String principal_json = okHttpUtil.get(access_url+"getUserInfoByAuthCode",param_p,new HashMap<>());
|
String principal_json = okHttpUtil.get(access_url+"getUserInfoByAuthCode",param_p,new HashMap<>());
|
||||||
JSONObject pfjsonObj = JSONObject.fromObject(principal_json);
|
JSONObject pfjsonObj = JSONObject.fromObject(principal_json);
|
||||||
|
log.info("getUserInfoByAuthCode "+principal_json);
|
||||||
if (pfjsonObj.has("data")) {
|
if (pfjsonObj.has("data")) {
|
||||||
System.out.println("data:" + pfjsonObj.get("data"));
|
|
||||||
JSONObject obj = JSONObject.fromObject(pfjsonObj.getOrDefault("data",""));
|
JSONObject obj = JSONObject.fromObject(pfjsonObj.getOrDefault("data",""));
|
||||||
|
|
||||||
if(obj.has("username")){
|
if(obj.has("username")){
|
||||||
return obj.getOrDefault("username","").toString();
|
return obj.getOrDefault("username","").toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.adc.da.main.config;
|
package com.adc.da.main.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
@@ -19,4 +20,14 @@ public class MybatisPlusConfig {
|
|||||||
return new PaginationInterceptor();
|
return new PaginationInterceptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 增加乐观锁机制
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public OptimisticLockerInterceptor optimisticLockerInterceptor(){
|
||||||
|
return new OptimisticLockerInterceptor();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class ConvertMqEO extends BaseEntity {
|
|||||||
private String mqCode;
|
private String mqCode;
|
||||||
private String id;
|
private String id;
|
||||||
private String addOrUp;
|
private String addOrUp;
|
||||||
|
private String name;
|
||||||
|
|
||||||
//向文件表添加信息
|
//向文件表添加信息
|
||||||
private String lawsId;
|
private String lawsId;
|
||||||
@@ -220,4 +221,12 @@ public class ConvertMqEO extends BaseEntity {
|
|||||||
public void setLawsFileClassify(String lawsFileClassify) {
|
public void setLawsFileClassify(String lawsFileClassify) {
|
||||||
this.lawsFileClassify = lawsFileClassify;
|
this.lawsFileClassify = lawsFileClassify;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.adc.da.slrs.DataSync.service.IDataSyncService;
|
|||||||
import com.sun.org.apache.bcel.internal.generic.NEW;
|
import com.sun.org.apache.bcel.internal.generic.NEW;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
@@ -22,13 +23,22 @@ public class ScheduledSync {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IDataSyncService iDataSyncService;
|
private IDataSyncService iDataSyncService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置文件设置是否开启定时器
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Value("${isNotScheduled}")
|
||||||
|
private boolean isNotScheduled; //是否开启定时器
|
||||||
|
|
||||||
//每天凌晨两点执行
|
//每天凌晨两点执行
|
||||||
@Scheduled(cron="0 0 2 * * ?")
|
@Scheduled(cron="0 0 2 * * ?")
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
public void syncSchedulingTasks() throws Exception {
|
public void syncSchedulingTasks() {
|
||||||
iDataSyncService.orgDataSync(); //时间短
|
if(isNotScheduled){
|
||||||
iDataSyncService.dataSync(); //时间长
|
log.info("======================================开始同步基础数据========================================");
|
||||||
|
iDataSyncService.orgDataSync(); //时间短
|
||||||
|
iDataSyncService.dataSync(); //时间长
|
||||||
|
log.info("======================================结束同步基础数据========================================");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.adc.da.slrs.DataSync.service;
|
|||||||
|
|
||||||
public interface IDataSyncService {
|
public interface IDataSyncService {
|
||||||
|
|
||||||
public String dataSync() throws Exception;
|
public String dataSync();
|
||||||
|
|
||||||
public String orgDataSync() throws Exception;
|
public String orgDataSync();
|
||||||
}
|
}
|
||||||
|
|||||||
+172
-129
@@ -1,5 +1,6 @@
|
|||||||
package com.adc.da.slrs.DataSync.service.impl;
|
package com.adc.da.slrs.DataSync.service.impl;
|
||||||
|
|
||||||
|
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.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;
|
||||||
@@ -8,12 +9,20 @@ import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
|||||||
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;
|
||||||
|
import com.adc.da.sys.constant.ValidFlagEnum;
|
||||||
import com.adc.da.sys.entity.UserOrgEO;
|
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.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import lombok.extern.log4j.Log4j;
|
||||||
|
import org.apache.ibatis.jdbc.Null;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -29,145 +38,179 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ITsInstitutionService tsInstitutionService;
|
ITsInstitutionService tsInstitutionService;
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(DataSyncServiceImpl.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
public String dataSync() throws Exception {
|
public String dataSync(){
|
||||||
SyncUserService syncUserService = new SyncUserService();
|
try{
|
||||||
List<String> res = syncUserService.syncFotonUser();
|
SyncUserService syncUserService = new SyncUserService();
|
||||||
//存放岗位信息
|
List<String> res = syncUserService.syncFotonUser();
|
||||||
Map<String, String> positionMap = new HashMap<>();
|
//存放岗位信息
|
||||||
Map<String, String> useDistinct = new HashMap<>();
|
Map<String, String> positionMap = new HashMap<>();
|
||||||
TsPosition position = new TsPosition();
|
TsPosition position = new TsPosition();
|
||||||
position.setCurrent(1);
|
position.setCurrent(1);
|
||||||
position.setPageSize(100000);
|
position.setPageSize(100000);
|
||||||
IPage<TsPosition> iPage = tsPositionService.getPosition(position);
|
IPage<TsPosition> iPage = tsPositionService.getPosition(position);
|
||||||
List<TsPosition> positions=iPage.getRecords();
|
List<TsPosition> positions=iPage.getRecords();
|
||||||
if (!positions.isEmpty()) {
|
if (!positions.isEmpty()) {
|
||||||
positions.forEach(tsPosition -> {
|
positions.forEach(tsPosition -> {
|
||||||
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
List<TsUser> addUserList = new ArrayList<>();
|
||||||
/**
|
List<TsUser> upUserList = new ArrayList<>();
|
||||||
* 得到数据时,删除系统表中所有用户信息
|
for (String s : res) {
|
||||||
*/
|
JSONObject userData = JSONObject.parseObject(s);
|
||||||
if (res.size()>0){
|
if(userData.containsKey("results")){
|
||||||
tsUserService.deleteUser();
|
JSONArray jsonArray = userData.getJSONArray("results");
|
||||||
}
|
jsonArray.forEach(object -> {
|
||||||
for (String s : res) {
|
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||||
//获取到所有用户数据
|
String userid = jsonObject.getString("userid");
|
||||||
List<TsUser> tsUsers = new ArrayList<>();
|
TsUser userEO = tsUserService.getById(userid);
|
||||||
|
String userState = "";
|
||||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
if(userEO != null){
|
||||||
jsonArray.forEach(object -> {
|
userState = "UPDATE";
|
||||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
}else{
|
||||||
//先获取岗位以及岗位id
|
userState = "ADD";
|
||||||
TsUser tsUser = new TsUser();
|
userEO = new TsUser();
|
||||||
UserOrgEO userOrgEO = new UserOrgEO();
|
}
|
||||||
//设置岗位
|
//先获取岗位以及岗位id
|
||||||
if (null != jsonObject.getString("title")) {
|
//设置岗位
|
||||||
//通过岗位名称查询系统表中是否有岗位,有则设定用户的岗位为系统中的岗位,否则新增
|
if (null != jsonObject.getString("title")) {
|
||||||
if (null == positionMap.get(jsonObject.getString("title"))) {
|
//通过岗位名称查询系统表中是否有岗位,有则设定用户的岗位为系统中的岗位,否则新增
|
||||||
TsPosition tsPosition = new TsPosition();
|
if (null == positionMap.get(jsonObject.getString("title"))) {
|
||||||
tsPosition.setId(String.valueOf(UUID.randomUUID()));
|
TsPosition tsPosition = new TsPosition();
|
||||||
tsPosition.setName(jsonObject.getString("title"));
|
tsPosition.setId(String.valueOf(UUID.randomUUID()));
|
||||||
tsPositionService.addPosition(tsPosition);
|
tsPosition.setName(jsonObject.getString("title"));
|
||||||
//放入岗位的map集合中
|
tsPositionService.addPosition(tsPosition);
|
||||||
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
//放入岗位的map集合中
|
||||||
//放入类中
|
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||||
tsUser.setPositionName(tsPosition.getName());
|
//放入类中
|
||||||
tsUser.setPositionId(tsPosition.getId());
|
userEO.setPositionName(tsPosition.getName());
|
||||||
} else {
|
userEO.setPositionId(tsPosition.getId());
|
||||||
tsUser.setPositionName(jsonObject.getString("title").trim());
|
} else {
|
||||||
tsUser.setPositionId(positionMap.get(jsonObject.getString("title").trim()));
|
userEO.setPositionName(jsonObject.getString("title").trim());
|
||||||
}
|
userEO.setPositionId(positionMap.get(jsonObject.getString("title").trim()));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
userEO.setPositionId(null);
|
||||||
|
userEO.setPositionName(null);
|
||||||
|
}
|
||||||
|
//设置其他数据
|
||||||
|
Timestamp createTime = new Timestamp(new Date().getTime());
|
||||||
|
userEO.setState(jsonObject.getString("userStatus"));
|
||||||
|
userEO.setUname(null!=jsonObject.getString("name")?jsonObject.getString("name"):"");
|
||||||
|
userEO.setCreationTime(createTime);
|
||||||
|
userEO.setUserId(jsonObject.getString("userid"));
|
||||||
|
userEO.setAccount(jsonObject.getString("userid"));
|
||||||
|
userEO.setInstitutionId(null!=jsonObject.getString("orgNumber")?jsonObject.getString("orgNumber"):"" );
|
||||||
|
userEO.setInstitutionName(null!=jsonObject.getString("orgName")?jsonObject.getString("orgName"):"" );
|
||||||
|
//2022-05-23:用户同步增加状态标识,将停用的用户过滤掉
|
||||||
|
if("1".equals(jsonObject.getString("userStatus"))){
|
||||||
|
userEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue()+"");
|
||||||
|
userEO.setDisableFlag(ValidFlagEnum.VALID_TRUE.getValue()+"");
|
||||||
|
}else{
|
||||||
|
userEO.setValidFlag(ValidFlagEnum.VALID_FALSE.getValue()+"");
|
||||||
|
userEO.setDisableFlag(ValidFlagEnum.VALID_FALSE.getValue()+"");
|
||||||
|
}
|
||||||
|
if("ADD".equals(userState)){
|
||||||
|
addUserList.add(userEO);
|
||||||
|
}else {
|
||||||
|
upUserList.add(userEO);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
//设置其他数据
|
}
|
||||||
Timestamp createTime = new Timestamp(new Date().getTime());
|
if(!addUserList.isEmpty()){
|
||||||
tsUser.setState(jsonObject.getString("userStatus"));
|
logger.debug("本次新增的用户为:"+JSONObject.toJSONString(addUserList));
|
||||||
tsUser.setUname(null!=jsonObject.getString("name")?jsonObject.getString("name"):"");
|
tsUserService.saveBatch(addUserList);
|
||||||
tsUser.setValidFlag("0");
|
}
|
||||||
tsUser.setDisableFlag("0");
|
if(!upUserList.isEmpty()){
|
||||||
tsUser.setCreationTime(createTime);
|
logger.debug("本次更新的用户为:"+JSONObject.toJSONString(upUserList));
|
||||||
tsUser.setUserId(jsonObject.getString("userid"));
|
tsUserService.updateBatchById(upUserList);
|
||||||
tsUser.setAccount(jsonObject.getString("userid"));
|
}
|
||||||
tsUser.setInstitutionId(null!=jsonObject.getString("orgNumber")?jsonObject.getString("orgNumber"):"" );
|
}catch(Exception e){
|
||||||
tsUser.setInstitutionName(null!=jsonObject.getString("orgName")?jsonObject.getString("orgName"):"" );
|
logger.error(e.getMessage(),e);
|
||||||
//2022-05-23:用户同步增加状态标识,将停用的用户过滤掉
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
if (null == useDistinct.get(jsonObject.getString("userid")) && "1".equals(jsonObject.getString("userStatus"))) {
|
|
||||||
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";
|
return "1";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
public String orgDataSync() throws Exception {
|
public String orgDataSync(){
|
||||||
SyncUserService syncUserService = new SyncUserService();
|
try{
|
||||||
List<String> res = syncUserService.syncFotonOrg();
|
SyncUserService syncUserService = new SyncUserService();
|
||||||
|
List<String> res = syncUserService.syncFotonOrg();
|
||||||
//获取到所有用户数据
|
//获取到所有用户数据
|
||||||
List<String> strings=new ArrayList<>();
|
List<String> strings=new ArrayList<>();
|
||||||
|
//tsInstitutionService.clearData();
|
||||||
tsInstitutionService.clearData();
|
for (String s : res) {
|
||||||
for (String s : res) {
|
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
jsonArray.forEach(object -> {
|
||||||
jsonArray.forEach(object -> {
|
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
strings.add(jsonObject.getString("parentOrgNumber"));
|
||||||
strings.add(jsonObject.getString("parentOrgNumber"));
|
});
|
||||||
});
|
}
|
||||||
}
|
List<TsInstitution> allTsInstitutionList = tsInstitutionService.list();
|
||||||
for (String s : res) {
|
List<TsInstitution> addTsInstitutionList = new ArrayList<>();
|
||||||
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
List<TsInstitution> updateTsInstitutionList = new ArrayList<>();
|
||||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
List<TsInstitution> delTsInstitutionList = new ArrayList<>();
|
||||||
jsonArray.forEach(object -> {
|
Set<String> syncAllIdList = new HashSet<>();
|
||||||
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
for (String s : res) {
|
||||||
TsInstitution tsInstitution=new TsInstitution();
|
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||||
tsInstitution.setId(jsonObject.getString("orgNumber"));
|
if(jsonArray!=null){
|
||||||
tsInstitution.setName(jsonObject.getString("orgName"));
|
jsonArray.forEach(object -> {
|
||||||
tsInstitution.setHasChild(strings.contains(jsonObject.getString("orgNumber"))?"1":"0");
|
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||||
tsInstitution.setParentId(jsonObject.getString("parentOrgNumber"));
|
TsInstitution tsInstitution=new TsInstitution();
|
||||||
//部门为"null"的数据不保存
|
tsInstitution.setId(jsonObject.getString("orgNumber"));
|
||||||
if (!"null".equals(jsonObject.getString("orgName"))){
|
tsInstitution.setName(jsonObject.getString("orgName"));
|
||||||
tsInstitutions.add(tsInstitution);
|
tsInstitution.setHasChild(strings.contains(jsonObject.getString("orgNumber"))?"1":"0");
|
||||||
|
tsInstitution.setParentId(jsonObject.getString("parentOrgNumber"));
|
||||||
|
//部门为"null"的数据不保存
|
||||||
|
if (!"null".equals(jsonObject.getString("orgName"))){
|
||||||
|
TsInstitution institution = tsInstitutionService.getById(tsInstitution.getId());
|
||||||
|
if(institution!=null){
|
||||||
|
updateTsInstitutionList.add(tsInstitution);
|
||||||
|
}else{
|
||||||
|
addTsInstitutionList.add(tsInstitution);
|
||||||
|
}
|
||||||
|
syncAllIdList.add(tsInstitution.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
tsInstitutionService.saveBatch(tsInstitutions);
|
//遍历出来需要删除的数据
|
||||||
|
for(TsInstitution data :allTsInstitutionList){
|
||||||
|
if(!syncAllIdList.contains(data.getId())){
|
||||||
|
delTsInstitutionList.add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//需要新增的数据
|
||||||
|
if(!addTsInstitutionList.isEmpty()){
|
||||||
|
logger.debug("本次新增的组织机构为:"+JSONObject.toJSONString(addTsInstitutionList));
|
||||||
|
tsInstitutionService.saveBatch(addTsInstitutionList);
|
||||||
|
}
|
||||||
|
//需要更新的数据
|
||||||
|
if(!updateTsInstitutionList.isEmpty()){
|
||||||
|
logger.debug("本次更新的组织机构为:"+JSONObject.toJSONString(updateTsInstitutionList));
|
||||||
|
tsInstitutionService.updateBatchById(updateTsInstitutionList);
|
||||||
|
}
|
||||||
|
//需要删除的数据
|
||||||
|
if(!delTsInstitutionList.isEmpty()){
|
||||||
|
logger.debug("本次删除的组织机构为:"+JSONObject.toJSONString(delTsInstitutionList));
|
||||||
|
List<String> delIdList = new ArrayList<>();
|
||||||
|
for(TsInstitution data : delTsInstitutionList){
|
||||||
|
delIdList.add(data.getId());
|
||||||
|
}
|
||||||
|
tsInstitutionService.removeByIds(delIdList);
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(e.getMessage(),e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
}
|
}
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
|
|||||||
+225
@@ -0,0 +1,225 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.controller;
|
||||||
|
|
||||||
|
import com.adc.da.base.web.BaseController;
|
||||||
|
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||||
|
import com.adc.da.slrs.StandardQA.dao.AskQuestionsDao;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
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.entity.Subscription;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.AskQuestionsServiceImpl;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
||||||
|
import com.adc.da.util.UUIDUtils;
|
||||||
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
|
import com.adc.da.util.http.Result;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
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;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 9:18
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/${restPath}/lawss/AskQuestions")
|
||||||
|
@Api(description = "|AskQuestions|")
|
||||||
|
public class AskQuestionsController extends BaseController<AskQuestions> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AskQuestionsServiceImpl askQuestionsService;
|
||||||
|
@Autowired
|
||||||
|
private AskQuestionsDao askQuestionsDao;
|
||||||
|
@Autowired
|
||||||
|
private AskUserServiceImpl askUserService;
|
||||||
|
|
||||||
|
@GetMapping("/getAskQuestionsPage")
|
||||||
|
public ResponseMessage<IPage<AskQuestions>> getAskQuestionsPage(AskQuestionsPage askQuestions){
|
||||||
|
IPage<AskQuestions> iPage = new Page<>();
|
||||||
|
iPage.setSize(askQuestions.getPageSize());
|
||||||
|
iPage.setPages(askQuestions.getPage());
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.orderByDesc("QUESTION_TIME");
|
||||||
|
IPage<AskQuestions> page = askQuestionsService.page(iPage,queryWrapper);
|
||||||
|
return Result.success(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询问题列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAskQuestions")
|
||||||
|
public ResponseMessage getAskQuestions(){
|
||||||
|
QueryWrapper<AskQuestions> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.orderByDesc("QUESTION_TIME");
|
||||||
|
List<AskQuestions> askQuestionsList=askQuestionsService.list(queryWrapper);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看我的问题详情
|
||||||
|
* @param askQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAskQuestionsDetails")
|
||||||
|
public ResponseMessage getAskQuestionsDetails(AskQuestions askQuestions){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getAskQuestions(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看我回答的问题
|
||||||
|
* @param askQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getReplyDetails")
|
||||||
|
public ResponseMessage getReplyDetails(AskQuestions askQuestions){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getReplyDetails(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据标准查询问题
|
||||||
|
* @param askQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getReplyDetailsByStandId")
|
||||||
|
public ResponseMessage getReplyDetailsByStandId(AskQuestions askQuestions){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getReplyDetailsByStandId(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据标准编号查询我的回答
|
||||||
|
* @param standardId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAskQuestionsByStandardId")
|
||||||
|
public ResponseMessage getAskQuestionsByStandardId(String standardId){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getAskQuestionsByStandardId(standardId);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据问题ID查询回答***
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAskQuestionsByakId")
|
||||||
|
public ResponseMessage getAskQuestionsByakId(String id){
|
||||||
|
List<Reply> askQuestionsList = askQuestionsService.getAskQuestionsByakId(id);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加问题
|
||||||
|
* @param askQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/insertAskQuestions")
|
||||||
|
public ResponseMessage insertAskQuestions(@RequestBody AskQuestions askQuestions){
|
||||||
|
askQuestions.setId(UUIDUtils.randomUUID20());
|
||||||
|
askQuestions.setAppendixId(askQuestions.getFileList().get(0).getAttId());
|
||||||
|
askQuestions.setAppendixName(askQuestions.getFileList().get(0).getName());
|
||||||
|
askQuestions.setQuestionTime(new Date());
|
||||||
|
List<String> uId = askQuestionsDao.getUId();
|
||||||
|
List<AskUser> askUserList = new ArrayList<>();
|
||||||
|
for (String id:uId) {
|
||||||
|
AskUser askUser = new AskUser();
|
||||||
|
askUser.setAsdId(askQuestions.getId());
|
||||||
|
askUser.setUsid(id);
|
||||||
|
askUserList.add(askUser);
|
||||||
|
}
|
||||||
|
//添加问题分配人员
|
||||||
|
askUserService.saveBatch(askUserList);
|
||||||
|
if(askQuestionsService.save(askQuestions)){
|
||||||
|
return Result.success("200","添加成功");
|
||||||
|
}else {
|
||||||
|
return Result.error("-1","添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订阅问题
|
||||||
|
* @param askQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAskQuestionsBySubscription")
|
||||||
|
public ResponseMessage getAskQuestionsBySubscription(AskQuestions askQuestions){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getAskQuestionsBySubscription(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据标准id查询订阅
|
||||||
|
* @param askQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getSubscriptionByStandId")
|
||||||
|
public ResponseMessage getSubscriptionByStandId(AskQuestions askQuestions){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getSubscriptionByStandId(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似查询
|
||||||
|
* @param problemDescription
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/resemblance")
|
||||||
|
public ResponseMessage resemblance(String problemDescription){
|
||||||
|
List<String> askQuestions = Arrays.asList(problemDescription.split(""));
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.resemblance(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类查询问题
|
||||||
|
* @param classification
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAskQuestionsReply")
|
||||||
|
public ResponseMessage getAskQuestionsReply(String classification){
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.select("DISTINCT STANDARD_ID");
|
||||||
|
queryWrapper.select("STANDARD_NAME");
|
||||||
|
queryWrapper.select("STANDARD_ENCDOING");
|
||||||
|
queryWrapper.eq("CLASSIFICATION",classification);
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.list(queryWrapper);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问答库的根据标准ID查询问题
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getSubscription")
|
||||||
|
public ResponseMessage getArchiveAskQuestions(String id){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.getArchiveAskQuestions(id);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/retrieve")
|
||||||
|
public ResponseMessage retrieve(AskQuestions askQuestions){
|
||||||
|
List<AskQuestions> askQuestionsList = askQuestionsService.retrieve(askQuestions);
|
||||||
|
return Result.success(askQuestionsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.controller;
|
||||||
|
|
||||||
|
import com.adc.da.base.web.BaseController;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.AskQuestionsServiceImpl;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
||||||
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
|
import com.adc.da.util.http.Result;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/2 0002 8:44
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/${restPath}/lawss/AskUser")
|
||||||
|
@Api(description = "|AskUser|")
|
||||||
|
public class AskUserController extends BaseController<AskUser> {
|
||||||
|
@Autowired
|
||||||
|
private AskUserServiceImpl askUserService;
|
||||||
|
@PostMapping("/insertAskUser")
|
||||||
|
public ResponseMessage insertAskUser(@RequestBody AskUser askUser){
|
||||||
|
if(askUserService.save(askUser)){
|
||||||
|
return Result.success("200","邀请成功");
|
||||||
|
}else {
|
||||||
|
return Result.error("-1","添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.controller;
|
||||||
|
|
||||||
|
import com.adc.da.base.web.BaseController;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.ReplyServiceImpl;
|
||||||
|
import com.adc.da.util.UUIDUtils;
|
||||||
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
|
import com.adc.da.util.http.Result;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 10:55
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/${restPath}/lawss/Reply")
|
||||||
|
@Api(description = "| Reply|")
|
||||||
|
public class ReplyController extends BaseController<Reply> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReplyServiceImpl replyService;
|
||||||
|
|
||||||
|
@PostMapping("/insertReply")
|
||||||
|
public ResponseMessage insertReply(@RequestBody Reply reply){
|
||||||
|
if(StringUtils.isEmpty(reply.getReply())){
|
||||||
|
return Result.error("-1","请输入回答内容");
|
||||||
|
}
|
||||||
|
if(reply.getFileList().size() >0) {
|
||||||
|
reply.setAppendixId(reply.getFileList().get(0).getAttId());
|
||||||
|
reply.setAppendixName(reply.getFileList().get(0).getName());
|
||||||
|
}
|
||||||
|
reply.setReplyTime(new Date());
|
||||||
|
reply.setId(UUIDUtils.randomUUID20());
|
||||||
|
if(replyService.save(reply)){
|
||||||
|
return Result.success("200","提交成功");
|
||||||
|
}else {
|
||||||
|
return Result.error("-1","添加失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@PostMapping("/updateReply")
|
||||||
|
public ResponseMessage updateReply(String id){
|
||||||
|
if(StringUtils.isEmpty(id)){
|
||||||
|
return Result.error("-1","请选择要归档的回答");
|
||||||
|
}
|
||||||
|
List<String> list = Arrays.asList(id.split(","));
|
||||||
|
for (String s: list) {
|
||||||
|
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||||
|
updateWrapper.set("STATE","yes");
|
||||||
|
updateWrapper.eq("ID",s);
|
||||||
|
replyService.update(updateWrapper);
|
||||||
|
}
|
||||||
|
return Result.success("200","归档成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.base.web.BaseController;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.Impl.SubscriptionServiceImpl;
|
||||||
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
|
import com.adc.da.util.http.Result;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/7 0007 11:18
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/${restPath}/lawss/Subscription")
|
||||||
|
@Api(description = "|Subscription|")
|
||||||
|
public class SubscriptionController extends BaseController<Subscription> {
|
||||||
|
@Autowired
|
||||||
|
private SubscriptionServiceImpl subscriptionService;
|
||||||
|
|
||||||
|
@PostMapping("/insertSubscription")
|
||||||
|
public ResponseMessage updateReply(@RequestBody Subscription subscription){
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("ASK_ID",subscription.getAskId());
|
||||||
|
queryWrapper.eq("USID",subscription.getUsId());
|
||||||
|
int number = subscriptionService.count(queryWrapper);
|
||||||
|
if(number>0){
|
||||||
|
return Result.success("200","此问题已订阅");
|
||||||
|
}
|
||||||
|
if(subscriptionService.save(subscription)){
|
||||||
|
return Result.success("200","订阅成功");
|
||||||
|
}else {
|
||||||
|
return Result.success("-1","订阅失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.dao;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 9:26
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface AskQuestionsDao extends BaseMapper<AskQuestions> {
|
||||||
|
|
||||||
|
List<AskQuestions> getAskQuestions (@Param("askQuestions") AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getReplyDetails (@Param("askQuestions") AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getReplyDetailsByStandId (@Param("askQuestions") AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getAskQuestionsBySubscription (@Param("askQuestions") AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> retrieve (@Param("askQuestions") AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getSubscriptionByStandId (@Param("askQuestions") AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> resemblance (@Param("chars") List<String> askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getAskQuestionsByStandardId (String standardId);
|
||||||
|
|
||||||
|
List<AskQuestions> getArchiveAskQuestions (String id);
|
||||||
|
|
||||||
|
List<Reply> getAskQuestionsByakId (String id);
|
||||||
|
|
||||||
|
List<String> getUId();
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.dao;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/2 0002 8:47
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface AskUserDao extends BaseMapper<AskUser> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.dao;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 11:02
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ReplyDao extends BaseMapper<Reply> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.dao;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/7 0007 11:19
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface SubscriptionDao extends BaseMapper<Subscription> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.entity;
|
||||||
|
|
||||||
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.adc.da.common.ConvertMqEO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 9:19
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="AskQuestions对象", description="")
|
||||||
|
public class AskQuestions extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@TableField("CLASSIFICATION")
|
||||||
|
@ApiModelProperty(value = "分类")
|
||||||
|
private String classification;
|
||||||
|
|
||||||
|
@TableField("PROBLEM_DESCRIPTION")
|
||||||
|
@ApiModelProperty(value = "问题描述")
|
||||||
|
private String problemDescription;
|
||||||
|
|
||||||
|
@TableField("QUESTIONER")
|
||||||
|
@ApiModelProperty(value = "提问人")
|
||||||
|
private String questioner;
|
||||||
|
|
||||||
|
@TableField("QUESTION_TIME")
|
||||||
|
@ApiModelProperty(value = "提问时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date questionTime;
|
||||||
|
|
||||||
|
@TableField("STANDARD_ENCDOING")
|
||||||
|
@ApiModelProperty(value = "标准编号")
|
||||||
|
private String standardEncdoing;
|
||||||
|
|
||||||
|
@TableField("STANDARD_NAME")
|
||||||
|
@ApiModelProperty(value = "标准名称")
|
||||||
|
private String standardName;
|
||||||
|
|
||||||
|
@TableField("STANDARD_ID")
|
||||||
|
@ApiModelProperty(value = "标准ID")
|
||||||
|
private String standardId;
|
||||||
|
|
||||||
|
@TableField("APPENDIX_ID")
|
||||||
|
@ApiModelProperty(value = "标准ID")
|
||||||
|
private String appendixId;
|
||||||
|
|
||||||
|
@TableField("APPENDIX_NAME")
|
||||||
|
@ApiModelProperty(value = "标准ID")
|
||||||
|
private String appendixName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回答人
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String answerer;
|
||||||
|
/**
|
||||||
|
* 回答
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String reply;
|
||||||
|
/**
|
||||||
|
* 回答时间
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date replyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*附件路径
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String appendix;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ConvertMqEO> fileList;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String subscription;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/10 0010 14:48
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AskQuestionsPage {
|
||||||
|
|
||||||
|
private Long page;
|
||||||
|
private Long pageSize;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.entity;
|
||||||
|
|
||||||
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/2 0002 8:44
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="AskUser对象", description="")
|
||||||
|
public class AskUser extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
@TableField("ASK_ID")
|
||||||
|
@ApiModelProperty(value = "问题ID")
|
||||||
|
private String asdId;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField("USID")
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private String usid;
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.entity;
|
||||||
|
|
||||||
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.adc.da.common.ConvertMqEO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 9:20
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="Reply对象", description="")
|
||||||
|
public class Reply extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@TableField("REPLY")
|
||||||
|
@ApiModelProperty(value = "回答")
|
||||||
|
private String reply;
|
||||||
|
|
||||||
|
@TableField("STATE")
|
||||||
|
@ApiModelProperty(value = "状态(0:显示,1:不显示)")
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
@TableField("REPLY_TIME")
|
||||||
|
@ApiModelProperty(value = "回答时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date replyTime;
|
||||||
|
|
||||||
|
@TableField("APPENDIX")
|
||||||
|
@ApiModelProperty(value = "附件")
|
||||||
|
private String appendix;
|
||||||
|
|
||||||
|
@TableField("ANSWERER")
|
||||||
|
@ApiModelProperty(value = "回答人")
|
||||||
|
private String answerer;
|
||||||
|
|
||||||
|
@TableField("ASK_ID")
|
||||||
|
@ApiModelProperty(value = "问题ID")
|
||||||
|
private String askId;
|
||||||
|
|
||||||
|
@TableField("APPENDIX_ID")
|
||||||
|
@ApiModelProperty(value = "附件ID")
|
||||||
|
private String appendixId;
|
||||||
|
|
||||||
|
@TableField("APPENDIX_NAME")
|
||||||
|
@ApiModelProperty(value = "附件名称")
|
||||||
|
private String appendixName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ConvertMqEO> fileList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.entity;
|
||||||
|
|
||||||
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/7 0007 11:16
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="Subscription对象", description="")
|
||||||
|
public class Subscription extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
@TableField("ASK_ID")
|
||||||
|
@ApiModelProperty(value = "问题ID")
|
||||||
|
private String askId;
|
||||||
|
|
||||||
|
@TableField("USID")
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private String usId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 9:22
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface AskQuestionsService extends IService<AskQuestions> {
|
||||||
|
|
||||||
|
List<AskQuestions> getAskQuestions(AskQuestions askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getReplyDetails(AskQuestions askQuestions);
|
||||||
|
List<AskQuestions> getReplyDetailsByStandId(AskQuestions askQuestions);
|
||||||
|
List<AskQuestions> getAskQuestionsBySubscription(AskQuestions askQuestions);
|
||||||
|
List<AskQuestions> retrieve(AskQuestions askQuestions);
|
||||||
|
List<AskQuestions> getSubscriptionByStandId(AskQuestions askQuestions);
|
||||||
|
List<AskQuestions> resemblance(List<String> askQuestions);
|
||||||
|
|
||||||
|
List<AskQuestions> getAskQuestionsByStandardId(String standardId);
|
||||||
|
List<AskQuestions> getArchiveAskQuestions(String id);
|
||||||
|
List<Reply> getAskQuestionsByakId(String id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/2 0002 8:47
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface AskUserService extends IService<AskUser> {
|
||||||
|
}
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.dao.AskQuestionsDao;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.AskQuestionsService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 9:23
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||||
|
public class AskQuestionsServiceImpl extends ServiceImpl<AskQuestionsDao, AskQuestions> implements AskQuestionsService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AskQuestionsDao askQuestionsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getAskQuestions(AskQuestions askQuestions) {
|
||||||
|
return askQuestionsDao.getAskQuestions(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getReplyDetails(AskQuestions askQuestions) {
|
||||||
|
return askQuestionsDao.getReplyDetails(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getReplyDetailsByStandId(AskQuestions askQuestions) {
|
||||||
|
return askQuestionsDao.getReplyDetailsByStandId(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getAskQuestionsBySubscription(AskQuestions askQuestions) {
|
||||||
|
return askQuestionsDao.getAskQuestionsBySubscription(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> retrieve(AskQuestions askQuestions) {
|
||||||
|
return askQuestionsDao.retrieve(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getSubscriptionByStandId(AskQuestions askQuestions) {
|
||||||
|
return askQuestionsDao.getSubscriptionByStandId(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> resemblance(List<String> askQuestions) {
|
||||||
|
return askQuestionsDao.resemblance(askQuestions);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getAskQuestionsByStandardId(String standardId) {
|
||||||
|
return askQuestionsDao.getAskQuestionsByStandardId(standardId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AskQuestions> getArchiveAskQuestions(String id) {
|
||||||
|
return askQuestionsDao.getArchiveAskQuestions(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Reply> getAskQuestionsByakId(String id) {
|
||||||
|
return askQuestionsDao.getAskQuestionsByakId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.dao.AskUserDao;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.AskUserService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/2 0002 8:47
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||||
|
public class AskUserServiceImpl extends ServiceImpl<AskUserDao, AskUser> implements AskUserService {
|
||||||
|
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.dao.ReplyDao;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.ReplyService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 11:03
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||||
|
public class ReplyServiceImpl extends ServiceImpl<ReplyDao, Reply> implements ReplyService {
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.dao.SubscriptionDao;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||||
|
import com.adc.da.slrs.StandardQA.service.SubscriptionService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/7 0007 11:20
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||||
|
public class SubscriptionServiceImpl extends ServiceImpl<SubscriptionDao, Subscription> implements SubscriptionService {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/5/31 0031 11:02
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface ReplyService extends IService<Reply> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.adc.da.slrs.StandardQA.service;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||||
|
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: qk
|
||||||
|
* @Date: 2022/6/7 0007 11:20
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface SubscriptionService extends IService<Subscription> {
|
||||||
|
}
|
||||||
+1
-1
@@ -47,7 +47,7 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
|
|||||||
if(sarMenuStandardNew.getDicId()!=null){
|
if(sarMenuStandardNew.getDicId()!=null){
|
||||||
queryWrapper.eq("DIC_ID", sarMenuStandardNew.getDicId());
|
queryWrapper.eq("DIC_ID", sarMenuStandardNew.getDicId());
|
||||||
}
|
}
|
||||||
queryWrapper.in(null!=access,"ID",access);
|
queryWrapper.in(null!=access && !access.isEmpty(),"ID",access);
|
||||||
queryWrapper.isNull("PARENT_ID");
|
queryWrapper.isNull("PARENT_ID");
|
||||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||||
TsResources=dao.selectList(queryWrapper);
|
TsResources=dao.selectList(queryWrapper);
|
||||||
|
|||||||
+11
-1
@@ -268,7 +268,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
|||||||
}
|
}
|
||||||
queryWrapper.isNull("PARENT_ID");
|
queryWrapper.isNull("PARENT_ID");
|
||||||
queryWrapper.eq("VALID_FLAG","0");
|
queryWrapper.eq("VALID_FLAG","0");
|
||||||
queryWrapper.in(null!=access,"ID",access);
|
queryWrapper.in(null!=access && !access.isEmpty(),"ID",access);
|
||||||
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
queryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||||
TsResources=dao.selectList(queryWrapper);
|
TsResources=dao.selectList(queryWrapper);
|
||||||
|
|
||||||
@@ -322,6 +322,16 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TsResource.setValidFlag(0);
|
TsResource.setValidFlag(0);
|
||||||
|
String pIds =TsResource.getParentIds();
|
||||||
|
if(StringUtils.isNotBlank(pIds)){
|
||||||
|
if(!pIds.startsWith(",")){
|
||||||
|
pIds = ","+pIds;
|
||||||
|
}
|
||||||
|
if(!pIds.endsWith(",")){
|
||||||
|
pIds = pIds+",";
|
||||||
|
}
|
||||||
|
TsResource.setParentIds(pIds);
|
||||||
|
}
|
||||||
dao.insert(TsResource);
|
dao.insert(TsResource);
|
||||||
// 把新生成的子目录加入用户的权限的下----插入ts_role_resource表
|
// 把新生成的子目录加入用户的权限的下----插入ts_role_resource表
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
|||||||
@@ -0,0 +1,222 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.adc.da.slrs.StandardQA.dao.AskQuestionsDao">
|
||||||
|
|
||||||
|
<select id="getAskQuestions" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT
|
||||||
|
DISTINCT
|
||||||
|
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,
|
||||||
|
aq.STANDARD_NAME
|
||||||
|
FROM ask_questions aq
|
||||||
|
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||||
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
|
<where>
|
||||||
|
<if test="askQuestions.questioner != null and askQuestions.questioner != ''">
|
||||||
|
AND aq.QUESTIONER =#{askQuestions.questioner}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.id != null and askQuestions.id != ''">
|
||||||
|
AND aq.ID = #{askQuestions.id}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||||
|
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.classification != null and askQuestions.classification != ''">
|
||||||
|
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardEncdoing != null and askQuestions.standardEncdoing != ''">
|
||||||
|
AND aq.STANDARD_ENCDOING LIKE concat(concat('%',#{askQuestions.standardEncdoing}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardName != null and askQuestions.standardName !=''">
|
||||||
|
AND aq.STANDARD_NAME LIKE concat(concat('%',#{askQuestions.standardName}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.problemDescription != null and askQuestions.problemDescription != ''">
|
||||||
|
AND aq.PROBLEM_DESCRIPTION LIKE concat(concat('%',#{askQuestions.problemDescription}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||||
|
AND reply.ANSWERER = #{askQuestions.answerer}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAskQuestionsByStandardId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||||
|
aq.STANDARD_NAME,aq.STANDARD_ID
|
||||||
|
FROM ask_questions aq
|
||||||
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
|
<where>
|
||||||
|
<if test="standardId !=null and standardId !=''">
|
||||||
|
AND aq.STANDARD_ID = #{standardId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getArchiveAskQuestions" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||||
|
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||||
|
FROM reply
|
||||||
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
|
<where>
|
||||||
|
reply.STATE = 'yes'
|
||||||
|
<if test="id != nll and id !=''">
|
||||||
|
AND reply.ASK_ID = #{id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAskQuestionsByakId" resultType="com.adc.da.slrs.StandardQA.entity.Reply">
|
||||||
|
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME
|
||||||
|
FROM reply
|
||||||
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
|
<where>
|
||||||
|
<if test="id !=null and id !=''">
|
||||||
|
AND reply.ASK_ID = #{id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by reply.REPLY_TIME
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getReplyDetails" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT
|
||||||
|
DISTINCT
|
||||||
|
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,
|
||||||
|
aq.STANDARD_NAME
|
||||||
|
FROM ask_questions aq
|
||||||
|
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 t2 ON t2.USID = reply.ANSWERER
|
||||||
|
LEFT JOIN ask_user au ON au.ASK_ID = aq.ID
|
||||||
|
<where>
|
||||||
|
<if test="askQuestions.answerer != null and askQuestions.answerer != ''">
|
||||||
|
AND au.USID = #{askQuestions.answerer}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.classification !=null and askQuestions.classification !=''">
|
||||||
|
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getReplyDetailsByStandId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||||
|
aq.STANDARD_NAME,aq.STANDARD_ID,reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||||
|
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||||
|
FROM ask_questions aq
|
||||||
|
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 t2 ON t2.USID = reply.ANSWERER
|
||||||
|
LEFT JOIN ask_user au ON au.ASK_ID = aq.ID
|
||||||
|
<where>
|
||||||
|
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||||
|
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAskQuestionsBySubscription" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT
|
||||||
|
DISTINCT
|
||||||
|
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,aq.STANDARD_NAME
|
||||||
|
FROM ask_questions aq
|
||||||
|
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||||
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
|
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||||
|
<where>
|
||||||
|
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||||
|
AND su.USID = #{askQuestions.answerer}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.classification !=null and askQuestions.classification !=''">
|
||||||
|
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="retrieve" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT
|
||||||
|
DISTINCT
|
||||||
|
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,aq.STANDARD_NAME
|
||||||
|
FROM ask_questions aq
|
||||||
|
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||||
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
|
<if test="askQuestions.type == 'myAns'">
|
||||||
|
LEFT JOIN ask_user au ON au.ASK_ID = aq.ID
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.type == 'mySub'">
|
||||||
|
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||||
|
</if>
|
||||||
|
<where>
|
||||||
|
<if test="askQuestions.questioner != null and askQuestions.questioner != ''">
|
||||||
|
AND aq.QUESTIONER =#{askQuestions.questioner}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.id != null and askQuestions.id != ''">
|
||||||
|
AND aq.ID = #{askQuestions.id}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||||
|
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.classification != null and askQuestions.classification != ''">
|
||||||
|
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardEncdoing != null and askQuestions.standardEncdoing != ''">
|
||||||
|
AND aq.STANDARD_ENCDOING LIKE concat(concat('%',#{askQuestions.standardEncdoing}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardName != null and askQuestions.standardName !=''">
|
||||||
|
AND aq.STANDARD_NAME LIKE concat(concat('%',#{askQuestions.standardName}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.subscription !=null and askQuestions.subscription !=''">
|
||||||
|
AND su.USID = #{askQuestions.subscription}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.answerer != null and askQuestions.answerer != ''">
|
||||||
|
AND au.USID = #{askQuestions.answerer}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.problemDescription != null and askQuestions.problemDescription != ''">
|
||||||
|
AND aq.PROBLEM_DESCRIPTION LIKE concat(concat('%',#{askQuestions.problemDescription}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||||
|
AND reply.ANSWERER = #{askQuestions.answerer}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getSubscriptionByStandId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||||
|
aq.STANDARD_NAME,aq.STANDARD_ID,reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||||
|
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||||
|
FROM ask_questions aq
|
||||||
|
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 t2 ON t2.USID = reply.ANSWERER
|
||||||
|
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||||
|
<where>
|
||||||
|
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||||
|
AND su.USID = #{askQuestions.answerer}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.classification !=null and askQuestions.classification !=''">
|
||||||
|
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||||
|
</if>
|
||||||
|
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||||
|
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="resemblance" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
|
SELECT *,
|
||||||
|
<foreach item="item" collection="chars" separator="+" open="(" close=")" index="">
|
||||||
|
(case when PROBLEM_DESCRIPTION like CONCAT('%',#{item},'%') then 1 else 0 end)
|
||||||
|
</foreach>
|
||||||
|
as num from ask_questions having num >1 order by num DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUId" resultType="java.lang.String">
|
||||||
|
SELECT tu.USID
|
||||||
|
FROM ts_user tu
|
||||||
|
LEFT JOIN ts_institution ti ON ti.id = tu.INSTITUTION_ID
|
||||||
|
WHERE
|
||||||
|
ti.`name`='标准法规部'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -19,10 +19,6 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class SyncUserService {
|
public class SyncUserService {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
SyncUserService syncUserService=new SyncUserService();
|
|
||||||
syncUserService.syncFotonUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步福田IDM数据
|
* 同步福田IDM数据
|
||||||
@@ -46,12 +42,11 @@ public class SyncUserService {
|
|||||||
System.out.println("RequestBody:" + params.toString());
|
System.out.println("RequestBody:" + params.toString());
|
||||||
// 用户测试
|
// 用户测试
|
||||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||||
|
log.debug(rs);
|
||||||
json.add(rs);
|
|
||||||
|
|
||||||
JSONObject responseStr = JSON.parseObject(rs);
|
JSONObject responseStr = JSON.parseObject(rs);
|
||||||
System.out.println(rs);
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
log.info(rs);
|
json.add(rs);
|
||||||
|
}
|
||||||
if (responseStr.containsKey("cookie")) {
|
if (responseStr.containsKey("cookie")) {
|
||||||
try {
|
try {
|
||||||
JSONArray entries = responseStr.getJSONArray("cookie");
|
JSONArray entries = responseStr.getJSONArray("cookie");
|
||||||
@@ -63,6 +58,7 @@ public class SyncUserService {
|
|||||||
cookie[i] = (byte) entries.getByte(i);
|
cookie[i] = (byte) entries.getByte(i);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
if (e.getMessage().contains("is not a JSONArray")) {
|
if (e.getMessage().contains("is not a JSONArray")) {
|
||||||
cookie = null;
|
cookie = null;
|
||||||
}
|
}
|
||||||
@@ -92,13 +88,11 @@ public class SyncUserService {
|
|||||||
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||||
// 组织测试
|
// 组织测试
|
||||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
||||||
json.add(rs);
|
|
||||||
|
|
||||||
|
|
||||||
JSONObject responseStr = JSONObject.parseObject(rs);
|
|
||||||
|
|
||||||
System.out.println(responseStr);
|
|
||||||
log.info(rs);
|
log.info(rs);
|
||||||
|
JSONObject responseStr = JSONObject.parseObject(rs);
|
||||||
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
|
json.add(rs);
|
||||||
|
}
|
||||||
if (responseStr.containsKey("cookie")) {
|
if (responseStr.containsKey("cookie")) {
|
||||||
try {
|
try {
|
||||||
JSONArray entries = responseStr.getJSONArray("cookie");
|
JSONArray entries = responseStr.getJSONArray("cookie");
|
||||||
@@ -110,14 +104,12 @@ public class SyncUserService {
|
|||||||
cookie[i] = (byte) entries.getByte(i);
|
cookie[i] = (byte) entries.getByte(i);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e);
|
log.error(e.getMessage(),e);
|
||||||
e.printStackTrace();
|
|
||||||
if (e.getMessage().contains("is not a JSONArray")) {
|
if (e.getMessage().contains("is not a JSONArray")) {
|
||||||
cookie = null;
|
cookie = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (cookie != null);
|
} while (cookie != null);
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO `ts_dictype`(`ID`, `DIC_ID`, `DIC_TYPE_NAME`, `DIC_TYPE_CODE`, `DESCRIBES`, `SHOW_INDEX`, `PARENT_ID`, `TREE_PID`, `OTHERS`, `CREATION_USER`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`) VALUES ('q6h0m329utvyzjp2ci4m', 'DNDYWNSJKH4H8LYTV2CJ', '全国安全防范报警系统标准化技术委员会(SAC/TC 100)', '3jurxfza8n', '全国安全防范报警系统标准化技术委员会(SAC/TC 100)', 2, NULL, NULL, NULL, 'admin', '0', '2022-05-26 08:01:33', '2022-05-26 08:01:33');
|
||||||
|
INSERT INTO `ts_dictype`(`ID`, `DIC_ID`, `DIC_TYPE_NAME`, `DIC_TYPE_CODE`, `DESCRIBES`, `SHOW_INDEX`, `PARENT_ID`, `TREE_PID`, `OTHERS`, `CREATION_USER`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`) VALUES ('vaqx4d6ggrg0tfoayqxs', 'DNDYWNSJKH4H8LYTV2CJ', '全国汽车标准化技术委员会挂车分技术委员会(SAC/TC 114/SC 13)', 'scloaolgv2', '全国汽车标准化技术委员会挂车分技术委员会(SAC/TC 114/SC 13)', 2, NULL, NULL, NULL, 'admin', '0', '2022-05-26 08:01:21', '2022-05-26 08:01:21');
|
||||||
|
INSERT INTO `ts_dictype`(`ID`, `DIC_ID`, `DIC_TYPE_NAME`, `DIC_TYPE_CODE`, `DESCRIBES`, `SHOW_INDEX`, `PARENT_ID`, `TREE_PID`, `OTHERS`, `CREATION_USER`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`) VALUES ('cp9ln5c7q3l8zow2vc5s', 'DNDYWNSJKH4H8LYTV2CJ', '生态环境部', '2wtg9whgmd', '生态环境部', 2, NULL, NULL, NULL, 'admin', '0', '2022-05-26 07:57:30', '2022-05-26 07:57:30');
|
||||||
Reference in New Issue
Block a user