-
行政检查计划数量
+
+
发布检查计划部门数量
1,005个
diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java
index 54f442cb..4877ccfe 100644
--- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java
+++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java
@@ -39,4 +39,11 @@ public interface StatisticalPanelMapper {
*/
Integer statisticalPanelProgramWithDept(StatisticsIndicatorPart statisticsIndicatorPart);
+ /**
+ * 查询本单位检查计划数量以部门分组计数
+ * @param statisticsIndicatorPart
+ * @return
+ */
+ Integer statisticalPanelProgramGroupByDept(StatisticsIndicatorPart statisticsIndicatorPart);
+
}
diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
index c5b45b13..5caaf64e 100644
--- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
+++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
@@ -12,6 +12,8 @@ import com.zdxt.code.domain.*;
import com.zdxt.code.domain.dto.StatisticalPanelDto;
import com.zdxt.code.mapper.StatisticalPanelMapper;
import com.zdxt.code.service.*;
+import com.zdxt.domain.auth.Dept;
+import com.zdxt.domain.auth.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -319,6 +321,9 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
lastDeptTotal = statisticalPanelMapper.statisticalPanelProgramWithDept(statisticsIndicatorPart);
statisticsIndicatorPart.setDeptId("");
}
+ //发布检查计划部门数量
+ Integer lastGroupByDeptTotal=statisticalPanelMapper.statisticalPanelProgramGroupByDept(statisticsIndicatorPart1);
+ Integer nowGroupByDeptTotal=statisticalPanelMapper.statisticalPanelProgramGroupByDept(statisticsIndicatorPart1);
List statisticsIndicatorParts = new ArrayList<>();
//返回结果
@@ -328,10 +333,16 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
statisticsIndicatorPart3.setHuan((allTotal-lastAllTotal));
statisticsIndicatorParts.add(statisticsIndicatorPart3);
- //行政检查计划
+ /*//行政检查计划
StatisticsIndicatorPart statisticsIndicatorPart5 = new StatisticsIndicatorPart();
statisticsIndicatorPart5.setTotal(allTotal);
statisticsIndicatorPart5.setHuan((allTotal-lastAllTotal));
+ statisticsIndicatorParts.add(statisticsIndicatorPart5);*/
+
+ //发布检查计划部门数量
+ StatisticsIndicatorPart statisticsIndicatorPart5 = new StatisticsIndicatorPart();
+ statisticsIndicatorPart5.setTotal(nowGroupByDeptTotal);
+ statisticsIndicatorPart5.setHuan((nowGroupByDeptTotal-lastGroupByDeptTotal));
statisticsIndicatorParts.add(statisticsIndicatorPart5);
//本单位检查计划统计
@@ -423,7 +434,7 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
return statisticsIndicatorPart;
}
public String takeDeptId(){
- //获取该帐号执法证件号
+ /*//获取该帐号执法证件号
String lawCertificateNum=userApi.getCurrentUser().getLawCertificateNum();
if(lawCertificateNum!=null&&!"".equals(lawCertificateNum)){
//通过该帐号的执法证件号去查该帐号执法人员表中的信息
@@ -435,7 +446,26 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
return iDeptService.selectDeptByCreditcode(zzjgdm).getDeptId();
}
}
+ }*/
+ //获取该帐号的deptId
+ Long userId=userApi.getCurrentUser().getUserId();
+ //通过该帐号的deptId查找对应的组织机构代码(creditcode)
+ UserBean user=userApi.getUserByUserId(userId);
+ String deptId=user.getDeptId();
+ if(deptId!=null&&!"".equals(deptId)){
+ Dept dept=iDeptService.selectDeptById(deptId);
+ if(dept.getCreditcode()!=null&&!"".equals(dept.getCreditcode())){//如果creditcode!=null则return 对应的deptId
+ return deptId;
+ }else {//如果creditcode==null则该部门不是执法部门,则查找其父部门的组织机构代码,直至其creditcode!=null为止
+ while (dept.getParentId()!=null&&!"".equals(dept.getParentId())&&!"null".equals(dept.getParentId())){
+ dept=iDeptService.selectDeptById(dept.getParentId());
+ if(dept.getCreditcode()!=null&&!"".equals(dept.getCreditcode())){
+ return dept.getDeptId();
+ }
+ }
+ }
}
+ //若deptId==null或者creditcode!=到底都为空则return null
return null;
}
diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml
index b6769344..21309a10 100644
--- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml
+++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml
@@ -73,7 +73,19 @@
AND time_type is not null
-
+
\ No newline at end of file