提交 6f7a94e5 authored 作者: kxjia's avatar kxjia

完善 非现场报送模板

上级 d3370854
......@@ -255,17 +255,24 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong
Map<Integer,Integer> taskAllocMap = baosongTaskAllocService.statAllocNum(alloc);
Map<Integer,Integer> tplChildNumMap = baosongTaskAllocService.staTplChildNum(alloc);
Map<Integer,Integer> fillStatMap = baosongTaskAllocService.selectTaskFillSta(alloc);
Map<Integer,Integer> fillNumMap = baosongTaskAllocService.selectTaskFillNum(alloc);
for(BaosongTask task: tasks){
Integer tt = tplChildNumMap.get(task.getTp());
if(tt==null) continue;
Integer aa =taskAllocMap.get(task.getId());
Integer cc =fillStatMap.get(task.getId());
Integer dd = fillNumMap.get(task.getId());
Integer sta = task.getSta();
if(sta==null) sta = 1;
if(sta==null) sta=1;
if(cc==null) cc=0;
if(aa==null) aa=0;
if(dd==null) aa=0;
updateTaskStatus(task,sta,aa,cc,tt);
task.setAllocNum(aa);
task.setTplItemNum(tt);
task.setFillStaNum(cc);
task.setFillNum(dd);
}
}
......
......@@ -93,6 +93,9 @@ public class BaosongTask implements Serializable {
@TableField(exist = false)
private java.lang.Integer fillStaNum;
@TableField(exist = false)
private java.lang.Integer fillNum;
@TableField(exist = false)
private java.lang.String staText;
}
......@@ -25,4 +25,5 @@ public interface BaosongTaskAllocMapper extends BaseMapper<BaosongTaskAlloc> {
List<Map<String,Object>> selectTaskStatus(@Param("query") BaosongTaskAlloc alloc);
List<Map<String,Object>> selectTaskFillSta(@Param("query") BaosongTaskAlloc alloc);
List<Map<String,Object>> getFillUsers(@Param("query") BaosongTaskAlloc alloc);
List<Map<String,Object>> selectTaskFillNum(@Param("query") BaosongTaskAlloc alloc);
}
......@@ -25,4 +25,5 @@ public interface IBaosongTaskAllocService extends IService<BaosongTaskAlloc> {
Map<Integer,Boolean> selectTaskStatus(BaosongTaskAlloc alloc);
Map<Integer,Integer> selectTaskFillSta(BaosongTaskAlloc alloc);
String getFillUsers(Integer taskId,Integer tplId);
Map<Integer,Integer> selectTaskFillNum(BaosongTaskAlloc alloc);
}
......@@ -89,6 +89,16 @@ public class BaosongTaskAllocServiceImpl extends ServiceImpl<BaosongTaskAllocMap
return retMap;
}
@Override
public Map<Integer,Integer> selectTaskFillNum(BaosongTaskAlloc alloc){
List<Map<String,Object>> retList = this.baseMapper.selectTaskFillNum(alloc);
Map<Integer,Integer> retMap = new HashMap<>();
for(Map<String,Object> map:retList) {
Integer taskid = Integer.valueOf(map.get("taskid").toString());
retMap.put(taskid, Integer.valueOf(map.get("cnt").toString()));
}
return retMap;
}
@Override
public String getFillUsers(Integer taskId,Integer tplId){
......
......@@ -2,14 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.stm.baosong.mapper.BaosongTaskAllocMapper">
<!-- 优化说明:
1. 移除了所有索引提示(USE INDEX)
2. 优化了SQL结构和格式,提高可读性
3. 移除了不必要的1=1条件
4. 保持了原有的字段命名风格
5. 优化了复杂查询的逻辑结构
-->
<select id="queryAllTaskAlloc" resultType="java.util.Map">
SELECT
A.*,
......@@ -119,11 +111,10 @@
</select>
<select id="staTplChildNum" resultType="java.util.Map">
SELECT
SUM(child_num) AS cnt,
tp
FROM baosong_tpl
GROUP BY tp
SELECT COUNT(*) cnt ,A.tp
FROM baosong_tpl A INNER JOIN baosong_tpl_item B ON A.id=B.tplid
WHERE B.child_num=0
GROUP BY A.tp
</select>
<select id="selectTaskStatus" resultType="java.util.Map">
......@@ -147,15 +138,19 @@
ON AA.tp = BB.tp
</select>
<select id="selectTaskFillNum" resultType="java.util.Map">
SELECT COUNT(*) AS cnt,A.taskid
FROM baosong_task_alloc A
INNER JOIN baosong_task_record B ON A.taskid=B.taskid AND A.itemid=B.itemid
WHERE B.itemid IS NOT NULL
GROUP BY A.taskid
</select>
<select id="selectTaskFillSta" resultType="java.util.Map">
SELECT
COUNT(*) AS cnt,
taskid
FROM baosong_task_alloc
WHERE fill_sta = TRUE
SELECT COUNT(*) AS cnt,taskid
FROM baosong_task_alloc
WHERE fill_sta IS TRUE
GROUP BY taskid
</select>
<select id="getFillUsers" resultType="java.util.Map">
SELECT
GROUP_CONCAT(DISTINCT B.realname SEPARATOR ',') AS usernames
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论