| @@ -1,6 +1,8 @@ | |||||
| package com.ruoyi.web.controller.agentcenter; | package com.ruoyi.web.controller.agentcenter; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskNumGroup; | |||||
| import com.ruoyi.agentcenter.vo.TaskAllAudit; | |||||
| import com.ruoyi.agentcenter.vo.TaskAudit; | |||||
| import com.ruoyi.agentcenter.vo.TaskDistrib; | import com.ruoyi.agentcenter.vo.TaskDistrib; | ||||
| import com.ruoyi.agentcenter.vo.TaskRevoke; | import com.ruoyi.agentcenter.vo.TaskRevoke; | ||||
| import com.ruoyi.common.core.domain.AjaxResult; | import com.ruoyi.common.core.domain.AjaxResult; | ||||
| @@ -34,7 +36,7 @@ public class ManagerAgentTaskController extends BaseController | |||||
| private ITAgentTaskService tAgentTaskService; | private ITAgentTaskService tAgentTaskService; | ||||
| /** | /** | ||||
| * 全部任务列表 | |||||
| * 县级全部任务统计 | |||||
| */ | */ | ||||
| @PreAuthorize("@ss.hasPermi('agentcenter:task:list')") | @PreAuthorize("@ss.hasPermi('agentcenter:task:list')") | ||||
| @GetMapping(value = "/countyTaskSummary") | @GetMapping(value = "/countyTaskSummary") | ||||
| @@ -67,8 +69,8 @@ public class ManagerAgentTaskController extends BaseController | |||||
| startPage(); | startPage(); | ||||
| task.setAgentCenter(getUserAgentCenter()); | task.setAgentCenter(getUserAgentCenter()); | ||||
| task.setAgentStatus(TAgentTask.AGENT_STATUS_READY); | task.setAgentStatus(TAgentTask.AGENT_STATUS_READY); | ||||
| AgentTaskTownNumGroup summary = new AgentTaskTownNumGroup(); | |||||
| List<AgentTaskTownNumGroup> undistribTaskList = tAgentTaskService.getUndistribTaskList(task, summary); | |||||
| AgentTaskNumGroup summary = new AgentTaskNumGroup(); | |||||
| List<AgentTaskNumGroup> undistribTaskList = tAgentTaskService.getUndistribTaskList(task, summary); | |||||
| TableDataInfo dataTable = getDataTable(undistribTaskList); | TableDataInfo dataTable = getDataTable(undistribTaskList); | ||||
| AjaxResult result = dataTable.toAjaxResult(); | AjaxResult result = dataTable.toAjaxResult(); | ||||
| result.put("numVillage", summary.getNumVillage()) | result.put("numVillage", summary.getNumVillage()) | ||||
| @@ -86,6 +88,7 @@ public class ManagerAgentTaskController extends BaseController | |||||
| public AjaxResult distrib(@Validated @RequestBody TaskDistrib taskDistrib) | public AjaxResult distrib(@Validated @RequestBody TaskDistrib taskDistrib) | ||||
| { | { | ||||
| taskDistrib.setDistriUser(getUsername()); | taskDistrib.setDistriUser(getUsername()); | ||||
| taskDistrib.setAgentCenter(getUserAgentCenter()); | |||||
| return toAjax(tAgentTaskService.distrib(taskDistrib)); | return toAjax(tAgentTaskService.distrib(taskDistrib)); | ||||
| } | } | ||||
| @@ -96,6 +99,7 @@ public class ManagerAgentTaskController extends BaseController | |||||
| @PostMapping(value = "/revoke") | @PostMapping(value = "/revoke") | ||||
| public AjaxResult revoke(@Validated @RequestBody TaskRevoke taskRevoke) | public AjaxResult revoke(@Validated @RequestBody TaskRevoke taskRevoke) | ||||
| { | { | ||||
| taskRevoke.setAgentCenter(getUserAgentCenter()); | |||||
| return toAjax(tAgentTaskService.revoke(taskRevoke)); | return toAjax(tAgentTaskService.revoke(taskRevoke)); | ||||
| } | } | ||||
| @@ -103,13 +107,24 @@ public class ManagerAgentTaskController extends BaseController | |||||
| * 审核 | * 审核 | ||||
| */ | */ | ||||
| @PreAuthorize("@ss.hasPermi('manager:task:audit')") | @PreAuthorize("@ss.hasPermi('manager:task:audit')") | ||||
| @GetMapping(value = "/audit/{id}") | |||||
| public AjaxResult audit(@PathVariable Long id) | |||||
| @PostMapping(value = "/audit") | |||||
| public AjaxResult audit(@Validated @RequestBody TaskAudit taskAudit) | |||||
| { | |||||
| taskAudit.setAuditUser(getUsername()); | |||||
| taskAudit.setAgentCenter(getUserAgentCenter()); | |||||
| return toAjax(tAgentTaskService.audit(taskAudit)); | |||||
| } | |||||
| /** | |||||
| * 全部审核 | |||||
| */ | |||||
| @PreAuthorize("@ss.hasPermi('manager:task:audit')") | |||||
| @PostMapping(value = "/auditAll") | |||||
| public AjaxResult auditAll(@Validated @RequestBody TaskAllAudit taskAudit) | |||||
| { | { | ||||
| TAgentTask task = new TAgentTask(); | |||||
| task.setId(id); | |||||
| task.setAuditUser(getUsername()); | |||||
| return toAjax(tAgentTaskService.audit(task)); | |||||
| taskAudit.setAuditUser(getUsername()); | |||||
| taskAudit.setAgentCenter(getUserAgentCenter()); | |||||
| return toAjax(tAgentTaskService.auditAll(taskAudit)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -125,7 +140,7 @@ public class ManagerAgentTaskController extends BaseController | |||||
| } | } | ||||
| /** | /** | ||||
| * 全部任务列表 | |||||
| * 县级处理中统计 | |||||
| */ | */ | ||||
| @PreAuthorize("@ss.hasPermi('agentcenter:task:list')") | @PreAuthorize("@ss.hasPermi('agentcenter:task:list')") | ||||
| @GetMapping(value = "/countyProcessingTaskSummary") | @GetMapping(value = "/countyProcessingTaskSummary") | ||||
| @@ -136,4 +151,27 @@ public class ManagerAgentTaskController extends BaseController | |||||
| return AjaxResult.success(tAgentTaskService.countyProcessingTaskSummary(task)); | return AjaxResult.success(tAgentTaskService.countyProcessingTaskSummary(task)); | ||||
| } | } | ||||
| /** | |||||
| * 待审核任务列表 | |||||
| */ | |||||
| @PreAuthorize("@ss.hasPermi('agentcenter:task:list')") | |||||
| @GetMapping(value = "/auditingTaskList") | |||||
| public TableDataInfo auditingTaskList(TAgentTask task) | |||||
| { | |||||
| startPage(); | |||||
| task.setAgentCenter(getUserAgentCenter()); | |||||
| return getDataTable(tAgentTaskService.getAuditingTaskList(task)); | |||||
| } | |||||
| /** | |||||
| * 镇级待审核统计 | |||||
| */ | |||||
| @PreAuthorize("@ss.hasPermi('agentcenter:task:list')") | |||||
| @GetMapping(value = "/auditTaskSummary") | |||||
| public AjaxResult auditTaskSummary(TAgentTask task) | |||||
| { | |||||
| task.setAgentCenter(getUserAgentCenter()); | |||||
| return AjaxResult.success(tAgentTaskService.auditTaskSummary(task)); | |||||
| } | |||||
| } | } | ||||
| @@ -161,10 +161,6 @@ public class TAgentTask extends BaseEntity | |||||
| @Excel(name = "评价备注") | @Excel(name = "评价备注") | ||||
| private String appraiseRemark; | private String appraiseRemark; | ||||
| /** 是否审核 */ | |||||
| @Excel(name = "是否审核", dictType = "sys_yes_no") | |||||
| private String isAudit; | |||||
| /** 是否评价 */ | /** 是否评价 */ | ||||
| @Excel(name = "是否评价", dictType = "sys_yes_no") | @Excel(name = "是否评价", dictType = "sys_yes_no") | ||||
| private String isAppraise; | private String isAppraise; | ||||
| @@ -0,0 +1,48 @@ | |||||
| package com.ruoyi.agentcenter.dto; | |||||
| import cn.hutool.core.date.DateUtil; | |||||
| import com.ruoyi.agentcenter.domain.TAgentTask; | |||||
| import com.ruoyi.common.utils.DateUtils; | |||||
| import com.ruoyi.common.utils.StringUtils; | |||||
| import lombok.Data; | |||||
| import lombok.experimental.Accessors; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| public class AgentTaskNumGroup | |||||
| { | |||||
| private Long numVillage; | |||||
| private Long numBook; | |||||
| private Long voucherCount; | |||||
| private Long contracCount; | |||||
| private Long otherCount; | |||||
| private Long allCount; | |||||
| private Long assetCount; | |||||
| private String townName; | |||||
| private String townCode; | |||||
| private String orgName; | |||||
| private String orgCode; | |||||
| private String endAt; | |||||
| private String handleDate; | |||||
| private String distriDate; | |||||
| private String handleNick; | |||||
| private String handleUser; | |||||
| private Boolean overdueFinish; | |||||
| private List<AgentTaskNumGroup> villageList; | |||||
| private List<TAgentTask> taskList; | |||||
| public void setupOverdueFinish() | |||||
| { | |||||
| if(StringUtils.isEmpty(endAt) || StringUtils.isEmpty(handleDate)) | |||||
| return; | |||||
| Date endAtDate = DateUtils.yyyy_MM_dd(endAt); | |||||
| Date handleDateDate = DateUtils.yyyy_MM_dd(handleDate); | |||||
| overdueFinish = handleDateDate.after(endAtDate); | |||||
| } | |||||
| } | |||||
| @@ -1,33 +0,0 @@ | |||||
| package com.ruoyi.agentcenter.dto; | |||||
| import lombok.Data; | |||||
| import lombok.experimental.Accessors; | |||||
| import java.util.List; | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| public class AgentTaskTownNumGroup | |||||
| { | |||||
| private Long numVillage; | |||||
| private Long numBook; | |||||
| private Long voucherCount; | |||||
| private Long contracCount; | |||||
| private Long otherCount; | |||||
| private Long allCount; | |||||
| private Long assetCount; | |||||
| private String townName; | |||||
| private String townCode; | |||||
| private String orgName; | |||||
| private String orgCode; | |||||
| private String endAt; | |||||
| private String handleUser; | |||||
| private List<AgentTaskTownNumGroup> villageList; | |||||
| public void calcOtherCount() | |||||
| { | |||||
| otherCount = allCount - voucherCount - contracCount - assetCount; | |||||
| } | |||||
| } | |||||
| @@ -3,7 +3,7 @@ package com.ruoyi.agentcenter.mapper; | |||||
| import java.util.List; | import java.util.List; | ||||
| import com.ruoyi.agentcenter.domain.TAgentTask; | import com.ruoyi.agentcenter.domain.TAgentTask; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownGroup; | import com.ruoyi.agentcenter.dto.AgentTaskTownGroup; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskVillageGroup; | import com.ruoyi.agentcenter.dto.AgentTaskVillageGroup; | ||||
| /** | /** | ||||
| @@ -106,14 +106,16 @@ public interface TAgentTaskMapper | |||||
| public int updateTAgentTaskCount(TAgentTask tAgentTask); | public int updateTAgentTaskCount(TAgentTask tAgentTask); | ||||
| public List<AgentTaskTownGroup> getAgentTaskGroupByTown(TAgentTask tAgentTask); | public List<AgentTaskTownGroup> getAgentTaskGroupByTown(TAgentTask tAgentTask); | ||||
| public AgentTaskTownGroup getAgentTaskTownSummary(TAgentTask tAgentTask); | |||||
| public List<AgentTaskVillageGroup> getAgentTaskGroupByVillage(TAgentTask tAgentTask); | public List<AgentTaskVillageGroup> getAgentTaskGroupByVillage(TAgentTask tAgentTask); | ||||
| public AgentTaskVillageGroup getAgentTaskVillageSummary(TAgentTask tAgentTask); | public AgentTaskVillageGroup getAgentTaskVillageSummary(TAgentTask tAgentTask); | ||||
| public List<AgentTaskVillageGroup> getProcessedAgentTaskGroupByVillage(TAgentTask tAgentTask); | public List<AgentTaskVillageGroup> getProcessedAgentTaskGroupByVillage(TAgentTask tAgentTask); | ||||
| public Long getAgentTaskOverdueFinishVillageCount(TAgentTask tAgentTask); | public Long getAgentTaskOverdueFinishVillageCount(TAgentTask tAgentTask); | ||||
| public List<TAgentTask> getTAgentTaskProcessedList(TAgentTask tAgentTask); | public List<TAgentTask> getTAgentTaskProcessedList(TAgentTask tAgentTask); | ||||
| public List<TAgentTask> getTaskHandleUserListGroup(TAgentTask tAgentTask); | public List<TAgentTask> getTaskHandleUserListGroup(TAgentTask tAgentTask); | ||||
| public List<AgentTaskTownNumGroup> getAgentTaskNumTownGroup(TAgentTask tAgentTask); | |||||
| public List<AgentTaskTownNumGroup> getAgentTaskNumVillageGroup(TAgentTask tAgentTask); | |||||
| public List<AgentTaskNumGroup> getAgentTaskNumTownGroup(TAgentTask tAgentTask); | |||||
| public List<AgentTaskNumGroup> getAgentTaskNumVillageGroup(TAgentTask tAgentTask); | |||||
| public int revokeAgentTaskByOrgCode(TAgentTask task); | public int revokeAgentTaskByOrgCode(TAgentTask task); | ||||
| public int auditAgentTask(TAgentTask task); | |||||
| } | } | ||||
| @@ -5,10 +5,12 @@ import java.util.function.Consumer; | |||||
| import com.ruoyi.agentcenter.domain.TAgentTask; | import com.ruoyi.agentcenter.domain.TAgentTask; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownGroup; | import com.ruoyi.agentcenter.dto.AgentTaskTownGroup; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskVillageGroup; | import com.ruoyi.agentcenter.dto.AgentTaskVillageGroup; | ||||
| import com.ruoyi.agentcenter.vo.AgentTaskUser; | import com.ruoyi.agentcenter.vo.AgentTaskUser; | ||||
| import com.ruoyi.agentcenter.vo.CountyTaskSummary; | |||||
| import com.ruoyi.agentcenter.vo.AgentTaskSummary; | |||||
| import com.ruoyi.agentcenter.vo.TaskAllAudit; | |||||
| import com.ruoyi.agentcenter.vo.TaskAudit; | |||||
| import com.ruoyi.agentcenter.vo.TaskDistrib; | import com.ruoyi.agentcenter.vo.TaskDistrib; | ||||
| import com.ruoyi.agentcenter.vo.TaskFinish; | import com.ruoyi.agentcenter.vo.TaskFinish; | ||||
| import com.ruoyi.agentcenter.vo.TaskRevoke; | import com.ruoyi.agentcenter.vo.TaskRevoke; | ||||
| @@ -122,6 +124,7 @@ public interface ITAgentTaskService | |||||
| public List<AgentTaskTownGroup> getTownTaskList(TAgentTask tAgentTask); | public List<AgentTaskTownGroup> getTownTaskList(TAgentTask tAgentTask); | ||||
| public List<AgentTaskTownGroup> getProcessingTaskList(TAgentTask tAgentTask); | public List<AgentTaskTownGroup> getProcessingTaskList(TAgentTask tAgentTask); | ||||
| public List<AgentTaskNumGroup> getAuditingTaskList(TAgentTask tAgentTask); | |||||
| public List<TAgentTask> getTodoTaskList(TAgentTask tAgentTask); | public List<TAgentTask> getTodoTaskList(TAgentTask tAgentTask); | ||||
| public List<AgentTaskVillageGroup> getProcessedTaskList(TAgentTask tAgentTask); | public List<AgentTaskVillageGroup> getProcessedTaskList(TAgentTask tAgentTask); | ||||
| @@ -129,11 +132,13 @@ public interface ITAgentTaskService | |||||
| public int distrib(TaskDistrib task); | public int distrib(TaskDistrib task); | ||||
| public int revoke(TaskRevoke task); | public int revoke(TaskRevoke task); | ||||
| public int audit(TAgentTask task); | |||||
| public int audit(TaskAudit task); | |||||
| public int finish(TaskFinish task); | public int finish(TaskFinish task); | ||||
| public int auditAll(TaskAllAudit task); | |||||
| public List<AgentTaskUser> userList(AgentTaskUser user); | public List<AgentTaskUser> userList(AgentTaskUser user); | ||||
| public List<AgentTaskTownNumGroup> getUndistribTaskList(TAgentTask tAgentTask, AgentTaskTownNumGroup summary); | |||||
| public CountyTaskSummary countyTaskSummary(TAgentTask task); | |||||
| public CountyTaskSummary countyProcessingTaskSummary(TAgentTask task); | |||||
| public List<AgentTaskNumGroup> getUndistribTaskList(TAgentTask tAgentTask, AgentTaskNumGroup summary); | |||||
| public AgentTaskSummary countyTaskSummary(TAgentTask task); | |||||
| public AgentTaskSummary countyProcessingTaskSummary(TAgentTask task); | |||||
| public AgentTaskSummary auditTaskSummary(TAgentTask task); | |||||
| } | } | ||||
| @@ -14,10 +14,12 @@ import cn.hutool.core.lang.Assert; | |||||
| import com.github.pagehelper.Page; | import com.github.pagehelper.Page; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownGroup; | import com.ruoyi.agentcenter.dto.AgentTaskTownGroup; | ||||
| import com.ruoyi.agentcenter.dto.AgentTaskTownNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskNumGroup; | |||||
| import com.ruoyi.agentcenter.dto.AgentTaskVillageGroup; | import com.ruoyi.agentcenter.dto.AgentTaskVillageGroup; | ||||
| import com.ruoyi.agentcenter.vo.AgentTaskUser; | import com.ruoyi.agentcenter.vo.AgentTaskUser; | ||||
| import com.ruoyi.agentcenter.vo.CountyTaskSummary; | |||||
| import com.ruoyi.agentcenter.vo.AgentTaskSummary; | |||||
| import com.ruoyi.agentcenter.vo.TaskAllAudit; | |||||
| import com.ruoyi.agentcenter.vo.TaskAudit; | |||||
| import com.ruoyi.agentcenter.vo.TaskDistrib; | import com.ruoyi.agentcenter.vo.TaskDistrib; | ||||
| import com.ruoyi.agentcenter.vo.TaskFinish; | import com.ruoyi.agentcenter.vo.TaskFinish; | ||||
| import com.ruoyi.agentcenter.vo.TaskRevoke; | import com.ruoyi.agentcenter.vo.TaskRevoke; | ||||
| @@ -28,6 +30,7 @@ import com.ruoyi.common.utils.ContainerUtils; | |||||
| import com.ruoyi.common.utils.DateUtils; | import com.ruoyi.common.utils.DateUtils; | ||||
| import com.ruoyi.common.utils.DeptUtils; | import com.ruoyi.common.utils.DeptUtils; | ||||
| import com.ruoyi.common.utils.PageUtils; | import com.ruoyi.common.utils.PageUtils; | ||||
| import com.ruoyi.common.utils.StringUtils; | |||||
| import com.ruoyi.system.mapper.SysDeptMapper; | import com.ruoyi.system.mapper.SysDeptMapper; | ||||
| import com.ruoyi.system.mapper.SysUserMapper; | import com.ruoyi.system.mapper.SysUserMapper; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -381,6 +384,7 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| TAgentTask cond = new TAgentTask(); | TAgentTask cond = new TAgentTask(); | ||||
| cond.setOrderYear(task.getOrderYear()) | cond.setOrderYear(task.getOrderYear()) | ||||
| .setOrderMonth(task.getOrderMonth()) | .setOrderMonth(task.getOrderMonth()) | ||||
| .setAgentCenter(task.getAgentCenter()) | |||||
| .setAgentStatus(TAgentTask.AGENT_STATUS_READY) | .setAgentStatus(TAgentTask.AGENT_STATUS_READY) | ||||
| .putParam("orgCodeList", orgCodeList) | .putParam("orgCodeList", orgCodeList) | ||||
| ; | ; | ||||
| @@ -408,25 +412,40 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| public int revoke(TaskRevoke taskRevoke) | public int revoke(TaskRevoke taskRevoke) | ||||
| { | { | ||||
| TAgentTask task = taskRevoke.toAgentTask(); | TAgentTask task = taskRevoke.toAgentTask(); | ||||
| tAgentTaskMapper.revokeAgentTaskByOrgCode(task); | |||||
| return 1; | |||||
| return tAgentTaskMapper.revokeAgentTaskByOrgCode(task); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public int audit(TAgentTask task) | |||||
| public int audit(TaskAudit task) | |||||
| { | { | ||||
| TAgentTask dbTask = tAgentTaskMapper.selectTAgentTaskById(task.getId()); | |||||
| TAgentTask cond = new TAgentTask(); | |||||
| cond.setAgentCenter(task.getAgentCenter()); | |||||
| cond.putParam("idList", task.getTaskIds()); | |||||
| List<TAgentTask> dbTasks = tAgentTaskMapper.selectTAgentTaskList(cond); | |||||
| ASSERT.EXP(TAgentTask.AGENT_STATUS_FINISHED.equals(dbTask.getAgentStatus())); | |||||
| if(CollectionUtil.isEmpty(dbTasks)) | |||||
| return 1; | |||||
| dbTask.setAgentStatus(TAgentTask.AGENT_STATUS_AUDITED) | |||||
| .setIsAudit("Y") | |||||
| .setAuditDate(DateUtils.getNowDate()) | |||||
| .setAuditUser(task.getAuditUser()) | |||||
| .setAuditNick(sysUserMapper.selectUserByUserName(task.getAuditUser()).getNickName()) | |||||
| ; | |||||
| ASSERT.EXP(dbTasks.stream().allMatch((x) -> TAgentTask.AGENT_STATUS_FINISHED.equals(x.getAgentStatus())), "存在不是已完成的任务"); | |||||
| return tAgentTaskMapper.updateTAgentTask(dbTask); | |||||
| dbTasks.forEach((x) -> { | |||||
| x.setAgentStatus(TAgentTask.AGENT_STATUS_AUDITED) | |||||
| .setAuditDate(DateUtils.getNowDate()) | |||||
| .setAuditUser(task.getAuditUser()) | |||||
| .setAuditNick(sysUserMapper.selectUserByUserName(task.getAuditUser()).getNickName()) | |||||
| ; | |||||
| }); | |||||
| return tAgentTaskMapper.updateTAgentTaskBatch(dbTasks); | |||||
| } | |||||
| @Override | |||||
| public int auditAll(TaskAllAudit taskAllAudit) | |||||
| { | |||||
| TAgentTask task = taskAllAudit.toAgentTask(); | |||||
| task.setAuditDate(DateUtils.getNowDate()); | |||||
| task.setAuditNick(sysUserMapper.selectUserByUserName(task.getAuditUser()).getNickName()); | |||||
| return tAgentTaskMapper.auditAgentTask(task); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -440,6 +459,7 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| dbTask.setHandleRemark(task.getHandleRemark()) | dbTask.setHandleRemark(task.getHandleRemark()) | ||||
| .setAgentStatus(TAgentTask.AGENT_STATUS_FINISHED) | .setAgentStatus(TAgentTask.AGENT_STATUS_FINISHED) | ||||
| .setHandleDate(DateUtils.getNowDate()) | .setHandleDate(DateUtils.getNowDate()) | ||||
| .setAuditNick(sysUserMapper.selectUserByUserName(task.getHandleUser()).getNickName()) | |||||
| ; | ; | ||||
| return tAgentTaskMapper.updateTAgentTask(dbTask); | return tAgentTaskMapper.updateTAgentTask(dbTask); | ||||
| @@ -479,9 +499,9 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<AgentTaskTownNumGroup> getUndistribTaskList(TAgentTask tAgentTask, AgentTaskTownNumGroup summary) | |||||
| public List<AgentTaskNumGroup> getUndistribTaskList(TAgentTask tAgentTask, AgentTaskNumGroup summary) | |||||
| { | { | ||||
| List<AgentTaskTownNumGroup> agentTaskNumTownGroup = tAgentTaskMapper.getAgentTaskNumTownGroup(tAgentTask); | |||||
| List<AgentTaskNumGroup> agentTaskNumTownGroup = tAgentTaskMapper.getAgentTaskNumTownGroup(tAgentTask); | |||||
| summary.setNumVillage(0L) | summary.setNumVillage(0L) | ||||
| .setNumBook(0L) | .setNumBook(0L) | ||||
| @@ -490,17 +510,19 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| if(CollectionUtil.isNotEmpty(agentTaskNumTownGroup)) | if(CollectionUtil.isNotEmpty(agentTaskNumTownGroup)) | ||||
| { | { | ||||
| summary.setNumBook(agentTaskNumTownGroup.stream().map(AgentTaskTownNumGroup::getNumBook).reduce(0L, Long::sum)); | |||||
| summary.setNumVillage(agentTaskNumTownGroup.stream().map(AgentTaskTownNumGroup::getNumVillage).reduce(0L, Long::sum)); | |||||
| summary.setAllCount(agentTaskNumTownGroup.stream().map(AgentTaskTownNumGroup::getAllCount).reduce(0L, Long::sum)); | |||||
| summary.setNumBook(agentTaskNumTownGroup.stream().map(AgentTaskNumGroup::getNumBook).reduce(0L, Long::sum)); | |||||
| summary.setNumVillage(agentTaskNumTownGroup.stream().map(AgentTaskNumGroup::getNumVillage).reduce(0L, Long::sum)); | |||||
| summary.setAllCount(agentTaskNumTownGroup.stream().map(AgentTaskNumGroup::getAllCount).reduce(0L, Long::sum)); | |||||
| List<AgentTaskTownNumGroup> agentTaskNumVillageGroup = tAgentTaskMapper.getAgentTaskNumVillageGroup(tAgentTask); | |||||
| Map<String, List<AgentTaskTownNumGroup>> group = ContainerUtils.groupingBy(agentTaskNumVillageGroup, AgentTaskTownNumGroup::getTownCode); | |||||
| List<AgentTaskNumGroup> agentTaskNumVillageGroup = tAgentTaskMapper.getAgentTaskNumVillageGroup(tAgentTask); | |||||
| Map<String, List<AgentTaskNumGroup>> group = ContainerUtils.groupingBy(agentTaskNumVillageGroup, AgentTaskNumGroup::getTownCode); | |||||
| agentTaskNumTownGroup.forEach((x) -> { | agentTaskNumTownGroup.forEach((x) -> { | ||||
| x.calcOtherCount(); | |||||
| x.setOtherCount(x.getAllCount() - x.getAssetCount() - x.getContracCount() - x.getVoucherCount()); | |||||
| x.setVillageList(group.getOrDefault(x.getTownCode(), new ArrayList<>())); | x.setVillageList(group.getOrDefault(x.getTownCode(), new ArrayList<>())); | ||||
| x.getVillageList().forEach(AgentTaskTownNumGroup::calcOtherCount); | |||||
| x.getVillageList().forEach((y) -> { | |||||
| y.setOtherCount(y.getAllCount() - y.getAssetCount() - y.getContracCount() - y.getVoucherCount()); | |||||
| }); | |||||
| }); | }); | ||||
| } | } | ||||
| @@ -508,9 +530,9 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| } | } | ||||
| @Override | @Override | ||||
| public CountyTaskSummary countyTaskSummary(TAgentTask task) | |||||
| public AgentTaskSummary countyTaskSummary(TAgentTask task) | |||||
| { | { | ||||
| CountyTaskSummary res = new CountyTaskSummary(); | |||||
| AgentTaskSummary res = new AgentTaskSummary(); | |||||
| List<AgentTaskTownGroup> agentTaskNumTownGroup = tAgentTaskMapper.getAgentTaskGroupByTown(task); | List<AgentTaskTownGroup> agentTaskNumTownGroup = tAgentTaskMapper.getAgentTaskGroupByTown(task); | ||||
| res.setNumTown((long)agentTaskNumTownGroup.size()); | res.setNumTown((long)agentTaskNumTownGroup.size()); | ||||
| @@ -566,9 +588,9 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| } | } | ||||
| @Override | @Override | ||||
| public CountyTaskSummary countyProcessingTaskSummary(TAgentTask task) | |||||
| public AgentTaskSummary countyProcessingTaskSummary(TAgentTask task) | |||||
| { | { | ||||
| CountyTaskSummary res = new CountyTaskSummary(); | |||||
| AgentTaskSummary res = new AgentTaskSummary(); | |||||
| task.setAgentStatus(TAgentTask.AGENT_STATUS_PROCESSING); | task.setAgentStatus(TAgentTask.AGENT_STATUS_PROCESSING); | ||||
| List<AgentTaskTownGroup> agentTaskNumTownGroup = tAgentTaskMapper.getAgentTaskGroupByTown(task); | List<AgentTaskTownGroup> agentTaskNumTownGroup = tAgentTaskMapper.getAgentTaskGroupByTown(task); | ||||
| @@ -581,4 +603,50 @@ public class TAgentTaskServiceImpl implements ITAgentTaskService | |||||
| return res; | return res; | ||||
| } | } | ||||
| @Override | |||||
| public List<AgentTaskNumGroup> getAuditingTaskList(TAgentTask tAgentTask) | |||||
| { | |||||
| tAgentTask.setAgentStatus(TAgentTask.AGENT_STATUS_FINISHED); | |||||
| List<AgentTaskNumGroup> villageGroups = tAgentTaskMapper.getAgentTaskNumVillageGroup(tAgentTask); | |||||
| if(CollectionUtil.isNotEmpty(villageGroups)) | |||||
| { | |||||
| List<String> orgCodeList = ContainerUtils.mapToList(villageGroups, AgentTaskNumGroup::getOrgCode); | |||||
| TAgentTask agentTaskCond = new TAgentTask(); | |||||
| agentTaskCond.setAgentStatus(TAgentTask.AGENT_STATUS_FINISHED); | |||||
| agentTaskCond.putParam("orgCodeList", orgCodeList); | |||||
| List<TAgentTask> tAgentTasks = tAgentTaskMapper.selectTAgentTaskList(agentTaskCond); | |||||
| Map<String, List<TAgentTask>> bookGroup = ContainerUtils.groupingBy(tAgentTasks, TAgentTask::getOrgCode); | |||||
| villageGroups.forEach((village) -> { | |||||
| if(StringUtils.isNotEmpty(village.getHandleDate())) | |||||
| village.setHandleDate(DateUtils.date(village.getHandleDate(), "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd")); | |||||
| if(StringUtils.isNotEmpty(village.getDistriDate())) | |||||
| village.setDistriDate(DateUtils.date(village.getDistriDate(), "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd")); | |||||
| village.setupOverdueFinish(); | |||||
| village.setOtherCount(village.getAllCount() - village.getContracCount() - village.getVoucherCount()); | |||||
| village.setTaskList(bookGroup.getOrDefault(village.getOrgCode(), new ArrayList<>())); | |||||
| village.getTaskList().forEach((x) -> { | |||||
| x.setOtherCount(x.getAllCount() - x.getVoucherCount() - x.getContracCount()); | |||||
| }); | |||||
| }); | |||||
| } | |||||
| return villageGroups; | |||||
| } | |||||
| @Override | |||||
| public AgentTaskSummary auditTaskSummary(TAgentTask task) | |||||
| { | |||||
| AgentTaskSummary res = new AgentTaskSummary(); | |||||
| task.setAgentStatus(TAgentTask.AGENT_STATUS_FINISHED); | |||||
| AgentTaskTownGroup summary = tAgentTaskMapper.getAgentTaskTownSummary(task); | |||||
| res.setNumVillage(summary.getNumVillage()) | |||||
| .setNumBook(summary.getNum()) | |||||
| ; | |||||
| return res; | |||||
| } | |||||
| } | } | ||||
| @@ -5,7 +5,7 @@ import lombok.experimental.Accessors; | |||||
| @Data | @Data | ||||
| @Accessors(chain = true) | @Accessors(chain = true) | ||||
| public class CountyTaskSummary | |||||
| public class AgentTaskSummary | |||||
| { | { | ||||
| private Long numTown; | private Long numTown; | ||||
| private Long numBook; | private Long numBook; | ||||
| @@ -0,0 +1,30 @@ | |||||
| package com.ruoyi.agentcenter.vo; | |||||
| import cn.hutool.core.bean.BeanUtil; | |||||
| import com.ruoyi.agentcenter.domain.TAgentTask; | |||||
| import lombok.Data; | |||||
| import lombok.experimental.Accessors; | |||||
| import javax.validation.constraints.NotBlank; | |||||
| import javax.validation.constraints.NotEmpty; | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| public class TaskAllAudit | |||||
| { | |||||
| @NotEmpty(message = "年不能为空") | |||||
| private String orderYear; | |||||
| @NotEmpty(message = "月不能为空") | |||||
| private String orderMonth; | |||||
| @NotBlank(message = "县地区不能为空") | |||||
| private String countyCode; | |||||
| private String townCode; | |||||
| private String auditUser; | |||||
| private String agentCenter; | |||||
| public TAgentTask toAgentTask() | |||||
| { | |||||
| return BeanUtil.copyProperties(this, TAgentTask.class); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| package com.ruoyi.agentcenter.vo; | |||||
| import cn.hutool.core.bean.BeanUtil; | |||||
| import com.ruoyi.agentcenter.domain.TAgentTask; | |||||
| import lombok.Data; | |||||
| import lombok.experimental.Accessors; | |||||
| import javax.validation.constraints.NotEmpty; | |||||
| import javax.validation.constraints.NotNull; | |||||
| import java.util.Date; | |||||
| @Data | |||||
| @Accessors(chain = true) | |||||
| public class TaskAudit | |||||
| { | |||||
| @NotEmpty(message = "任务ID不能为空") | |||||
| private Long[] taskIds; | |||||
| private String auditUser; | |||||
| private String agentCenter; | |||||
| } | |||||
| @@ -26,6 +26,7 @@ public class TaskDistrib | |||||
| private String orderMonth; | private String orderMonth; | ||||
| private String distriUser; | private String distriUser; | ||||
| private String agentCenter; | |||||
| @Data | @Data | ||||
| @Accessors(chain = true) | @Accessors(chain = true) | ||||
| @@ -19,6 +19,8 @@ public class TaskRevoke | |||||
| @NotBlank(message = "村不能为空") | @NotBlank(message = "村不能为空") | ||||
| private String orgCode; | private String orgCode; | ||||
| private String agentCenter; | |||||
| public TAgentTask toAgentTask() | public TAgentTask toAgentTask() | ||||
| { | { | ||||
| return BeanUtil.copyProperties(this, TAgentTask.class); | return BeanUtil.copyProperties(this, TAgentTask.class); | ||||
| @@ -34,7 +34,6 @@ | |||||
| <result property="auditUser" column="audit_user" /> | <result property="auditUser" column="audit_user" /> | ||||
| <result property="auditNick" column="audit_nick" /> | <result property="auditNick" column="audit_nick" /> | ||||
| <result property="auditDate" column="audit_date" /> | <result property="auditDate" column="audit_date" /> | ||||
| <result property="isAudit" column="is_audit" /> | |||||
| <result property="appraiseUser" column="appraise_user" /> | <result property="appraiseUser" column="appraise_user" /> | ||||
| <result property="appraiseNick" column="appraise_nick" /> | <result property="appraiseNick" column="appraise_nick" /> | ||||
| <result property="appraiseScore" column="appraise_score" /> | <result property="appraiseScore" column="appraise_score" /> | ||||
| @@ -50,7 +49,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="selectTAgentTaskVo"> | <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, abnormal_count 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, 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> | </sql> | ||||
| <select id="selectTAgentTaskList" parameterType="TAgentTask" resultMap="TAgentTaskResult"> | <select id="selectTAgentTaskList" parameterType="TAgentTask" resultMap="TAgentTaskResult"> | ||||
| @@ -84,7 +83,6 @@ | |||||
| <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | ||||
| <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | ||||
| <if test="auditDate != null "> and audit_date = #{auditDate}</if> | <if test="auditDate != null "> and audit_date = #{auditDate}</if> | ||||
| <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if> | |||||
| <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | ||||
| <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | ||||
| <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | ||||
| @@ -97,6 +95,9 @@ | |||||
| <if test="params.agentStatusList != null"> | <if test="params.agentStatusList != null"> | ||||
| AND agent_status IN (null <foreach collection="params.agentStatusList" item="i">,#{i}</foreach> ) | AND agent_status IN (null <foreach collection="params.agentStatusList" item="i">,#{i}</foreach> ) | ||||
| </if> | </if> | ||||
| <if test="params.idList != null"> | |||||
| AND id IN (null <foreach collection="params.idList" item="i">,#{i}</foreach> ) | |||||
| </if> | |||||
| </if> | </if> | ||||
| </where> | </where> | ||||
| </select> | </select> | ||||
| @@ -137,7 +138,6 @@ | |||||
| <if test="auditUser != null">audit_user,</if> | <if test="auditUser != null">audit_user,</if> | ||||
| <if test="auditNick != null">audit_nick,</if> | <if test="auditNick != null">audit_nick,</if> | ||||
| <if test="auditDate != null">audit_date,</if> | <if test="auditDate != null">audit_date,</if> | ||||
| <if test="isAudit != null">is_audit,</if> | |||||
| <if test="appraiseUser != null">appraise_user,</if> | <if test="appraiseUser != null">appraise_user,</if> | ||||
| <if test="appraiseNick != null">appraise_nick,</if> | <if test="appraiseNick != null">appraise_nick,</if> | ||||
| <if test="appraiseScore != null">appraise_score,</if> | <if test="appraiseScore != null">appraise_score,</if> | ||||
| @@ -178,7 +178,6 @@ | |||||
| <if test="auditUser != null">#{auditUser},</if> | <if test="auditUser != null">#{auditUser},</if> | ||||
| <if test="auditNick != null">#{auditNick},</if> | <if test="auditNick != null">#{auditNick},</if> | ||||
| <if test="auditDate != null">#{auditDate},</if> | <if test="auditDate != null">#{auditDate},</if> | ||||
| <if test="isAudit != null">#{isAudit},</if> | |||||
| <if test="appraiseUser != null">#{appraiseUser},</if> | <if test="appraiseUser != null">#{appraiseUser},</if> | ||||
| <if test="appraiseNick != null">#{appraiseNick},</if> | <if test="appraiseNick != null">#{appraiseNick},</if> | ||||
| <if test="appraiseScore != null">#{appraiseScore},</if> | <if test="appraiseScore != null">#{appraiseScore},</if> | ||||
| @@ -224,7 +223,6 @@ | |||||
| audit_user, | audit_user, | ||||
| audit_nick, | audit_nick, | ||||
| audit_date, | audit_date, | ||||
| is_audit, | |||||
| appraise_user, | appraise_user, | ||||
| appraise_nick, | appraise_nick, | ||||
| appraise_score, | appraise_score, | ||||
| @@ -267,7 +265,6 @@ | |||||
| #{item.auditUser}, | #{item.auditUser}, | ||||
| #{item.auditNick}, | #{item.auditNick}, | ||||
| #{item.auditDate}, | #{item.auditDate}, | ||||
| #{item.isAudit}, | |||||
| #{item.appraiseUser}, | #{item.appraiseUser}, | ||||
| #{item.appraiseNick}, | #{item.appraiseNick}, | ||||
| #{item.appraiseScore}, | #{item.appraiseScore}, | ||||
| @@ -313,7 +310,6 @@ | |||||
| <if test="auditUser != null">audit_user = #{auditUser},</if> | <if test="auditUser != null">audit_user = #{auditUser},</if> | ||||
| <if test="auditNick != null">audit_nick = #{auditNick},</if> | <if test="auditNick != null">audit_nick = #{auditNick},</if> | ||||
| <if test="auditDate != null">audit_date = #{auditDate},</if> | <if test="auditDate != null">audit_date = #{auditDate},</if> | ||||
| <if test="isAudit != null">is_audit = #{isAudit},</if> | |||||
| <if test="appraiseUser != null">appraise_user = #{appraiseUser},</if> | <if test="appraiseUser != null">appraise_user = #{appraiseUser},</if> | ||||
| <if test="appraiseNick != null">appraise_nick = #{appraiseNick},</if> | <if test="appraiseNick != null">appraise_nick = #{appraiseNick},</if> | ||||
| <if test="appraiseScore != null">appraise_score = #{appraiseScore},</if> | <if test="appraiseScore != null">appraise_score = #{appraiseScore},</if> | ||||
| @@ -361,7 +357,6 @@ | |||||
| <if test="item.auditUser != null">audit_user = #{item.auditUser},</if> | <if test="item.auditUser != null">audit_user = #{item.auditUser},</if> | ||||
| <if test="item.auditNick != null">audit_nick = #{item.auditNick},</if> | <if test="item.auditNick != null">audit_nick = #{item.auditNick},</if> | ||||
| <if test="item.auditDate != null">audit_date = #{item.auditDate},</if> | <if test="item.auditDate != null">audit_date = #{item.auditDate},</if> | ||||
| <if test="item.isAudit != null">is_audit = #{item.isAudit},</if> | |||||
| <if test="item.appraiseUser != null">appraise_user = #{item.appraiseUser},</if> | <if test="item.appraiseUser != null">appraise_user = #{item.appraiseUser},</if> | ||||
| <if test="item.appraiseNick != null">appraise_nick = #{item.appraiseNick},</if> | <if test="item.appraiseNick != null">appraise_nick = #{item.appraiseNick},</if> | ||||
| <if test="item.appraiseScore != null">appraise_score = #{item.appraiseScore},</if> | <if test="item.appraiseScore != null">appraise_score = #{item.appraiseScore},</if> | ||||
| @@ -420,7 +415,6 @@ | |||||
| <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | ||||
| <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | ||||
| <if test="auditDate != null "> and audit_date = #{auditDate}</if> | <if test="auditDate != null "> and audit_date = #{auditDate}</if> | ||||
| <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if> | |||||
| <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | ||||
| <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | ||||
| <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | ||||
| @@ -462,7 +456,6 @@ | |||||
| <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | ||||
| <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | ||||
| <if test="auditDate != null "> and audit_date = #{auditDate}</if> | <if test="auditDate != null "> and audit_date = #{auditDate}</if> | ||||
| <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if> | |||||
| <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | ||||
| <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | ||||
| <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | ||||
| @@ -504,7 +497,6 @@ | |||||
| <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | <if test="auditUser != null and auditUser != ''"> and audit_user = #{auditUser}</if> | ||||
| <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | <if test="auditNick != null and auditNick != ''"> and audit_nick = #{auditNick}</if> | ||||
| <if test="auditDate != null "> and audit_date = #{auditDate}</if> | <if test="auditDate != null "> and audit_date = #{auditDate}</if> | ||||
| <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if> | |||||
| <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | <if test="appraiseUser != null and appraiseUser != ''"> and appraise_user = #{appraiseUser}</if> | ||||
| <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | <if test="appraiseNick != null and appraiseNick != ''"> and appraise_nick = #{appraiseNick}</if> | ||||
| <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | <if test="appraiseScore != null "> and appraise_score = #{appraiseScore}</if> | ||||
| @@ -551,7 +543,7 @@ | |||||
| COUNT(*) as num, | COUNT(*) as num, | ||||
| COUNT(DISTINCT org_code) as num_village, | COUNT(DISTINCT org_code) as num_village, | ||||
| COUNT(*) = SUM(IF(agent_status = '3' OR agent_status = '4', 1, 0)) as num_process_finish, | COUNT(*) = SUM(IF(agent_status = '3' OR agent_status = '4', 1, 0)) as num_process_finish, | ||||
| COUNT(*) = SUM(IF(is_audit = 'Y', 1, 0)) as num_approval_finish, | |||||
| COUNT(*) = SUM(IF(agent_status = '4', 1, 0)) as num_approval_finish, | |||||
| town_name, town_code, | town_name, town_code, | ||||
| order_year, order_month, | order_year, order_month, | ||||
| IFNULL(SUM(IF(abnormal_count > 0, 1, 0)), 0) as num_except | IFNULL(SUM(IF(abnormal_count > 0, 1, 0)), 0) as num_except | ||||
| @@ -569,6 +561,24 @@ | |||||
| ORDER BY town_code | ORDER BY town_code | ||||
| </select> | </select> | ||||
| <select id="getAgentTaskTownSummary" parameterType="TAgentTask" resultMap="AgentTaskTownGroupResultMap"> | |||||
| SELECT | |||||
| COUNT(*) as num, | |||||
| COUNT(DISTINCT org_code) as num_village, | |||||
| town_name, town_code, | |||||
| order_year, order_month | |||||
| FROM | |||||
| t_agent_task | |||||
| <where> | |||||
| <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="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if> | |||||
| <if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if> | |||||
| <if test="agentStatus != null and agentStatus != ''"> and agent_status = #{agentStatus}</if> | |||||
| </where> | |||||
| </select> | |||||
| <resultMap id="AgentTaskVillageGroupResultMap" type="com.ruoyi.agentcenter.dto.AgentTaskVillageGroup"> | <resultMap id="AgentTaskVillageGroupResultMap" type="com.ruoyi.agentcenter.dto.AgentTaskVillageGroup"> | ||||
| <result property="num" column="num"/> | <result property="num" column="num"/> | ||||
| <result property="numProcessFinish" column="num_process_finish"/> | <result property="numProcessFinish" column="num_process_finish"/> | ||||
| @@ -594,7 +604,7 @@ | |||||
| SELECT | SELECT | ||||
| COUNT(*) as num, | COUNT(*) as num, | ||||
| IFNULL(SUM(IF(agent_status = '3' OR agent_status = '4', 1, 0)), 0) as num_process_finish, | IFNULL(SUM(IF(agent_status = '3' OR agent_status = '4', 1, 0)), 0) as num_process_finish, | ||||
| IFNULL(SUM(IF(is_audit = 'Y', 1, 0)), 0) as num_approval_finish, | |||||
| IFNULL(SUM(IF(agent_status = '4', 1, 0)), 0) as num_approval_finish, | |||||
| org_name, org_code, town_code, | 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, | IFNULL(SUM(abnormal_count), 0) as num_except, | ||||
| @@ -623,7 +633,7 @@ | |||||
| SELECT | SELECT | ||||
| COUNT(*) as num, | COUNT(*) as num, | ||||
| IFNULL(SUM(IF(agent_status = '3' OR agent_status = '4', 1, 0)), 0) as num_process_finish, | IFNULL(SUM(IF(agent_status = '3' OR agent_status = '4', 1, 0)), 0) as num_process_finish, | ||||
| IFNULL(SUM(IF(is_audit = 'Y', 1, 0)), 0) as num_approval_finish, | |||||
| IFNULL(SUM(IF(agent_status = '4', 1, 0)), 0) as num_approval_finish, | |||||
| org_name, org_code, town_code, | org_name, org_code, town_code, | ||||
| IFNULL(SUM(abnormal_count), 0) as num_except | IFNULL(SUM(abnormal_count), 0) as num_except | ||||
| FROM | FROM | ||||
| @@ -646,8 +656,8 @@ | |||||
| <select id="getProcessedAgentTaskGroupByVillage" parameterType="TAgentTask" resultMap="AgentTaskVillageGroupResultMap"> | <select id="getProcessedAgentTaskGroupByVillage" parameterType="TAgentTask" resultMap="AgentTaskVillageGroupResultMap"> | ||||
| SELECT | SELECT | ||||
| COUNT(*) as num, | COUNT(*) as num, | ||||
| IFNULL(SUM(IF(is_audit != 'Y', 1, 0)), 0) as num_not_approval, | |||||
| IFNULL(SUM(IF(is_audit = 'Y', 1, 0)), 0) as num_approval_finish, | |||||
| IFNULL(SUM(IF(agent_status = '3', 1, 0)), 0) as num_not_approval, | |||||
| IFNULL(SUM(IF(agent_status = '4', 1, 0)), 0) as num_approval_finish, | |||||
| org_name, org_code, town_code, | org_name, org_code, town_code, | ||||
| MAX(end_at) as end_at, MAX(handle_date) as handle_date, MAX(distri_date) as distri_date, GROUP_CONCAT(DISTINCT audit_nick) as handle_nick | MAX(end_at) as end_at, MAX(handle_date) as handle_date, MAX(distri_date) as distri_date, GROUP_CONCAT(DISTINCT audit_nick) as handle_nick | ||||
| FROM | FROM | ||||
| @@ -692,7 +702,7 @@ | |||||
| </select> | </select> | ||||
| <select id="getTAgentTaskProcessedList" parameterType="TAgentTask" resultMap="TAgentTaskResult"> | <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 | |||||
| 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, 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 | , IF(LEFT(handle_date, 10) > end_at, 1, 0) as overdue | ||||
| from t_agent_task | from t_agent_task | ||||
| <where> | <where> | ||||
| @@ -703,7 +713,6 @@ | |||||
| <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</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="orderYear != null and orderYear != ''"> and order_year = #{orderYear}</if> | ||||
| <if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</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="isAppraise != null and isAppraise != ''"> and is_appraise = #{isAppraise}</if> | ||||
| <if test="params != null"> | <if test="params != null"> | ||||
| <if test="params.orgCodeList != null"> | <if test="params.orgCodeList != null"> | ||||
| @@ -734,7 +743,7 @@ | |||||
| GROUP BY handle_user | GROUP BY handle_user | ||||
| </select> | </select> | ||||
| <resultMap id="AgentTaskTownNumGroupResultMap" type="com.ruoyi.agentcenter.dto.AgentTaskTownNumGroup"> | |||||
| <resultMap id="AgentTaskNumGroupResultMap" type="com.ruoyi.agentcenter.dto.AgentTaskNumGroup"> | |||||
| <result property="numVillage" column="num_village"/> | <result property="numVillage" column="num_village"/> | ||||
| <result property="numBook" column="num_book"/> | <result property="numBook" column="num_book"/> | ||||
| <result property="voucherCount" column="voucher_count"/> | <result property="voucherCount" column="voucher_count"/> | ||||
| @@ -747,9 +756,12 @@ | |||||
| <result property="orgName" column="org_name"/> | <result property="orgName" column="org_name"/> | ||||
| <result property="orgCode" column="org_code"/> | <result property="orgCode" column="org_code"/> | ||||
| <result property="endAt" column="end_at"/> | <result property="endAt" column="end_at"/> | ||||
| <result property="distriDate" column="distri_date"/> | |||||
| <result property="handleDate" column="handle_date"/> | |||||
| <result property="handleNick" column="handle_nick"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getAgentTaskNumTownGroup" parameterType="TAgentTask" resultMap="AgentTaskTownNumGroupResultMap"> | |||||
| <select id="getAgentTaskNumTownGroup" parameterType="TAgentTask" resultMap="AgentTaskNumGroupResultMap"> | |||||
| SELECT | SELECT | ||||
| COUNT(*) as num_book, | COUNT(*) as num_book, | ||||
| COUNT(DISTINCT org_code) as num_village, | COUNT(DISTINCT org_code) as num_village, | ||||
| @@ -772,7 +784,7 @@ | |||||
| ORDER BY town_code | ORDER BY town_code | ||||
| </select> | </select> | ||||
| <select id="getAgentTaskNumVillageGroup" parameterType="TAgentTask" resultMap="AgentTaskTownNumGroupResultMap"> | |||||
| <select id="getAgentTaskNumVillageGroup" parameterType="TAgentTask" resultMap="AgentTaskNumGroupResultMap"> | |||||
| SELECT | SELECT | ||||
| COUNT(*) as num_book, | COUNT(*) as num_book, | ||||
| COUNT(DISTINCT org_code) as num_village, | COUNT(DISTINCT org_code) as num_village, | ||||
| @@ -780,7 +792,7 @@ | |||||
| IFNULL(SUM(contrac_count), 0) as contrac_count, | IFNULL(SUM(contrac_count), 0) as contrac_count, | ||||
| IFNULL(SUM(all_count), 0) as all_count, | IFNULL(SUM(all_count), 0) as all_count, | ||||
| IFNULL(SUM(asset_count), 0) as asset_count, | IFNULL(SUM(asset_count), 0) as asset_count, | ||||
| MAX(end_at) as end_at, | |||||
| MAX(end_at) as end_at, MAX(distri_date) as distri_date, MAX(handle_date) as handle_date, GROUP_CONCAT(DISTINCT handle_nick) as handle_nick, | |||||
| org_name, org_code, | org_name, org_code, | ||||
| town_name, town_code | town_name, town_code | ||||
| FROM | FROM | ||||
| @@ -794,7 +806,7 @@ | |||||
| <if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if> | <if test="orderMonth != null and orderMonth != ''"> and order_month = #{orderMonth}</if> | ||||
| </where> | </where> | ||||
| GROUP BY org_code | GROUP BY org_code | ||||
| ORDER BY org_code | |||||
| ORDER BY town_code, org_code | |||||
| </select> | </select> | ||||
| <update id="revokeAgentTaskByOrgCode" parameterType="TAgentTask"> | <update id="revokeAgentTaskByOrgCode" parameterType="TAgentTask"> | ||||
| @@ -812,11 +824,45 @@ | |||||
| <if test="updateBy != null">update_by = #{updateBy},</if> | <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
| <if test="updateTime != null">update_time = #{updateTime},</if> | <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
| </trim> | </trim> | ||||
| where | |||||
| org_code = #{orgCode} | |||||
| <where> | |||||
| <if test="agentCenter != null and agentCenter != ''"> and agent_center = #{agentCenter}</if> | |||||
| and org_code = #{orgCode} | |||||
| and order_year = #{orderYear} | and order_year = #{orderYear} | ||||
| and order_month = #{orderMonth} | and order_month = #{orderMonth} | ||||
| and agent_status = '2' | and agent_status = '2' | ||||
| </where> | |||||
| </update> | |||||
| <update id="auditAgentTask" parameterType="TAgentTask"> | |||||
| update t_agent_task | |||||
| <trim prefix="SET" suffixOverrides=","> | |||||
| agent_status = '4', | |||||
| audit_user = #{auditUser}, | |||||
| audit_nick = #{auditNick}, | |||||
| audit_date = #{auditDate}, | |||||
| <if test="updateBy != null">update_by = #{updateBy},</if> | |||||
| <if test="updateTime != null">update_time = #{updateTime},</if> | |||||
| </trim> | |||||
| <where> | |||||
| <if test="agentCenter != null and agentCenter != ''"> and agent_center = #{agentCenter}</if> | |||||
| <choose> | |||||
| <when test="countyCode != null and countyCode != ''"> | |||||
| AND county_code = #{countyCode} | |||||
| </when> | |||||
| <when test="orgCode != null and orgCode != ''"> | |||||
| AND org_code = #{orgCode} | |||||
| </when> | |||||
| <when test="townCode != null and townCode != ''"> | |||||
| AND town_code = #{townCode} | |||||
| </when> | |||||
| <otherwise> | |||||
| 1 = 2 | |||||
| </otherwise> | |||||
| </choose> | |||||
| and order_year = #{orderYear} | |||||
| and order_month = #{orderMonth} | |||||
| and agent_status = '3' | |||||
| </where> | |||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||
| @@ -0,0 +1,88 @@ | |||||
| package com.ruoyi.common.utils; | |||||
| import java.util.stream.Stream; | |||||
| public final class ARG<T> | |||||
| { | |||||
| private T[] args; | |||||
| public ARG(T...args) | |||||
| { | |||||
| this.args = args; | |||||
| } | |||||
| public int argc() | |||||
| { | |||||
| return Argc((Object[]) args); | |||||
| } | |||||
| @SuppressWarnings("unchecked") | |||||
| public T argv(int i, T...defValue) | |||||
| { | |||||
| return (T)Argv(i, (T)First((Object[]) defValue)); | |||||
| } | |||||
| public Stream<T> stream(T...args) | |||||
| { | |||||
| return Stream.of(args); | |||||
| } | |||||
| public static int Argc(Object...args) | |||||
| { | |||||
| return null != args ? args.length : 0; | |||||
| } | |||||
| public static Object Argv(int i, Object...args) | |||||
| { | |||||
| return Argv_def(i, null, args); | |||||
| } | |||||
| public static Object Argv_def(int i, Object defValue, Object...args) | |||||
| { | |||||
| int argc = Argc(args); | |||||
| int index = i < 0 ? argc + i : i; | |||||
| if(index >= argc) | |||||
| throw new RuntimeException(String.format("Argv: index(%d) >= argc(%d)", index, argc)); | |||||
| Object ret = args[index]; | |||||
| return null != ret ? ret : defValue; | |||||
| } | |||||
| public static Object First(Object...args) | |||||
| { | |||||
| return Argv(0, args); | |||||
| } | |||||
| public static Object First_def(Object defValue, Object...args) | |||||
| { | |||||
| return Argv_def(0, null, args); | |||||
| } | |||||
| public static Stream<Object> Stream(Object...args) | |||||
| { | |||||
| return Stream.of(args); | |||||
| } | |||||
| public static <T> T ArgvT_def(int i, T defValue, T...args) | |||||
| { | |||||
| int argc = Argc((Object[]) args); | |||||
| int index = i < 0 ? argc + i : i; | |||||
| if(index >= argc) | |||||
| throw new RuntimeException(String.format("Argv: index(%d) >= argc(%d)", index, argc)); | |||||
| T ret = args[index]; | |||||
| return null != ret ? ret : defValue; | |||||
| } | |||||
| public static <T> T FirstT(T...args) | |||||
| { | |||||
| return ArgvT_def(0, null, args); | |||||
| } | |||||
| public static <T> T FirstT_def(T defValue, T...args) | |||||
| { | |||||
| return ArgvT_def(0, defValue, args); | |||||
| } | |||||
| public static <T> Stream<T> StreamT(T...args) | |||||
| { | |||||
| return Stream.of(args); | |||||
| } | |||||
| } | |||||
| @@ -9,6 +9,8 @@ import java.time.LocalTime; | |||||
| import java.time.ZoneId; | import java.time.ZoneId; | ||||
| import java.time.ZonedDateTime; | import java.time.ZonedDateTime; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import cn.hutool.core.date.DateUtil; | |||||
| import org.apache.commons.lang3.time.DateFormatUtils; | import org.apache.commons.lang3.time.DateFormatUtils; | ||||
| /** | /** | ||||
| @@ -188,4 +190,53 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils | |||||
| ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); | ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); | ||||
| return Date.from(zdt.toInstant()); | return Date.from(zdt.toInstant()); | ||||
| } | } | ||||
| public static String yyyy(Date...date) | |||||
| { | |||||
| Date d = ARG.FirstT_def(new Date(), date); | |||||
| return DateUtil.format(d, "yyyy"); | |||||
| } | |||||
| public static String yyyy_MM(Date...date) | |||||
| { | |||||
| Date d = ARG.FirstT_def(new Date(), date); | |||||
| return DateUtil.format(d, "yyyy-MM"); | |||||
| } | |||||
| public static String yyyy_MM_dd(Date...date) | |||||
| { | |||||
| Date d = ARG.FirstT_def(new Date(), date); | |||||
| return DateUtil.format(d, "yyyy-MM-dd"); | |||||
| } | |||||
| public static String yyyy_MM_dd_HH_mm_ss(Date...date) | |||||
| { | |||||
| Date d = ARG.FirstT_def(new Date(), date); | |||||
| return DateUtil.format(d, "yyyy-MM-dd HH:mm:ss"); | |||||
| } | |||||
| public static Date yyyy(String str) | |||||
| { | |||||
| return DateUtil.parse(str, "yyyy"); | |||||
| } | |||||
| public static Date yyyy_MM(String str) | |||||
| { | |||||
| return DateUtil.parse(str, "yyyy-MM"); | |||||
| } | |||||
| public static Date yyyy_MM_dd(String str) | |||||
| { | |||||
| return DateUtil.parse(str, "yyyy-MM-dd"); | |||||
| } | |||||
| public static Date yyyy_MM_dd_HH_mm_ss(String str) | |||||
| { | |||||
| return DateUtil.parse(str, "yyyy-MM-dd HH:mm:ss"); | |||||
| } | |||||
| public static String date(String src, String srcFormat, String dstFormat) | |||||
| { | |||||
| return DateUtil.format(DateUtil.parse(src, srcFormat), dstFormat); | |||||
| } | |||||
| } | } | ||||