flower_city/src/main/java/com/dg/core/controller/HomeStatisticsController.java
@@ -33,9 +33,6 @@ IClassifyAdministrationService iClassifyAdministrationService; @Autowired ITransactionEventService iTransactionEventService; @Autowired HomeStatisticsService homeStatisticsService; @@ -172,7 +169,7 @@ { PieChartAll pieChartAll=new PieChartAll(); pieChartAll.setWorkOrderNum(iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null)+""); pieChartAll.setFingerpostNum(iTransactionEventService.countStatisticsNum(null)+""); pieChartAll.setFingerpostNum(homeStatisticsService.countStatisticsNum(null)+""); List<PieChart> workOrderList=new ArrayList<>(); List<PieChart> fingerpostList=new ArrayList<>(); List<ClassifyAdministration> oneIds=iClassifyAdministrationService.getClassify(null,"1"); @@ -196,7 +193,7 @@ if(clasIds.size()>0) { workOrderNum=iGuideRepairOrderService.countStatisticsNum(null,null,null,null,null,clasIds); fingerpostNum=iTransactionEventService.countStatisticsNum(clasIds); fingerpostNum=homeStatisticsService.countStatisticsNum(clasIds); } workOrder.setNum(workOrderNum+""); fingerpost.setNum(fingerpostNum+""); flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java
@@ -15,6 +15,7 @@ import com.dg.core.util.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; @@ -94,6 +95,22 @@ @Authorization public ResultData insertConfig(@RequestBody TransactionEvent entity) { if(StringUtils.isEmpty(entity.getDepartmentId())) { return ResultData.error("部门id不能为空"); } if(StringUtils.isEmpty(entity.getMatterName())) { return ResultData.error("事件名称不能为空"); } String id=iTransactionEventService.selectDataIfExist(entity.getDepartmentId(),entity.getMatterName()); if(!StringUtils.isEmpty(id)) { return ResultData.error("事件名称已存在"); } return toAjax(iTransactionEventService.insertConfig(entity)); } @@ -107,6 +124,22 @@ @Authorization public ResultData updateConfig(@RequestBody TransactionEvent entity) { if(StringUtils.isEmpty(entity.getDepartmentId())) { return ResultData.error("部门id不能为空"); } if(StringUtils.isEmpty(entity.getMatterName())) { return ResultData.error("事件名称不能为空"); } String id=iTransactionEventService.selectDataIfExist(entity.getDepartmentId(),entity.getMatterName()); if(!StringUtils.isEmpty(id)) { return ResultData.error("事件名称已存在"); } return toAjax(iTransactionEventService.updateConfig(entity)); } flower_city/src/main/java/com/dg/core/db/gen/mapper/HomeStatisticsMapper.java
@@ -68,4 +68,10 @@ * @return */ List<Guidance> guidanceBrowse(); /** * 获取统计数据 首页用 勿动 */ int countStatisticsNum(List<String> classifyIds); } flower_city/src/main/java/com/dg/core/db/gen/mapper/TransactionEventMapper.java
@@ -159,11 +159,11 @@ */ List<TransactionEvent> selectListByIds(String[] list); /** * 获取统计数据 首页用 勿动 * 根据部门判断是否有事项名称重复 */ int countStatisticsNum(List<String> classifyIds); String selectDataIfExist(@Param("departmentId") String departmentId, @Param("matterName") String matterName); flower_city/src/main/java/com/dg/core/service/HomeStatisticsService.java
@@ -66,4 +66,9 @@ * @return */ Integer countWork(); /** * 获取统计数据 首页用 勿动 */ int countStatisticsNum(List<String> classifyIds); } flower_city/src/main/java/com/dg/core/service/ITransactionEventService.java
@@ -6,6 +6,7 @@ import com.dg.core.db.manual.pojo.QueryResults; import com.dg.core.db.manual.pojo.RecommendResult; import com.dg.core.db.manual.pojo.Search; import org.springframework.data.repository.query.Param; import java.util.List; @@ -124,8 +125,9 @@ /** * 获取统计数据 首页用 勿动 * 根据部门判断是否有事项名称重复 */ int countStatisticsNum(List<String> classifyIds); String selectDataIfExist(@Param("departmentId") String departmentId, @Param("matterName") String matterName); } flower_city/src/main/java/com/dg/core/service/impl/HomeStatisticsImpl.java
@@ -64,4 +64,10 @@ return baseMapper.countWork(); } @Override public int countStatisticsNum(List<String> classifyIds) { return baseMapper.countStatisticsNum(classifyIds); } } flower_city/src/main/java/com/dg/core/service/impl/TransactionEventImpl.java
@@ -136,10 +136,11 @@ } @Override public int countStatisticsNum(List<String> classifyIds) { return baseMapper.countStatisticsNum(classifyIds); public String selectDataIfExist(String departmentId, String matterName) { return baseMapper.selectDataIfExist(departmentId,matterName); } @Override public int countNumByMatterName(String matterName) { return baseMapper.countNumByMatterName(matterName); flower_city/src/main/resources/mapper/HomeStatisticsMapper.xml
@@ -97,7 +97,18 @@ <!-- 首页统计 勿动 --> <select id="countStatisticsNum" resultType="integer"> select count(id) from automessage_transaction_event <where> <if test="classifyIds != null"> and classify_id IN <foreach collection="classifyIds" item="param" open="(" close=")" separator=","> #{param} </foreach> </if> </where> </select> flower_city/src/main/resources/mapper/TransactionEventMapper.xml
@@ -373,20 +373,12 @@ </select> <!-- 首页统计 勿动 --> <select id="countStatisticsNum" resultType="integer"> select count(id) from automessage_transaction_event <where> <if test="classifyIds != null"> and classify_id IN <foreach collection="classifyIds" item="param" open="(" close=")" separator=","> #{param} </foreach> </if> </where> <select id="selectDataIfExist" resultType="string"> select id from automessage_transaction_event where department_id=#{departmentId} and matter_name=#{matterName} </select> </mapper>