11.24 异步操作添加 导出字段删除 查询修改

This commit is contained in:
yuezhihang
2021-11-24 10:55:35 +08:00
parent 36c91409fa
commit 3c46d1f88d
9 changed files with 68 additions and 14 deletions
@@ -161,4 +161,17 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
public ResponseMessage<List<SelectionResult>> selectFileFieldForSel1(){
return Result.success(sarStandAttrDetailsEOService.selectFileFieldForSel1(null));
}
@ApiOperation(value = "|SarStandAttrDetailsEO|查询标准中所有文件类型")
@GetMapping("/getListData")
// @RequiresPermissions("lawss:sarStandAttrDetails:get")
public ResponseMessage<List<SarStandAttrDetails>> getListData(){
QueryWrapper<SarStandAttrDetails> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("ATTR_TYPE","file");
List<SarStandAttrDetails> sarStandAttrDetails=sarStandAttrDetailsEOService.list(queryWrapper);
return Result.success(sarStandAttrDetails);
}
}
@@ -0,0 +1,12 @@
package com.adc.da.slrs.sarStandAttrDetails.entity;
import lombok.Data;
@Data
public class listDTO {
private String key;
private String value;
}
@@ -190,7 +190,7 @@ public class SarFileSplitItemsEOController extends BaseController<SarFileSplitIt
nowFile.mkdirs();
String fileName = fileOriName + ".xls";
HSSFSheet sheetItems = workbook.createSheet("条款内容");
String[] headers = {"条款号","条款名称","内容简介","责任部门","FO","责任工程师","SVPPS","适用车辆类型","要求类型","企标覆盖关系"};
String[] headers = {"条款号","条款名称","内容简介"};
HSSFCellStyle cellStyle =workbook.createCellStyle();
cellStyle.setWrapText(true);
// cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
@@ -4,6 +4,7 @@ import com.adc.da.base.web.BaseController;
import com.adc.da.http.PageInfo;
import com.adc.da.person.dao.PersonCollectEODao;
import com.adc.da.person.dao.PersonShareEODao;
import com.adc.da.slrs.standardSplit.dao.SarStandCompareHisEODao;
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO;
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEOPage;
import com.adc.da.slrs.standardSplit.service.SarItemsCompareHisEOService;
@@ -18,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@@ -46,6 +48,9 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
@Autowired
private PersonCollectEODao personCollectEODao;
@Autowired
private SarStandCompareHisEODao dao;
@ApiOperation(value = "|SarStandCompareHisEO|分页查询")
@GetMapping("/page")
// @RequiresPermissions("lawss:sarStandCompareHis:page")
@@ -126,8 +131,15 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
@ApiOperation(value = "全文比对")
@PostMapping("/fullTextComparison")
public ResponseMessage<Map<String,Object>> fullTextComparison(String leftStandard, String rightStandard) throws Exception {
Map<String,Object> resultMap = sarStandCompareHisEOService.fullTextComparison(leftStandard,rightStandard);
return Result.success(resultMap);
public ResponseMessage<String> fullTextComparison(String leftStandard, String rightStandard) throws Exception {
String id=UUIDUtils.randomUUID(32);
SarStandCompareHisEO sarStandCompareHisEO =new SarStandCompareHisEO();
sarStandCompareHisEO.setId(id);
sarStandCompareHisEO.setCompareStatus("比对中");
sarStandCompareHisEO.setCompareType("全文比对");
sarStandCompareHisEO.setCreateTime(new Date());
dao.insertSelective(sarStandCompareHisEO);
Map<String,Object> resultMap = sarStandCompareHisEOService.fullTextComparison(leftStandard,rightStandard,id);
return Result.success("标准正在比对中请稍后查看结果");
}
}
@@ -2,6 +2,7 @@ package com.adc.da.slrs.standardSplit.entity;
import com.adc.da.base.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
@@ -13,6 +14,7 @@ import java.util.List;
* <b>日期:</b> 2020-02-24 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/
@Data
public class SarStandCompareHisEO extends BaseEntity {
private String compareType;
@@ -36,6 +38,7 @@ public class SarStandCompareHisEO extends BaseEntity {
private String newFileTypeShow;
private String newSarType;
private String collectId;
private String compareStatus;
private List<SarStandItemsCompareHisEO> resLeftMapList = new ArrayList<>();
@@ -1,6 +1,7 @@
package com.adc.da.slrs.standardSplit.entity;
import com.adc.da.base.page.BasePage;
import lombok.Data;
/**
* <b>功能:</b>SAR_STAND_COMPARE_HIS SarStandCompareHisEOPage<br>
@@ -8,6 +9,7 @@ import com.adc.da.base.page.BasePage;
* <b>日期:</b> 2020-02-24 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/
@Data
public class SarStandCompareHisEOPage extends BasePage {
private String compareType;
@@ -50,6 +52,7 @@ public class SarStandCompareHisEOPage extends BasePage {
private String oldNumOrName;
private String newNumOrName;
private String compareStatus;
private String shunxu;
@@ -21,5 +21,5 @@ public interface SarStandCompareHisEOService {
Map<String,Object> clauseComparison(String oldItemId, String newItemId, String standHisId);
Map<String,Object> fullTextComparison(String leftStandard, String rightStandard) throws Exception;
Map<String,Object> fullTextComparison(String leftStandard, String rightStandard,String id) throws Exception;
}
@@ -245,9 +245,9 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
}
return resultMap;
}
@Async
@Override
public Map<String, Object> fullTextComparison(String leftStandard, String rightStandard) throws Exception{
public Map<String, Object> fullTextComparison(String leftStandard, String rightStandard,String id) throws Exception{
Map<String,Object> resultMap = new HashMap<String,Object>();
List<Map<String,Object>> leftMapList = fullTextComparePackageData(leftStandard);
List<Map<String,Object>> rightMapList = fullTextComparePackageData(rightStandard);
@@ -281,7 +281,7 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
resultMap.put("resRightMapList",resRightMapList);
}
//往全文比对历史表中添加数据
addStandCompareHis(leftStandard,rightStandard,"全文比对",resLeftMapList,resRightMapList);
addStandCompareHis(leftStandard,rightStandard,"全文比对",resLeftMapList,resRightMapList,id);
return resultMap;
}
@@ -319,12 +319,12 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
**/
@Async
public void addStandCompareHis(String leftStandId,String rightStandId,String compareType,
List<Map<String,Object>> resLeftMapList,List<Map<String,Object>> resRightMapList) throws Exception{
List<Map<String,Object>> resLeftMapList,List<Map<String,Object>> resRightMapList,String id) throws Exception{
SarFileSplitInfoEO leftInfo = sarFileSplitInfoEOService.selectByPrimaryKey(leftStandId);
SarFileSplitInfoEO rightInfo = sarFileSplitInfoEOService.selectByPrimaryKey(rightStandId);
//保存标准比对历史表数据
SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO();
String id = UUIDUtils.randomUUID20();
// String id = UUIDUtils.randomUUID20();
sarStandCompareHisEO.setId(id);
sarStandCompareHisEO.setOldStandId(leftStandId);
sarStandCompareHisEO.setNewStandId(rightStandId);
@@ -341,7 +341,8 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setCompareType(compareType);
dao.insertSelective(sarStandCompareHisEO);
sarStandCompareHisEO.setCompareStatus("比对完成");
dao.updateByPrimaryKeySelective(sarStandCompareHisEO);
//保存标准的所有条款比对的历史数据
if(resLeftMapList!=null && !resLeftMapList.isEmpty()) {
setStandCompareHisEO(resLeftMapList, id, "LEFT");
@@ -19,11 +19,12 @@
<result column="modify_time" property="modifyTime" />
<result column="new_file_type" property="newFileType" />
<result column="new_sar_type" property="newSarType" />
<result column="compare_status" property="compareStatus"/>
</resultMap>
<!-- SAR_STAND_COMPARE_HIS table all fields -->
<sql id="Base_Column_List" >
compare_type, id, old_stand_id, old_stand_num, old_stand_name, new_stand_id, new_stand_num, new_stand_name, old_file_type, old_sar_type, create_user, create_time, modify_user, modify_time, new_file_type, new_sar_type
compare_type, id, old_stand_id, old_stand_num, old_stand_name, new_stand_id, new_stand_num, new_stand_name, old_file_type, old_sar_type, create_user, create_time, modify_user, modify_time, new_file_type, new_sar_type ,compare_status
</sql>
<!-- 查询条件 -->
@@ -89,6 +90,9 @@
</if>
<if test="newSarType != null" >
and new_sar_type ${newSarTypeOperator} #{newSarType}
</if>
<if test="compareStatus != null" >
and compare_status = #{compareStatus}
</if>
<if test="oldNumOrName != null" >
and (old_stand_num like concat('%',#{oldNumOrName},'%') OR old_stand_name like concat('%',#{oldNumOrName},'%'))
@@ -105,7 +109,7 @@
SELECT SEQ_SAR_STAND_COMPARE_HIS.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_STAND_COMPARE_HIS(<include refid="Base_Column_List" />)
values (#{compareType, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{oldStandId, jdbcType=VARCHAR}, #{oldStandNum, jdbcType=VARCHAR}, #{oldStandName, jdbcType=VARCHAR}, #{newStandId, jdbcType=VARCHAR}, #{newStandNum, jdbcType=VARCHAR}, #{newStandName, jdbcType=VARCHAR}, #{oldFileType, jdbcType=VARCHAR}, #{oldSarType, jdbcType=VARCHAR}, #{createUser, jdbcType=VARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{newFileType, jdbcType=VARCHAR}, #{newSarType, jdbcType=VARCHAR})
values (#{compareType, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{oldStandId, jdbcType=VARCHAR}, #{oldStandNum, jdbcType=VARCHAR}, #{oldStandName, jdbcType=VARCHAR}, #{newStandId, jdbcType=VARCHAR}, #{newStandNum, jdbcType=VARCHAR}, #{newStandName, jdbcType=VARCHAR}, #{oldFileType, jdbcType=VARCHAR}, #{oldSarType, jdbcType=VARCHAR}, #{createUser, jdbcType=VARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{newFileType, jdbcType=VARCHAR}, #{newSarType, jdbcType=VARCHAR},#{compareStatus, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
@@ -131,6 +135,7 @@
<if test="modifyTime != null" >modify_time,</if>
<if test="newFileType != null" >new_file_type,</if>
<if test="newSarType != null" >new_sar_type,</if>
<if test="compareStatus != null" >compare_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="compareType != null" >#{compareType, jdbcType=VARCHAR},</if>
@@ -149,6 +154,7 @@
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="newFileType != null" >#{newFileType, jdbcType=VARCHAR},</if>
<if test="newSarType != null" >#{newSarType, jdbcType=VARCHAR},</if>
<if test="compareStatus != null" >#{compareStatus, jdbcType=VARCHAR},</if>
</trim>
</insert>
@@ -169,7 +175,8 @@
modify_user = #{modifyUser},
modify_time = #{modifyTime},
new_file_type = #{newFileType},
new_sar_type = #{newSarType}
new_sar_type = #{newSarType},
compare_status = #{compareStatus}
where id = #{id}
</update>
@@ -222,6 +229,9 @@
<if test="newSarType != null" >
new_sar_type = #{newSarType},
</if>
<if test="compareStatus != null" >
compare_status = #{compareStatus},
</if>
</set>
where id = #{id}
</update>