From 246494c9cfe6b1dea970c48c358f74813c7bd540 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 28 Nov 2022 11:19:44 +0800 Subject: [PATCH 1/2] . --- .../TAbilityApplicationController.java | 7 +++++++ .../listener/v3/CorrectionListenerV3.java | 18 +++++++++--------- .../service/TAbilityApplicationService.java | 2 ++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index 1a45633e..19ff79dd 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -617,4 +617,11 @@ public class TAbilityApplicationController { } + @GetMapping("/getApplyPriceCount") + @ApiOperation("资金报表大屏获取总节约资金") + @LogOperation("资金报表大屏获取总节约资金") + public Result getApplyPriceCount() { + return new Result().ok(tAbilityApplicationService.getApplyPriceCount()); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java index 7875beb3..6a09caa0 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/v3/CorrectionListenerV3.java @@ -236,15 +236,15 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac List historicActivityInstanceList = historyService.createHistoricActivityInstanceQuery().processInstanceId(delegateTask.getProcessInstanceId()) .activityType("userTask").unfinished().orderByHistoricActivityInstanceEndTime().desc().list(); - //if (!historicActivityInstanceList.isEmpty() && historicActivityInstanceList.get(0).getAssignee().equals(assignee)) { - // taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人重复,默认通过"); - // taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE); - // taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); - // taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); - // taskService.complete(delegateTask.getId(), delegateTask.getVariables()); - // sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); - // return; - //} + if (!historicActivityInstanceList.isEmpty() && historicActivityInstanceList.get(0).getAssignee().equals(assignee)) { + taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人重复,默认通过"); + taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE); + taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE); + taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId()); + taskService.complete(delegateTask.getId(), delegateTask.getVariables()); + sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1); + return; + } List dtoList = delegateTask.getVariable("tAbilityApplicationDTOList", List.class); Optional tAbilityApplicationDTO = dtoList.stream().filter(index -> { diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java index 63bd6236..f763b77f 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/TAbilityApplicationService.java @@ -84,4 +84,6 @@ public interface TAbilityApplicationService extends CrudService params); Object getApplyDistrictFundStatement(Map params); + + Object getApplyPriceCount(); } \ No newline at end of file From 85e3c58cf8e58df7063c2fc2712219f627692f57 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 28 Nov 2022 16:47:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=87=91=E9=A2=9D=E8=BD=AC=E4=B8=BA?= =?UTF-8?q?=E4=B8=87=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/TAbilityApplicationDao.java | 2 -- .../impl/TAbilityApplicationServiceImpl.java | 23 +++++++++++++------ .../processForm/TAbilityApplicationDao.xml | 20 +++++++--------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java index d998196c..b1c5e388 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java @@ -67,8 +67,6 @@ public interface TAbilityApplicationDao extends BaseDao getDistrictFundStatement(); - List getCenusDistrictList(); - List getComponentFundStatement(); List getResourceFundStatement(); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java index cb75db58..bd8a539e 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java @@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; import java.util.stream.Collectors; @@ -211,7 +212,7 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl params) { - List cenusDistrictList = abilityApplicationDao.getCenusDistrictList(); + List cenusDistrictList = abilityApplicationDao.getDistrictFundStatement(); List resultList = new ArrayList<>(); resultList.addAll(cenusDistrictList); return resultList; @@ -220,9 +221,9 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl params) { List cenusDistrictList = abilityApplicationDao.getComponentFundStatement(); - Long total = 0L; + BigDecimal total = BigDecimal.ZERO; for (Map map : cenusDistrictList) { - total = total + Long.parseLong(map.get("applyPrice").toString()); + total = total.add((BigDecimal) map.get("applyPrice")); } Map resultMap = new HashMap<>(); resultMap.put("list", cenusDistrictList); @@ -233,9 +234,9 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl params) { List list = abilityApplicationDao.getResourceFundStatement(); - Long total = 0L; + BigDecimal total = BigDecimal.ZERO; for (Map map : list) { - total = total + Long.parseLong(map.get("applyPrice").toString()); + total = total.add((BigDecimal) map.get("applyPrice")); } Map resultMap = new HashMap<>(); resultMap.put("list", list); @@ -246,9 +247,9 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl params) { List list = abilityApplicationDao.getInfrastructureFundStatement(); - Long total = 0L; + BigDecimal total = BigDecimal.ZERO; for (Map map : list) { - total = total + Long.parseLong(map.get("applyPrice").toString()); + total = total.add((BigDecimal) map.get("applyPrice")); } Map resultMap = new HashMap<>(); resultMap.put("list", list); @@ -289,4 +290,12 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl()); + BigDecimal result = new BigDecimal(sum).divide(new BigDecimal(10000)); + result = result.setScale(1, BigDecimal.ROUND_HALF_UP); + return result ; + } + } \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index 6757df71..3233c4a5 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -702,7 +702,7 @@ ( SELECT srg.id AS "districtId ", srg.NAME AS "districtName", - IFNULL( COUNT( taa.apply_price ), 0 ) AS "applyPrice", + convert(IFNULL(SUM( taa.apply_price ), 0) / 10000, decimal(15, 1)) AS "applyPrice", srg.sort FROM ( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg @@ -741,15 +741,11 @@ ) ORDER BY sort - - SELECT '会客厅' AS "resourceName", - SUM( apply_price ) AS "applyPrice" + convert(IFNULL( SUM( apply_price ), 0 ) / 10000, decimal(15,1)) AS "applyPrice" FROM t_meetingroom_book tmb WHERE @@ -821,7 +817,7 @@ sd.id AS "deptId", sd.NAME AS "deptName", COUNT( tdr.id ) AS "resourceCount", - SUM( taa.price ) AS "applyPrice" + convert(IFNULL( SUM( taa.price ), 0 ) / 10000, decimal(15,1)) AS "applyPrice" FROM sys_dept sd LEFT JOIN tb_data_resource tdr ON tdr.dept_id = sd.id @@ -853,7 +849,7 @@ sd.id AS "deptId", sd.NAME AS "deptName", SUM( taa.applyCount ) AS "applyCount", - SUM( taa.price ) AS "applyPrice" + convert(IFNULL( SUM( taa.price ), 0 ) / 10000, decimal(15,1)) AS "applyPrice" FROM ( SELECT @@ -884,7 +880,7 @@ srg.id AS "districtId ", srg.NAME AS "districtName", IFNULL(SUM(taa.applyCount), 0) AS "applyCount", - IFNULL( SUM( taa.apply_price ), 0 ) AS "applyPrice", + convert(IFNULL( SUM( taa.apply_price ), 0 ) / 10000, decimal(15,1)) AS "applyPrice", srg.sort FROM ( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg @@ -903,7 +899,7 @@ srg.id AS "districtId ", srg.NAME AS "districtName", IFNULL(SUM(taa.applyCount), 0) AS "applyCount", - IFNULL( SUM(taa.apply_price ), 0 ) AS "applyPrice", + convert(IFNULL( SUM( taa.apply_price ), 0 ) / 10000, decimal(15,1)) AS "applyPrice", srg.sort FROM ( SELECT id, NAME, sort FROM sys_region WHERE tree_level = 3 AND 9 >= sort ) srg