bug: 政策法规资料导出问题
This commit is contained in:
+5
-2
@@ -107,7 +107,7 @@ public class SarLawsInformationController extends BaseController<SarLawsInformat
|
|||||||
|
|
||||||
@ApiOperation("导出政策法规资料信息")
|
@ApiOperation("导出政策法规资料信息")
|
||||||
@GetMapping("/exportLawsInformationInfo")
|
@GetMapping("/exportLawsInformationInfo")
|
||||||
public ResponseMessage<?> exportLawsInformationInfo(SarLawsInformation sarLawsInformation, HttpServletResponse response,
|
public ResponseMessage<?> exportLawsInformationInfo(SarLawsInformation sarLawsInformation, String userId, HttpServletResponse response,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
OutputStream os = null;
|
OutputStream os = null;
|
||||||
Workbook workbook = null;
|
Workbook workbook = null;
|
||||||
@@ -119,13 +119,16 @@ public class SarLawsInformationController extends BaseController<SarLawsInformat
|
|||||||
response.setHeader("Content-Disposition",
|
response.setHeader("Content-Disposition",
|
||||||
"attachment; filename=" + ReadExcel.encodeFileName(sarLawsInformation.getExportName()+".xlsx",
|
"attachment; filename=" + ReadExcel.encodeFileName(sarLawsInformation.getExportName()+".xlsx",
|
||||||
request));
|
request));
|
||||||
|
if (StringUtils.isBlank(userId)) {
|
||||||
|
return Result.error("导出失败,用户ID为空");
|
||||||
|
}
|
||||||
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
||||||
if (StrUtil.isNotBlank(sarLawsInformation.getExportIds())) {
|
if (StrUtil.isNotBlank(sarLawsInformation.getExportIds())) {
|
||||||
List<String> idList = Arrays.asList(sarLawsInformation.getExportIds().split(","));
|
List<String> idList = Arrays.asList(sarLawsInformation.getExportIds().split(","));
|
||||||
datas = informationService.getLawsInformationByIds(idList);
|
datas = informationService.getLawsInformationByIds(idList);
|
||||||
} else {
|
} else {
|
||||||
// 导出所有数据
|
// 导出所有数据
|
||||||
datas = informationService.getAllLawsInformation(sarLawsInformation);
|
datas = informationService.getAllLawsInformation(sarLawsInformation, userId);
|
||||||
}
|
}
|
||||||
List<SarLawsInformationExport> datasExport = new ArrayList<>();
|
List<SarLawsInformationExport> datasExport = new ArrayList<>();
|
||||||
for (SarLawsInformation data : datas) {
|
for (SarLawsInformation data : datas) {
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ public interface SarLawsInformationService extends IService<SarLawsInformation>
|
|||||||
* @param sarLawsInformation 法规资料对象,用于查询
|
* @param sarLawsInformation 法规资料对象,用于查询
|
||||||
* @return 法规资料列表
|
* @return 法规资料列表
|
||||||
*/
|
*/
|
||||||
List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation);
|
List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation, String userId);
|
||||||
|
|
||||||
ResponseMessage<?> importLawsInformationInfo(MultipartFile file);
|
ResponseMessage<?> importLawsInformationInfo(MultipartFile file);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -355,8 +355,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation) {
|
public List<SarLawsInformation> getAllLawsInformation(SarLawsInformation sarLawsInformation, String userId) {
|
||||||
String userId = LoginUserUtil.getUserId();
|
|
||||||
// 查询有权限的资料ID
|
// 查询有权限的资料ID
|
||||||
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SarLawsInformationAuth> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
wrapper.eq(SarLawsInformationAuth::getUserId, userId);
|
||||||
|
|||||||
-11
@@ -156,22 +156,11 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SarLawsTopic lawsTopicInfoDB = getLawsTopicInfo(lawsTopic.getId());
|
SarLawsTopic lawsTopicInfoDB = getLawsTopicInfo(lawsTopic.getId());
|
||||||
log.error("====================新的================" + sdf.format(lawsTopic.getStartTime()));
|
|
||||||
log.error("====================旧的================" + sdf.format(lawsTopicInfoDB.getStartTime()));
|
|
||||||
if (lawsTopic.getCloseTime()!= null) {
|
|
||||||
log.error("====================新的================" + sdf.format(lawsTopic.getCloseTime()));
|
|
||||||
}
|
|
||||||
if (lawsTopicInfoDB.getCloseTime() != null) {
|
|
||||||
log.error("====================旧的================" + sdf.format(lawsTopicInfoDB.getCloseTime()));
|
|
||||||
}
|
|
||||||
List<String> compareList = compareLawsTopic(lawsTopicInfoDB, lawsTopic);
|
List<String> compareList = compareLawsTopic(lawsTopicInfoDB, lawsTopic);
|
||||||
if (compareLawsTopic(lawsTopicInfoDB, lawsTopic).size() == 0) {
|
if (compareLawsTopic(lawsTopicInfoDB, lawsTopic).size() == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
lawsTopic.setModifyTime(new Date());
|
lawsTopic.setModifyTime(new Date());
|
||||||
for (String s : compareList) {
|
|
||||||
log.error("====================变更项====================" + s);
|
|
||||||
}
|
|
||||||
int update = this.baseMapper.updateById(lawsTopic);
|
int update = this.baseMapper.updateById(lawsTopic);
|
||||||
// 比较列表字段是否经过修改,如果经过修改,先删除,再添加
|
// 比较列表字段是否经过修改,如果经过修改,先删除,再添加
|
||||||
if (compareList.contains("课题组会议列表被变更")) {
|
if (compareList.contains("课题组会议列表被变更")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user