fix(自定义对比): 78391

This commit is contained in:
yjz
2023-11-15 09:16:01 +08:00
parent 3f3e39179d
commit 80ba36b0ae
3 changed files with 25 additions and 2 deletions
@@ -180,6 +180,7 @@ public class LawsCustomCompareInfoController {
@RequiresPermissions("customComparison:edit")
public Result<IPage<StandardVO>> saveCell(@RequestBody LawsCustomCompareCell lawsCustomCompareCell) {
lawsCustomCompareCellService.saveOrUpdate(lawsCustomCompareCell);
lawsCustomCompareInfoService.editCompareCreateTime(lawsCustomCompareCell.getInfoId());
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -193,6 +194,7 @@ public class LawsCustomCompareInfoController {
@RequiresPermissions("customComparison:edit")
public Result<IPage<StandardVO>> saveCellCompareResult(@RequestBody LawsCustomCompareInventory lawsCustomCompareCell) {
lawsCustomCompareInventoryService.saveOrUpdate(lawsCustomCompareCell);
lawsCustomCompareInfoService.editCompareCreateTime(lawsCustomCompareCell.getInfoId());
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -219,6 +221,7 @@ public class LawsCustomCompareInfoController {
@RequiresPermissions("customComparison:edit")
public Result<T> save(@RequestBody LawsCustomCompareInfo lawsCustomCompareInfo) {
lawsCustomCompareInfoService.saveOrUpdate(lawsCustomCompareInfo);
lawsCustomCompareInfoService.editCompareCreateTime(lawsCustomCompareInfo.getId());
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -233,6 +236,7 @@ public class LawsCustomCompareInfoController {
public Result<T> delById(@RequestBody Map<String, Object> map) {
if (map.containsKey("id")){
lawsCustomCompareInfoService.delById((String) map.get("id"));
lawsCustomCompareInfoService.editCompareCreateTime((String) map.get("id"));
}
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -248,6 +252,7 @@ public class LawsCustomCompareInfoController {
public Result<T> delInventoryById(@RequestBody Map<String, Object> map) {
if (map.containsKey("id")){
lawsCustomCompareInventoryService.removeById((String) map.get("id"));
lawsCustomCompareInfoService.editCompareCreateTime((String) map.get("id"));
}
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
@@ -107,5 +107,11 @@ public interface ILawsCustomCompareInfoService extends IService<LawsCustomCompar
* @param map
*/
void editInventory(Map<String, Object> map);
/**
* 自定义对比-更新对比时间
* @param id
*/
void editCompareCreateTime(String id);
}
@@ -247,6 +247,7 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
.eq(LawsCustomCompareCell::getInfoId, lawsCustomCompareInfo.getId())
.notIn(LawsCustomCompareCell::getStandardId, standardIdList));
}
editCompareCreateTime(lawsCustomCompareInfo.getId());
return lawsCustomCompareInfo.getId();
}
@@ -344,6 +345,7 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
new LambdaQueryWrapper<LawsCustomCompareInfoStandard>()
.eq(LawsCustomCompareInfoStandard::getInfoId, infoId)
.eq(LawsCustomCompareInfoStandard::getStandardId, standardId));
editCompareCreateTime(standardId);
}
@Override
@@ -434,6 +436,14 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
.or().eq(LawsCustomCompareCell::getCompareItemId, idList)));
}
}
editCompareCreateTime(infoId);
}
@Override
public void editCompareCreateTime(String id) {
update(new LambdaUpdateWrapper<LawsCustomCompareInfo>()
.eq(LawsCustomCompareInfo::getId, id)
.set(LawsCustomCompareInfo::getCreateTime, new Date()));
}
private void createTableCellContent(XSSFSheet sheet, List<StandardVO> standardVOS, List<LawsCustomCompareInventory> featureList, List<LawsCustomCompareInventory> compareList, List<LawsCustomCompareCell> list, CellStyle cellStyle) {
@@ -496,14 +506,16 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl<LawsCustomComp
private void writeFile(LawsCustomCompareCell v) {
if (StringUtils.isNotBlank(v.getFileId())){
String exportPath = exportExcelTempPath.replace("exportExcelTemp", "清单详情");
OSSFile ossFile = iossFileService.getById(v.getFileId());
InputStream download = MinioUtil.download(ossFile.getUrl());
inputStreamToFile(download, exportExcelTempPath + File.separator + ossFile.getFileName());
inputStreamToFile(download, exportPath + File.separator + ossFile.getFileName());
}
}
public void inputStreamToFile (InputStream inputStream, String filePath) {
File saveFile = new File(exportExcelTempPath);
String replacePath = exportExcelTempPath.replace("exportExcelTemp", "清单详情");
File saveFile = new File(replacePath);
// 导出路径 没有则创建
if (!saveFile.exists()) {
saveFile.mkdirs();