yanyan 1 year ago
parent
commit
d11ac6ccf9
  1. 4
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/mapper/DeptMapper.java
  2. 31
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/service/DeptServiceImpl.java
  3. 17
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/controller/NoticeController.java
  4. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/service/INoticeService.java
  5. 108
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/service/NoticeServiceImpl.java
  6. 10
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml
  7. 9
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml
  8. 14
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html
  9. 34
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html
  10. 6
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/dept/edit.html
  11. 8
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/user/edit.html
  12. 8
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/user/user.html
  13. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java
  14. 103
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticsEnterpriseController.java
  15. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/Zfztjdm111915Mapper.java
  16. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java
  17. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnterpriseInformationService.java
  18. 5
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java
  19. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java
  20. 13
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java
  21. 132
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java
  22. 9
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
  23. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/Zfztjdm111915ServiceImpl.java
  24. 9
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/ComplaintStatisticsMapper.xml
  25. 18
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml
  26. 14
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/Zfztjdm111915Mapper.xml

4
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/mapper/DeptMapper.java

@ -145,6 +145,10 @@ public interface DeptMapper
*/
List<Dept> selectChildrenDeptById(String deptId);
List<Dept> selectSelfAndChildrenById(String deptId);
List<Dept> selectDeptByRoleId(Long roleId);
/**
* 根据部门类型(in语句),获取所有子部门,id必须传

31
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/service/DeptServiceImpl.java

@ -147,7 +147,7 @@ public class DeptServiceImpl implements IDeptService
private List<Ztree> getZtrees(List<Ztree> ztrees) {
if (CollectionUtils.isNotEmpty(ztrees)) {
//拿到深圳市
//添加深圳市节点
Ztree ztree = new Ztree();
ztree.setpId("0");
ztree.setId("0");
@ -162,6 +162,7 @@ public class DeptServiceImpl implements IDeptService
.filter(item -> Objects.equals(item.getDictValue(), "1") ||
Objects.equals(item.getDictValue(), "2"))
.map(item -> {
//添加市值和区的节点 给市值和区绑定深圳市的父节点
Ztree ztree1 = new Ztree();
ztree1.setTitle(item.getDictLabel());
ztree1.setName(item.getDictLabel());
@ -171,7 +172,7 @@ public class DeptServiceImpl implements IDeptService
}).collect(Collectors.toList());
ztrees.addAll(zoneTree);
//给市值和区挂上深圳市
//绑定区和市直节点 例如给罗湖区的父节点绑定区的节点 给深圳市司法局的父节点绑定市直的节点
ztrees = ztrees.stream()
.peek(i -> i.setpId(Objects.equals(i.getZone(), 1) ||
Objects.equals(i.getZone(), 2) ? String.valueOf(i.getZone()) : i.getpId()))
@ -179,25 +180,35 @@ public class DeptServiceImpl implements IDeptService
.collect(Collectors.toList());
Map<String, String> map = ztrees.stream()
.filter(item -> Objects.equals(item.getZone(), 2))
.collect(Collectors.toMap(Ztree::getId, Ztree::getName));
List<String> collect = ztrees.stream()
.filter(item -> Objects.equals(item.getZone(), 2))
.map(Ztree::getId).collect(Collectors.toList());
for (String pid : collect) {
List<Ztree> finalZtrees = ztrees;
map.forEach((pid, value)->{
//给区直挂上区直
Ztree ztree1 = new Ztree();
ztree1.setTitle("区直");
ztree1.setName("区直");
ztree1.setId(pid+"3");
ztree1.setpId(pid);
ztrees.add(ztree1);
//
for (Ztree ztree2 : ztrees) {
if (Objects.equals(ztree2.getZone(), 3) &&
StringUtils.isNotEmpty(ztree2.getAncestors()) && ztree2.getAncestors().contains(pid)) {
ztree2.setpId(ztree1.getId());
finalZtrees.add(ztree1);
//给所有区下面的部门 挂到区-区直下
for (Ztree ztree2 : finalZtrees) {
if (Objects.equals(ztree2.getZone(), 3)) {
if(StringUtils.isNotEmpty(ztree2.getAncestors()) && ztree2.getAncestors().contains(pid)) {
ztree2.setpId(ztree1.getId());
}else if (StringUtils.isEmpty(ztree2.getAncestors())
|| collect.stream().noneMatch(i -> ztree2.getAncestors().contains(i))) {
if (ztree2.getName().contains(value.substring(0,2))) {
ztree2.setpId(ztree1.getId());
}
}
}
}
}
});
}
}
return ztrees;

17
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/controller/NoticeController.java

@ -8,6 +8,8 @@ import java.util.stream.Collectors;
import com.zdxt.auth.common.utils.StringUtils;
import com.zdxt.auth.common.utils.text.Convert;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.framework.web.controller.BaseController;
import com.zdxt.auth.framework.web.domain.AjaxResult;
import com.zdxt.auth.framework.web.page.TableDataInfo;
@ -43,6 +45,9 @@ public class NoticeController extends BaseController
@Autowired
private IDeptService deptService;
@Autowired
private UserApi userApi;
@RequiresPermissions("system:notice:view")
@GetMapping()
public String notice()
@ -59,7 +64,7 @@ public class NoticeController extends BaseController
public TableDataInfo list(Notice notice)
{
startPage();
List<Notice> list = noticeService.selectNoticeList(notice);
List<Notice> list = noticeService.selectNoticeListNew(notice);
return getDataTable(list);
}
@ -140,6 +145,11 @@ public class NoticeController extends BaseController
@ResponseBody
public AjaxResult editSave(Notice notice)
{
UserBean currentUser = userApi.getCurrentUser();
Notice notice1 = noticeService.selectNoticeById(notice.getNoticeId());
if (notice1!=null && notice1.getUserId()!=0 && !Objects.equals(notice1.getUserId(),currentUser.getUserId())) {
return error("仅支持创建人修改");
}
return toAjax(noticeService.updateNotice(notice));
}
@ -151,6 +161,11 @@ public class NoticeController extends BaseController
@ResponseBody
public AjaxResult editNoticeFile(@RequestParam("files") MultipartFile[] files, Notice notice)
{
UserBean currentUser = userApi.getCurrentUser();
Notice notice1 = noticeService.selectNoticeById(notice.getNoticeId());
if (notice1!=null && notice1.getUserId()!=0 && !Objects.equals(notice1.getUserId(),currentUser.getUserId())) {
return error("仅支持创建人修改");
}
return toAjax(noticeService.editNoticeFile(files, notice));
}

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/service/INoticeService.java

@ -29,6 +29,8 @@ public interface INoticeService
*/
public List<Notice> selectNoticeList(Notice notice);
public List<Notice> selectNoticeListNew(Notice notice);
public List<Notice> selectNoticeListNoPermission(Notice notice);
/**

108
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/service/NoticeServiceImpl.java

@ -1,15 +1,18 @@
package com.zdxt.auth.project.system.notice.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.zdxt.auth.common.utils.StringUtils;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.auth.dto.RoleBean;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.dto.ZdxtFileBean;
import com.zdxt.auth.feign.FileUploadApi;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.feign.ZdxtFileCommonApi;
import com.zdxt.auth.project.system.dept.mapper.DeptMapper;
import com.zdxt.auth.project.system.dept.service.IDeptService;
@ -18,6 +21,8 @@ import com.zdxt.common.zdxtFile.AttFileRespDTO;
import com.zdxt.common.zdxtFile.FilePreviewUtilBean;
import com.zdxt.common.zdxtFile.ZdxtFileCommon;
import com.zdxt.domain.auth.Dept;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zdxt.auth.common.utils.security.ShiroUtils;
@ -47,6 +52,9 @@ public class NoticeServiceImpl implements INoticeService
@Autowired
private FileUploadApi fileUploadApi;
@Autowired
private UserApi userApi;
/**
* 查询公告信息
*
@ -83,6 +91,84 @@ public class NoticeServiceImpl implements INoticeService
return noticeMapper.selectNoticeList(notice);
}
@Override
public List<Notice> selectNoticeListNew(Notice notice) {
List<DeptBean> checkDept = this.check(notice);
List<Notice> noticeList = noticeMapper.selectNoticeList(notice);
if (CollectionUtils.isNotEmpty(noticeList) && checkDept != null) {
if (checkDept.size() == 0) {
return new ArrayList<>();
}
List<String> deptIds = checkDept.stream().map(DeptBean::getDeptId).collect(Collectors.toList());
noticeList = noticeList.stream().filter(i -> StringUtils.isEmpty(i.getBureauDeptIds())
|| hasIntersection(Arrays.asList(i.getBureauDeptIds().split(",")), deptIds))
.collect(Collectors.toList());
}
return noticeList;
}
/**
* 判断两个 List 是否存在交集(是否有重复元素)
*/
public static boolean hasIntersection(List<String> list1, List<String> list2) {
Set<String> set1 = new HashSet<>(list1);// O(n)
for (String item : list2) {
if (set1.contains(item)) {// O(1) 平均,O(n) 最坏
return true; // 找到一个重复项即可返回
}
}
return false;
}
public List<DeptBean> check(Notice notice) {
UserBean currentUser = userApi.getCurrentUser();
List<DeptBean> deptBeans = new ArrayList<>();
if (currentUser.isAdmin()){
return null;
}
for (RoleBean role : currentUser.getRoles()) {
String dataScope = role.getDataScope();
if ("1".equals(dataScope)) {
//全部可见
return null;
}else if ("2".equals(dataScope)) {
//自定义权限 SELECT dept_id, dept_name FROM sys_role_dept WHERE role_id = {}
List<Dept> depts = deptMapper.selectDeptByRoleId(role.getRoleId());
if (CollectionUtils.isNotEmpty(depts)){
for (Dept dept : depts) {
DeptBean deptBean = new DeptBean();
BeanUtils.copyProperties(dept,deptBean);
deptBeans.add(deptBean);
}
}
} else if ("3".equals(dataScope)) {
//部门数据权限 SELECT dept_id, dept_name FROM sys_dept WHERE dept_id = {}
Dept dept = deptMapper.selectDeptById(currentUser.getDeptId());
if (Objects.nonNull(dept)){
DeptBean deptBean = new DeptBean();
BeanUtils.copyProperties(dept,deptBean);
deptBeans.add(deptBean);
}
} else if ("4".equals(dataScope)) {
//部门及以下数据权限 SELECT dept_id FROM sys_dept WHERE dept_id = '{}' or find_in_set( '{}' , ancestors ) <> 0
List<Dept> depts = deptMapper.selectSelfAndChildrenById(currentUser.getDeptId());
if (CollectionUtils.isNotEmpty(depts)){
for (Dept dept : depts) {
DeptBean deptBean = new DeptBean();
BeanUtils.copyProperties(dept,deptBean);
deptBeans.add(deptBean);
}
}
} else if ("5".equals(dataScope)) {
//仅本人数据权限 不给看
return deptBeans;
}
}
return deptBeans;
}
@Override
@DataScope
public List<Notice> selectNoticeListNoPermission(Notice notice) {
@ -110,7 +196,6 @@ public class NoticeServiceImpl implements INoticeService
public int insertNotice(Notice notice)
{
notice.setNoticeId(IdUtil.fastSimpleUUID());
notice.setCreateBy(ShiroUtils.getLoginName());
//通过部门id获取部门名称
if (StringUtils.isNotEmpty(notice.getBureauDeptIds())) {
StringBuilder deptNames = null;
@ -126,8 +211,12 @@ public class NoticeServiceImpl implements INoticeService
}
}
}
notice.setBureauDeptNames(deptNames.toString());
notice.setBureauDeptNames(deptNames+"");
}
UserBean currentUser = userApi.getCurrentUser();
notice.setCreateBy(currentUser!=null? currentUser.getLoginName() : null);
notice.setUserId(currentUser!=null? currentUser.getUserId() : null);
notice.setDeptId(currentUser!=null? currentUser.getDeptId() : null);
return noticeMapper.insertNotice(notice);
}
@ -135,7 +224,6 @@ public class NoticeServiceImpl implements INoticeService
public int addNotice(MultipartFile[] files, Notice notice) {
String busId = IdUtil.fastSimpleUUID();
notice.setNoticeId(busId);
notice.setCreateBy(ShiroUtils.getLoginName());
//通过部门id获取部门名称
if (StringUtils.isNotEmpty(notice.getBureauDeptIds())) {
StringBuilder deptNames = null;
@ -151,7 +239,7 @@ public class NoticeServiceImpl implements INoticeService
}
}
}
notice.setBureauDeptNames(deptNames.toString());
notice.setBureauDeptNames(deptNames + "");
}
// 上传文件,并在附件表中添加记录
if (ObjectUtil.isNotEmpty(files)) {
@ -161,6 +249,10 @@ public class NoticeServiceImpl implements INoticeService
}
}
}
UserBean currentUser = userApi.getCurrentUser();
notice.setCreateBy(currentUser!=null? currentUser.getLoginName() : null);
notice.setUserId(currentUser!=null? currentUser.getUserId() : null);
notice.setDeptId(currentUser!=null? currentUser.getDeptId() : null);
return noticeMapper.insertNotice(notice);
}
@ -189,7 +281,7 @@ public class NoticeServiceImpl implements INoticeService
}
}
}
notice.setBureauDeptNames(deptNames.toString());
notice.setBureauDeptNames(deptNames + "");
}
return noticeMapper.updateNotice(notice);
}

10
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml

@ -240,6 +240,16 @@
select * from sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectSelfAndChildrenById" parameterType="string" resultMap="DeptResult">
select * from sys_dept where dept_id = #{deptId} or find_in_set(#{deptId}, ancestors)
</select>
<select id="selectDeptByRoleId" parameterType="Long" resultMap="DeptResult">
select * from sys_dept d
inner join sys_role_dept rd on d.dept_id = rd.dept_id
where d.del_flag = '0' and rd.role_id = #{roleId}
</select>
<select id="getChildrenDeptByIdAndInDeptType" resultMap="DeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
and dept_type in

9
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml

@ -16,11 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="bureauDeptIds" column="bureau_dept_ids" />
<result property="bureauDeptNames" column="bureau_dept_names" />
<result property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNoticeVo">
select notice_id, notice_title, object_type, notice_content, status, create_by, create_time, update_by, update_time,bureau_dept_ids,bureau_dept_names,remark
select notice_id, notice_title, object_type, notice_content, status, create_by, create_time, update_by,
update_time,bureau_dept_ids,bureau_dept_names,user_id,dept_id,remark
from sys_notice
</sql>
@ -63,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time,
<if test="bureauDeptIds != null and bureauDeptIds != ''">bureau_dept_ids,</if>
<if test="bureauDeptNames != null and bureauDeptNames != ''">bureau_dept_names,</if>
<if test="userId != null and userId != ''">user_id,</if>
<if test="deptId != null and deptId != ''">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noticeId != null and noticeId != '' ">#{noticeId}, </if>
@ -75,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate(),
<if test="bureauDeptIds != null and bureauDeptIds != ''">#{bureauDeptIds},</if>
<if test="bureauDeptNames != null and bureauDeptNames != ''">#{bureauDeptNames},</if>
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
</trim>
</insert>

14
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html

@ -71,7 +71,7 @@
</div>
</div>
<div class="select_item">
<!--<label class="select_time">时间筛选<i class="fa fa-calendar" id="timeSelect"></i></label>-->
<!--<label class="select_time">s时间筛选<i class="fa fa-calendar" id="timeSelect"></i></label>-->
<label class="select_time">时间筛选<a id="timeSelect"></a></label>
<span>综合数据</span></div>
</div>
@ -346,9 +346,15 @@
deptId = null; deptName='全区';
changeArea(null, '全区','1')
} else {
$("#dept_flag").html(datas[0].deptName)
deptId = datas[0].deptId; deptName= datas[0].deptName;
changeArea(datas[0].deptId, datas[0].deptName,'1')
if(datas.length === 0) {
$("#dept_flag").html('无权限')
deptId = -1; deptName='无权限';
changeArea(-1, '无权限')
}else {
$("#dept_flag").html(datas[0].deptName)
deptId = datas[0].deptId; deptName= datas[0].deptName;
changeArea(datas[0].deptId, datas[0].deptName,'1')
}
}
for(var i=0; i<datas.length; i++) {
html += '<dd class="check_label" dpId="'+datas[i].deptId+'" dpName="'+datas[i].deptName+'" ' +

34
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html

@ -275,14 +275,6 @@
var deptName = null;
var beginTime = null;
var endTime = null;
$.ajax({
url: ctx + "code/statisticalPanel/queryDeptLength",
type: "get",
data: {zone: 1},
success: function (result) {
totalSize = result.data;
}
});
layui.use('laydate',function(){
var laydate = layui.laydate;
@ -315,7 +307,15 @@
});
$(function(){
queryDept();
$.ajax({
url: ctx + "code/statisticalPanel/queryDeptLength",
type: "get",
data: {zone: 1},
success: function (result) {
totalSize = result.data;
queryDept();
}
});
});
@ -332,10 +332,18 @@
const datas = res.data;
var html = '';
if(datas.length === totalSize) {
html += '<dd class="check_label" onclick="changeArea(null, \'全市直\')">全市直</dd>';
$("#dept_flag").html('全市直')
deptId = null; deptName='全市直';
changeArea(null, '全市直')
if (datas.length === 0){
html += '<dd class="check_label" onclick="changeArea(-1, \'无权限\')">无权限</dd>';
//html += '<dd class="check_label" onclick="changeArea(null, \'全市直\')">全市直</dd>';
$("#dept_flag").html('无权限')
deptId = -1; deptName='无权限';
changeArea(-1, '无权限')
}else {
html += '<dd class="check_label" onclick="changeArea(null, \'全市直\')">全市直</dd>';
$("#dept_flag").html('全市直')
deptId = null; deptName='全市直';
changeArea(null, '全市直')
}
} else {
$("#dept_flag").html(datas[0].deptName)
deptId = datas[0].deptId; deptName= datas[0].deptName;

6
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/dept/edit.html

@ -141,18 +141,18 @@
};
$.modal.openOptions(options);
} else {
$.modal.alertError("父部门不能选择");
// $.modal.alertError("父部门不能选择");
}
}
function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowLastLevel(tree)) {
// if ($.tree.notAllowLastLevel(tree)) {
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
// }
}
$(function() {
$('#deptType').select2({

8
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/user/edit.html

@ -208,7 +208,9 @@
/*用户管理-修改-选择部门树*/
function selectDeptTree() {
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
var url = ctx + "system/dept/selectDeptTree/" + deptId;
var list = [1,2,3,4,15];
var url = ctx + "system/dept/treeData?zoneList="+list;
//var url = ctx + "system/dept/selectDeptTree/" + deptId;
var options = {
title: '选择部门',
width: "380",
@ -220,12 +222,12 @@
function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowParents(tree)) {
// if ($.tree.notAllowParents(tree)) {
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
// }
}
$(function() {

8
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/user/user.html

@ -241,7 +241,9 @@
function queryDeptTree()
{
var url = ctx + "system/dept/treeData";
//var url = ctx + "system/dept/treeData";
var list = [1,2,3,4,15];
var url = ctx + "system/dept/treeData?zoneList="+list;
var options = {
url: url,
expandLevel: 2,
@ -263,6 +265,10 @@
function zOnClick(event, treeId, treeNode) {
$("#deptId").val(treeNode.id);
$("#parentId").val(treeNode.pId);
// if (treeNode.name ==="深圳市") {
// $("#deptId").val("");
// $("#parentId").val("");
// }
$.table.search();
}
}

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementRegistrationController.java

@ -396,7 +396,7 @@ public class EnforcementRegistrationController extends BaseController
Map<String,DictData> dictDataMap=iDictDataService.selectDictDataByType("check_category").stream().collect(Collectors.toMap(DictData::getDictValue,Function.identity()));
// List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList1(enforcementRegistration);
List<EnforcementRegistration> list =
enforcementRegistrationMapper.selectEnforcementRegistrationList1(enforcementRegistration);
enforcementRegistrationService.selectEnforcementRegistrationList2(enforcementRegistration);
Map<String,Long> checkMap=list.stream().collect(Collectors.groupingBy(item->item.getCheckCategory()==null||"".equals(item.getCheckCategory())?"空":item.getCheckCategory(),Collectors.counting()));
for(String s:checkMap.keySet()){
StatisticsIndicator statisticsIndicator=new StatisticsIndicator();

103
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticsEnterpriseController.java

@ -1,5 +1,6 @@
package com.zdxt.code.controller;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.code.domain.*;
import com.zdxt.code.service.IEnterpriseInformationService;
@ -42,15 +43,16 @@ public class StatisticsEnterpriseController extends BaseController {
@GetMapping()
public String statisticsEnterprise(Model model) {
LocalDate localDate = LocalDate.now();
List<EnterpriseInformation> enterpriseInformationList = iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation());
List<EnterpriseInformation> existList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 0).collect(Collectors.toList());
List<EnterpriseInformation> logoutList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 1).collect(Collectors.toList());
// List<EnterpriseInformation> enterpriseInformationList = iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation());
// List<EnterpriseInformation> existList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 0).collect(Collectors.toList());
// List<EnterpriseInformation> logoutList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 1).collect(Collectors.toList());
Map<String,Integer> map = iEnterpriseInformationService.selectEnterpriseInformationList2(new EnterpriseInformation());
//model.addAttribute("yearList", yearMake());
model.addAttribute("number", enterpriseInformationList.size());//企业总数
model.addAttribute("exist", existList.size());//续存数量
model.addAttribute("logout", logoutList.size());//注销数量
model.addAttribute("number", map.get("all"));//企业总数
model.addAttribute("exist", map.get("ex"));//续存数量
model.addAttribute("logout", map.get("lo"));//注销数量
//model.addAttribute("year", localDate.getYear());
model.addAttribute("number2", enterpriseInformationList.size());//企业总数--Tap2
model.addAttribute("number2", map.get("all"));//企业总数--Tap2
model.addAttribute("number3", "100%");
return prefix + "/statisticsEnterprise";
}
@ -68,29 +70,6 @@ public class StatisticsEnterpriseController extends BaseController {
}else {
model.addAttribute("qyJd", qyName);
}
/*String qy = iDictDataService.selectDictLabel("address_type", searchType.getQy());
enterpriseInformation.setEnterpriseAddress("深圳市" + qy);
if (searchType.getJd() != null && !"".equals(searchType.getJd())) {
String jd = iDictDataService.selectDictLabel(searchType.getQy(), searchType.getJd());
enterpriseInformation.setEnterpriseAddress("深圳市" + qy + jd);
}
String qyJd=enterpriseInformation.getEnterpriseAddress().substring(3);
model.addAttribute("qyJd",enterpriseInformation.getEnterpriseAddress().substring(3));
if (qy.equals("光明区")) {
//光明区
enterpriseInformationList = iEnterpriseInformationService.selectEnterpriseInformationList1(enterpriseInformation);
EnterpriseInformation e2 = new EnterpriseInformation();
e2.setEnterpriseAddress("深圳市光明新区");
//光明新区
if (searchType.getJd() != null && !"".equals(searchType.getJd())) {
String jd = iDictDataService.selectDictLabel(searchType.getQy(), searchType.getJd());
e2.setEnterpriseAddress("深圳市光明新区" + jd);
}
List<EnterpriseInformation> e2List = iEnterpriseInformationService.selectEnterpriseInformationList1(e2);
enterpriseInformationList.addAll(e2List);
} else {
enterpriseInformationList = iEnterpriseInformationService.selectEnterpriseInformationList1(enterpriseInformation);
}*/
}else {
model.addAttribute("qyJd", "全市");
}
@ -108,6 +87,22 @@ public class StatisticsEnterpriseController extends BaseController {
String companyOrgType=iDictDataService.selectDictLabel("enterpriseType",searchType.getCompanyOrgType());
enterpriseInformationList=enterpriseInformationList.stream().filter(item->item.getCompanyOrgType().contains(companyOrgType)).collect(Collectors.toList());
}
List<String> qyNameList = new ArrayList<>();
List<DictData> dictDataListQY = iDictDataService.selectDictDataByType("address_type");
for (DictData dictData : dictDataListQY) {
qyNameList.add(dictData.getDictLabel());
}
List<DeptBean> checkDept = iEnterpriseInformationService.check(enterpriseInformation);
for (int i=0;i< qyNameList.size();i++) {
String qy= qyNameList.get(i);
if (checkDept == null){
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(qy))) {
}else{
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
}
}
List<EnterpriseInformation> existList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 0).collect(Collectors.toList());
List<EnterpriseInformation> logoutList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 1).collect(Collectors.toList());
model.addAttribute("number", enterpriseInformationList.size());//企业总数
@ -156,6 +151,22 @@ public class StatisticsEnterpriseController extends BaseController {
/*EnterpriseInformation enterpriseInformation=dateMake(searchType);
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(enterpriseInformation);*/
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation());
List<String> qyNameList = new ArrayList<>();
List<DictData> dictDataListQY = iDictDataService.selectDictDataByType("address_type");
for (DictData dictData : dictDataListQY) {
qyNameList.add(dictData.getDictLabel());
}
List<DeptBean> checkDept = iEnterpriseInformationService.check(new EnterpriseInformation());
for (int i=0;i< qyNameList.size();i++) {
String qy= qyNameList.get(i);
if (checkDept == null){
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(qy))) {
}else{
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
}
}
return statisticsEnterpriseService.type(enterpriseInformationList);
}
@RequiresPermissions("code:statisticsEnterprise:view")
@ -164,6 +175,22 @@ public class StatisticsEnterpriseController extends BaseController {
/*EnterpriseInformation enterpriseInformation=dateMake(searchType);
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(enterpriseInformation);*/
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation());
List<String> qyNameList = new ArrayList<>();
List<DictData> dictDataListQY = iDictDataService.selectDictDataByType("address_type");
for (DictData dictData : dictDataListQY) {
qyNameList.add(dictData.getDictLabel());
}
List<DeptBean> checkDept = iEnterpriseInformationService.check(new EnterpriseInformation());
for (int i=0;i< qyNameList.size();i++) {
String qy= qyNameList.get(i);
if (checkDept == null){
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(qy))) {
}else{
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
}
}
List<DictData>dictDataList=iDictDataService.selectDictDataByType("enterpriseType");
List<StatisticsIndicator> statisticsIndicatorList=new ArrayList<>();
for(DictData d:dictDataList){
@ -235,6 +262,22 @@ public class StatisticsEnterpriseController extends BaseController {
@ResponseBody
public void export2(HttpServletResponse httpServletResponse) throws IOException {
List<EnterpriseInformation> enterpriseInformationList=iEnterpriseInformationService.selectEnterpriseInformationList1(new EnterpriseInformation());
List<String> qyNameList = new ArrayList<>();
List<DictData> dictDataListQY = iDictDataService.selectDictDataByType("address_type");
for (DictData dictData : dictDataListQY) {
qyNameList.add(dictData.getDictLabel());
}
List<DeptBean> checkDept = iEnterpriseInformationService.check(new EnterpriseInformation());
for (int i=0;i< qyNameList.size();i++) {
String qy= qyNameList.get(i);
if (checkDept == null){
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(qy))) {
}else{
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
}
}
List<StatisticsIndicator> statisticsIndicatorList=statisticsEnterpriseService.type(enterpriseInformationList);
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("企业类型统计");

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/Zfztjdm111915Mapper.java

@ -14,5 +14,7 @@ public interface Zfztjdm111915Mapper {
*/
List<Zfztjdm111915> selectZfztjdmList(Zfztjdm111915 zfztjdm111915);
List<Zfztjdm111915> selectZfztjdmListAndDept(String subName);
List<Zfztjdm111915> selectZfztjdmListAndDeptScope(Zfryjdm2405301 zfryjdm2405301);
Zfztjdm111915 selectZfztjdmAndDeptByCode(String code);
}

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java

@ -41,6 +41,8 @@ public interface IEnforcementRegistrationService
List<EnforcementRegistration> selectEnforcementRegistrationByEpId(EnforcementRegistration enforcementRegistration);
List<EnforcementRegistration> selectEnforcementRegistrationList1(EnforcementRegistration enforcementRegistration);
List<EnforcementRegistration> selectEnforcementRegistrationList2(EnforcementRegistration enforcementRegistration);
List<EnforcementRegistration> selectUnite(EnforcementRegistration enforcementRegistration);
List<EnforcementRegistration> selectEnforcementRegistrationAndAddressList(EnforcementRegistration enforcementRegistration);

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnterpriseInformationService.java

@ -1,11 +1,13 @@
package com.zdxt.code.service;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.code.domain.EnterpriseInformation;
import com.zdxt.code.domain.QrCodeGenerateHistory;
import com.zdxt.code.domain.SearchType;
import com.zdxt.code.domain.StatisticsIndicator;
import java.util.List;
import java.util.Map;
/**
* 企业信息登记Service接口
@ -41,6 +43,10 @@ public interface IEnterpriseInformationService
List<EnterpriseInformation> selectEnterpriseInformationList1(EnterpriseInformation enterpriseInformation);
Map selectEnterpriseInformationList2(EnterpriseInformation enterpriseInformation);
List<DeptBean> check(EnterpriseInformation enterpriseInformation);
/**
* 查询企业信息登记列表
*

5
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ComplaintStatisticsImpl.java

@ -7,6 +7,7 @@ import com.zdxt.code.domain.*;
import com.zdxt.code.mapper.ComplaintStatisticsMapper;
import com.zdxt.code.mapper.EnforcementRegistrationMapper;
import com.zdxt.code.service.ComplaintStatisticsService;
import com.zdxt.common.annotation.DataScope;
import com.zdxt.domain.auth.Dept;
import com.zdxt.domain.auth.DictData;
import org.springframework.beans.factory.annotation.Autowired;
@ -28,11 +29,13 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService {
@Autowired
private EnforcementRegistrationMapper enforcementRegistrationMapper;
@Override
@DataScope(deptField = "complaint_department_id")
public List<ComplaintStatistics> selectComplaintStatisticsList(ComplaintStatistics complaintStatistics){
return complaintStatisticsMapper.selectComplaintStatisticsList(complaintStatistics);
}
@Override
@DataScope(deptField = "complaint_department_id")
public List<ComplaintStatistics> selectComplaintStatisticsGroup(ComplaintStatistics complaintStatistics){
return complaintStatisticsMapper.selectComplaintStatisticsGroup(complaintStatistics);
}
@ -41,6 +44,7 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService {
return complaintStatisticsMapper.selectComplaintStatisticsGroupByType(complaintStatistics);
}
@Override
@DataScope(deptField = "complaint_department_id")
public List<ComplaintStatistics> selectComplaintStatisticsLEFTEnterpriseList(ComplaintStatistics complaintStatistics){
return complaintStatisticsMapper.selectComplaintStatisticsLEFTEnterpriseList(complaintStatistics);
}
@ -240,6 +244,7 @@ public class ComplaintStatisticsImpl implements ComplaintStatisticsService {
}
@Override
@DataScope(deptField = "complaint_department_id")
public List<ComplaintStatistics> selectComplaintStatisticsListGroupDeptList(ComplaintStatistics complaintStatistics) {
Map<String, Dept> deptMap=new HashMap<>();
if(complaintStatistics.getComplaintDepartment()!=null&&!"".equals(complaintStatistics.getComplaintDepartment())){//搜索条件内有投诉对象时

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java

@ -211,32 +211,38 @@ public class EnforcementInspectionProgramServiceImpl implements IEnforcementInsp
}
@Override
@DataScope(deptField = "enforcement_department_id")
public List<EnforcementInspectionProgramDto> staticProgram(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticProgram(enforcementInspectionProgramDto);
}
@Override
@DataScope(deptField = "enforcement_department_id")
public EnforcementInspectionProgramDto staticAllProgram(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticAllProgram(enforcementInspectionProgramDto);
}
@Override
@DataScope(deptField = "enforcement_department_id")
public List<EnforcementInspectionProgramDto> staticProgramWithAll(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticProgramWithAll(enforcementInspectionProgramDto);
}
@Override
@DataScope(deptField = "enforcement_department_id")
public List<EnforcementInspectionProgramDto> staticProgramWithYear(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticProgramWithYear(enforcementInspectionProgramDto);
}
@Override
@DataScope(deptField = "enforcement_department_id")
public List<EnforcementInspectionProgramDto> staticProgramWithQuarter(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticProgramWithQuarter(enforcementInspectionProgramDto);
}
@Override
@DataScope(deptField = "enforcement_department_id")
public List<EnforcementInspectionProgramDto> staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticProgramWithMonth(enforcementInspectionProgramDto);
}

13
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java

@ -214,6 +214,15 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
return enforcementRegistrations;
}
@Override
@DataScope
public List<EnforcementRegistration> selectEnforcementRegistrationList2(EnforcementRegistration enforcementRegistration)
{
List<EnforcementRegistration> enforcementRegistrations =
enforcementRegistrationMapper.selectEnforcementRegistrationList1(enforcementRegistration);
return enforcementRegistrations;
}
@Override
@DataScope
public List<EnforcementRegistration> selectEnforcementRegistrationByEpId(EnforcementRegistration enforcementRegistration)
@ -284,7 +293,7 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
enforcementRegistrationMapper.selectEnforcementRegistrationList1(enforcementRegistration);
return enforcementRegistrations;
}
@DataScope(deptAlias = "r",userAlias = "r")
@DataScope(deptAlias = "r",userAlias = "r",deptField = "bureau_dept_id")
@Override
public List<EnforcementRegistration> selectEnforcementRegistrationAndAddressList(EnforcementRegistration enforcementRegistration) {
List<EnforcementRegistration> enforcementRegistrations =
@ -698,7 +707,7 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
enforcementRegistrationMapper.staticEnforcementRegistration(enforcementRegistrationDto);
return enforcementRegistrationDtos;
}
@DataScope(deptAlias = "r",userAlias = "r")
@DataScope(deptAlias = "r",userAlias = "r",deptField = "bureau_dept_id")
@Override
public List<EnforcementRegistrationDto> staticEnforcementRegistrationLI(EnforcementRegistrationDto enforcementRegistrationDto) {
if(enforcementRegistrationDto.getQy()!=null&&!"".equals(enforcementRegistrationDto.getQy())){

132
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

@ -17,9 +17,12 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.auth.dto.RoleBean;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.FileUploadApi;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.project.system.dept.mapper.DeptMapper;
import com.zdxt.auth.project.system.dict.mapper.DictDataMapper;
import com.zdxt.code.domain.*;
import com.zdxt.code.service.IEnterpriseMerchantAuthorizationService;
@ -28,11 +31,17 @@ import com.zdxt.code.service.ISsztJbxx110497Service;
import com.zdxt.code.utils.CrawlerUtil;
import com.zdxt.code.utils.PasswordTools;
import com.zdxt.code.utils.QRCodeUtil;
import com.zdxt.common.annotation.DataScope;
import com.zdxt.common.util.DateUtils;
import com.zdxt.common.util.StringUtils;
import com.zdxt.domain.auth.Dept;
import com.zdxt.domain.auth.DictData;
import com.zdxt.domain.auth.Role;
import io.swagger.models.auth.In;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -79,6 +88,9 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
@Autowired
private DictDataMapper dictDataMapper;
@Autowired
private DeptMapper deptMapper;
/**
* 查询企业信息登记
*
@ -134,6 +146,109 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
return enterpriseInformationMapper.selectEnterpriseInformationList1(enterpriseInformation);
}
@Override
public Map selectEnterpriseInformationList2(EnterpriseInformation enterpriseInformation) {
List<StatisticsIndicator> statisticsIndicatorList = new ArrayList<>();
Map<String,Integer> map= new HashMap<>();
int allCompany = 0;
int exCompany = 0;
int loCompany = 0;
List<EnterpriseInformation> enterpriseInformationList =
enterpriseInformationMapper.selectEnterpriseInformationList1(enterpriseInformation);
List<String> qyNameList = new ArrayList<>();
List<DictData> dictDataListQY = dictDataMapper.selectDictDataByType("address_type");
for (DictData dictData : dictDataListQY) {
qyNameList.add(dictData.getDictLabel());
}
List<DeptBean> checkDept = check(enterpriseInformation);
for (int i=0;i< qyNameList.size();i++) {
String qy= qyNameList.get(i);
StatisticsIndicator s = new StatisticsIndicator();
System.out.println(qy.substring(0, qy.indexOf("区")));
List<EnterpriseInformation> qyList = enterpriseInformationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
List<EnterpriseInformation> existList = qyList.stream().filter(item -> item.getIsUnsubscribe() == 0).collect(Collectors.toList());
List<EnterpriseInformation> logoutList = qyList.stream().filter(item -> item.getIsUnsubscribe() == 1).collect(Collectors.toList());
s.setName(qy);
s.setSort(i);
s.setTotalNumber(qyList.size());
s.setNumInt(existList.size());
s.setValue(logoutList.size());
if (checkDept == null){
allCompany = allCompany + qyList.size();
exCompany = exCompany + existList.size();
loCompany = loCompany + logoutList.size();
statisticsIndicatorList.add(s);
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(qy))) {
allCompany = allCompany + qyList.size();
exCompany = exCompany + existList.size();
loCompany = loCompany + logoutList.size();
statisticsIndicatorList.add(s);
}
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
}
//其他
if (enterpriseInformationList.size()>0) {
List<EnterpriseInformation> existList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 0).collect(Collectors.toList());
List<EnterpriseInformation> logoutList = enterpriseInformationList.stream().filter(item -> item.getIsUnsubscribe() == 1).collect(Collectors.toList());
allCompany = allCompany + enterpriseInformationList.size();
exCompany = exCompany + existList.size();
loCompany = loCompany + logoutList.size();
}
map.put("all",allCompany);
map.put("ex",exCompany);
map.put("lo",loCompany);
return map;
}
@Override
public List<DeptBean> check(EnterpriseInformation enterpriseInformation) {
UserBean currentUser = userApi.getCurrentUser();
List<DeptBean> deptBeans = new ArrayList<>();
if (currentUser.isAdmin()){
return null;
}
for (RoleBean role : currentUser.getRoles()) {
String dataScope = role.getDataScope();
if ("1".equals(dataScope)) {
//全部可见
return null;
}else if ("2".equals(dataScope)) {
//自定义权限 SELECT dept_id, dept_name FROM sys_role_dept WHERE role_id = {}
List<Dept> depts = deptMapper.selectDeptByRoleId(role.getRoleId());
if (CollectionUtils.isNotEmpty(depts)){
for (Dept dept : depts) {
DeptBean deptBean = new DeptBean();
BeanUtils.copyProperties(dept,deptBean);
deptBeans.add(deptBean);
}
}
} else if ("3".equals(dataScope)) {
//部门数据权限 SELECT dept_id, dept_name FROM sys_dept WHERE dept_id = {}
Dept dept = deptMapper.selectDeptById(currentUser.getDeptId());
if (Objects.nonNull(dept)){
DeptBean deptBean = new DeptBean();
BeanUtils.copyProperties(dept,deptBean);
deptBeans.add(deptBean);
}
} else if ("4".equals(dataScope)) {
//部门及以下数据权限 SELECT dept_id FROM sys_dept WHERE dept_id = '{}' or find_in_set( '{}' , ancestors ) <> 0
List<Dept> depts = deptMapper.selectSelfAndChildrenById(currentUser.getDeptId());
if (CollectionUtils.isNotEmpty(depts)){
for (Dept dept : depts) {
DeptBean deptBean = new DeptBean();
BeanUtils.copyProperties(dept,deptBean);
deptBeans.add(deptBean);
}
}
} else if ("5".equals(dataScope)) {
//仅本人数据权限 不给看
return deptBeans;
}
}
return deptBeans;
}
@Override
public List<EnterpriseInformation> selectEnterpriseInformationAndQrInfo(EnterpriseInformation enterpriseInformation) {
return enterpriseInformationMapper.selectEnterpriseInformationAndQrInfo(enterpriseInformation);
@ -584,11 +699,12 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
if(searchType.getEnterpriseAddress()!=null&&!searchType.getEnterpriseAddress().equals("")){
enterpriseInformation.setEnterpriseAddress(searchType.getEnterpriseAddress());
}
List<EnterpriseInformation> enterpriseInformationList = enterpriseInformationMapper.selectEnterpriseInformationList1(enterpriseInformation);
List<EnterpriseInformation> enterpriseInformationList = this.selectEnterpriseInformationList1(enterpriseInformation);
if(searchType.getCompanyOrgType()!=null&&!searchType.getCompanyOrgType().equals("")){
String companyOrgType=dictDataMapper.selectDictLabel("enterpriseType",searchType.getCompanyOrgType());
enterpriseInformationList=enterpriseInformationList.stream().filter(item->item.getCompanyOrgType().contains(companyOrgType)).collect(Collectors.toList());
}
List<DeptBean> checkDept = check(enterpriseInformation);
for (int i=0;i< qyNameList.size();i++) {
String qy= qyNameList.get(i);
StatisticsIndicator s = new StatisticsIndicator();
@ -601,7 +717,11 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
s.setTotalNumber(qyList.size());
s.setNumInt(existList.size());
s.setValue(logoutList.size());
statisticsIndicatorList.add(s);
if (checkDept == null){
statisticsIndicatorList.add(s);
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(qy))) {
statisticsIndicatorList.add(s);
}
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + qy.substring(0, qy.indexOf("区")) + "新区")).collect(Collectors.toList());
}
if (enterpriseInformationList.size() > 0) {
@ -637,6 +757,7 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
String companyOrgType=dictDataMapper.selectDictLabel("enterpriseType",searchType.getCompanyOrgType());
enterpriseInformationList=enterpriseInformationList.stream().filter(item->item.getCompanyOrgType().contains(companyOrgType)).collect(Collectors.toList());
}
List<DeptBean> checkDept = check(enterpriseInformation);
String qyName = searchType.getName();
DictData dictData = new DictData();
dictData.setDictType("address_type");
@ -655,7 +776,12 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
s.setTotalNumber(jdList.size());
s.setNumInt(existList.size());
s.setValue(logoutList.size());
statisticsIndicatorList.add(s);
if (checkDept == null){
statisticsIndicatorList.add(s);
}else if (checkDept.size()!=0 && checkDept.stream().anyMatch(e -> e.getDeptName().equals(jdName))) {
statisticsIndicatorList.add(s);
}
// statisticsIndicatorList.add(s);
enterpriseInformationList = enterpriseInformationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + qyName.substring(0, qyName.indexOf("区")) + "区" + jdName) && !item.getEnterpriseAddress().startsWith("深圳市" + qyName.substring(0, qyName.indexOf("区")) + "新区" + jdName)).collect(Collectors.toList());
}
if (enterpriseInformationList.size() > 0) {

9
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java

@ -708,6 +708,11 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
int ent_num = statisticalPanelMapper.staisticalEnterprise(params);
double ent_rr_num = statisticalPanelMapper.staisticalEnterprise_rr(params);
double ent_yoy_num = statisticalPanelMapper.staisticalEnterprise_yoy(params);
if (Objects.equals(params.getDeptId(),"-1")) {
ent_num = 0;
ent_rr_num = 0;
ent_yoy_num = 0;
}
params.setQy(null);
enterprise.setNum(ent_num);
// enterprise.setRing_ratio(this.calculateRingRatio(ent_rr_num, ent_num));
@ -788,7 +793,7 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
lawEnforcement.setCurrent_month_num(statisticalPanelMapper.staisticalLawEnforcement(params));
complaint.setCurrent_month_num(statisticalPanelMapper.staisticalComplaint(params));
// warning.setCurrent_month_num(statisticalPanelMapper.staisticalWarning(params));
enterprise.setCurrent_month_num(statisticalPanelMapper.staisticalEnterprise(params));
enterprise.setCurrent_month_num(Objects.equals(params.getDeptId(),"-1")?0:statisticalPanelMapper.staisticalEnterprise(params));
params.setQy(null);
/** -------- 昨天 -------- */
@ -803,7 +808,7 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
lawEnforcement.setYesterday_num(statisticalPanelMapper.staisticalLawEnforcement(params));
complaint.setYesterday_num(statisticalPanelMapper.staisticalComplaint(params));
// warning.setYesterday_num(statisticalPanelMapper.staisticalWarning(params));
enterprise.setYesterday_num(statisticalPanelMapper.staisticalEnterprise(params));
enterprise.setYesterday_num(Objects.equals(params.getDeptId(),"-1")?0:statisticalPanelMapper.staisticalEnterprise(params));
params.setQy(null);
return all_area;

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/Zfztjdm111915ServiceImpl.java

@ -33,9 +33,10 @@ public class Zfztjdm111915ServiceImpl implements IZfztjdm111915Service {
@Override
@DataScope(deptField = "d.dept_id")
public List<Zfztjdm111915> getDeptStaticList(Zfryjdm2405301 zfryjdm2405301) {
// int totalNumber=0;
List<Zfztjdm111915> zfztjdm111915List = this.selectZfztjdmListAndDept(zfryjdm2405301.getZfdw());
List<Zfztjdm111915> zfztjdm111915List = zfztjdm111915Mapper.selectZfztjdmListAndDeptScope(zfryjdm2405301);
// Map<String,Zfztjdm111915> zfztjdm111915Map=zfztjdm111915List.stream().collect(Collectors.toMap(Zfztjdm111915::getCode, Function.identity()));
List<Zfztjdm111915> hasList=new ArrayList<>();
List<Zfryjdm2405301> zfryjdm2405301List = iZfryjdm2405301Service.selectZfryjdmAndUserListGroupBy(zfryjdm2405301);
@ -56,9 +57,10 @@ public class Zfztjdm111915ServiceImpl implements IZfztjdm111915Service {
}
}
@Override
@DataScope
public int getZFRYNumber(Zfryjdm2405301 zfryjdm2405301) {
int totalNumber=0;
List<Zfztjdm111915> zfztjdm111915List = this.selectZfztjdmListAndDept(zfryjdm2405301.getZfdw());
List<Zfztjdm111915> zfztjdm111915List = zfztjdm111915Mapper.selectZfztjdmListAndDeptScope(zfryjdm2405301);
// Map<String,Zfztjdm111915> zfztjdm111915Map=zfztjdm111915List.stream().collect(Collectors.toMap(Zfztjdm111915::getCode, Function.identity()));
List<Zfryjdm2405301> zfryjdm2405301List = iZfryjdm2405301Service.selectZfryjdmAndUserListGroupBy(zfryjdm2405301);
for (int i = 0; i < zfztjdm111915List.size(); i++) {

9
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/ComplaintStatisticsMapper.xml

@ -56,6 +56,9 @@
<if test="month != null and month != ''">
and MONTH(complaint_time)=#{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
</where>
order by complaint_time desc
</select>
@ -82,6 +85,9 @@
<if test="month != null and month != ''">
and MONTH(c.complaint_time)=#{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
</where>
</select>
<select id="selectComplaintStatisticsGroup" parameterType="ComplaintStatistics" resultMap="ComplaintStatisticsResult">
@ -114,6 +120,9 @@
<if test="month != null and month != ''">
and MONTH(complaint_time)=#{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
group by complaint_department_id
order by total desc
</where>

18
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

@ -200,6 +200,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="month != null and month != '' ">
and DATE_FORMAT(create_time, '%m') = #{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
AND bureau_dept_id is not null
and time_type is not null
and (plan_year is not null or quarter is not null or mouth is not null)
@ -233,6 +236,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="month != null and month != '' ">
and DATE_FORMAT(create_time, '%m') = #{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
AND bureau_dept_id is not null
and time_type is not null
and (plan_year is not null or quarter is not null or mouth is not null)
@ -263,6 +269,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="month != null and month != '' ">
and DATE_FORMAT(create_time, '%m') = #{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
AND bureau_dept_id is not null
AND time_type is not null
and (plan_year is not null or quarter is not null or mouth is not null)
@ -295,6 +304,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="month != null and month != '' ">
and DATE_FORMAT(create_time, '%m') = #{month}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
AND bureau_dept_id is not null
and time_type ='year'
and plan_year is not null
@ -348,6 +360,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="year != null and year != ''">
AND YEAR(create_time) = #{year}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
AND bureau_dept_id is not null
and time_type ='quarter'
and plan_year is not null
@ -410,6 +425,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="year != null and year != ''">
AND YEAR(create_time) = #{year}
</if>
<if test="params.dataScope != null and params.dataScope != ''">
${params.dataScope}
</if>
AND bureau_dept_id is not null
and time_type ='month'
and plan_year is not null

14
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/Zfztjdm111915Mapper.xml

@ -35,6 +35,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
group by t.code
</select>
<select id="selectZfztjdmListAndDeptScope" resultMap="Zfztjdm111915Result">
select t.sub_name,t.code,d.dept_id as deptId,d.ancestors from zfztjdm111915 t
left join
(select dept_id,ancestors,creditcode from sys_dept where status='0' and del_flag='0' and creditcode is not null) d
on t.code=d.creditcode
<where>
<if test="subName!=null and subName!=''">and sub_name like concat('%',#{zfdw},'%')</if>
<if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 -->
${params.dataScope}
</if>
</where>
group by t.code
</select>
<select id="selectZfztjdmAndDeptByCode" parameterType="String" resultMap="Zfztjdm111915Result">
select t.sub_name,t.code,d.dept_id as deptId,d.ancestors from zfztjdm111915 t
left join

Loading…
Cancel
Save