Эх сурвалжийг харах

1. 增加省属企业统计页面接口
2. 增加一级企业查询接口
3. 修改穿透后的根据sys_org_code 查询条件

sugb 2 сар өмнө
parent
commit
723816a98f

+ 6 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java

@@ -591,10 +591,15 @@ public class SysPermissionController {
 			if(permission.getMenuType()==null) {
 				continue;
 			}
+
 			JSONObject json = null;
 			if(permission.getMenuType().equals(CommonConstant.MENU_TYPE_2) &&CommonConstant.STATUS_1.equals(permission.getStatus())) {
+				//20250611 确保null 前端不会自动退出
+				if(null==permission.getPerms()){
+					continue;
+				}
 				json = new JSONObject();
-				json.put("action", permission.getPerms());
+				json.put("action", permission.getPerms());   //?
 				json.put("type", permission.getPermsType());
 				json.put("describe", permission.getName());
 				jsonArray.add(json);

+ 16 - 0
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/gzvhb/mapper/QcSsgqzysytdqkGzvMapper.java

@@ -3,10 +3,13 @@ package org.jeecg.modules.zrzyqc.gzvhb.mapper;
 import java.util.HashMap;
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.zrzyqc.gzvhb.entity.QcSsgqzysytdqkGzv;
 import org.jeecg.modules.zrzyqc.qyxx.entity.QcQyxx;
+import org.jeecg.modules.zrzyqc.qyxx.entity.QcSsCountVO;
 
 /**
  * @Description: qc_ssgqzysytdqk_gzv
@@ -22,4 +25,17 @@ public interface QcSsgqzysytdqkGzvMapper extends BaseMapper<QcSsgqzysytdqkGzv> {
     void upSfsh(String id);
     void upShjg(String id);
 
+    /**
+     * 统计省属企业信息
+     * @param qcSsCountVO
+     * @param page
+     * @return
+     */
+    IPage<QcSsCountVO> customPage(QcSsCountVO qcSsCountVO, Page<QcSsCountVO> page);
+
+    /**
+     * 获取29家一级企业名称
+     * @return
+     */
+    List<String> getFirstNames();
 }

+ 24 - 0
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/gzvhb/mapper/xml/QcSsgqzysytdqkGzvMapper.xml

@@ -8,6 +8,30 @@
     <select id="selectQyxx" parameterType="String" resultType="org.jeecg.modules.zrzyqc.qyxx.entity.QcQyxx">
         select * from qc_qyxx where create_by=#{username} and sys_org_code=#{orgCode}
     </select>
+    <select id="customPage" resultType="org.jeecg.modules.zrzyqc.qyxx.entity.QcSsCountVO">
+        SELECT
+        s.create_by AS firstOrgName,s.sys_org_code as sysOrgCode,
+        count(t.dk) as dkNum,
+        ROUND(sum(t.sjzytdmj * 0.0015), 2) as area,
+        (SELECT count(*) from qc_qyxx where left(sys_org_code,6)=left(s.sys_org_code,6)  and org_type &lt;&gt;'2') as orgNum,
+        (select count(distinct sys_org_code) from qc_ssgqzysytdqk_gzv where left(sys_org_code,6)=s.sys_org_code) as sbOrgNum
+        FROM
+        qc_ssgqzysytdqk_gzv
+        AS T LEFT JOIN qc_qyxx AS s ON LEFT( T.sys_org_code, 6 ) = s.sys_org_code
+        WHERE
+        T.sys_org_code LIKE'A04%' and s.org_type='2'
+        <if test="qcSsCountVO.firstOrgName!=null">
+            and s.create_by=#{qcSsCountVO.firstOrgName}
+        </if>
+        <if test="qcSsCountVO.sysOrgCode!=null">
+            and s.sys_org_code like concat(#{qcSsCountVO.sysOrgCode},'%')
+        </if>
+        GROUP BY s.create_by,s.sys_org_code
+        ORDER BY s.sys_org_code
+    </select>
+    <select id="getFirstNames" resultType="java.lang.String">
+        SELECT distinct create_by as firstOrgName from qc_qyxx where org_type='2' and sys_org_code like 'A04A%'
+    </select>
     <insert id="insertDkxx" parameterType="hashmap"  >
         insert into dkxx(id,dkmc,xmid,shape,area)
         values (#{id},#{dkmc}, #{xmid},MDSYS.sdo_geometry(2003,'4326',null,sdo_elem_info_array(

+ 16 - 0
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/gzvhb/service/IQcSsgqzysytdqkGzvService.java

@@ -1,10 +1,13 @@
 package org.jeecg.modules.zrzyqc.gzvhb.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.zrzyqc.gzvhb.entity.QcSsgqzysytdqkGzv;
 import org.jeecg.modules.zrzyqc.gzvhb.model.ResultCount;
 import org.jeecg.modules.zrzyqc.qyxx.entity.QcQyxx;
+import org.jeecg.modules.zrzyqc.qyxx.entity.QcSsCountVO;
 
 import java.util.HashMap;
 import java.util.List;
@@ -52,4 +55,17 @@ public interface IQcSsgqzysytdqkGzvService extends IService<QcSsgqzysytdqkGzv> {
      * 获取一级企业列表,并进行一级企业组装
      */
     List<QcQyxx> getFirstOrgNamesQyxx(List<QcQyxx> list);
+
+    /**
+     * 省属企业统计
+     * @param page
+     * @return
+     */
+    IPage<QcSsCountVO> customPage(Page<QcSsCountVO> page, QcSsCountVO qcSsCountVO);
+
+    /**
+     * 获取一级单位列表
+     * @return
+     */
+    List<String> getFirstNames();
 }

+ 26 - 5
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/gzvhb/service/impl/QcSsgqzysytdqkGzvServiceImpl.java

@@ -1,6 +1,8 @@
 package org.jeecg.modules.zrzyqc.gzvhb.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.system.vo.SysCategoryModel;
@@ -9,13 +11,13 @@ import org.jeecg.modules.zrzyqc.gzvhb.mapper.QcSsgqzysytdqkGzvMapper;
 import org.jeecg.modules.zrzyqc.gzvhb.model.ResultCount;
 import org.jeecg.modules.zrzyqc.gzvhb.service.IQcSsgqzysytdqkGzvService;
 import org.jeecg.modules.zrzyqc.qyxx.entity.QcQyxx;
+import org.jeecg.modules.zrzyqc.qyxx.entity.QcSsCountVO;
 import org.jeecg.modules.zrzyqc.qyxx.mapper.QcQyxxMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
-import java.text.DecimalFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -38,6 +40,7 @@ public class QcSsgqzysytdqkGzvServiceImpl extends ServiceImpl<QcSsgqzysytdqkGzvM
     public void upSfsb(String id) {
         qcSsgqzysytdqkGzvMapper.upSfsb(id);
     }
+
     @Override
     public QcQyxx selectQyxx(String username, String orCode) {
         return qcSsgqzysytdqkGzvMapper.selectQyxx(username, orCode);
@@ -95,7 +98,7 @@ public class QcSsgqzysytdqkGzvServiceImpl extends ServiceImpl<QcSsgqzysytdqkGzvM
                         entry -> entry.getValue().get("value").toString()
                 ));
         for (QcSsgqzysytdqkGzv qcSsgqzysytdqkGzv : list) {
-            if (qcSsgqzysytdqkGzv.getSysOrgCode() != null && qcSsgqzysytdqkGzv.getSysOrgCode().length()>=6) {
+            if (qcSsgqzysytdqkGzv.getSysOrgCode() != null && qcSsgqzysytdqkGzv.getSysOrgCode().length() >= 6) {
                 String code = qcSsgqzysytdqkGzv.getSysOrgCode().substring(0, 6);
                 String value = map.get(code).toString();
                 qcSsgqzysytdqkGzv.setFirstOrgName(value);
@@ -114,7 +117,7 @@ public class QcSsgqzysytdqkGzvServiceImpl extends ServiceImpl<QcSsgqzysytdqkGzvM
                 ));
         if (null != qcSsgqzysytdqkGzv) {
 
-            if (qcSsgqzysytdqkGzv.getSysOrgCode() != null && qcSsgqzysytdqkGzv.getSysOrgCode().length()>=6) {
+            if (qcSsgqzysytdqkGzv.getSysOrgCode() != null && qcSsgqzysytdqkGzv.getSysOrgCode().length() >= 6) {
                 String code = qcSsgqzysytdqkGzv.getSysOrgCode().substring(0, 6);
                 String value = map.get(code).toString();
                 qcSsgqzysytdqkGzv.setFirstOrgName(value);
@@ -132,7 +135,7 @@ public class QcSsgqzysytdqkGzvServiceImpl extends ServiceImpl<QcSsgqzysytdqkGzvM
                         entry -> entry.getValue().get("value").toString()
                 ));
         for (QcQyxx qcQyxx : list) {
-            if (qcQyxx.getSysOrgCode() != null && qcQyxx.getSysOrgCode().length()>=6) {
+            if (qcQyxx.getSysOrgCode() != null && qcQyxx.getSysOrgCode().length() >= 6) {
                 String code = qcQyxx.getSysOrgCode().substring(0, 6);
                 String value = map.get(code).toString();
                 qcQyxx.setFirstOrgName(value);
@@ -141,9 +144,26 @@ public class QcSsgqzysytdqkGzvServiceImpl extends ServiceImpl<QcSsgqzysytdqkGzvM
         return list;
     }
 
+    /**
+     * 省属企业统计
+     *
+     * @param page
+     * @return
+     */
+    @Override
+    public IPage<QcSsCountVO> customPage(Page<QcSsCountVO> page, QcSsCountVO qcSsCountVO) {
+        return baseMapper.customPage(qcSsCountVO, page);
+    }
+
+    @Override
+    public List<String> getFirstNames() {
+       return baseMapper.getFirstNames();
+    }
+
 
     /**
      * 省属企业统计图表
+     *
      * @param list
      * @return
      */
@@ -232,13 +252,14 @@ public class QcSsgqzysytdqkGzvServiceImpl extends ServiceImpl<QcSsgqzysytdqkGzvM
 
     /**
      * 省直企业统计图表
+     *
      * @param list
      * @return
      */
     @Override
     public List<Map<String, Double>> sumListBysz(List<QcSsgqzysytdqkGzv> list) {
         List<DictModel> xzqh = sysBaseAPI.getDictItems("xq");
-       // List<DictModel> tsyqsyfsList = sysBaseAPI.getDictItems("tsyqsyfs");
+        // List<DictModel> tsyqsyfsList = sysBaseAPI.getDictItems("tsyqsyfs");
         List<SysCategoryModel> sysCategoryModels = sysBaseAPI.queryAllSysCategory();
         Double num = Double.valueOf(0);
         List<Map<String, Double>> result = new ArrayList<>();

+ 58 - 0
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/qyxx/controller/QcCountController.java

@@ -0,0 +1,58 @@
+package org.jeecg.modules.zrzyqc.qyxx.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.zrzyqc.gzvhb.service.IQcSsgqzysytdqkGzvService;
+import org.jeecg.modules.zrzyqc.qyxx.entity.QcQyxx;
+import org.jeecg.modules.zrzyqc.qyxx.entity.QcSsCountVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @Description: 信息统计
+ * @Author: jeecg-boot
+ * @Date: 2022-07-08
+ * @Version: V1.0
+ */
+@Api(tags = "信息统计")
+@RestController
+@RequestMapping("/qcsb.qyxx/xxCount")
+@Slf4j
+public class QcCountController {
+    @Autowired
+    private IQcSsgqzysytdqkGzvService qcSsgqzysytdqkGzvService;
+
+    /**
+     * 分页列表查询
+     */
+    @ApiOperation(value = "信息统计-分页列表查询", notes = "信息统计-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<QcSsCountVO>> queryPageList(QcSsCountVO qcSsCountVO,
+                                               @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                               @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        Page<QcSsCountVO> page = new Page<QcSsCountVO>(pageNo, pageSize);
+        IPage<QcSsCountVO> pageList = qcSsgqzysytdqkGzvService.customPage(page, qcSsCountVO);
+        return Result.OK(pageList);
+    }
+    /**
+     * 获取一级单位名称
+     */
+    @ApiOperation(value = "获取一级单位列表", notes = "获取一级单位列表")
+    @GetMapping(value = "/firstNames")
+    public Result<List<String>> getFirstNames() {
+        List<String> list = qcSsgqzysytdqkGzvService.getFirstNames();
+        return Result.OK(list);
+    }
+}

+ 7 - 1
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/qyxx/controller/QcQyxxController.java

@@ -153,7 +153,13 @@ public class QcQyxxController extends JeecgController<QcQyxx, IQcQyxxService> {
                                                   HttpServletRequest req) {
         QueryWrapper<QcQyxx> queryWrapper = QueryGenerator.initQueryWrapper(qcQyxx, req.getParameterMap());
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        queryWrapper.likeRight("sys_org_code", "A04");
+
+        if (qcQyxx.getSysOrgCode()!=null){
+            queryWrapper.likeRight("sys_org_code", qcQyxx.getSysOrgCode());
+            queryWrapper.ne("org_type", "2");
+        }else{
+            queryWrapper.likeRight("sys_org_code", "A04");
+        }
         Page<QcQyxx> page = new Page<QcQyxx>(pageNo, pageSize);
         IPage<QcQyxx> pageList = qcQyxxService.page(page, queryWrapper);
         // 生成一级单位名称

+ 13 - 0
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/qyxx/entity/QcSsCountDTO.java

@@ -0,0 +1,13 @@
+package org.jeecg.modules.zrzyqc.qyxx.entity;
+
+import lombok.Data;
+
+/**
+ * @author 天气预报
+ * @date 2025/6/11 14:05
+ * @package: org.jeecg.modules.zrzyqc.qyxx.entity
+ * @description
+ */
+@Data
+public class QcSsCountDTO {
+}

+ 19 - 0
jeecg-boot-module-zrzyqc/src/main/java/org/jeecg/modules/zrzyqc/qyxx/entity/QcSsCountVO.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.zrzyqc.qyxx.entity;
+
+import lombok.Data;
+
+/**
+ * @author 天气预报
+ * @date 2025/6/11 14:05
+ * @package: org.jeecg.modules.zrzyqc.qyxx.entity
+ * @description
+ */
+@Data
+public class QcSsCountVO {
+    private String firstOrgName;
+    private String sysOrgCode;
+    private Integer dkNum;
+    private Double area;
+    private Integer orgNum;
+    private Integer sbOrgNum;
+}