优化企标导入功能
This commit is contained in:
+17
-2
@@ -84,9 +84,24 @@ public class SarBussStandAttrInfoExecl extends BaseEntity {
|
|||||||
|
|
||||||
private String xgjh;
|
private String xgjh;
|
||||||
|
|
||||||
//附件
|
//发布稿附件
|
||||||
|
private String fbgbuss;
|
||||||
|
|
||||||
|
//编制说明附件
|
||||||
|
private String bzsmbuss;
|
||||||
|
|
||||||
|
//历史版本附件
|
||||||
|
private String lsbbbuss;
|
||||||
|
|
||||||
|
//其他文件附件
|
||||||
private String qtwjbuss;
|
private String qtwjbuss;
|
||||||
|
|
||||||
|
//修改单附件
|
||||||
|
private String xgd;
|
||||||
|
|
||||||
|
//关联文件附件
|
||||||
|
private String glwjbuss;
|
||||||
|
|
||||||
//标准中文名称
|
//标准中文名称
|
||||||
private String standName;
|
private String standName;
|
||||||
|
|
||||||
@@ -109,7 +124,7 @@ public class SarBussStandAttrInfoExecl extends BaseEntity {
|
|||||||
private String issueTime;
|
private String issueTime;
|
||||||
|
|
||||||
//标准编号
|
//标准编号
|
||||||
private String standCode;
|
private String standNumber;
|
||||||
|
|
||||||
//标准英文名称
|
//标准英文名称
|
||||||
private String standEnName;
|
private String standEnName;
|
||||||
|
|||||||
+2
-2
@@ -416,9 +416,9 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
|||||||
|
|
||||||
@ApiOperation(value = "导入功能")
|
@ApiOperation(value = "导入功能")
|
||||||
@PostMapping("/importSarBussionessStandFile")
|
@PostMapping("/importSarBussionessStandFile")
|
||||||
public ResponseMessage<String> importSarBussionessStandFile(@RequestParam(value = "file",required = false)MultipartFile file) throws Exception{
|
public ResponseMessage<String> importSarBussionessStandFile(@RequestParam(value = "file",required = false)MultipartFile file,String menuId) throws Exception{
|
||||||
|
|
||||||
return sarBussionessStandEOService.importSarBussionessStandFile(file);
|
return sarBussionessStandEOService.importSarBussionessStandFile(file,menuId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "|SarBussionessStand|判断原文译文")
|
@ApiOperation(value = "|SarBussionessStand|判断原文译文")
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
|||||||
|
|
||||||
ResponseMessage emptyFileAnewStorage(String type);
|
ResponseMessage emptyFileAnewStorage(String type);
|
||||||
|
|
||||||
ResponseMessage<String> importSarBussionessStandFile(MultipartFile file)throws Exception;
|
ResponseMessage<String> importSarBussionessStandFile(MultipartFile file,String menuId)throws Exception;
|
||||||
|
|
||||||
ResponseMessage repetitionFile();
|
ResponseMessage repetitionFile();
|
||||||
|
|
||||||
|
|||||||
+231
-27
@@ -248,6 +248,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SarStandardsInfoDao sarStandardsInfoDao;
|
private SarStandardsInfoDao sarStandardsInfoDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITsResourceService tsResourceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
||||||
@@ -1348,14 +1350,23 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SarBussionessStand selectStandardsInfoByKey(String id) throws Exception{
|
public SarBussionessStand selectStandardsInfoByKey(String id) throws Exception{
|
||||||
|
String info = "企标文本状态";
|
||||||
|
String pid = dicTypeEODao.selectByPid(info);
|
||||||
|
List<DicTypeEO> dicTypeEOS = dicTypeEODao.selectByPidInfo(pid);
|
||||||
List<SarBussionessStand> sarBussionessStandlist = this.baseMapper.selectStandardsInfoByKey(id);
|
List<SarBussionessStand> sarBussionessStandlist = this.baseMapper.selectStandardsInfoByKey(id);
|
||||||
SarBussionessStand sarBussionessStandEO = new SarBussionessStand();
|
SarBussionessStand sarBussionessStandEO = new SarBussionessStand();
|
||||||
if(!sarBussionessStandlist.isEmpty()) {
|
if(!sarBussionessStandlist.isEmpty()) {
|
||||||
List<SarBussionessStand> newStandList = new ArrayList<>();
|
List<SarBussionessStand> newStandList = new ArrayList<>();
|
||||||
newStandList.add(sarBussionessStandlist.get(0));
|
newStandList.add(sarBussionessStandlist.get(0));
|
||||||
attrInfoShowDetails(newStandList);
|
attrInfoShowDetails(newStandList);
|
||||||
|
for (DicTypeEO data : dicTypeEOS){
|
||||||
|
if(data.getDicTypeCode().equals(newStandList.get(0).getTextStatusBuss())){
|
||||||
|
newStandList.get(0).setTextStatusBussShow(data.getDicTypeName());
|
||||||
|
}
|
||||||
|
}
|
||||||
sarBussionessStandEO = newStandList.get(0);
|
sarBussionessStandEO = newStandList.get(0);
|
||||||
}
|
}
|
||||||
|
//企标文本状态
|
||||||
return sarBussionessStandEO;
|
return sarBussionessStandEO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2022,9 +2033,16 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ResponseMessage<String> importSarBussionessStandFile(MultipartFile file)throws Exception {
|
public ResponseMessage<String> importSarBussionessStandFile(MultipartFile file,String menuId)throws Exception {
|
||||||
|
|
||||||
|
List<TsResource> tsResources = tsResourceService.getByMenuId(menuId);
|
||||||
|
if (ObjectUtils.isEmpty(tsResources)){
|
||||||
|
return Result.error("请选择目录进行导入");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//给出头部信息
|
//给出头部信息
|
||||||
String[] headerExcel = {"企标编号,中文名称,英文名称,文本状态,发布日期,企标实施日期,企标制修订状态,起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称,附件,企标类型,标准年份,"};
|
String[] headerExcel = {"企标类别,标准年份,企标编号,中文名称,英文名称,文本状态,发布日期,企标实施日期,企标制修订状态,起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称,发布稿附件,编制说明附件,历史版本附件,其他文件附件,修改单附件,关联文件附件,"};
|
||||||
|
|
||||||
//获取文件全称
|
//获取文件全称
|
||||||
String fileNameStr = file.getOriginalFilename();
|
String fileNameStr = file.getOriginalFilename();
|
||||||
@@ -2118,8 +2136,28 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
SarBussStandAttrInfoExecl sarBussStandAttrInfo = new SarBussStandAttrInfoExecl();
|
SarBussStandAttrInfoExecl sarBussStandAttrInfo = new SarBussStandAttrInfoExecl();
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
|
|
||||||
String standCode = rowList.get("企标编号");
|
String standSort = rowList.get("企标类别");
|
||||||
sarBussStandAttrInfo.setStandCode(standCode);
|
if (StringUtils.isNotBlank(standSort)){
|
||||||
|
if (standSort.length() > 100){
|
||||||
|
return Result.error("企标类别输入过长");
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setStandSort(standSort);
|
||||||
|
}else {
|
||||||
|
return Result.error("企标类别不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
String standYear = rowList.get("标准年份");
|
||||||
|
if (StringUtils.isNotBlank(standYear)){
|
||||||
|
if (standYear.length() > 100){
|
||||||
|
return Result.error("标准年份输入过长");
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setStandYear(standYear);
|
||||||
|
}else {
|
||||||
|
return Result.error("标准年份不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
String standNumber = rowList.get("企标编号");
|
||||||
|
sarBussStandAttrInfo.setStandNumber(standNumber);
|
||||||
|
|
||||||
String standName = rowList.get("中文名称");
|
String standName = rowList.get("中文名称");
|
||||||
if(StringUtils.isNotBlank(standName)){
|
if(StringUtils.isNotBlank(standName)){
|
||||||
@@ -2127,6 +2165,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
return Result.error("输入的标准名称过长");
|
return Result.error("输入的标准名称过长");
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setStandName(standName);
|
sarBussStandAttrInfo.setStandName(standName);
|
||||||
|
}else {
|
||||||
|
return Result.error("中文名称不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String standEnName = rowList.get("英文名称");
|
String standEnName = rowList.get("英文名称");
|
||||||
@@ -2137,7 +2177,37 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
if (textStatusBuss.length() > 200){
|
if (textStatusBuss.length() > 200){
|
||||||
return Result.error("输入的文本状态过长");
|
return Result.error("输入的文本状态过长");
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setTextStatusBuss(textStatusBuss);
|
|
||||||
|
switch (textStatusBuss){
|
||||||
|
case "发布":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("6jnqba2mby");
|
||||||
|
break;
|
||||||
|
case "被代替":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("quxujsuev5");
|
||||||
|
break;
|
||||||
|
case "参考":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("01i8opy07d");
|
||||||
|
break;
|
||||||
|
case "即将实施":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("rpvoxsvr60");
|
||||||
|
break;
|
||||||
|
case "有效":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("9z741h2m3j");
|
||||||
|
break;
|
||||||
|
case "直接上传":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("t769k1rkcy");
|
||||||
|
break;
|
||||||
|
case "作废":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("3lqnlgmgcn");
|
||||||
|
break;
|
||||||
|
case "待修订-指的其他企业标准":
|
||||||
|
sarBussStandAttrInfo.setTextStatusBuss("1w7cegukbs");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return Result.error("请提供准确的文本状态");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return Result.error("文本状态不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
@@ -2246,7 +2316,68 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String kcvppscnbuss = rowList.get("关联模块--卡车vpps中文名称");
|
String kcvppscnbuss = rowList.get("关联模块--卡车vpps中文名称");
|
||||||
sarBussStandAttrInfo.setKcvppscnbuss(kcvppscnbuss);
|
sarBussStandAttrInfo.setKcvppscnbuss(kcvppscnbuss);
|
||||||
|
|
||||||
String qtwjbuss = rowList.get("附件");
|
|
||||||
|
String fbgbuss = rowList.get("发布稿附件");
|
||||||
|
if (fbgbuss != null && !fbgbuss.equals("")) {
|
||||||
|
String[] split = fbgbuss.split(",");
|
||||||
|
String s = "";
|
||||||
|
if (split.length != 0) {
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
String name = fileInfo.getName();
|
||||||
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
|
File files = new File(split1[0] + split[j]);
|
||||||
|
AttFileVo attFileVo = attFileEOService.saveFileInfo(files);
|
||||||
|
if (StringUtils.isNotBlank(attFileVo.getId())) {
|
||||||
|
s += "," + attFileVo.getAttId();
|
||||||
|
} else {
|
||||||
|
s = attFileVo.getAttId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setFbgbuss(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String bzsmbuss = rowList.get("编制说明附件");
|
||||||
|
if (bzsmbuss != null && !bzsmbuss.equals("")) {
|
||||||
|
String[] split = bzsmbuss.split(",");
|
||||||
|
String s = "";
|
||||||
|
if (split.length != 0) {
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
String name = fileInfo.getName();
|
||||||
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
|
File files = new File(split1[0] + split[j]);
|
||||||
|
AttFileVo attFileVo = attFileEOService.saveFileInfo(files);
|
||||||
|
if (StringUtils.isNotBlank(attFileVo.getId())) {
|
||||||
|
s += "," + attFileVo.getAttId();
|
||||||
|
} else {
|
||||||
|
s = attFileVo.getAttId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setBzsmbuss(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String lsbbbuss = rowList.get("历史版本附件");
|
||||||
|
if (lsbbbuss != null && !lsbbbuss.equals("")) {
|
||||||
|
String[] split = lsbbbuss.split(",");
|
||||||
|
String s = "";
|
||||||
|
if (split.length != 0) {
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
String name = fileInfo.getName();
|
||||||
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
|
File files = new File(split1[0] + split[j]);
|
||||||
|
AttFileVo attFileVo = attFileEOService.saveFileInfo(files);
|
||||||
|
if (StringUtils.isNotBlank(attFileVo.getId())) {
|
||||||
|
s += "," + attFileVo.getAttId();
|
||||||
|
} else {
|
||||||
|
s = attFileVo.getAttId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setLsbbbuss(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String qtwjbuss = rowList.get("其他文件附件");
|
||||||
if (qtwjbuss != null && !qtwjbuss.equals("")) {
|
if (qtwjbuss != null && !qtwjbuss.equals("")) {
|
||||||
String[] split = qtwjbuss.split(",");
|
String[] split = qtwjbuss.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2266,20 +2397,44 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String standSort = rowList.get("企标类型");
|
String xgd = rowList.get("修改单附件");
|
||||||
if (StringUtils.isNotBlank(standSort)){
|
if (xgd != null && !xgd.equals("")) {
|
||||||
if (standSort.length() > 100){
|
String[] split = xgd.split(",");
|
||||||
return Result.error("企标类型输入过长");
|
String s = "";
|
||||||
|
if (split.length != 0) {
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
String name = fileInfo.getName();
|
||||||
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
|
File files = new File(split1[0] + split[j]);
|
||||||
|
AttFileVo attFileVo = attFileEOService.saveFileInfo(files);
|
||||||
|
if (StringUtils.isNotBlank(attFileVo.getId())) {
|
||||||
|
s += "," + attFileVo.getAttId();
|
||||||
|
} else {
|
||||||
|
s = attFileVo.getAttId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setXgd(s);
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setStandSort(standSort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String standYear = rowList.get("标准年份");
|
String glwjbuss = rowList.get("关联文件附件");
|
||||||
if (StringUtils.isNotBlank(standYear)){
|
if (glwjbuss != null && !glwjbuss.equals("")) {
|
||||||
if (standYear.length() > 100){
|
String[] split = glwjbuss.split(",");
|
||||||
return Result.error("标准年份输入过长");
|
String s = "";
|
||||||
|
if (split.length != 0) {
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
String name = fileInfo.getName();
|
||||||
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
|
File files = new File(split1[0] + split[j]);
|
||||||
|
AttFileVo attFileVo = attFileEOService.saveFileInfo(files);
|
||||||
|
if (StringUtils.isNotBlank(attFileVo.getId())) {
|
||||||
|
s += "," + attFileVo.getAttId();
|
||||||
|
} else {
|
||||||
|
s = attFileVo.getAttId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sarBussStandAttrInfo.setGlwjbuss(s);
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setStandYear(standYear);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SarBussStandAttrInfoExecl> list = new ArrayList<>();
|
List<SarBussStandAttrInfoExecl> list = new ArrayList<>();
|
||||||
@@ -2368,6 +2523,12 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
String resData = JSON.toJSONString(attInfoMap, SerializerFeature.WriteMapNullValue);
|
||||||
sarBussionessStand.setSarStandAttrEOStr(resData);
|
sarBussionessStand.setSarStandAttrEOStr(resData);
|
||||||
|
|
||||||
|
// String textStatusBussShow = sarBussionessStand.getTextStatusBuss();
|
||||||
|
|
||||||
|
//拼接企标编号
|
||||||
|
String standCode = sarBussionessStand.getStandSort() + " " + sarBussionessStand.getStandNumber() + "-" + sarBussionessStand.getStandYear();
|
||||||
|
sarBussionessStand.setStandCode(standCode);
|
||||||
// 根据标准号判断数据是否已存在
|
// 根据标准号判断数据是否已存在
|
||||||
//2021年4月9日 此处检查当前是否存在standId
|
//2021年4月9日 此处检查当前是否存在standId
|
||||||
QueryWrapper<SarBussionessStand>queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SarBussionessStand>queryWrapper = new QueryWrapper<>();
|
||||||
@@ -2378,13 +2539,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
//return Result.error("当前企标标准号和企标名称已存在");
|
//return Result.error("当前企标标准号和企标名称已存在");
|
||||||
throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在");
|
throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
String standCode = "";
|
|
||||||
if(StringUtils.isNotBlank(sarBussionessStand.getStandCode()) && !"null".equals(sarBussionessStand.getStandCode())){
|
|
||||||
standCode = sarBussionessStand.getStandCode();
|
|
||||||
}
|
|
||||||
List<SarBussionessStand> lawsList = iSarBussionessStandService.selectStandardsByStandNumber(standCode);
|
|
||||||
|
|
||||||
//此处判断是否是带入的标准
|
//此处判断是否是带入的标准
|
||||||
if(StringUtils.isNotBlank(sarBussionessStand.getId())) {
|
if(StringUtils.isNotBlank(sarBussionessStand.getId())) {
|
||||||
bussId = sarBussionessStand.getId();
|
bussId = sarBussionessStand.getId();
|
||||||
@@ -2401,8 +2555,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
||||||
} else {//标准号、ID都不存在的情况
|
} else {//标准号、ID都不存在的情况
|
||||||
// 新增方法
|
// 新增方法
|
||||||
sarBussionessStand.setStandCode(standCode);
|
//sarBussionessStand.setTextStatusBussShow(textStatusBussShow);
|
||||||
iSarBussionessStandService.createSarBussionessStand(sarBussionessStand);
|
saveSarBussionessStand(sarBussionessStand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -2467,8 +2621,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
//查询字典表,形成Hash映射提升速度
|
//查询字典表,形成Hash映射提升速度
|
||||||
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
|
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
|
||||||
Map<String, String> dicMap = dicInfo.stream()
|
Map<String, String> dicMap = dicInfo.stream()
|
||||||
.filter(item-> !item.getDicTypeName().isEmpty())
|
.filter(item-> !item.getDicTypeCode().isEmpty())
|
||||||
.collect(Collectors.toMap(DicTypeEO::getDicTypeName,DicTypeEO::getDicTypeCode,(value1, value2 )->value2));
|
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2));
|
||||||
|
|
||||||
for(SarBussStandAttrInfoExecl row : sarlist){
|
for(SarBussStandAttrInfoExecl row : sarlist){
|
||||||
attrInfoDetailsImport(row);
|
attrInfoDetailsImport(row);
|
||||||
@@ -3951,4 +4105,54 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
return "标准Id==="+standId+"修改文件==="+strFile+"删除文件=="+strFileInfo;
|
return "标准Id==="+standId+"修改文件==="+strFile+"删除文件=="+strFileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResponseMessage<SarBussionessStand> saveSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception {
|
||||||
|
//标准信息表中插入一条数据
|
||||||
|
sarBussionessStandEO.setValidFlag(ValueStateEnum.VALUE_TRUE.getValue());
|
||||||
|
sarBussionessStandEO.setCreationTime(new Date());
|
||||||
|
sarBussionessStandEO.setModifyTime(new Date());
|
||||||
|
sarBussionessStandEO.setId(UUIDUtils.randomUUID20());
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(sarBussionessStandEO.getMenuId())){
|
||||||
|
sarBussionessStandEO.setMenuId("3");
|
||||||
|
}
|
||||||
|
//根据新建标准所在目录,确定此处是否需要在标准目录关联表中插入数据
|
||||||
|
if (StringUtils.isNotEmpty(sarBussionessStandEO.getMenuId())) {
|
||||||
|
SarBussStandMenu sarStandMenuEO = new SarBussStandMenu();
|
||||||
|
sarStandMenuEO.setBussStandId(sarBussionessStandEO.getId());
|
||||||
|
sarStandMenuEO.setMenuId(sarBussionessStandEO.getMenuId());
|
||||||
|
sarStandMenuEO.setValidFlag(ValueStateEnum.VALUE_TRUE.getValue());
|
||||||
|
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
|
||||||
|
sarBussStandMenuEODao.insertSelective(sarStandMenuEO);
|
||||||
|
}
|
||||||
|
int insertresult = this.baseMapper.insert(sarBussionessStandEO);
|
||||||
|
if (insertresult >= 1) {
|
||||||
|
// 根据代替标准号 ,修改代替标准号标准中的,被代替标准号
|
||||||
|
updateReplaceConnect(sarBussionessStandEO);
|
||||||
|
//编写预警信息
|
||||||
|
// writeWarnings(sarBussionessStandEO);
|
||||||
|
// 处理属性表信息
|
||||||
|
if (StringUtils.isNotBlank(sarBussionessStandEO.getSarStandAttrEOStr())) {
|
||||||
|
createStandAttrInfo(sarBussionessStandEO,false);
|
||||||
|
}
|
||||||
|
// 增加关联事件
|
||||||
|
String sortName = sysInfoEOService.getDicNamesByCodes(sarBussionessStandEO.getStandSort(),"JKSADFH564S");
|
||||||
|
String number = sortName + " " + sarBussionessStandEO.getStandCode();
|
||||||
|
if (StringUtils.isNotBlank(sarBussionessStandEO.getStandYear())) {
|
||||||
|
number += "-" + sarBussionessStandEO.getStandYear();
|
||||||
|
}
|
||||||
|
String content = "入库" + number + " 《" + sarBussionessStandEO.getStandName() + "》";
|
||||||
|
String prcCreateUser = StringUtils.isNotBlank(sarBussionessStandEO.getPrcCreateUser()) ? sarBussionessStandEO.getPrcCreateUser() : "";
|
||||||
|
sarUpdLogEOService.createBaseProcessLog(sarBussionessStandEO.getId(),"BUSINESS",content,prcCreateUser);
|
||||||
|
saveNewFeed(sarBussionessStandEO,"2");
|
||||||
|
if(elasflag) {
|
||||||
|
attrInfoShowSearchDetails(sarBussionessStandEO,"add");
|
||||||
|
createStandMQService.sendBussStandMQ(sarBussionessStandEO,"add");
|
||||||
|
}
|
||||||
|
return Result.success("00", "插入数据成功", sarBussionessStandEO);
|
||||||
|
} else {
|
||||||
|
return Result.error("01", "插入输入过程中出错");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,4 +59,7 @@ public interface ITsResourceService extends IService<TsResource> {
|
|||||||
List<String> getChildMenuList(String menuId);
|
List<String> getChildMenuList(String menuId);
|
||||||
|
|
||||||
boolean dealWithData();
|
boolean dealWithData();
|
||||||
|
|
||||||
|
List<TsResource> getByMenuId(String menuId)throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -1,5 +1,6 @@
|
|||||||
package com.adc.da.slrs.sarResource.service.impl;
|
package com.adc.da.slrs.sarResource.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.exception.AdcDaBaseException;
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
|
|
||||||
@@ -490,6 +491,14 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TsResource> getByMenuId(String menuId) throws Exception{
|
||||||
|
QueryWrapper<TsResource> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("PARENT_ID",menuId);
|
||||||
|
List<TsResource> tsResources = baseMapper.selectList(queryWrapper);
|
||||||
|
return tsResources;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean dealData(TsResource tsResource,Map<String,TsResource> map){
|
public boolean dealData(TsResource tsResource,Map<String,TsResource> map){
|
||||||
if (null!=tsResource.getParentId() && !"".equals(tsResource.getParentId()) && !"0".equals(tsResource.getParentId())){
|
if (null!=tsResource.getParentId() && !"".equals(tsResource.getParentId()) && !"0".equals(tsResource.getParentId())){
|
||||||
tsResource.setParentIds(tsResource.getParentIds()+tsResource.getParentId()+",");
|
tsResource.setParentIds(tsResource.getParentIds()+tsResource.getParentId()+",");
|
||||||
|
|||||||
@@ -85,4 +85,7 @@ public interface DicTypeEODao extends BaseMapper<DicTypeEO> {
|
|||||||
*/
|
*/
|
||||||
public List<DicTypeEO> getDicInfo(@Param("filed") String... filed);
|
public List<DicTypeEO> getDicInfo(@Param("filed") String... filed);
|
||||||
|
|
||||||
|
String selectByPid(@Param("Info") String Info);
|
||||||
|
|
||||||
|
List<DicTypeEO> selectByPidInfo(@Param("pid") String pid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -614,4 +614,21 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByPid" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
ID
|
||||||
|
FROM
|
||||||
|
ts_dictionary
|
||||||
|
WHERE
|
||||||
|
DICTIONARY_NAME = #{Info}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByPidInfo" resultType="com.adc.da.sys.entity.DicTypeEO">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
ts_dictype
|
||||||
|
WHERE
|
||||||
|
DIC_ID = #{pid}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user