Merge remote-tracking branch 'origin/develop_master' into develop_master
# Conflicts: # adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java
This commit is contained in:
@@ -38,6 +38,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/get_verify_by_instance");
|
||||
addInterceptor.excludePathPatterns("/api/sys/user/getById");
|
||||
addInterceptor.excludePathPatterns("/api/person/userInfo/getByUserInfoCode");
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/upload");
|
||||
//pcms项目数据下发开放接口
|
||||
addInterceptor.excludePathPatterns("/api/sarStandProjectLibrary/save");
|
||||
addInterceptor.excludePathPatterns("/slrs/sar-stand-project-team/save");
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.adc.da.slrs.sarModelTree.dao;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface SarModuleTreeDao extends BaseMapper<SarModuleTree> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.sarModelTree.entity;
|
||||
|
||||
/**
|
||||
* 同步数据时使用的返回给其他系统的结果
|
||||
*/
|
||||
public class ResponseResult {
|
||||
private String GUID; //序列号 业务主键
|
||||
|
||||
private String MESSAGE; //接口信息 失败时,详细的失败原因
|
||||
|
||||
private String STATUS; //接口状态 B(失败),S(成功)
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.adc.da.slrs.sarModelTree.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("sar_module_tree")
|
||||
public class SarModuleTree {
|
||||
|
||||
@SerializedName("GUID")
|
||||
@TableId
|
||||
private String guid;
|
||||
@SerializedName("FTVSTYPE1")
|
||||
@TableField("FTVSTYPE1")
|
||||
private String ftvstype1;
|
||||
|
||||
|
||||
@SerializedName("FTVSTYPE2")
|
||||
@TableField("FTVSTYPE2")
|
||||
private String ftvstype2;
|
||||
|
||||
@SerializedName("FTVSTYPE3")
|
||||
@TableField("FTVSTYPE3")
|
||||
private String ftvstype3;
|
||||
|
||||
@SerializedName("FTVSTYPE4")
|
||||
@TableField("FTVSTYPE4")
|
||||
private String ftvstype4;
|
||||
|
||||
@SerializedName("FTVSTYPE5")
|
||||
@TableField("FTVSTYPE5")
|
||||
private String ftvstype5;
|
||||
|
||||
@SerializedName("FTVSTYPE6")
|
||||
@TableField("FTVSTYPE6")
|
||||
private String ftvstype6;
|
||||
|
||||
@SerializedName("FTVSTYPE7")
|
||||
@TableField("FTVSTYPE7")
|
||||
private String ftvstype7;
|
||||
|
||||
@SerializedName("FTVSTYPE9")
|
||||
@TableField("FTVSTYPE9")
|
||||
private String ftvstype9;
|
||||
|
||||
@SerializedName("ACLUSERNAMES")
|
||||
@TableField("ACLUSERNAMES")
|
||||
private String aclusernames;
|
||||
|
||||
@SerializedName("CREATOR")
|
||||
@TableField("CREATOR")
|
||||
private String creator;
|
||||
|
||||
@SerializedName("SERIESID")
|
||||
@TableField("SERIESID")
|
||||
private String seriesid;
|
||||
|
||||
@SerializedName("RESERVED")
|
||||
@TableField("RESERVED")
|
||||
private String reserved;
|
||||
|
||||
@SerializedName("STARTED")
|
||||
@TableField("STARTED")
|
||||
private String started;
|
||||
|
||||
@SerializedName("CREATIONDATE")
|
||||
@TableField("CREATIONDATE")
|
||||
private String creationdate;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarModelTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISarModuleTreeService {
|
||||
|
||||
List<SarModelTree> getAll(SarModelTree sarModelTree);
|
||||
|
||||
List<SarModelTree> recursionGetChildren(SarModelTree parent);
|
||||
|
||||
public Head analysisJsonAndStorage(String json);
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.adc.da.slrs.sarModelTree.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.dao.SarModuleTreeDao;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarModuleTree> implements ISarModuleTreeService {
|
||||
|
||||
@Autowired()
|
||||
private SarModuleTreeServiceImpl sarModuleTreeService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.groupBy("FTVSTYPE1");
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
|
||||
//把SarModuleTree类型的list集合转换为SarModelTree类型的list集合
|
||||
List<SarModelTree> sarModelTreeList = moduleTreeList.stream().map(SarModuleTree -> {
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
modelTree.setId(SarModuleTree.getGuid());
|
||||
modelTree.setName(SarModuleTree.getFtvstype1());
|
||||
modelTree.setModel(SarModuleTree.getFtvstype1());
|
||||
return modelTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return sarModelTreeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Head analysisJsonAndStorage(String json) {
|
||||
//获取头部 返回结果需要
|
||||
Head head = new Head();
|
||||
try{
|
||||
|
||||
//把字符串转换成对象
|
||||
JsonObject parse = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
|
||||
//要把jsonObject里的HEAD强转成JsonObject类型
|
||||
JsonObject HEAD = (JsonObject) parse.get("HEAD");
|
||||
//因为是最后要取的值了,所以就拿到之后把它转换成String类型
|
||||
HEAD.get("CONSUMER").getAsString();
|
||||
|
||||
head.setBIZTRANSACTIONID(HEAD.get("BIZTRANSACTIONID").getAsString());
|
||||
|
||||
//获取json中的list
|
||||
JsonArray list = (JsonArray)parse.get("LIST");
|
||||
Gson gson = new Gson();
|
||||
List<SarModuleTree> moduleTreeList = new LinkedList<>();
|
||||
list.forEach(item->{
|
||||
JsonObject objectJson=(JsonObject) item;
|
||||
SarModuleTree sarModuleTree = gson.fromJson(objectJson, SarModuleTree.class);
|
||||
sarModuleTree.setGuid(UUIDUtils.randomUUID20());
|
||||
moduleTreeList.add(sarModuleTree);
|
||||
});
|
||||
|
||||
|
||||
//进行全量覆盖即删除表中所有数据,之后插入新的数据
|
||||
sarModuleTreeService.remove(null);
|
||||
sarModuleTreeService.saveBatch(moduleTreeList);
|
||||
head.setSUCCESSCOUNT(String.valueOf(moduleTreeList.size()));
|
||||
}catch (Exception e){
|
||||
head.setERRORCODE("2");
|
||||
head.setRESULT("业务失败需要重做,失败原因: "+e.getMessage());
|
||||
return head;
|
||||
}
|
||||
|
||||
head.setERRORCODE("0");
|
||||
head.setRESULT("成功");
|
||||
return head;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -230,6 +230,7 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
Head head = sarStandProjectLibraryService.AnalysisJsonAndStorage(jsonStr);
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
ResponseDto responseDto = new ResponseDto(head,companies);
|
||||
//todo 未确定返回内容
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
|
||||
+11
-4
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class ResponseDto {
|
||||
@@ -17,14 +18,20 @@ public class ResponseDto {
|
||||
// }
|
||||
|
||||
|
||||
List<Company> LIST;
|
||||
List<?> LIST;
|
||||
|
||||
public ResponseDto(Head HEAD, List<Company> LIST) {
|
||||
public ResponseDto(Head HEAD, List<?> LIST) {
|
||||
this.HEAD = HEAD;
|
||||
this.LIST = LIST;
|
||||
}
|
||||
|
||||
public ResponseDto() {
|
||||
|
||||
public ResponseDto(Head HEAD) {
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
companies.add(company);
|
||||
this.LIST=companies;
|
||||
this.HEAD=HEAD;
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -41,6 +41,7 @@ public class SarStandProjectTeamController extends BaseController<SarStandProjec
|
||||
public ResponseDto save(@RequestBody String jsonStr){
|
||||
Head head = sarStandProjectTeamService.AnalysisJsonAndStorage(jsonStr);
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
//todo 未确定返回内容
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
|
||||
Reference in New Issue
Block a user