瀏覽代碼

修改首页统计,根据部门来区分

Administrator 2 年之前
父節點
當前提交
263d528891

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/constant/CommonConstants.java

@@ -39,7 +39,7 @@ public class CommonConstants {
     //市直部门
     public static final String  SZBM= "szbm";
     //缓存首页统计数据
-    public static final String  INDEX= "index";
+    public static final String  INDEX= "index:";
 
 
 

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/projectV2/ZsyzSbbzbMapper.java

@@ -35,6 +35,13 @@ public interface ZsyzSbbzbMapper
      */
     public List<ZsyzSbbzb> selectZsyzSbbzbListByZp(ZsyzSbbzb zsyzSbbzb);
 
+    /**
+     * 首页统计查询只查询承接地信息
+     * @param zsyzSbbzb
+     * @return
+     */
+    public List<ZsyzSbbzb> selectZsyzSbbzbCjdList(ZsyzSbbzb zsyzSbbzb);
+
     /**
      * 新增招商引资_申报_首谈信息_主
      * 

+ 7 - 8
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/projectV2/common/ZsyzCommonServiceImpL.java

@@ -122,8 +122,9 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
      */
     @Override
     public AjaxResult census() {
+        Long deptId = SecurityUtils.getDeptId();
         //先去redis 中查询
-        Map<String, Object> map = redisCache.getCacheObject(INDEX);
+        Map<String, Object> map = redisCache.getCacheObject(INDEX+deptId);
         if (map == null) {
             map = new HashMap<>();
             //定义返回值
@@ -131,7 +132,6 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
             SysUser currentUser = SecurityUtils.getLoginUser().getUser();
             ZsyzSbbzb zsyzSbbzb = new ZsyzSbbzb();
             List<ZsyzSbbzb> zsyzSbbzbs = new ArrayList<>();
-            Long deptId = SecurityUtils.getDeptId();
             String roleKey = "";
             // 如果是超级管理员/管理员,则不过滤数据
             List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
@@ -154,6 +154,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
                         if (SZBM.equals(split[i])) {
                             //如果是市直部门则包含承接地数据
                             flag = false;
+                            break;
                         }
                     }
                 }
@@ -161,10 +162,10 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
                 if (flag) {
                     //只查询承接地数据
                     zsyzSbbzb.setCjdId(deptId);
-                    zsyzSbbzbs = zsyzSbbzbMapper.selectZsyzSbbzbList(zsyzSbbzb);
+                    zsyzSbbzbs = zsyzSbbzbMapper.selectZsyzSbbzbCjdList(zsyzSbbzb);
                 } else {
                     zsyzSbbzb.setDeptId(deptId);
-                    //查询指派给市值和承接地是市值的数据
+                    //查询指派给市值
                     zsyzSbbzbs = zsyzSbbzbMapper.selectZsyzSbbzbListByZp(zsyzSbbzb);
                 }
             } else {
@@ -205,9 +206,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
             map.put("tc", tc);
             map.put("sk", sk);
             //todo 问题项目  只有要素部门意见不通过和承接地不承接的是问题项目
-            ZsyzShyj zsyzShyj = new ZsyzShyj();
-            zsyzShyj.setDeptId(deptId);
-            List<ZsyzShyj> zsyzShyjs = zsyzShyjService.selectZsyzShyjListByWt(zsyzShyj);
+            List<ZsyzShyj> zsyzShyjs = zsyzShyjService.selectZsyzShyjListByWt(new ZsyzShyj());
             int wt = 0;
             if (zsyzShyjs != null) {
                 wt = zsyzShyjs.size();
@@ -217,7 +216,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
             long ps = zsyzSbbzbMapper.ldpsListCount(new ZsyzSbbzb());
             map.put("ps", ps);
             map.put("all", all);
-            redisCache.setCacheObject(INDEX, map, 1, TimeUnit.HOURS);
+            redisCache.setCacheObject(INDEX+deptId, map, 1, TimeUnit.HOURS);
         }
         return AjaxResult.success(map);
     }

+ 10 - 2
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSbbzbMapper.xml

@@ -452,7 +452,7 @@
         from zsyz_project_dept d
                  left join zsyz_sbbzb s on s.id = d.xm_id
         where s.is_del = 'N'
-          and (d.dept_id = #{deptId} or s.depe_id = #{deptId})
+          and d.dept_id = #{deptId}
     </select>
     <select id="ldpsList" parameterType="ZsyzSbbzb" resultMap="ZsyzSbbzbResult">
         select s.id, s.sbdw, s.tbrq, s.zszxfzr, s.xmbh, s.xmxsmc, s.sfwlhxxxm, s.yzdq_id, s.yzdq_name, s.yzss_name,
@@ -631,6 +631,13 @@
         </where>
         group by s.id ) a
     </select>
+    <select id="selectZsyzSbbzbCjdList" parameterType="ZsyzSbbzb" resultMap="ZsyzSbbzbResult">
+        <include refid="selectZsyzSbbzbVo"/>
+        <where>
+            is_del = 'N'
+            <if test="cjdId != null ">and cjd_id = #{cjdId}</if>
+        </where>
+    </select>
 
 
     <insert id="insertZsyzSbbzb" parameterType="ZsyzSbbzb" useGeneratedKeys="true" keyProperty="id">
@@ -807,7 +814,8 @@
     </update>
     <update id="updateZsyzSbbzbProgress" parameterType="ZsyzSbbzb">
         update zsyz_sbbzb
-        set progress = #{progress}
+        set progress = #{progress},
+        shjg = #{shjg}
         where id = #{id}
     </update>
     <update id="updateZsyzSbbzbMeet" parameterType="ZsyzSbbzb">