合并分支 'dev_20230216' 到 'master'
Dev 20230216 查看合并请求 laws-foton-slrs/foton-slrs-system-rest!53
This commit is contained in:
+109
-35
@@ -1031,9 +1031,6 @@ public class WorkFlowController {
|
|||||||
for (EsRevisePlan data : esRevisePlans){
|
for (EsRevisePlan data : esRevisePlans){
|
||||||
//数据拼接
|
//数据拼接
|
||||||
ProcessRollBackEO processRollBackEO = new ProcessRollBackEO();
|
ProcessRollBackEO processRollBackEO = new ProcessRollBackEO();
|
||||||
//起草人
|
|
||||||
processRollBackEO.setUserId(data.getDrafter());
|
|
||||||
processRollBackEO.setType("25");
|
|
||||||
//拼接json
|
//拼接json
|
||||||
HashMap<String, Object> qbfsForm = new HashMap<>();
|
HashMap<String, Object> qbfsForm = new HashMap<>();
|
||||||
HashMap<String, Object> qbfsFormInfo = new HashMap<>();
|
HashMap<String, Object> qbfsFormInfo = new HashMap<>();
|
||||||
@@ -1042,15 +1039,42 @@ public class WorkFlowController {
|
|||||||
qbfsForm.put("planStatus",data.getPlanStatus());
|
qbfsForm.put("planStatus",data.getPlanStatus());
|
||||||
qbfsForm.put("reviseStatus",data.getReviseStatus());
|
qbfsForm.put("reviseStatus",data.getReviseStatus());
|
||||||
qbfsForm.put("drafter",data.getDrafter());
|
qbfsForm.put("drafter",data.getDrafter());
|
||||||
TsUser byIdDrafter = userService.getById(data.getDrafter());
|
|
||||||
if(byIdDrafter!=null){
|
String drafterNameStr = "";
|
||||||
qbfsForm.put("drafterName",byIdDrafter.getUname());
|
if(StringUtils.isNotBlank(data.getDrafter())){
|
||||||
|
String[] split = data.getDrafter().split(",");
|
||||||
|
List<String> asList = Arrays.asList(split);
|
||||||
|
for (String uid:asList){
|
||||||
|
TsUser byIdDrafterInfo = userService.getById(uid);
|
||||||
|
if(StringUtils.isBlank(drafterNameStr)){
|
||||||
|
drafterNameStr = byIdDrafterInfo.getUname();
|
||||||
|
}else {
|
||||||
|
drafterNameStr = drafterNameStr+","+byIdDrafterInfo.getUname();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isNotBlank(drafterNameStr)){
|
||||||
|
qbfsForm.put("drafterName",drafterNameStr);
|
||||||
|
}
|
||||||
|
|
||||||
qbfsForm.put("resPerson",data.getResPerson());
|
qbfsForm.put("resPerson",data.getResPerson());
|
||||||
TsUser byIdResPrson = userService.getById(data.getResPerson());
|
String resPersonNameStr = "";
|
||||||
if(byIdResPrson!=null){
|
if(StringUtils.isNotBlank(data.getResPerson())){
|
||||||
qbfsForm.put("resPersonName",byIdResPrson.getUname());
|
String[] split = data.getResPerson().split(",");
|
||||||
|
List<String> asList = Arrays.asList(split);
|
||||||
|
for (String uid:asList){
|
||||||
|
TsUser byIdDrafterInfo = userService.getById(uid);
|
||||||
|
if(StringUtils.isBlank(resPersonNameStr)){
|
||||||
|
resPersonNameStr = byIdDrafterInfo.getUname();
|
||||||
|
}else {
|
||||||
|
resPersonNameStr = resPersonNameStr+","+byIdDrafterInfo.getUname();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isNotBlank(drafterNameStr)){
|
||||||
|
qbfsForm.put("resPersonName",resPersonNameStr);
|
||||||
|
}
|
||||||
|
|
||||||
String wgLeaderStr = data.getWgLeader();
|
String wgLeaderStr = data.getWgLeader();
|
||||||
if(wgLeaderStr!=null){
|
if(wgLeaderStr!=null){
|
||||||
if(wgLeaderStr.endsWith(",")){
|
if(wgLeaderStr.endsWith(",")){
|
||||||
@@ -1058,10 +1082,23 @@ public class WorkFlowController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
qbfsForm.put("wgLeader",wgLeaderStr);
|
qbfsForm.put("wgLeader",wgLeaderStr);
|
||||||
qbfsForm.put("resPerson",data.getResPerson());
|
|
||||||
TsUser byIdWgleader = userService.getById(data.getResPerson());
|
String wgLeaderNameStr = "";
|
||||||
if(byIdWgleader!=null){
|
if(StringUtils.isNotBlank(data.getWgLeader())){
|
||||||
qbfsForm.put("wgLeaderName",byIdWgleader.getUname());
|
String[] split = data.getWgLeader().split(",");
|
||||||
|
List<String> asList = Arrays.asList(split);
|
||||||
|
for (String uid : asList){
|
||||||
|
TsUser byIdWgleader = userService.getById(uid);
|
||||||
|
if(StringUtils.isBlank(wgLeaderNameStr)){
|
||||||
|
wgLeaderNameStr = byIdWgleader.getUname();
|
||||||
|
}else {
|
||||||
|
wgLeaderNameStr = wgLeaderNameStr+","+byIdWgleader.getUname();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(wgLeaderNameStr)){
|
||||||
|
qbfsForm.put("wgLeaderName",wgLeaderNameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
qbfsForm.put("standId",data.getStandId());
|
qbfsForm.put("standId",data.getStandId());
|
||||||
@@ -1090,9 +1127,22 @@ public class WorkFlowController {
|
|||||||
qbfsForm.put("esStandRelations",data.getEsStandRelations());
|
qbfsForm.put("esStandRelations",data.getEsStandRelations());
|
||||||
qbfsForm.put("isRelate",data.getIsRelate());
|
qbfsForm.put("isRelate",data.getIsRelate());
|
||||||
qbfsForm.put("useLevel",data.getUseLevel());
|
qbfsForm.put("useLevel",data.getUseLevel());
|
||||||
TsUser byIdUseLevel = userService.getById(data.getUseLevel());
|
|
||||||
if(byIdUseLevel!=null){
|
String useLevelNameStr = "";
|
||||||
qbfsForm.put("useLevelName",data.getUseLevelName());
|
if(StringUtils.isNotBlank(data.getUseLevel())){
|
||||||
|
String[] split = data.getUseLevel().split(",");
|
||||||
|
List<String> asList = Arrays.asList(split);
|
||||||
|
for (String uid: asList){
|
||||||
|
TsUser byIdUseLevel = userService.getById(uid);
|
||||||
|
if(StringUtils.isBlank(useLevelNameStr)){
|
||||||
|
useLevelNameStr = byIdUseLevel.getUname();
|
||||||
|
}else {
|
||||||
|
useLevelNameStr = useLevelNameStr+","+byIdUseLevel.getUname();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(useLevelNameStr)){
|
||||||
|
qbfsForm.put("useLevelName",useLevelNameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
qbfsForm.put("technologic",data.getTechnologic());
|
qbfsForm.put("technologic",data.getTechnologic());
|
||||||
@@ -1102,30 +1152,54 @@ public class WorkFlowController {
|
|||||||
qbfsForm.put("LXD",data.getLxd());
|
qbfsForm.put("LXD",data.getLxd());
|
||||||
qbfsForm.put("LXDName","");
|
qbfsForm.put("LXDName","");
|
||||||
qbfsForm.put("addFlag","1");
|
qbfsForm.put("addFlag","1");
|
||||||
qbfsForm.put("prcCreateUser",data.getDrafter());
|
|
||||||
TsUser byIdDrafterInfo = userService.getById(data.getDrafter());
|
|
||||||
if(byIdDrafterInfo!=null){
|
// String prcCreateUserNameStr = "";
|
||||||
qbfsForm.put("prcCreateUserName",byIdDrafterInfo.getUname());
|
// if(StringUtils.isNotBlank(data.getDrafter())){
|
||||||
}
|
// String[] split = data.getDrafter().split(",");
|
||||||
|
// List<String> asList = Arrays.asList(split);
|
||||||
|
// for (String uid:asList){
|
||||||
|
// TsUser byIdDrafterInfo = userService.getById(uid);
|
||||||
|
// if(StringUtils.isBlank(prcCreateUserNameStr)){
|
||||||
|
// prcCreateUserNameStr = byIdDrafterInfo.getUname();
|
||||||
|
// }else {
|
||||||
|
// prcCreateUserNameStr = prcCreateUserNameStr+","+byIdDrafterInfo.getUname();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
qbfsForm.put("nowEsId","操作成功");
|
qbfsForm.put("nowEsId","操作成功");
|
||||||
qbfsForm.put("type","5");
|
qbfsForm.put("type","5");
|
||||||
String jsonMap = JSONObject.toJSONString(qbfsForm);
|
if(StringUtils.isNotBlank(data.getDrafter())){
|
||||||
qbfsFormInfo.put("qbfsForm",qbfsForm);
|
String[] split = data.getDrafter().split(",");
|
||||||
processRollBackEO.setJson(JSONObject.toJSONString(qbfsFormInfo));
|
List<String> asList = Arrays.asList(split);
|
||||||
ResponseMessage responseMessage = startProcessRollBack(processRollBackEO);
|
TsUser byIdUseLevel = userService.getById(asList.get(0));
|
||||||
if(responseMessage!=null){
|
qbfsForm.put("prcCreateUser",asList.get(0));
|
||||||
String taskId = responseMessage.getData().toString();
|
qbfsForm.put("prcCreateUserName",byIdUseLevel.getUname());
|
||||||
BusMes busMes = new BusMes();
|
|
||||||
busMes.setPrcType("25");
|
|
||||||
busMes.setTaskIds(taskId);
|
|
||||||
// busMes.setCreateUserName(userName);
|
|
||||||
// if(jsonObject.get("prcCreateUser")!=null){
|
// if(jsonObject.get("prcCreateUser")!=null){
|
||||||
// busMes.setUserId(jsonObject.get("prcCreateUser").toString());
|
// busMes.setUserId(jsonObject.get("prcCreateUser").toString());
|
||||||
// }
|
// }
|
||||||
busMes.setCreateUserName(data.getDrafterName());
|
//起草人
|
||||||
busMes.setUserId(data.getDrafter());
|
processRollBackEO.setUserId(asList.get(0));
|
||||||
busMes.setJson(jsonMap);
|
processRollBackEO.setType("25");
|
||||||
Wrapper<String> stringWrapper = completeTaskByUserId(busMes);
|
String jsonMap = JSONObject.toJSONString(qbfsForm);
|
||||||
|
qbfsFormInfo.put("qbfsForm",qbfsForm);
|
||||||
|
processRollBackEO.setJson(JSONObject.toJSONString(qbfsFormInfo));
|
||||||
|
ResponseMessage responseMessage = startProcessRollBack(processRollBackEO);
|
||||||
|
if(responseMessage!=null){
|
||||||
|
String taskId = responseMessage.getData().toString();
|
||||||
|
BusMes busMes = new BusMes();
|
||||||
|
busMes.setCreateUserName(byIdUseLevel.getUname());
|
||||||
|
busMes.setPrcType("25");
|
||||||
|
busMes.setTaskIds(taskId);
|
||||||
|
busMes.setCreateUserName(byIdUseLevel.getUname());
|
||||||
|
busMes.setUserId(asList.get(0));
|
||||||
|
busMes.setJson(jsonMap);
|
||||||
|
Wrapper<String> stringWrapper = completeTaskByUserId(busMes);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
|||||||
@@ -172,6 +172,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/resetALLSearchCenterForExits");
|
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/resetALLSearchCenterForExits");
|
||||||
|
|
||||||
|
//标准详情 拆分的导出
|
||||||
|
addInterceptor.excludePathPatterns("/api/lawss/sarFileSplitItems/exportStandardItemExcel");
|
||||||
|
|
||||||
//// //测试接口使用
|
//// //测试接口使用
|
||||||
// addInterceptor.excludePathPatterns("/api/**");
|
// addInterceptor.excludePathPatterns("/api/**");
|
||||||
|
|
||||||
|
|||||||
@@ -58,5 +58,8 @@ public class SarStandItemVal extends BaseEntity {
|
|||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private Date modifyTime;
|
private Date modifyTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String imgName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
@@ -1,8 +1,14 @@
|
|||||||
package com.adc.da.slrs.SarStandItemVal.service;
|
package com.adc.da.slrs.SarStandItemVal.service;
|
||||||
|
|
||||||
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSpiltValTableExportDto;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSplitValExportDto;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSplitValImgExportDto;
|
||||||
|
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEOPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务类
|
* 服务类
|
||||||
@@ -13,4 +19,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface ISarStandItemValService extends IService<SarStandItemVal> {
|
public interface ISarStandItemValService extends IService<SarStandItemVal> {
|
||||||
|
|
||||||
|
List<FileSplitValExportDto> combineItemValInfo(List<SarStandItemVal> getValList, List<FileSpiltValTableExportDto> allTableList, List<FileSplitValImgExportDto> allImgList, SarFileSplitItemsEOPage page);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+77
@@ -3,9 +3,18 @@ package com.adc.da.slrs.SarStandItemVal.service.impl;
|
|||||||
import com.adc.da.slrs.SarStandItemVal.dao.SarStandItemValDao;
|
import com.adc.da.slrs.SarStandItemVal.dao.SarStandItemValDao;
|
||||||
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
||||||
import com.adc.da.slrs.SarStandItemVal.service.ISarStandItemValService;
|
import com.adc.da.slrs.SarStandItemVal.service.ISarStandItemValService;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSpiltValTableExportDto;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSplitValExportDto;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSplitValImgExportDto;
|
||||||
|
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEOPage;
|
||||||
|
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsTableEOPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务实现类
|
* 服务实现类
|
||||||
@@ -17,4 +26,72 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class SarStandItemValServiceImpl extends ServiceImpl<SarStandItemValDao, SarStandItemVal> implements ISarStandItemValService {
|
public class SarStandItemValServiceImpl extends ServiceImpl<SarStandItemValDao, SarStandItemVal> implements ISarStandItemValService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FileSplitValExportDto> combineItemValInfo(List<SarStandItemVal> getValList, List<FileSpiltValTableExportDto> allTableList, List<FileSplitValImgExportDto> allImgList, SarFileSplitItemsEOPage page) {
|
||||||
|
int tableIndex = page.getTableIndex();
|
||||||
|
int imgIndex = page.getImgIndex();
|
||||||
|
List<FileSplitValExportDto> valContent = new ArrayList<>();
|
||||||
|
if (getValList != null && !getValList.isEmpty()) {
|
||||||
|
String preType = "";
|
||||||
|
for(SarStandItemVal itemsValEO : getValList){
|
||||||
|
String type = itemsValEO.getPropertyType();
|
||||||
|
FileSplitValExportDto lastOne = new FileSplitValExportDto();
|
||||||
|
lastOne.setValType(type);
|
||||||
|
if(preType.equals(type) && "TEXT".equals(type)) {
|
||||||
|
lastOne = valContent.get(valContent.size() - 1);
|
||||||
|
lastOne.setValContent(lastOne.getValContent()+itemsValEO.getPropertyVal() + "\n");
|
||||||
|
valContent.set(valContent.size() - 1, lastOne);
|
||||||
|
} else if ("TEXT".equals(type)) {
|
||||||
|
lastOne.setValContent(lastOne.getValContent()+itemsValEO.getPropertyVal() + "\n");
|
||||||
|
valContent.add(lastOne);
|
||||||
|
} else if ("TABLE".equals(type)) {
|
||||||
|
String tableName = String.valueOf(tableIndex);
|
||||||
|
lastOne.setValContent("tableSheet" + tableName);
|
||||||
|
//查询table信息
|
||||||
|
SarFileSplitItemsTableEOPage tablePage = new SarFileSplitItemsTableEOPage();
|
||||||
|
tablePage.setItemsValId(itemsValEO.getId());
|
||||||
|
valContent.add(lastOne);
|
||||||
|
// List<List<SarFileSplitItemsTableEO>> tableList = combineTableList(itemsValEO);
|
||||||
|
FileSpiltValTableExportDto tableExportDto = new FileSpiltValTableExportDto();
|
||||||
|
tableExportDto.setTableName("tableSheet" + tableName);
|
||||||
|
// tableExportDto.setTableEOList(tableList);
|
||||||
|
tableExportDto.setTableHtCon(itemsValEO.getPropertyVal());
|
||||||
|
allTableList.add(tableExportDto);
|
||||||
|
tableIndex++;
|
||||||
|
page.setTableIndex(tableIndex);
|
||||||
|
} else if ("IMG".equals(type)) {
|
||||||
|
String imgContent = itemsValEO.getPropertyVal();
|
||||||
|
String imgUUIndex = "img" + String.valueOf(imgIndex);
|
||||||
|
if (StringUtils.isNotEmpty(imgContent)){
|
||||||
|
int pathIndex = imgContent.indexOf("src='file");
|
||||||
|
if (pathIndex==-1){
|
||||||
|
String sa = imgContent.replaceAll("\''","\'");
|
||||||
|
pathIndex = sa.indexOf("src='file");
|
||||||
|
}
|
||||||
|
if (pathIndex > -1 && imgContent.length()>(pathIndex+16)) {
|
||||||
|
String imgPath = imgContent.substring(pathIndex+16,imgContent.length()-2);
|
||||||
|
String imgName = imgUUIndex + "-" +imgPath.substring(imgPath.lastIndexOf("/")+1,imgPath.length());
|
||||||
|
lastOne.setValContent(imgUUIndex+".png");
|
||||||
|
final String[] split = imgName.split("-");
|
||||||
|
final String[] split1 = split[1].split("\\.");
|
||||||
|
lastOne.setValContent(split1[0]+".png");
|
||||||
|
valContent.add(lastOne);
|
||||||
|
FileSplitValImgExportDto fileSplitValImgExportDto = new FileSplitValImgExportDto();
|
||||||
|
fileSplitValImgExportDto.setImgName(imgUUIndex+".png");
|
||||||
|
if (StringUtils.isNotEmpty(itemsValEO.getImgName())) {
|
||||||
|
fileSplitValImgExportDto.setImgPath(itemsValEO.getImgName());
|
||||||
|
} else {
|
||||||
|
fileSplitValImgExportDto.setImgPath(imgPath);
|
||||||
|
}
|
||||||
|
allImgList.add(fileSplitValImgExportDto);
|
||||||
|
imgIndex++;
|
||||||
|
page.setImgIndex(imgIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preType = itemsValEO.getPropertyType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valContent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -1,12 +1,11 @@
|
|||||||
package com.adc.da.slrs.sarStandItems.entity;
|
package com.adc.da.slrs.sarStandItems.entity;
|
||||||
|
|
||||||
import com.adc.da.base.page.BasePage;
|
import com.adc.da.base.page.BasePage;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -36,4 +35,7 @@ public class FindSarItemsPageReqDTO extends BasePage {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "解读内容")
|
@ApiModelProperty(value = "解读内容")
|
||||||
private String readContent;
|
private String readContent;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选中的id")
|
||||||
|
private List<String> idList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.adc.da.slrs.sarStandItems.entity;
|
|||||||
|
|
||||||
import com.adc.da.base.entity.BaseEntity;
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
|
import com.adc.da.slrs.SarCompStatusInfo.entity.SarCompStatusInfo;
|
||||||
|
import com.adc.da.slrs.standardSplit.dto.FileSplitValExportDto;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -197,4 +197,7 @@ public class SarStandItems extends BaseEntity {
|
|||||||
@TableField("edit_flag")
|
@TableField("edit_flag")
|
||||||
private String editFlag;
|
private String editFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<FileSplitValExportDto> itemValContent;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+345
-5
@@ -2,9 +2,7 @@ package com.adc.da.slrs.standardSplit.controller;
|
|||||||
|
|
||||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
import com.adc.da.att.controller.AttFileEOController;
|
|
||||||
import com.adc.da.att.entity.AttFileEO;
|
import com.adc.da.att.entity.AttFileEO;
|
||||||
import com.adc.da.att.service.IAttFileEOService;
|
import com.adc.da.att.service.IAttFileEOService;
|
||||||
import com.adc.da.att.util.CommonExportUtil;
|
import com.adc.da.att.util.CommonExportUtil;
|
||||||
@@ -13,6 +11,10 @@ import com.adc.da.common.ConvertHtml2Excel;
|
|||||||
import com.adc.da.common.FileUnZip;
|
import com.adc.da.common.FileUnZip;
|
||||||
import com.adc.da.common.SplitTableInfo;
|
import com.adc.da.common.SplitTableInfo;
|
||||||
import com.adc.da.http.PageInfo;
|
import com.adc.da.http.PageInfo;
|
||||||
|
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
||||||
|
import com.adc.da.slrs.SarStandItemVal.service.ISarStandItemValService;
|
||||||
|
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||||
|
import com.adc.da.slrs.sarStandItems.service.impl.SarStandItemsServiceImpl;
|
||||||
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardsInfoEO;
|
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardsInfoEO;
|
||||||
import com.adc.da.slrs.standardSplit.dto.*;
|
import com.adc.da.slrs.standardSplit.dto.*;
|
||||||
import com.adc.da.slrs.standardSplit.entity.*;
|
import com.adc.da.slrs.standardSplit.entity.*;
|
||||||
@@ -21,10 +23,10 @@ import com.adc.da.sys.util.UUIDUtils;
|
|||||||
import com.adc.da.util.exception.AdcDaBaseException;
|
import com.adc.da.util.exception.AdcDaBaseException;
|
||||||
import com.adc.da.util.http.ResponseMessage;
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
import com.adc.da.util.http.Result;
|
import com.adc.da.util.http.Result;
|
||||||
import com.adc.da.util.utils.FileUtil;
|
|
||||||
import com.adc.da.util.utils.IOUtils;
|
import com.adc.da.util.utils.IOUtils;
|
||||||
import com.adc.da.utils.util.POIReadExcelToHtml;
|
import com.adc.da.utils.util.POIReadExcelToHtml;
|
||||||
import com.adc.da.common.ReadExcel;
|
import com.adc.da.common.ReadExcel;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -43,8 +45,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.adc.da.utils.util.ExcelUtil.checkObjAllFieldsIsNull;
|
import static com.adc.da.utils.util.ExcelUtil.checkObjAllFieldsIsNull;
|
||||||
@@ -74,6 +74,12 @@ public class SarFileSplitItemsEOController extends BaseController<SarFileSplitIt
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SarStandardsInfoEOService sarStandardsInfoEOService;
|
private SarStandardsInfoEOService sarStandardsInfoEOService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarStandItemsServiceImpl ServiceImpl;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarStandItemValService iSarStandItemValService;
|
||||||
|
|
||||||
@Value("${file.path}")
|
@Value("${file.path}")
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
|
||||||
@@ -823,4 +829,338 @@ public class SarFileSplitItemsEOController extends BaseController<SarFileSplitIt
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|SarFileSplitItemsEO|导出zip")
|
||||||
|
@GetMapping(value = "/exportStandardItemExcel")
|
||||||
|
public void exportStandardItemExcel(String idList, String exportName,String standId, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||||
|
OutputStream os = null;
|
||||||
|
OutputStream excelOS = null;
|
||||||
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||||
|
String fileOriName = "拆分条款信息";
|
||||||
|
if (StringUtils.isNotEmpty(exportName)) {
|
||||||
|
fileOriName = exportName;
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
//创建临时文件夹
|
||||||
|
String fileNowPath = uploadFilePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName;
|
||||||
|
File nowFile = new File(fileNowPath);
|
||||||
|
if (nowFile.exists()){
|
||||||
|
nowFile.delete();
|
||||||
|
}
|
||||||
|
nowFile.mkdirs();
|
||||||
|
String fileName = fileOriName + ".xls";
|
||||||
|
HSSFSheet sheetItems = workbook.createSheet("条款内容");
|
||||||
|
String[] headers = {"条款号","条款名称","内容简介"};
|
||||||
|
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
||||||
|
cellStyle.setWrapText(true);
|
||||||
|
// cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
HSSFCellStyle cellStyle1 =workbook.createCellStyle();
|
||||||
|
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
HSSFCellStyle cellStyleLink =workbook.createCellStyle();
|
||||||
|
HSSFFont font = workbook.createFont();
|
||||||
|
font.setColor(IndexedColors.LIGHT_BLUE.index);
|
||||||
|
cellStyleLink.setFont(font);
|
||||||
|
cellStyleLink.setWrapText(true);
|
||||||
|
List<String> ids = new ArrayList<>();
|
||||||
|
QueryWrapper<SarStandItems> objectQueryWrapper = new QueryWrapper<>();
|
||||||
|
SarFileSplitItemsEOPage page = new SarFileSplitItemsEOPage();
|
||||||
|
if (StringUtils.isNotEmpty(idList)) {
|
||||||
|
String[] idArr = idList.split(",");
|
||||||
|
List<String> itemIdList = Arrays.asList(idArr);
|
||||||
|
if(!itemIdList.isEmpty()){
|
||||||
|
for (String id :itemIdList) {
|
||||||
|
ids.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
page.setIdList(itemIdList);
|
||||||
|
}
|
||||||
|
//查询全部条款
|
||||||
|
page.setInfoId(null);
|
||||||
|
page.setOrderBy(null);
|
||||||
|
|
||||||
|
if(!ids.isEmpty()){
|
||||||
|
objectQueryWrapper.in("ID", ids);
|
||||||
|
}
|
||||||
|
//查询全部条款
|
||||||
|
objectQueryWrapper.orderByAsc("ITEMS_NUM");
|
||||||
|
if(StringUtils.isNotBlank(standId)) {
|
||||||
|
objectQueryWrapper.eq("STAND_ID", standId);
|
||||||
|
}
|
||||||
|
List<SarStandItems> allItemsList = ServiceImpl.list(objectQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
List<FileSpiltValTableExportDto> allTableList = new ArrayList<>();
|
||||||
|
List<FileSplitValImgExportDto> allImgList = new ArrayList<>();
|
||||||
|
List<AttFileEO> allRelevFileList = new ArrayList<>();
|
||||||
|
int countMaxFile = 1;
|
||||||
|
String fileIds = "";
|
||||||
|
if (allItemsList != null && !allItemsList.isEmpty()) {
|
||||||
|
for (SarStandItems itemsExportDto : allItemsList) {
|
||||||
|
QueryWrapper<SarStandItemVal> sarStandItemValQueryWrapper = new QueryWrapper<>();
|
||||||
|
sarStandItemValQueryWrapper.orderByDesc("CREATION_TIME");
|
||||||
|
sarStandItemValQueryWrapper.in("ITEM_ID",itemsExportDto.getId());
|
||||||
|
List<SarStandItemVal> getValList = iSarStandItemValService.list(sarStandItemValQueryWrapper);
|
||||||
|
|
||||||
|
for (SarStandItemVal sarStandItemVal : getValList){
|
||||||
|
//判断数据是否是img
|
||||||
|
if(sarStandItemVal.getPropertyType().equals("img") || sarStandItemVal.getPropertyType().equals("IMG")){
|
||||||
|
//进行分割
|
||||||
|
String[] split = sarStandItemVal.getPropertyVal().split("=");
|
||||||
|
//获取图片id
|
||||||
|
String[] split1 = split[3].split("'");
|
||||||
|
sarStandItemVal.setPropertyVal(split1[0]);
|
||||||
|
//循环数据 获取id
|
||||||
|
if(StringUtils.isBlank(fileIds)){
|
||||||
|
fileIds = split1[0];
|
||||||
|
}else {
|
||||||
|
fileIds += ","+split1[0];
|
||||||
|
}
|
||||||
|
AttFileEO fileInfo = attFileEOService.getFileInfo(sarStandItemVal.getPropertyVal());
|
||||||
|
String excelImageUrl = "src='file:///E:/data/slrs/file"+fileInfo.getFilePath()+fileInfo.getOldFileName();
|
||||||
|
// 数据加工
|
||||||
|
sarStandItemVal.setPropertyVal(excelImageUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<FileSplitValExportDto> valContentList = iSarStandItemValService.combineItemValInfo(getValList,allTableList,allImgList,page);
|
||||||
|
itemsExportDto.setItemValContent(valContentList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 在excel表中添加表头
|
||||||
|
HSSFRow row = sheetItems.createRow(0);
|
||||||
|
sheetItems.setColumnWidth(0,10*256);
|
||||||
|
sheetItems.setColumnWidth(1,20*256);
|
||||||
|
sheetItems.setColumnWidth(2,100*256);
|
||||||
|
sheetItems.setColumnWidth(3,20*256);
|
||||||
|
sheetItems.setColumnWidth(4,20*256);
|
||||||
|
sheetItems.setColumnWidth(5,20*256);
|
||||||
|
sheetItems.setColumnWidth(6,20*256);
|
||||||
|
sheetItems.setColumnWidth(7,20*256);
|
||||||
|
sheetItems.setColumnWidth(8,20*256);
|
||||||
|
sheetItems.setColumnWidth(9,20*256);
|
||||||
|
|
||||||
|
for (int i = 0; i < headers.length; i++) {
|
||||||
|
HSSFCell cell = row.createCell(i);
|
||||||
|
HSSFRichTextString text = new HSSFRichTextString(headers[i]);
|
||||||
|
cell.setCellValue(text);
|
||||||
|
cell.setCellStyle(cellStyle1);
|
||||||
|
}
|
||||||
|
//放文字内容
|
||||||
|
int allRow = 0;
|
||||||
|
for(int rowNum = 0;rowNum < allItemsList.size(); rowNum++){
|
||||||
|
SarStandItems exportDto = allItemsList.get(rowNum);
|
||||||
|
List<FileSplitValExportDto> valList = exportDto.getItemValContent();
|
||||||
|
int countFile = 0;
|
||||||
|
if(valList != null && !valList.isEmpty()){
|
||||||
|
int startRow = allRow + 1;
|
||||||
|
for (int valRow=0;valRow<valList.size();valRow++) {
|
||||||
|
allRow++;
|
||||||
|
HSSFRow row1 = sheetItems.createRow(allRow);
|
||||||
|
row1.createCell(0).setCellValue(exportDto.getItemsNum());
|
||||||
|
row1.getCell(0).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(1).setCellValue(exportDto.getItemsName());
|
||||||
|
row1.getCell(1).setCellStyle(cellStyle);
|
||||||
|
HSSFCell cell2 = row1.createCell(2);
|
||||||
|
row1.getCell(2).setCellStyle(cellStyle);
|
||||||
|
String content = valList.get(valRow).getValContent();
|
||||||
|
if (StringUtils.isNotEmpty(content)) {
|
||||||
|
content = content.replaceAll("null","");
|
||||||
|
if (content.lastIndexOf("\n") > -1) {
|
||||||
|
content = content.substring(0,content.lastIndexOf("\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//处理上下角标
|
||||||
|
List<SplitFont> subList = new ArrayList<>();
|
||||||
|
List<SplitFont> supList = new ArrayList<>();
|
||||||
|
boolean handleCorner = false;
|
||||||
|
if (content.contains("<span class=sup>")) {
|
||||||
|
handleCornerMarkers(content, supList, "<span class=sup>","<span class=sub>");
|
||||||
|
}
|
||||||
|
if (content.contains("<span class=sub>")) {
|
||||||
|
handleCornerMarkers(content, subList, "<span class=sub>","<span class=sub>");
|
||||||
|
}
|
||||||
|
if (subList.size() > 0 || supList.size() > 0) {
|
||||||
|
content = content.replaceAll("<span class=sup>", "");
|
||||||
|
content = content.replaceAll("<span class=sub>", "");
|
||||||
|
content = content.replaceAll("</span>", "");
|
||||||
|
//设置角标font
|
||||||
|
HSSFFont fontSub = workbook.createFont();
|
||||||
|
fontSub.setTypeOffset(HSSFFont.SS_SUB);
|
||||||
|
HSSFFont fontSup = workbook.createFont();
|
||||||
|
fontSup.setTypeOffset(HSSFFont.SS_SUPER);
|
||||||
|
|
||||||
|
RichTextString richTextString = new HSSFRichTextString(content);
|
||||||
|
if (subList.size() > 0) {
|
||||||
|
for (SplitFont splitFont : subList) {
|
||||||
|
richTextString.applyFont(splitFont.getStartIndex(),splitFont.getEndIndex(),fontSub);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (supList.size() > 0) {
|
||||||
|
for (SplitFont splitFont : supList) {
|
||||||
|
richTextString.applyFont(splitFont.getStartIndex(),splitFont.getEndIndex(),fontSup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cell2.setCellValue(richTextString);
|
||||||
|
handleCorner = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if("TABLE".equals(valList.get(valRow).getValType())){
|
||||||
|
/* 连接跳转*/
|
||||||
|
CreationHelper createHelper = workbook.getCreationHelper();
|
||||||
|
Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.DOCUMENT);
|
||||||
|
String tableName = "#\'"+ content + "\'!A1";
|
||||||
|
hyperlink1.setAddress(tableName);
|
||||||
|
cell2.setHyperlink(hyperlink1);// 链接
|
||||||
|
row1.getCell(2).setCellStyle(cellStyleLink);
|
||||||
|
} //else if ("IMG".equals(valList.get(valRow).getValType())) {
|
||||||
|
if ("IMG".equals(valList.get(valRow).getValType())) {
|
||||||
|
/* 连接跳转*/
|
||||||
|
CreationHelper createHelper = workbook.getCreationHelper();
|
||||||
|
Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.FILE);
|
||||||
|
String imgName = content;
|
||||||
|
hyperlink1.setAddress(imgName);
|
||||||
|
cell2.setHyperlink(hyperlink1);// 链接
|
||||||
|
row1.getCell(2).setCellStyle(cellStyleLink);
|
||||||
|
}
|
||||||
|
if (!handleCorner) {
|
||||||
|
cell2.setCellValue(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
row1.createCell(3).setCellValue(exportDto.getResponsibleUnitShow());
|
||||||
|
row1.getCell(3).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(4).setCellValue(exportDto.getFoShow());
|
||||||
|
row1.getCell(4).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(5).setCellValue(exportDto.getDutyEngineerShow());
|
||||||
|
row1.getCell(5).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(6).setCellValue(exportDto.getSvpps());
|
||||||
|
row1.getCell(6).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(7).setCellValue(exportDto.getApplyArctic());
|
||||||
|
row1.getCell(7).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(8).setCellValue(exportDto.getClaimTypeShow());
|
||||||
|
row1.getCell(8).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(9).setCellValue(exportDto.getBusStandCover());
|
||||||
|
row1.getCell(9).setCellStyle(cellStyle);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (allRow > startRow) {
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,0,0));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,1,1));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,3,3));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,4,4));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,5,5));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,6,6));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,7,7));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,8,8));
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(startRow,allRow,9,9));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
allRow++;
|
||||||
|
HSSFRow row1 = sheetItems.createRow(allRow);
|
||||||
|
row1.createCell(0).setCellValue(exportDto.getItemsNum());
|
||||||
|
row1.getCell(0).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(1).setCellValue(exportDto.getItemsName());
|
||||||
|
row1.getCell(1).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(2).setCellValue("");
|
||||||
|
row1.getCell(2).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(3).setCellValue(exportDto.getResponsibleUnitShow());
|
||||||
|
row1.getCell(3).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(4).setCellValue(exportDto.getFoShow());
|
||||||
|
row1.getCell(4).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(5).setCellValue(exportDto.getDutyEngineerShow());
|
||||||
|
row1.getCell(5).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(6).setCellValue(exportDto.getSvpps());
|
||||||
|
row1.getCell(6).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(7).setCellValue(exportDto.getApplyArctic());
|
||||||
|
row1.getCell(7).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(8).setCellValue(exportDto.getClaimTypeShow());
|
||||||
|
row1.getCell(8).setCellStyle(cellStyle);
|
||||||
|
row1.createCell(9).setCellValue(exportDto.getBusStandCover());
|
||||||
|
row1.getCell(9).setCellStyle(cellStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (countMaxFile > 1) {
|
||||||
|
for (int i=1;i<countMaxFile;i++) {
|
||||||
|
sheetItems.setColumnWidth(9+i,40*256);
|
||||||
|
}
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(0,0,9,9+countMaxFile-1));
|
||||||
|
}
|
||||||
|
// 放表格内容
|
||||||
|
if(allTableList!= null && !allTableList.isEmpty()){
|
||||||
|
for(FileSpiltValTableExportDto tableExportDto : allTableList){
|
||||||
|
// List<List<SarFileSplitItemsTableEO>> rowtableList = tableExportDto.getTableEOList();
|
||||||
|
// HSSFSheet sheetTable = workbook.createSheet(tableExportDto.getTableName());
|
||||||
|
String tableName = tableExportDto.getTableName();
|
||||||
|
String tableHtml = tableExportDto.getTableHtCon();
|
||||||
|
if (StringUtils.isNotEmpty(tableHtml) && tableHtml.indexOf("<tbody>") < 0) {
|
||||||
|
if (tableHtml.indexOf("<thead>") < 0) {
|
||||||
|
tableHtml = tableHtml.replaceFirst("<tr>","<tbody><tr>");
|
||||||
|
tableHtml = tableHtml.replaceFirst("</table>","</tbody></table>");
|
||||||
|
} else {
|
||||||
|
tableHtml = tableHtml.replaceFirst("</thead>","</thead><tbody>");
|
||||||
|
tableHtml = tableHtml.replaceFirst("</table>","</tbody></table>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String cnt = "\n";
|
||||||
|
tableHtml = tableHtml.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt);
|
||||||
|
workbook = ConvertHtml2Excel.table2Excel(tableHtml,workbook,tableName);
|
||||||
|
// for (int r=0;r<rowtableList.size();r++) {
|
||||||
|
// List<SarFileSplitItemsTableEO> colTableList = rowtableList.get(r);
|
||||||
|
// HSSFRow tRow = sheetTable.createRow(colTableList.get(0).getRowNum()-1);
|
||||||
|
// for(int c=0;c<colTableList.size();c++){
|
||||||
|
// SarFileSplitItemsTableEO tableEO = colTableList.get(c);
|
||||||
|
// tRow.createCell(tableEO.getColNum()-1).setCellValue(tableEO.getContent());
|
||||||
|
// tRow.getCell(tableEO.getColNum()-1).setCellStyle(cellStyle);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//下载图片内容
|
||||||
|
if (allImgList != null && !allImgList.isEmpty()) {
|
||||||
|
sarFileSplitItemsEOService.downLoadImgList(allImgList,fileNowPath);
|
||||||
|
}
|
||||||
|
//下载关联文件内容
|
||||||
|
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
|
||||||
|
sarFileSplitItemsEOService.downLoadFileList(allRelevFileList,fileNowPath);
|
||||||
|
}
|
||||||
|
String repFileName = fileName.replaceAll("/","_");
|
||||||
|
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
||||||
|
response.setHeader("Content-Disposition",
|
||||||
|
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
||||||
|
response.setContentType("application/force-download");
|
||||||
|
response.flushBuffer();
|
||||||
|
os = response.getOutputStream();
|
||||||
|
workbook.write(excelOS);
|
||||||
|
excelOS.flush();
|
||||||
|
excelOS.close();
|
||||||
|
List<AttFileEO> multiFileInfos = this.attFileEOService.getMultiFileInfos(fileIds);
|
||||||
|
if(CollectionUtils.isNotEmpty(multiFileInfos)){
|
||||||
|
for (AttFileEO data : multiFileInfos){
|
||||||
|
if(StringUtils.isNotBlank(data.getOldFileName())){
|
||||||
|
String[] split = data.getOldFileName().split("\\.");
|
||||||
|
//存在则更换后缀
|
||||||
|
if(split.length>0){
|
||||||
|
data.setOldFileName(split[0]+".png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.attFileEOService.downLoadFileList(multiFileInfos,fileNowPath);
|
||||||
|
}
|
||||||
|
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||||
|
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||||
|
int len = 0;
|
||||||
|
while ((len = fis.read()) != -1) {
|
||||||
|
os.write(len);
|
||||||
|
}
|
||||||
|
os.flush();
|
||||||
|
os.close(); // 后开先关
|
||||||
|
fis.close(); // 先开后关
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||||
|
} finally {
|
||||||
|
IOUtils.closeQuietly(os);
|
||||||
|
IOUtils.closeQuietly(excelOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-4
@@ -6,6 +6,8 @@ import com.adc.da.att.vo.AttFileVo;
|
|||||||
import com.adc.da.common.FileUnZip;
|
import com.adc.da.common.FileUnZip;
|
||||||
import com.adc.da.common.SplitTableInfo;
|
import com.adc.da.common.SplitTableInfo;
|
||||||
import com.adc.da.login.util.UserUtils;
|
import com.adc.da.login.util.UserUtils;
|
||||||
|
import com.adc.da.slrs.SarStandItemVal.dao.SarStandItemValDao;
|
||||||
|
import com.adc.da.slrs.SarStandItemVal.entity.SarStandItemVal;
|
||||||
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
|
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
|
||||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||||
import com.adc.da.slrs.standardSplit.dao.*;
|
import com.adc.da.slrs.standardSplit.dao.*;
|
||||||
@@ -38,8 +40,6 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.adc.da.utils.util.ExcelUtil.checkObjAllFieldsIsNull;
|
import static com.adc.da.utils.util.ExcelUtil.checkObjAllFieldsIsNull;
|
||||||
@@ -81,6 +81,8 @@ public class SarFileSplitItemsEOServiceImpl implements SarFileSplitItemsEOServic
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SarStandItemsDao sarStandItemsDao;
|
private SarStandItemsDao sarStandItemsDao;
|
||||||
|
@Autowired
|
||||||
|
private SarStandItemValDao sarStandItemValDao;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1081,7 +1083,22 @@ public class SarFileSplitItemsEOServiceImpl implements SarFileSplitItemsEOServic
|
|||||||
//加入的里面 删除旧的
|
//加入的里面 删除旧的
|
||||||
QueryWrapper<SarStandItems> objectQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<SarStandItems> objectQueryWrapper = new QueryWrapper<>();
|
||||||
objectQueryWrapper.eq("STAND_ID",sarFileSplitInfoEO.getStandId());
|
objectQueryWrapper.eq("STAND_ID",sarFileSplitInfoEO.getStandId());
|
||||||
sarStandItemsDao.delete(objectQueryWrapper);
|
List<SarStandItems> sarStandItemsList = sarStandItemsDao.selectList(objectQueryWrapper);
|
||||||
|
if(!sarStandItemsList.isEmpty()){
|
||||||
|
List<String> setIds = new ArrayList<>();
|
||||||
|
for (SarStandItems sarStandItems:sarStandItemsList) {
|
||||||
|
setIds.add(sarStandItems.getId());
|
||||||
|
}
|
||||||
|
if(!setIds.isEmpty()){
|
||||||
|
//加入的里面 删除旧的
|
||||||
|
QueryWrapper<SarStandItems> objectQueryWrapperDelete = new QueryWrapper<>();
|
||||||
|
objectQueryWrapperDelete.in("ID",setIds);
|
||||||
|
sarStandItemsDao.delete(objectQueryWrapperDelete);
|
||||||
|
sarStandItemValDao.deleteByItemsIds(setIds);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//加入的里面
|
//加入的里面
|
||||||
for (SarFileSplitItemsEO itemsEO : addItemsEOList){
|
for (SarFileSplitItemsEO itemsEO : addItemsEOList){
|
||||||
if(itemsEO.getItemsNum().equals("总目录")) {
|
if(itemsEO.getItemsNum().equals("总目录")) {
|
||||||
@@ -1094,8 +1111,23 @@ public class SarFileSplitItemsEOServiceImpl implements SarFileSplitItemsEOServic
|
|||||||
sarStandItems.setItemsName(itemsEO.getItemsName());
|
sarStandItems.setItemsName(itemsEO.getItemsName());
|
||||||
sarStandItems.setTermsConditions(itemsEO.getItermsConditions());
|
sarStandItems.setTermsConditions(itemsEO.getItermsConditions());
|
||||||
sarStandItems.setDutyEngineer(itemsEO.getDutyEngineer());
|
sarStandItems.setDutyEngineer(itemsEO.getDutyEngineer());
|
||||||
sarStandItems.setId(UUIDUtils.randomUUID20());
|
String uuId = UUIDUtils.randomUUID20();
|
||||||
|
sarStandItems.setId(uuId);
|
||||||
sarStandItemsDao.insert(sarStandItems);
|
sarStandItemsDao.insert(sarStandItems);
|
||||||
|
List<SarFileSplitItemsValEO> itemValEOList = itemsEO.getItemValEOList();
|
||||||
|
if(!itemValEOList.isEmpty()){
|
||||||
|
for (SarFileSplitItemsValEO itemsValEO: itemValEOList){
|
||||||
|
SarStandItemVal sarStandItemVal = new SarStandItemVal();
|
||||||
|
sarStandItemVal.setItemId(uuId);
|
||||||
|
sarStandItemVal.setCreationTime(new Date());
|
||||||
|
sarStandItemVal.setPropertyType(itemsValEO.getType());
|
||||||
|
sarStandItemVal.setPropertyVal(itemsValEO.getItemContent());
|
||||||
|
sarStandItemVal.setValidFlag(0);
|
||||||
|
sarStandItemVal.setId(UUIDUtils.randomUUID20());
|
||||||
|
sarStandItemValDao.insert(sarStandItemVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//统计成功结果需要去掉总目录这条数据
|
//统计成功结果需要去掉总目录这条数据
|
||||||
String msg = "成功导入" + (countSuccess-1) + "条";
|
String msg = "成功导入" + (countSuccess-1) + "条";
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- 福田数据库 表字段 记录 字典 等信息记录
|
||||||
|
-- 2023-04-14 16:27 生产环境未同步
|
||||||
|
-- 更改 sar_stand_item_val 表PROOERTY_VAL 类型 varchar 为 text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user