!127 fix(xispeak): 精简导出列,注释部分非必要字段
* fix(xispeak): 精简导出列,注释部分非必要字段 * fix(xispeak): 反馈增删改同步主表落实条数与已闭环数 * fix(xispeak): 导出切 EasyExcel 端点,反馈闭环口径改为已完成
This commit is contained in:
+13
-2
@@ -470,6 +470,17 @@ public class BgXiSpeakController extends JeecgController<BgXiSpeak, IBgXiSpeakSe
|
||||
java.util.Collections.singletonList(example));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过EasyExcel导出数据
|
||||
*/
|
||||
@AutoLog(value = "习总书记重要讲话指示批示情况-通过EasyExcel导出")
|
||||
@RequiresPermissions("bg.xispeak:bg_xi_speak:exportXls")
|
||||
@GetMapping(value = "/exportXlsByEasyExcel")
|
||||
public void exportXlsByEasyExcel(HttpServletRequest request, HttpServletResponse response,
|
||||
BgXiSpeak bgXiSpeak) throws IOException {
|
||||
super.exportXlsByEasyExcel(request, response, bgXiSpeak, BgXiSpeak.class, "习总书记重要讲话指示批示情况");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量查询多个 xispeak 节点下的反馈统计数量
|
||||
*
|
||||
@@ -503,8 +514,8 @@ public class BgXiSpeakController extends JeecgController<BgXiSpeak, IBgXiSpeakSe
|
||||
Map<String, Integer> counts = result.get(fb.getMainId());
|
||||
if (counts != null) {
|
||||
counts.put("total", counts.get("total") + 1);
|
||||
// 已完成兼容两种取值:CompletionStatus.FINISHED=1(监听器写入)与 feedback_status 字典的 3(表单提交)
|
||||
if ("1".equals(fb.getCompletionStatus()) || "3".equals(fb.getCompletionStatus())) {
|
||||
// feedback_status 字典:3=已完成(闭环)
|
||||
if ("3".equals(fb.getCompletionStatus())) {
|
||||
counts.put("closed", counts.get("closed") + 1);
|
||||
}
|
||||
}
|
||||
|
||||
+20
-1
@@ -1,7 +1,9 @@
|
||||
package org.jeecg.modules.supervision.xispeak.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
@@ -129,6 +131,7 @@ public class BgXiSpeakFeedbackController extends JeecgController<BgXiSpeakFeedba
|
||||
@PostMapping(value = "/addBgXiSpeakFeedback")
|
||||
public Result<String> add(@RequestBody BgXiSpeakFeedback bgXiSpeakFeedback) {
|
||||
bgXiSpeakFeedbackService.save(bgXiSpeakFeedback);
|
||||
bgXiSpeakFeedbackService.syncFeedbackCounts(bgXiSpeakFeedback.getMainId());
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@@ -143,6 +146,7 @@ public class BgXiSpeakFeedbackController extends JeecgController<BgXiSpeakFeedba
|
||||
@PostMapping(value = "/editBgXiSpeakFeedback")
|
||||
public Result<String> edit(@RequestBody BgXiSpeakFeedback bgXiSpeakFeedback) {
|
||||
bgXiSpeakFeedbackService.updateById(bgXiSpeakFeedback);
|
||||
bgXiSpeakFeedbackService.syncFeedbackCounts(bgXiSpeakFeedback.getMainId());
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
@@ -156,7 +160,11 @@ public class BgXiSpeakFeedbackController extends JeecgController<BgXiSpeakFeedba
|
||||
@Operation(summary="习总书记重要讲话反馈表-通过id删除")
|
||||
@DeleteMapping(value = "/deleteBgXiSpeakFeedback")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
BgXiSpeakFeedback fb = bgXiSpeakFeedbackService.getById(id);
|
||||
bgXiSpeakFeedbackService.removeById(id);
|
||||
if (fb != null) {
|
||||
bgXiSpeakFeedbackService.syncFeedbackCounts(fb.getMainId());
|
||||
}
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
@@ -170,7 +178,18 @@ public class BgXiSpeakFeedbackController extends JeecgController<BgXiSpeakFeedba
|
||||
@Operation(summary="习总书记重要讲话反馈表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatchBgXiSpeakFeedback")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.bgXiSpeakFeedbackService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
List<BgXiSpeakFeedback> list = bgXiSpeakFeedbackService.listByIds(idList);
|
||||
Set<String> mainIds = new HashSet<>();
|
||||
for (BgXiSpeakFeedback fb : list) {
|
||||
if (oConvertUtils.isNotEmpty(fb.getMainId())) {
|
||||
mainIds.add(fb.getMainId());
|
||||
}
|
||||
}
|
||||
this.bgXiSpeakFeedbackService.removeByIds(idList);
|
||||
for (String mainId : mainIds) {
|
||||
bgXiSpeakFeedbackService.syncFeedbackCounts(mainId);
|
||||
}
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -125,7 +125,7 @@ public class BgXiSpeak implements Serializable {
|
||||
private java.lang.Integer numberOfResolutions;
|
||||
/**落实情况*/
|
||||
@Excel(name = "落实情况", width = 15)
|
||||
@ExcelColumn(name = "落实情况", width = 15)
|
||||
// @ExcelColumn(name = "落实情况", width = 15)
|
||||
@Schema(description = "落实情况")
|
||||
private java.lang.String implStatus;
|
||||
/**落实条数*/
|
||||
@@ -145,12 +145,12 @@ public class BgXiSpeak implements Serializable {
|
||||
private java.lang.String reportFeedbackStatus;
|
||||
/**是否存在完成风险(0不存在,1存在)*/
|
||||
@Excel(name = "是否存在完成风险(请填入是/否)", width = 15, dicCode = "true_or_flase")
|
||||
@ExcelColumn(name = "是否存在完成风险(请填入是/否)", width = 15, dicCode = "true_or_flase")
|
||||
// @ExcelColumn(name = "是否存在完成风险(请填入是/否)", width = 15, dicCode = "true_or_flase")
|
||||
@Schema(description = "是否存在完成风险(0不存在,1存在)")
|
||||
private java.lang.Integer isCompletionRisk;
|
||||
/**拖期风险应对措施*/
|
||||
@Excel(name = "拖期风险应对措施", width = 15)
|
||||
@ExcelColumn(name = "拖期风险应对措施", width = 15)
|
||||
// @ExcelColumn(name = "拖期风险应对措施", width = 15)
|
||||
@Schema(description = "拖期风险应对措施")
|
||||
private java.lang.String delayRiskMitigation;
|
||||
/**完成状态(0推进中,1已完成)*/
|
||||
@@ -171,7 +171,7 @@ public class BgXiSpeak implements Serializable {
|
||||
private java.lang.Integer treeDepth;
|
||||
/**同级数据排序号*/
|
||||
@Excel(name = "同级数据排序号", width = 15)
|
||||
@ExcelColumn(name = "同级数据排序号", width = 15)
|
||||
// @ExcelColumn(name = "同级数据排序号", width = 15)
|
||||
@Schema(description = "同级数据排序号")
|
||||
private java.lang.Integer sortOrder;
|
||||
/**逻辑删除flag(0保留,1删除)*/
|
||||
|
||||
+7
@@ -18,4 +18,11 @@ public interface IBgXiSpeakFeedbackService extends IService<BgXiSpeakFeedback> {
|
||||
* @return 实体对象
|
||||
*/
|
||||
BgXiSpeakFeedback getByIdForUpdate(String id);
|
||||
|
||||
/**
|
||||
* 重新统计指定主表下的反馈总条数与已闭环条数(completionStatus=3),同步回主表 implCount/closedCount
|
||||
*
|
||||
* @param mainId 主表ID
|
||||
*/
|
||||
void syncFeedbackCounts(String mainId);
|
||||
}
|
||||
+26
@@ -1,10 +1,15 @@
|
||||
package org.jeecg.modules.supervision.xispeak.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.supervision.xispeak.entity.BgXiSpeak;
|
||||
import org.jeecg.modules.supervision.xispeak.entity.BgXiSpeakFeedback;
|
||||
import org.jeecg.modules.supervision.xispeak.mapper.BgXiSpeakFeedbackMapper;
|
||||
import org.jeecg.modules.supervision.xispeak.mapper.BgXiSpeakMapper;
|
||||
import org.jeecg.modules.supervision.xispeak.service.IBgXiSpeakFeedbackService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@@ -17,10 +22,31 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@Service
|
||||
public class BgXiSpeakFeedbackServiceImpl extends ServiceImpl<BgXiSpeakFeedbackMapper, BgXiSpeakFeedback> implements IBgXiSpeakFeedbackService {
|
||||
|
||||
@Autowired
|
||||
private BgXiSpeakMapper bgXiSpeakMapper;
|
||||
|
||||
@Override
|
||||
public BgXiSpeakFeedback getByIdForUpdate(String id) {
|
||||
return this.getOne(new LambdaQueryWrapper<BgXiSpeakFeedback>()
|
||||
.eq(BgXiSpeakFeedback::getId, id)
|
||||
.last("for update"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncFeedbackCounts(String mainId) {
|
||||
if (oConvertUtils.isEmpty(mainId)) {
|
||||
return;
|
||||
}
|
||||
long total = this.count(new LambdaQueryWrapper<BgXiSpeakFeedback>()
|
||||
.eq(BgXiSpeakFeedback::getMainId, mainId));
|
||||
long closed = this.count(new LambdaQueryWrapper<BgXiSpeakFeedback>()
|
||||
.eq(BgXiSpeakFeedback::getMainId, mainId)
|
||||
.eq(BgXiSpeakFeedback::getCompletionStatus, "3"));
|
||||
BgXiSpeak update = new BgXiSpeak();
|
||||
update.setId(mainId);
|
||||
update.setImplCount((int) total);
|
||||
update.setClosedCount((int) closed);
|
||||
bgXiSpeakMapper.updateById(update);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user