zhaodengke 1 anno fa
parent
commit
aba271c296
4 ha cambiato i file con 44 aggiunte e 26 eliminazioni
  1. +6
    -1
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/domain/TAgentTask.java
  2. +1
    -0
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/mapper/TAgentTaskMapper.java
  3. +1
    -22
      ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/service/impl/TAgentTaskServiceImpl.java
  4. +36
    -3
      ruoyi-agentcenter/src/main/resources/mapper/agentcenter/TAgentTaskMapper.xml

+ 6
- 1
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/domain/TAgentTask.java Vedi File

@@ -170,6 +170,11 @@ public class TAgentTask extends BaseEntity
private String isAppraise;

/** 其他数 */
@Excel(name = "其他数")
private Integer otherCount;

/** 异常数 */
@Excel(name = "异常数")
private Integer abnormalCount;

private Boolean overdue;
}

+ 1
- 0
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/mapper/TAgentTaskMapper.java Vedi File

@@ -108,4 +108,5 @@ public interface TAgentTaskMapper
public List<AgentTaskVillageGroup> getAgentTaskGroupByVillage(TAgentTask tAgentTask);
public List<AgentTaskVillageGroup> getProcessedAgentTaskGroupByVillage(TAgentTask tAgentTask);
public Long getAgentTaskOverdueFinishVillageCount(TAgentTask tAgentTask);
public List<TAgentTask> getTAgentTaskProcessedList(TAgentTask tAgentTask);
}

+ 1
- 22
ruoyi-agentcenter/src/main/java/com/ruoyi/agentcenter/service/impl/TAgentTaskServiceImpl.java Vedi File

@@ -42,8 +42,6 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService
private TAgentTaskMapper tAgentTaskMapper;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private TAgentContractionMapper agentContractionMapper;

/**
* 查询任务清单
@@ -295,26 +293,9 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService
List<AgentTaskTownGroup> agentTaskGroupByTown = tAgentTaskMapper.getAgentTaskGroupByTown(tAgentTask);
if(CollectionUtil.isNotEmpty(agentTaskGroupByTown))
{
List<SysDept> deptList = sysDeptMapper.getDeptList(new SysDept());
Long rootId;
if(StringUtils.isNotEmpty(tAgentTask.getTownCode()))
rootId = deptList.stream().filter((x) -> tAgentTask.getTownCode().equals(x.getOrgCode())).map(SysDept::getParentId).findFirst().get();
else
rootId = deptList.stream().filter((x) -> tAgentTask.getCountyCode().equals(x.getOrgCode())).map(SysDept::getDeptId).findFirst().get();

TAgentContraction contractionCond = new TAgentContraction();
contractionCond.setOrderStatus(Enums.OrderStatus.PAUSE);
contractionCond.putParam("task", tAgentTask);
List<TAgentContraction> contractionList = agentContractionMapper.getAgentContractionGroupByDept(contractionCond);
Map<Long, Long> townExceptMap = DeptUtils.groupByDept(rootId, deptList, contractionList, TAgentContraction::getDeptId, Collectors.mapping(TAgentContraction::getId, Collectors.reducing(0L, Long::sum)), null);

List<String> townCodeList = ContainerUtils.mapToList(agentTaskGroupByTown, AgentTaskTownGroup::getTownCode);

Map<String, Long> contractionMap = ContainerUtils.toMap(contractionList, TAgentContraction::getOrgCode, TAgentContraction::getId);
List<AgentTaskVillageGroup> villageGroups = tAgentTaskMapper.getAgentTaskGroupByVillage(new TAgentTask().putParam("townCodeList", townCodeList));
villageGroups.forEach((x) -> {
x.setNumExcept(contractionMap.getOrDefault(x.getOrgCode(), 0L));
});
Map<String, List<AgentTaskVillageGroup>> villageMap = ContainerUtils.groupingBy(villageGroups, AgentTaskVillageGroup::getTownCode);

List<String> orgCodeList = ContainerUtils.mapToList(villageGroups, AgentTaskVillageGroup::getOrgCode);
@@ -324,9 +305,7 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService
List<TAgentTask> tAgentTasks = tAgentTaskMapper.selectTAgentTaskList(agentTaskCond);
Map<String, List<TAgentTask>> bookGroup = ContainerUtils.groupingBy(tAgentTasks, TAgentTask::getOrgCode);

Map<String, Long> deptIdMap = ContainerUtils.toMap(deptList, SysDept::getOrgCode, SysDept::getDeptId);
agentTaskGroupByTown.forEach((town) -> {
town.setNumExcept(townExceptMap.getOrDefault(deptIdMap.get(town.getTownCode()), 0L));
town.setVillageList(villageMap.getOrDefault(town.getTownCode(), new ArrayList<>()));
town.getVillageList().forEach((village) -> {
village.setTaskList(bookGroup.getOrDefault(village.getOrgCode(), new ArrayList<>()));
@@ -355,7 +334,7 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService
if(CollectionUtil.isNotEmpty(list))
{
PageUtils.orderBy("org_code");
List<TAgentTask> tAgentTasks = tAgentTaskMapper.selectTAgentTaskList(tAgentTask);
List<TAgentTask> tAgentTasks = tAgentTaskMapper.getTAgentTaskProcessedList(tAgentTask);
tAgentTasks.forEach((x) -> {
x.setOtherCount(x.getAllCount() - x.getContracCount() - x.getVoucherCount());
});


+ 36
- 3
ruoyi-agentcenter/src/main/resources/mapper/agentcenter/TAgentTaskMapper.xml Vedi File

@@ -44,10 +44,13 @@
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="abnormalCount" column="abnormal_count" />

<result property="overdue" column="overdue" />
</resultMap>

<sql id="selectTAgentTaskVo">
select id, agent_center, county_code, county_name, town_code, town_name, org_code, org_name, book_id, book_name, order_year, order_month, voucher_count, contrac_count, asset_count, all_count, finish_count, agent_status, distri_user, distri_nick, distri_date, end_at, handle_user, handle_nick, handle_remark, handle_date, audit_user, audit_nick, audit_date, is_audit, appraise_user, appraise_nick, appraise_score, appraise_remark, is_appraise, create_by, create_time, update_by, update_time from t_agent_task
select id, agent_center, county_code, county_name, town_code, town_name, org_code, org_name, book_id, book_name, order_year, order_month, voucher_count, contrac_count, asset_count, all_count, finish_count, agent_status, distri_user, distri_nick, distri_date, end_at, handle_user, handle_nick, handle_remark, handle_date, audit_user, audit_nick, audit_date, is_audit, appraise_user, appraise_nick, appraise_score, appraise_remark, is_appraise, create_by, create_time, update_by, update_time, abnormal_count from t_agent_task
</sql>

<select id="selectTAgentTaskList" parameterType="TAgentTask" resultMap="TAgentTaskResult">
@@ -144,6 +147,7 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="abnormalCount != null">abnormal_count,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="agentCenter != null and agentCenter != ''">#{agentCenter},</if>
@@ -184,6 +188,7 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="abnormalCount != null">#{abnormalCount},</if>
</trim>
</insert>

@@ -229,6 +234,7 @@
create_time,
update_by,
update_time,
abnormal_count,
</trim>
values
<foreach item="item" collection="list" separator="," >
@@ -271,6 +277,7 @@
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
#{item.abnormalCount},
</trim>
</foreach>
</insert>
@@ -316,6 +323,7 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="abnormalCount != null">abnormal_count = #{abnormalCount},</if>
</trim>
where id = #{id}
</update>
@@ -363,6 +371,7 @@
<if test="item.createTime != null">create_time = #{item.createTime},</if>
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
<if test="item.abnormalCount != null">abnormal_count = #{item.abnormalCount},</if>
</set>
where id = #{item.id}
</foreach>
@@ -542,7 +551,8 @@
IFNULL(SUM(IF(agent_status = '3', 1, 0)), 0) as num_process_finish,
IFNULL(SUM(IF(is_audit = 'Y', 1, 0)), 0) as num_approval_finish,
town_name, town_code,
order_year, order_month
order_year, order_month,
IFNULL(SUM(abnormal_count), 0) as num_except
FROM
t_agent_task
<where>
@@ -579,7 +589,8 @@
IFNULL(SUM(IF(agent_status = '3', 1, 0)), 0) as num_process_finish,
IFNULL(SUM(IF(is_audit = 'Y', 1, 0)), 0) as num_approval_finish,
org_name, org_code, town_code,
MAX(end_at) as end_at, MAX(handle_date) as handle_date, MAX(distri_date) as distri_date, handle_nick
MAX(end_at) as end_at, MAX(handle_date) as handle_date, MAX(distri_date) as distri_date, handle_nick,
IFNULL(SUM(abnormal_count), 0) as num_except
FROM
t_agent_task
<where>
@@ -643,4 +654,26 @@
</if>
</where>
</select>

<select id="getTAgentTaskProcessedList" parameterType="TAgentTask" resultMap="TAgentTaskResult">
select id, agent_center, county_code, county_name, town_code, town_name, org_code, org_name, book_id, book_name, order_year, order_month, voucher_count, contrac_count, asset_count, all_count, finish_count, agent_status, distri_user, distri_nick, distri_date, end_at, handle_user, handle_nick, handle_remark, handle_date, audit_user, audit_nick, audit_date, is_audit, appraise_user, appraise_nick, appraise_score, appraise_remark, is_appraise, create_by, create_time, update_by, update_time
, IF(LEFT(handle_date, 10) > end_at, 1, 0) as overdue
from t_agent_task
<where>
AND agent_status IN ('3', '4')
<if test="agentCenter != null and agentCenter != ''"> and agent_center = #{agentCenter}</if>
<if test="countyCode != null and countyCode != ''"> and county_code = #{countyCode}</if>
<if test="townCode != null and townCode != ''"> and town_code = #{townCode}</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if>
<if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if>
<if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if>
<if test="isAppraise != null and isAppraise != ''"> and is_appraise = #{isAppraise}</if>
<if test="params != null">
<if test="params.orgCodeList != null">
AND org_code IN (null <foreach collection="params.orgCodeList" item="i">,#{i}</foreach> )
</if>
</if>
</where>
</select>
</mapper>

Caricamento…
Annulla
Salva