提交代码

dev_xds
姜玉琦 2024-04-06 01:31:05 +08:00
parent 6e84af4b01
commit 1dc7cdf4f3
44 changed files with 1085 additions and 556 deletions

View File

@ -30,6 +30,12 @@ public class BaseEntity implements Serializable
* ID,B b.,
*/
private List<Long> prjIds;
/**
*
*/
private String proType;
/** 搜索值 */
@JsonIgnore
private String searchValue;
@ -192,4 +198,12 @@ public class BaseEntity implements Serializable
{
this.params = params;
}
public String getProType() {
return proType;
}
public void setProType(String proType) {
this.proType = proType;
}
}

View File

@ -141,6 +141,6 @@ public class SecurityUtils
public static boolean isUserB() {
long roleId=getRoleId();
return 5==roleId || 6==roleId || 7==roleId || 99==roleId||15==roleId||16==roleId||17==roleId;
return 5==roleId || 6==roleId || 7==roleId || 99==roleId || 15==roleId || 16==roleId || 17==roleId;
}
}

View File

@ -2,6 +2,10 @@ package com.ruoyi.common.utils.sign;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.List;
import java.util.Objects;
import com.ruoyi.common.core.text.Convert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -82,6 +86,23 @@ public class Md5Utils
}
}
public static String hash(List<Long> objs)
{
if(objs==null){
return null;
}
String s = objs.toString();
try
{
return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
}
catch (Exception e)
{
log.error("not supported charset...{}", e);
return s;
}
}
public static String hash(String s)
{
try

View File

@ -152,8 +152,9 @@
SELECT a.dict_label taskName,b.cnt assigneeId,c.cnt procDefVersion FROM
( SELECT * FROM sys_dict_data WHERE dict_type = 'sys_process_category') a
LEFT JOIN (SELECT category,COUNT(1) cnt FROM vw_flow_all WHERE finishTime IS NOT NULL
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -163,8 +164,9 @@
GROUP BY category) b ON a.dict_value=b.category
LEFT JOIN (SELECT category,COUNT(1) cnt FROM vw_flow_all WHERE finishTime IS NULL AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -174,11 +176,13 @@
GROUP BY category) c ON a.dict_value=c.category
</select>
<select id="groupByUnit" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT cat taskName, COUNT(1) assigneeId FROM (
SELECT *,'总包单位' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '总包%'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -187,8 +191,9 @@
</if>
UNION
SELECT *,'监理单位' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '监理%'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -197,8 +202,9 @@
</if>
UNION
SELECT *,'设计单位' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '设计%'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -207,8 +213,9 @@
</if>
UNION
SELECT *,'甲方代表' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '甲方%'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -217,8 +224,9 @@
</if>
UNION
SELECT *,'子公司' cat FROM vw_flow_all WHERE finishTime IS NULL AND taskName LIKE '工程%'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -228,11 +236,13 @@
) a
GROUP BY cat
</select>
<select id="groupByUnitFinish" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT cat taskName, COUNT(1) assigneeId FROM (
SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请' and finishTime IS not NULL
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -241,8 +251,9 @@
</if>
UNION
SELECT *,'监理单位' cat FROM vw_flow_all WHERE taskName LIKE '监理%' AND taskName!='提交申请' and finishTime IS not NULL
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -251,8 +262,9 @@
</if>
UNION
SELECT *,'设计单位' cat FROM vw_flow_all WHERE taskName LIKE '设计%' AND taskName!='提交申请' and finishTime IS not NULL
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -261,8 +273,9 @@
</if>
UNION
SELECT *,'甲方代表' cat FROM vw_flow_all WHERE taskName LIKE '甲方%' AND taskName!='提交申请' and finishTime IS not NULL
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -271,8 +284,9 @@
</if>
UNION
SELECT *,'子公司' cat FROM vw_flow_all WHERE taskName LIKE '工程%' AND taskName!='提交申请' and finishTime IS not NULL
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -282,11 +296,13 @@
) a
GROUP BY cat
</select>
<select id="groupByUnitTotal" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT cat taskName, COUNT(1) assigneeId FROM (
SELECT *,'总包单位' cat FROM vw_flow_all WHERE taskName LIKE '总包%' AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -295,8 +311,9 @@
</if>
UNION
SELECT *,'监理单位' cat FROM vw_flow_all WHERE taskName LIKE '监理%' AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -305,8 +322,9 @@
</if>
UNION
SELECT *,'设计单位' cat FROM vw_flow_all WHERE taskName LIKE '设计%' AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -315,8 +333,9 @@
</if>
UNION
SELECT *,'甲方代表' cat FROM vw_flow_all WHERE taskName LIKE '甲方%' AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -325,8 +344,9 @@
</if>
UNION
SELECT *,'子公司' cat FROM vw_flow_all WHERE taskName LIKE '工程%' AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="projectDeptId !=null and projectDeptId!=''">and businessDeptId=#{projectDeptId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -336,21 +356,24 @@
) a
GROUP BY cat
</select>
<select id="listByCategory" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
<select id="listByCategory" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT * FROM vw_flow_all
<where>
<if test="category != null and category != ''"> and category = #{category}</if>
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
<if test="projectId !=null and projectId>0">and businessKey=#{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="category != null and category != ''"> and category = #{category}</if>
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="projectId !=null and projectId>0">and businessKey=#{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="listByUnit" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
<select id="listByUnit" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT * FROM vw_flow_all WHERE finishTime IS NULL
<if test="taskId!=null">
<if test="taskId==1"> AND taskName LIKE '总包%' </if>
@ -360,6 +383,7 @@
<if test="taskId==5"> AND taskName LIKE '工程%' </if>
</if>
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="projectId !=null and projectId>0">and businessKey=#{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
@ -368,16 +392,18 @@
</foreach>
</if>
</select>
<select id="listByState" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
SELECT * FROM vw_flow_all
<where>
<if test="taskId!=null">
<if test="taskId==1"> AND taskName!='提交申请' </if>
<if test="taskId==2"> AND finishTime IS NULL AND taskName!='提交申请' </if>
<if test="taskId==3"> AND finishTime IS NOT NULL </if>
</if>
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
<if test="projectId !=null and projectId>0">and businessKey=#{projectId}</if>
<if test="taskId!=null">
<if test="taskId==1"> AND taskName!='提交申请' </if>
<if test="taskId==2"> AND finishTime IS NULL AND taskName!='提交申请' </if>
<if test="taskId==3"> AND finishTime IS NOT NULL </if>
</if>
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
<if test="projectId !=null and projectId>0">and businessKey=#{projectId}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and businessKey in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -391,6 +417,7 @@
SELECT a.businessKey,a.cnt duration ,b.projectName businessKeyName FROM (
SELECT businessKey,COUNT(1) cnt FROM vw_flow_all WHERE taskName!='提交申请'
<if test="deptId !=null and deptId>0">and businessDeptId=#{deptId}</if>
<if test="proType != null and proType != ''"> and businessType = #{proType}</if>
GROUP BY businessKey ) a,sur_project b WHERE a.businessKey=b.id
ORDER BY a.cnt DESC
</select>
@ -420,6 +447,7 @@
FROM
vw_flow_all fa
<where>
<if test="proType != null and proType != ''"> and fa.businessType = #{proType}</if>
<if test="procDefKey != null and procDefKey != ''"> and fa.procDefKey = #{procDefKey}</if>
<if test="businessKey != null and businessKey != ''"> and fa.businessKey = #{businessKey}</if>
<!-- 查询条件-项目部门 -->

View File

@ -52,6 +52,7 @@ CREATE VIEW vw_flow_all AS (
DEF.KEY_ AS procDefKey,
sp.id AS businessKey,
sp.deptId as businessDeptId,
sp.projectType as businessType,
sp.projectName AS businessKeyName,
ru.user_id AS startUserId,
ru.nick_name AS startUserName,
@ -107,6 +108,7 @@ CREATE VIEW vw_flow_await AS (SELECT
DEF.KEY_ AS procDefKey,
sp.id AS businessKey,
sp.deptId AS businessDeptId,
sp.projectType AS businessType,
sp.projectName AS businessKeyName,
ru.user_id AS startUserId,
ru.nick_name AS startUserName,
@ -152,49 +154,6 @@ WHERE
##审批意见
DROP view vw_flow_comment;
CREATE VIEW vw_flow_comment AS (
SELECT
hc.ID_ AS commentId,
hc.TYPE_ AS commentType,
ht.ID_ AS taskId,
ht.NAME_ AS taskName,
ht.REV_ AS rev,
CASE
WHEN hc.TYPE_ = 1
AND ht.REV_ != 2 THEN
'通过'
WHEN hc.TYPE_ != 1 THEN
'驳回'
END AS commentResult,
ht.PROC_INST_ID_ AS procInstId,
ht.TASK_DEF_KEY_ AS taskDefKey,
ht.EXECUTION_ID_ AS executionId,
ht.DELETE_REASON_ AS deleteReason,
DATE_FORMAT(
ht.START_TIME_,
'%Y-%m-%d %H:%i:%S'
) AS startTime,
DATE_FORMAT(
ht.END_TIME_,
'%Y-%m-%d %H:%i:%S'
) AS endTime,
ht.DURATION_ AS duration,
hc.MESSAGE_ AS message,
ru.nick_name AS assigneeName,
rd.dept_name AS deptName,
r.role_name as candidate
FROM
act_hi_taskinst ht
LEFT JOIN act_hi_comment hc ON hc.TASK_ID_ = ht.ID_
LEFT JOIN act_hi_identitylink hi on hi.TASK_ID_ = ht.ID_ and hi.TYPE_ = 'candidate'
left JOIN sys_role r on r.role_id = hi.group_Id_
LEFT JOIN sys_user ru ON ru.user_id = ht.ASSIGNEE_
LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
where hc.TYPE_ is null or hc.TYPE_!='event'
)
##审批意见V2
DROP view vw_flow_comment;
CREATE VIEW vw_flow_comment AS (
SELECT
hc.ID_ AS commentId,
hc.TYPE_ AS commentType,
@ -264,6 +223,7 @@ DEF.END_TIME_ as finishTime,
pd.KEY_ AS procDefKey,
sp.id AS businessKey,
sp.deptId AS businessDeptId,
sp.projectType AS businessType,
sp.projectName AS businessKeyName,
ru.user_id AS startUserId,
ru.nick_name AS startUserName,
@ -279,6 +239,7 @@ LEFT JOIN sys_dept rd ON rd.dept_id = ru.dept_id
WHERE
RES.ASSIGNEE_ is not null and RES.END_TIME_ is not null)
##君哥其它sql
CREATE VIEW vw_smz_ssp_problemmodify_audit
AS

View File

@ -1,8 +1,10 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.yanzhu.jh.work.domain.WorkFile;
@ -13,6 +15,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Conller
*/
@ -20,6 +25,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/bgscreen/workfile")
public class BgWorkFileController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
IWorkFileService workFileService;
@ -33,6 +41,11 @@ public class BgWorkFileController extends BaseController {
*/
@GetMapping("/getWorkFileList")
public TableDataInfo getWorkFileList(String fileBelong,long deptId){
String key="bgscreen_workfile_getWorkFileList_"+fileBelong+"-"+deptId;
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
WorkFile workFile = new WorkFile();
workFile.setFileBelong(fileBelong);
workFile.setDeptId(deptId);
@ -41,7 +54,10 @@ public class BgWorkFileController extends BaseController {
workFile.setDeptId(sysDeptService.getRootDept(getDeptId()));
}
}
return getDataTable(workFileService.selectWorkFileListLimit20(workFile));
clearPage();
List<WorkFile> list = workFileService.selectWorkFileListLimit20(workFile);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
/**

View File

@ -1,18 +1,25 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.work.domain.WorkTrain;
import com.yanzhu.jh.work.service.IWorkTrainService;
import liquibase.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Conller
@ -21,6 +28,9 @@ import java.util.List;
@RequestMapping("/bgscreen/workTrain")
public class BgWorkTrainController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
IWorkTrainService workTrainService;
@ -30,7 +40,12 @@ public class BgWorkTrainController extends BaseController {
* @return
*/
@GetMapping("/getWorkTrainList")
public TableDataInfo getWorkTrainList(String trainType,String deptId,String projectId){
public TableDataInfo getWorkTrainList(String trainType,String deptId,String projectId,String proType){
String key="bgscreen_workTrain_getWorkTrainList_"+trainType+"-"+deptId+"-"+projectId+"-"+proType;
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
WorkTrain workTrain = new WorkTrain();
workTrain.setTrainType(trainType);
if(deptId!=null && !"0".equals(deptId)){
@ -43,7 +58,12 @@ public class BgWorkTrainController extends BaseController {
if(projectId!=null && !"0".equals(projectId)){
workTrain.setProjectId(Convert.toLong(projectId));
}
return getDataTable(workTrainService.selectBgscreenWorkTrainListv2(workTrain));
if(proType!=null && !"0".equals(proType)){
workTrain.setProType(projectId);
}
List<WorkTrain> list = workTrainService.selectBgscreenWorkTrainListv2(workTrain);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
/**
@ -51,7 +71,7 @@ public class BgWorkTrainController extends BaseController {
* @return
*/
@GetMapping("/getGroupByDataType")
public AjaxResult getGroupByDataType(String deptId, String projectId){
public AjaxResult getGroupByDataType(String deptId, String projectId,String proType){
WorkTrain workTrain = new WorkTrain();
if(deptId!=null && !"0".equals(deptId)){
workTrain.setNowDept(deptId);
@ -60,14 +80,35 @@ public class BgWorkTrainController extends BaseController {
workTrain.setPrjIds(getProjectIds());
}
}
String key="bgscreen_workTrain_getGroupByDataType_"+deptId+"-"+projectId+"-"+proType+Md5Utils.hash(workTrain.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(projectId!=null && !"0".equals(projectId)){
workTrain.setProjectId(Convert.toLong(projectId));
}
return AjaxResult.success(workTrainService.getGroupByDataType(workTrain));
if(proType!=null && !"0".equals(proType)){
workTrain.setProType(projectId);
}
List<WorkTrain> list = workTrainService.getGroupByDataType(workTrain);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
/**
* deptId: this.deptId,
* projectId: this.projectId,
* trainType: this.trainType,
* dataType: this.nav
* @param where
* @return
*/
@PostMapping("/queryWorkTrainList")
public TableDataInfo queryWorkTrainList(@RequestBody WorkTrain where){
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
Long deptId= where.getDeptId();
if(deptId!=null && deptId>0){
where.setNowDept(""+deptId);
@ -76,8 +117,18 @@ public class BgWorkTrainController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_workTrain_queryWorkTrainList_"+pageNum+"-"+pageSize+"-"+where.getDeptId()+"-"+where.getProjectId()+"-"+where.getTrainType()+"-"+where.getDataType()+"-"+where.getProType()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
if(StringUtils.isEmpty(where.getProType()) || "0".equals(where.getProType())){
where.setProType(null);
}
startPage();
List<WorkTrain> list=workTrainService.queryWorkTrainList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}

View File

@ -3,9 +3,12 @@ package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.flowable.service.IFlowBusinessKeyService;
import com.ruoyi.system.domain.FlowTaskEntity;
import com.yanzhu.jh.bigscreen.web.vo.FlowTypeMapper;
@ -18,6 +21,7 @@ import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/flow")
public class FloweController extends BaseController {
@Autowired
IFlowBusinessKeyService flowBusinessKeyService;
@ -25,41 +29,43 @@ public class FloweController extends BaseController {
private RedisCache redisCache;
@GetMapping("/groupByCategory")
public AjaxResult groupByCategory(long deptId,long projectId){
String key="bgscreen_flow_groupByCategory_"+deptId+"_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
public AjaxResult groupByCategory(long deptId,long projectId,long proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
where.setDeployId(deptId<1?null:""+deptId);
String key="bgscreen_flow_groupByCategory_"+deptId+"_"+projectId+"_"+proType+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setProjectDeptId(deptId<1?null:""+deptId);
where.setBusinessKey(projectId<1?null:""+projectId);
where.setProType(proType<1?null:""+proType);
List<FlowTaskEntity> list=flowBusinessKeyService.groupByCategory(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@GetMapping("/groupByUnit")
public AjaxResult groupByUnit(long deptId,long projectId){
String key="bgscreen_flow_groupByUnit_"+deptId+"_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
public AjaxResult groupByUnit(long deptId,long projectId,long proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
where.setDeployId(deptId<1?"":""+deptId);
String key="bgscreen_flow_groupByUnit_"+deptId+"_"+projectId+"_"+proType+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
List<FlowTaskEntity> list=flowBusinessKeyService.groupByUnit(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
@ -67,20 +73,22 @@ public class FloweController extends BaseController {
@GetMapping("/groupByUnitFinish")
public AjaxResult groupByUnitFinish(long deptId,long projectId){
String key="bgscreen_flow_groupByUnitFinish_"+deptId+"_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
public AjaxResult groupByUnitFinish(long deptId,long projectId,long proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
where.setDeployId(deptId<1?"":""+deptId);
String key="bgscreen_flow_groupByUnitFinish_"+deptId+"_"+projectId+"_"+proType+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
List<FlowTaskEntity> list=flowBusinessKeyService.groupByUnitFinish(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
@ -88,68 +96,101 @@ public class FloweController extends BaseController {
@GetMapping("/groupByUnitTotal")
public AjaxResult groupByUnitTotal(long deptId,long projectId){
String key="bgscreen_flow_groupByUnitTotal_"+deptId+"_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
public AjaxResult groupByUnitTotal(long deptId,long projectId,long proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
where.setDeployId(deptId<1?"":""+deptId);
String key="bgscreen_flow_groupByUnitTotal_"+deptId+"_"+projectId+"_"+proType+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
List<FlowTaskEntity> list=flowBusinessKeyService.groupByUnitTotal(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/listByUnit")
public TableDataInfo listByUnit(@RequestBody FlowTaskEntity where){
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
if(where.getDeptId()<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_flow_listByUnit_"+pageNum+"-"+pageSize+"-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+"_"+where.getTaskId()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
startPage();
List<FlowTaskEntity> list=flowBusinessKeyService.listByUnit(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
@PostMapping("/listByCategory")
public TableDataInfo listByCategory(@RequestBody FlowTaskEntity where){
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
if(where.getDeptId()<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_flow_listByCategory_"+pageNum+"-"+pageSize+"-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+"_"+where.getCategory()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
startPage();
List<FlowTaskEntity> list=flowBusinessKeyService.listByCategory(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
@PostMapping("/listByState")
public TableDataInfo listByState(@RequestBody FlowTaskEntity where){
startPage();
List<FlowTaskEntity> list=flowBusinessKeyService.listByState(where);
if(where.getDeptId()<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
String key="bgscreen_flow_listByState_"+pageNum+"-"+pageSize+"-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+"_"+where.getTaskId()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
startPage();
List<FlowTaskEntity> list=flowBusinessKeyService.listByState(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
@GetMapping("/groupByProject")
public AjaxResult groupByProject(long deptId){
String key="bgscreen_flow_groupByProject_"+deptId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
List<FlowTaskEntity> list=flowBusinessKeyService.groupByProject(deptId);
return AjaxResult.success(list);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);
}
/**
@ -157,21 +198,23 @@ public class FloweController extends BaseController {
* JiangYuQi
*/
@GetMapping("/findSafetyWorkList")
public AjaxResult findSafetyWorkList(long deptId,long projectId,String flowType){
String key="bgscreen_flow_findSafetyWorkList_"+deptId+"_"+projectId+"_"+flowType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
public AjaxResult findSafetyWorkList(long deptId,long projectId,String flowType,long proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_flow_findSafetyWorkList_"+deptId+"_"+projectId+"_"+flowType+"_"+proType+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setProcDefKey(FlowTypeMapper.getFlowProcdefKey(flowType));
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
List<FlowTaskEntity> list=flowBusinessKeyService.findSafetyWorkList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -1,14 +1,22 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.yanzhu.jh.work.domain.WorkJournalism;
import com.yanzhu.jh.work.service.IWorkJournalismService;
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.RestController;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Conller
*/
@ -16,6 +24,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/bgscreen/journalism")
public class JournalismConller extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
IWorkJournalismService workJournalismService;
@ -25,7 +36,17 @@ public class JournalismConller extends BaseController {
*/
@GetMapping("/getJournalismList")
public TableDataInfo getJournalismList(){
return getDataTable(workJournalismService.selectBgscreenWorkJournalismList());
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
String key="bgscreen_journalism_getJournalismList_"+pageNum+"-"+pageSize;
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
List<WorkJournalism> list = workJournalismService.selectBgscreenWorkJournalismList();
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
/**

View File

@ -1,6 +1,5 @@
package com.yanzhu.jh.bigscreen.web.controller;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
@ -8,52 +7,50 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.trouble.domain.SmzSspProblemmodify;
import com.yanzhu.jh.trouble.domain.where.SmzSspProblemmodifyWhere;
import com.yanzhu.jh.trouble.service.ISmzSspProblemmodifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/problemmodify")
public class ProblemmodifyController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
private ISmzSspProblemmodifyService smzSspProblemmodifyService;
/**
* -()
* @param deptId
* @param roleType
* @param where
* @return
*/
@PostMapping("/safetySummary")
public List<SmzSspProblemmodify> safetySummary(@RequestBody SmzSspProblemmodifyWhere where)
{
//3集团//4子公司//5监理单位//6总包//7分包
where.setInfoType(0l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_safetySummary-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
Long deptId=where.getDeptId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
//3集团//4子公司//5监理单位//6总包//7分包
where.setInfoType(0l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_safetySummary-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummary(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list;
@ -62,28 +59,27 @@ public class ProblemmodifyController extends BaseController {
/**
* -()
* @param deptId
* @param roleType
* @param where
* @return
*/
@PostMapping("/qualitySummary")
public List<SmzSspProblemmodify> qualitySummary(@RequestBody SmzSspProblemmodifyWhere where)
{
//3集团//4子公司//5监理单位//6总包//7分包
where.setInfoType(1l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_qualitySummary-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
Long deptId=where.getDeptId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
//3集团//4子公司//5监理单位//6总包//7分包
where.setInfoType(1l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_qualitySummary-"+where.getDeptId()+"-"+where.getProType()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummary(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list;
@ -96,23 +92,23 @@ public class ProblemmodifyController extends BaseController {
* @return
*/
@PostMapping("/safetySummaryByProject")
public List<SmzSspProblemmodify> safetySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where)
public List<SmzSspProblemmodify> safetySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where)
{
//3集团//4子公司//5监理单位//6总包//7分包
where.setInfoType(0l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_safetySummaryByProject-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
Long deptId=where.getDeptId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
//3集团//4子公司//5监理单位//6总包//7分包
where.setInfoType(0l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_safetySummaryByProject-"+where.getDeptId()+"-"+where.getProType()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummaryByProject(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list;
@ -121,29 +117,28 @@ public class ProblemmodifyController extends BaseController {
/**
* -()
* @param deptId
* @param roleType
* @param where
* @return
*/
@PostMapping("/qualitySummaryByProject")
public List<SmzSspProblemmodify> qualitySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where)
{
//3集团//4子公司//5监理单位//6总包//7分包 int deptId,int roleType,int projectId
where.setInfoType(1l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_qualitySummaryByProject-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
Long deptId=where.getDeptId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
//3集团//4子公司//5监理单位//6总包//7分包 int deptId,int roleType,int projectId
where.setInfoType(1l);
String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd");
String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd");
String key="problemmodify_qualitySummaryByProject-"+where.getDeptId()+"-"+where.getProType()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return (List<SmzSspProblemmodify>) obj;
}
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummaryByProject(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list;
@ -151,27 +146,43 @@ public class ProblemmodifyController extends BaseController {
@PostMapping("/countByDate")
public AjaxResult countByDate(@RequestBody SmzSspProblemmodifyWhere where){
List<SmzSspProblemmodify> list=smzSspProblemmodifyService.countByDate(where);
Long deptId=where.getDeptId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="problemmodify_countByDate-"+where.getDeptId()+"-"+where.getProjectId()+"-"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
List<SmzSspProblemmodify> list=smzSspProblemmodifyService.countByDate(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/countByDateRange")
public AjaxResult countByDateRange(@RequestBody SmzSspProblemmodifyWhere where){
List<SmzSspProblemmodify> list=smzSspProblemmodifyService.countByDateRange(where);
Long deptId=where.getDeptId();
if(deptId==null||deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="problemmodify_countByDateRange-"+where.getDeptId()+"-"+where.getProjectId()+"-"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
List<SmzSspProblemmodify> list=smzSspProblemmodifyService.countByDateRange(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/groupByInfotypeCheckState")
public AjaxResult groupByInfotypeCheckState(@RequestBody SmzSspProblemmodifyWhere where){
Long deptId=where.getDeptId();
@ -180,12 +191,19 @@ public class ProblemmodifyController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
String key="problemmodify_groupByInfotypeCheckState-"+where.getDeptId()+"-"+where.getProjectId()+"-"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
List<SmzSspProblemmodify> list=smzSspProblemmodifyService.groupByInfotypeCheckState(where);
SmzSspProblemmodify obj=new SmzSspProblemmodify();
obj.setId(smzSspProblemmodifyService.countTimeout(where));
obj.setCheckState(5l);
obj.setInfoType(where.getInfoType());
list.add(obj);
SmzSspProblemmodify spObj=new SmzSspProblemmodify();
spObj.setId(smzSspProblemmodifyService.countTimeout(where));
spObj.setCheckState(5l);
spObj.setInfoType(where.getInfoType());
list.add(spObj);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@ -195,21 +213,25 @@ public class ProblemmodifyController extends BaseController {
* @return
*/
@GetMapping("/getMonitAndWarning")
public AjaxResult getMonitAndWarning(long deptId,long projectId){
String key="problemmodify_getMonitAndWarning-"+deptId+"_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
public AjaxResult getMonitAndWarning(long deptId,long projectId,String proType){
SmzSspProblemmodifyWhere where=new SmzSspProblemmodifyWhere();
where.setDeptId(deptId);
where.setProjectId(projectId);
where.setStartDate(new Date());
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="problemmodify_getMonitAndWarning-"+deptId+"_"+projectId+"_"+proType+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setDeptId(deptId);
where.setProjectId(projectId);
where.setStartDate(new Date());
if(StringUtils.isNotNull(proType) && Objects.equals(proType,"0")){
where.setProType(proType);
}
Map<String,List<Map<String, Object>>> map=new HashMap<>();
//map.put("today",smzSspProblemmodifyService.countByDate(where));
@ -233,6 +255,14 @@ public class ProblemmodifyController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
return AjaxResult.success(smzSspProblemmodifyService.selectSmzSspProblemmodifyListAndUnitName(where));
String params = Md5Utils.hash(deptId+"_"+where.getProjectId()+"_"+where.getInfoType()+"_"+where.getRoleType()+"_"+where.getActiveName()+"_"+where.getCheckState()+"_"+where.getStartDate()+"_"+where.getEndDate()+where.getProType()+Md5Utils.hash(where.getPrjIds()));
String key="problemmodify_getMonitAndWarning-"+params;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSmzSspProblemmodifyListAndUnitName(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
}

View File

@ -2,13 +2,18 @@ package com.yanzhu.jh.bigscreen.web.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectAttendanceData;
import com.yanzhu.jh.project.domain.SurProjectAttendanceUser;
import com.yanzhu.jh.project.domain.SurProjectDeptWroks;
@ -20,9 +25,9 @@ import com.yanzhu.jh.project.service.ISurProjectWorkAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Conller
@ -31,6 +36,9 @@ import java.util.List;
@RequestMapping("/bgscreen/attendance")
public class ProjectAttendanceController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
ISurProjectWorkAttendanceService surProjectWorkAttendanceService;
@ -43,9 +51,8 @@ public class ProjectAttendanceController extends BaseController {
@Autowired
ISurProjectAttendanceUserService attendanceUserService;
@Autowired
HttpServletRequest request;
/**
* ---------------------使
*
* @param deptId
* @param projectId
@ -54,7 +61,6 @@ public class ProjectAttendanceController extends BaseController {
@GetMapping("/getDeptWorksList")
public TableDataInfo getDeptWorksList(String deptId,String projectId){
SurProjectDeptWroks surProjectDeptWroks = new SurProjectDeptWroks();
if(deptId!=null && !"0".equals(deptId)){
surProjectDeptWroks.setDeptId(Convert.toLong(deptId));
}else{
@ -68,6 +74,12 @@ public class ProjectAttendanceController extends BaseController {
return getDataTable(surProjectDeptWroksService.selectBgscreenDeptWroksList(surProjectDeptWroks));
}
/**
* ---------------------使
*
* @param where
* @return
*/
@PostMapping("selectList")
public TableDataInfo selectList(@RequestBody SurProjectDeptWroks where){
startPage();
@ -82,6 +94,7 @@ public class ProjectAttendanceController extends BaseController {
}
/**
* ---------------------使
*
* @param deptId
* @param projectId
@ -116,14 +129,21 @@ public class ProjectAttendanceController extends BaseController {
*/
@PostMapping("/groupByComany")
public AjaxResult groupByComany(@RequestBody SurProjectAttendanceData where){
Long deptId= where.getDeptId();
Long deptId = where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_attendance_groupByComany-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
where.setAttendanceTime(DateUtil.formatDate(DateTime.now()));
List<SurProjectAttendanceData> list=attendanceDataService.groupTodayCompanyTypeId(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@ -135,7 +155,13 @@ public class ProjectAttendanceController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_attendance_groupAllByComany-"+where.getDeptId()+"-"+where.getSubDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectAttendanceData> list=attendanceDataService.groupAllByComany(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@ -153,12 +179,21 @@ public class ProjectAttendanceController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
String key="bgscreen_attendance_workerOnDuty-"+pageNum+"-"+pageSize+"-"+where.getId()+"-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
startPage();
List<SurProjectAttendanceUser> list=attendanceUserService.queryWorkerOnDuty(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
/**
*
* @param where
@ -172,7 +207,14 @@ public class ProjectAttendanceController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_attendance_groupByWorkerOnDuty-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
List<SurProjectAttendanceData> list=attendanceUserService.groupByWorkerOnDutyByDept(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
/**
@ -185,9 +227,19 @@ public class ProjectAttendanceController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
String key="bgscreen_attendance_todayAttendance-"+pageNum+"-"+pageSize+"-"+where.getId()+"-"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
startPage();
where.setAttendanceTime(DateUtil.formatDate(DateTime.now()));
List<SurProjectAttendanceData> list=attendanceDataService.todayAttendance(where);
List<SurProjectAttendanceData> list = attendanceDataService.todayAttendance(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectBuildNodeData;
import com.yanzhu.jh.project.service.ISurProjectBuildNodeDataService;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,10 +19,12 @@ import java.util.concurrent.TimeUnit;
public class ProjectBuildNodeController extends BaseController {
@Autowired
ISurProjectBuildNodeDataService surProjectBuildNodeDataService;
@Autowired
private RedisCache redisCache;
@Autowired
ISurProjectBuildNodeDataService surProjectBuildNodeDataService;
/**
*
* @param where
@ -35,7 +38,15 @@ public class ProjectBuildNodeController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
return AjaxResult.success(surProjectBuildNodeDataService.selectScheduledAlerts(where));
String key="bgscreen_projectBuildNode_selectScheduledAlerts_"+where.getId()+"-"+where.getProjectId()+"-"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectBuildNodeData> list = surProjectBuildNodeDataService.selectScheduledAlerts(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success();
}
/**
@ -51,8 +62,17 @@ public class ProjectBuildNodeController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
return AjaxResult.success(surProjectBuildNodeDataService.countCompletionRate(where));
String key="bgscreen_projectBuildNode_countCompletionRate_"+where.getId()+"-"+where.getProjectId()+"-"+where.getProType()+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectBuildNodeData> list = surProjectBuildNodeDataService.countCompletionRate(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
/**
*
* @param where
@ -60,7 +80,14 @@ public class ProjectBuildNodeController extends BaseController {
*/
@PostMapping("/selectCurrent")
public AjaxResult selectCurrent(@RequestBody SurProjectBuildNodeData where){
return AjaxResult.success(surProjectBuildNodeDataService.selectCurrent(where));
String key="bgscreen_projectBuildNode_selectCurrent_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectBuildNodeData> list = surProjectBuildNodeDataService.selectCurrent(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success();
}
/**
@ -70,6 +97,11 @@ public class ProjectBuildNodeController extends BaseController {
*/
@GetMapping("/listByProject")
public AjaxResult listByProject(long projectId){
String key="bgscreen_projectBuildNode_listByProject_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
SurProjectBuildNodeData surProjectBuildNodeData=new SurProjectBuildNodeData();
surProjectBuildNodeData.setProjectId(projectId);
List list=surProjectBuildNodeDataService.selectSurProjectBuildNodeDataList(surProjectBuildNodeData);
@ -78,6 +110,7 @@ public class ProjectBuildNodeController extends BaseController {
}
surProjectBuildNodeDataService.addProjectNodes(projectId);
list=surProjectBuildNodeDataService.selectSurProjectBuildNodeDataList(surProjectBuildNodeData);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}

View File

@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectCheckDetection;
import com.yanzhu.jh.project.service.ISurProjectCheckDetectionService;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,11 +21,13 @@ import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/checkDetection")
public class ProjectCheckDetectionController extends BaseController {
@Autowired
ISurProjectCheckDetectionService checkDetectionService;
@Autowired
private RedisCache redisCache;
@Autowired
ISurProjectCheckDetectionService checkDetectionService;
/**
*
* @param where checkType deptId projectId
@ -32,34 +35,43 @@ public class ProjectCheckDetectionController extends BaseController {
*/
@PostMapping("/groupByCheckType")
public AjaxResult groupByCheckType(@RequestBody SurProjectCheckDetection where){
String key="bgscreen_checkDetection_groupMeasureInfo_"+where.getCheckType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_checkDetection_groupMeasureInfo_"+where.getCheckType()+"_"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectCheckDetection> list=checkDetectionService.groupByCheckType(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
/**
*
* @param where
* @return
*/
@PostMapping("/getList")
public AjaxResult getList(@RequestBody SurProjectCheckDetection where){
String key="bgscreen_getList_groupMeasureInfo_"+where.getCheckType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_checkDetection_getList_"+where.getCheckType()+"_"+where.getDeptId()+"_"+where.getProjectId()+where
.getProType()+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectCheckDetection> list=checkDetectionService.getList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -1,15 +1,25 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectChecking;
import com.yanzhu.jh.project.service.ISurProjectCheckingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Conller
*/
@ -17,6 +27,9 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/bgscreen/projectChecking")
public class ProjectCheckingController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
private ISurProjectCheckingService surProjectCheckingService;
@ -27,7 +40,10 @@ public class ProjectCheckingController extends BaseController {
* @return
*/
@GetMapping("/getProjectCheckingList")
public TableDataInfo getProjectCheckingList(String deptId, String projectId){
public TableDataInfo getProjectCheckingList(String deptId, String projectId,String proType){
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
SurProjectChecking surProjectChecking = new SurProjectChecking();
if(deptId!=null && !"0".equals(deptId)){
surProjectChecking.setProjectDeptId(deptId);
@ -36,10 +52,20 @@ public class ProjectCheckingController extends BaseController {
surProjectChecking.setPrjIds(getProjectIds());
}
}
String key="bgscreen_projectChecking_getProjectCheckingList_"+pageNum+"-"+pageSize+"-"+"_"+surProjectChecking.getProjectDeptId()+deptId+"_"+projectId+"_"+proType+ Md5Utils.hash(surProjectChecking.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectChecking.setProjectId(Convert.toLong(projectId));
}
return getDataTable(surProjectCheckingService.selectBgscreenProjectCheckingList(surProjectChecking));
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectChecking.setProType(proType);
}
List<SurProjectChecking> list = surProjectCheckingService.selectBgscreenProjectCheckingList(surProjectChecking);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
/**
@ -49,7 +75,7 @@ public class ProjectCheckingController extends BaseController {
* @return
*/
@GetMapping("/getProjectCheckingView")
public AjaxResult getProjectCheckingView(String deptId, String projectId){
public AjaxResult getProjectCheckingView(String deptId, String projectId,String proType){
SurProjectChecking surProjectChecking = new SurProjectChecking();
if(deptId!=null && !"0".equals(deptId)){
surProjectChecking.setProjectDeptId(deptId);
@ -58,10 +84,21 @@ public class ProjectCheckingController extends BaseController {
surProjectChecking.setPrjIds(getProjectIds());
}
}
String key="bgscreen_projectChecking_getProjectCheckingView_"+deptId+"_"+surProjectChecking.getProjectDeptId()+"_"+projectId+"_"+proType+Md5Utils.hash(surProjectChecking.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectChecking.setProjectId(Convert.toLong(projectId));
}
return success(surProjectCheckingService.selectBgscreenProjectCheckingView(surProjectChecking));
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectChecking.setProType(proType);
}
Map<String, Object> data = surProjectCheckingService.selectBgscreenProjectCheckingView(surProjectChecking);
redisCache.setCacheObject(key, data, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(data);
}
/**
@ -71,7 +108,7 @@ public class ProjectCheckingController extends BaseController {
* @return
*/
@GetMapping("/getProjectCheckingGroupFoChart")
public AjaxResult getProjectCheckingGroupFoChart(String deptId, String projectId){
public AjaxResult getProjectCheckingGroupFoChart(String deptId, String projectId,String proType){
SurProjectChecking surProjectChecking = new SurProjectChecking();
if(deptId!=null && !"0".equals(deptId)){
surProjectChecking.setProjectDeptId(deptId);
@ -80,10 +117,21 @@ public class ProjectCheckingController extends BaseController {
surProjectChecking.setPrjIds(getProjectIds());
}
}
String key="bgscreen_projectChecking_getProjectCheckingGroupFoChart_"+deptId+"_"+surProjectChecking.getProjectDeptId()+"_"+projectId+"_"+proType+Md5Utils.hash(surProjectChecking.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectChecking.setProjectId(Convert.toLong(projectId));
}
return success(surProjectCheckingService.getProjectCheckingGroupFoChart(surProjectChecking));
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectChecking.setProType(proType);
}
List<SurProjectChecking> list = surProjectCheckingService.getProjectCheckingGroupFoChart(surProjectChecking);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);
}
/**
@ -93,7 +141,7 @@ public class ProjectCheckingController extends BaseController {
* @return
*/
@GetMapping("/groupCheckingByProjectId")
public AjaxResult groupCheckingByProjectId(String lvl,String deptId, String projectId){
public AjaxResult groupCheckingByProjectId(String lvl,String deptId, String projectId,String proType){
SurProjectChecking surProjectChecking = new SurProjectChecking();
surProjectChecking.setDataTypeLvl2(lvl);
if(deptId!=null && !"0".equals(deptId)){
@ -103,15 +151,33 @@ public class ProjectCheckingController extends BaseController {
surProjectChecking.setPrjIds(getProjectIds());
}
}
String key="bgscreen_projectChecking_groupCheckingByProjectId_"+lvl+"-"+deptId+"_"+surProjectChecking.getProjectDeptId()+"_"+projectId+"_"+proType+Md5Utils.hash(surProjectChecking.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectChecking.setProjectId(Convert.toLong(projectId));
}
return success(surProjectCheckingService.groupCheckingByProjectId(surProjectChecking));
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectChecking.setProType(proType);
}
List<SurProjectChecking> list = surProjectCheckingService.groupCheckingByProjectId(surProjectChecking);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);
}
/**
*
* @param where
* @return
*/
@PostMapping("/queryProjectCheckingList")
public TableDataInfo queryProjectCheckingList(@RequestBody SurProjectChecking where){
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
Long deptId=where.getDeptId();
Long projectId=where.getProjectId();
if(deptId!=null && deptId.equals(0)){
@ -122,10 +188,17 @@ public class ProjectCheckingController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_projectChecking_groupCheckingByProjectId_"+pageNum+"-"+pageSize+"_"+where.getDeptId()+"_"+where.getProjectDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
if(projectId!=null && projectId.equals(0)){
where.setProjectId(Convert.toLong(projectId));
}
startPage();
return getDataTable(surProjectCheckingService.selectBgscreenProjectCheckingListByPage(where));
List<SurProjectChecking> list = surProjectCheckingService.selectBgscreenProjectCheckingListByPage(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
}

View File

@ -5,6 +5,8 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProject;
import com.yanzhu.jh.project.domain.SurProjectUserinfo;
import com.yanzhu.jh.project.service.ISurProjectService;
@ -34,9 +36,8 @@ public class ProjectController extends BaseController {
@Autowired
private RedisCache redisCache;
@GetMapping("findProjectByDept")
public AjaxResult findProjectByDept(Long deptId){
@GetMapping("/findProjectByDept")
public AjaxResult findProjectByDept(Long deptId,String proType){
SurProject surProject=new SurProject();
if(deptId==-1){
long roleId= SecurityUtils.getRoleId();
@ -45,41 +46,37 @@ public class ProjectController extends BaseController {
}else{
surProject.setId(SecurityUtils.getUserId());
}
return AjaxResult.success(isurProjectService.selectSurProjectListByBuser(surProject));
return success(isurProjectService.selectSurProjectListByBuser(surProject));
}
if(deptId!=null && deptId.longValue()>0){
surProject.setDeptId(deptId);
}
return AjaxResult.success(isurProjectService.selectSurProjectList(surProject));
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProject.setProjectType(proType);
}
return success(isurProjectService.selectSurProjectList(surProject));
}
@GetMapping("getProjectBuildNode")
@GetMapping("/getProjectBuildNode")
public AjaxResult getProjectBuildNode(Long projectId){
SurProjectBuildNodeData nodeData=new SurProjectBuildNodeData();
nodeData.setProjectId(projectId);
List list=surProjectBuildNodeDataService.selectSurProjectBuildNodeDataList(nodeData);
if(list.size()>0){
return AjaxResult.success(list);
return success(list);
}
surProjectBuildNodeDataService.addProjectNodes(projectId);
list=surProjectBuildNodeDataService.selectSurProjectBuildNodeDataList(nodeData);
return AjaxResult.success(list);
return success(list);
}
/**
*
* @return
*/
@GetMapping("getProgressProjects")
public AjaxResult getProgressProjects(long deptId){
String key="bgscreen_prj_getProgressProjects_"+deptId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
@GetMapping("/getProgressProjects")
public AjaxResult getProgressProjects(long deptId,String proType){
SurProject where=new SurProject();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -88,19 +85,22 @@ public class ProjectController extends BaseController {
}else{
where.setDeptId(deptId);
}
String key="bgscreen_prj_getProgressProjects_"+deptId+"_"+proType+"_"+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProjectType(proType);
}
List<SurProject> list= isurProjectService.selectProgressProjects(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
return success(list);
}
@GetMapping("groupByProjectCategory")
public AjaxResult groupByProjectCategory(long deptId){
String key="bgscreen_prj_groupByProjectCategory_"+deptId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
@GetMapping("/groupByProjectCategory")
public AjaxResult groupByProjectCategory(long deptId,String proType){
SurProject where=new SurProject();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -109,41 +109,56 @@ public class ProjectController extends BaseController {
}else{
where.setDeptId(deptId);
}
List<SurProject> list= isurProjectService.groupByProjectCategory(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("groupByCategory")
public AjaxResult groupByCategory(@RequestBody SurProject surProject){
String key="bgscreen_prj_groupByProjectCategory_"+surProject.getId()+"_"+surProject.getDeptId();
String key="bgscreen_prj_groupByProjectCategory_"+deptId+"_"+proType+"_"+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
return success(obj);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProjectType(proType);
}
List<SurProject> list= isurProjectService.groupByProjectCategory(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);
}
@PostMapping("/groupByCategory")
public AjaxResult groupByCategory(@RequestBody SurProject surProject){
String key="bgscreen_prj_groupByProjectCategory_"+surProject.getId()+"_"+surProject.getDeptId()+surProject.getProType();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
List<SurProject> list=isurProjectService.groupByCategory(surProject);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
return success(list);
}
@PostMapping("groupByLevel")
@PostMapping("/groupByLevel")
public AjaxResult groupByLevel(@RequestBody SurProject surProject){
String key="bgscreen_prj_groupByLevel_"+surProject.getId()+"_"+surProject.getDeptId();
String key="bgscreen_prj_groupByLevel_"+surProject.getId()+"_"+surProject.getDeptId()+surProject.getProType();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
return success(obj);
}
List<SurProject> list=isurProjectService.groupByLevel(surProject);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
return success(list);
}
@GetMapping("/getProjectUser")
public AjaxResult getProjectUser(Long projectId){
String key="bgscreen_prj_getProjectUser_"+projectId;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
SurProjectUserinfo where=new SurProjectUserinfo();
where.setProjectId(projectId);
return AjaxResult.success( surProjectUserinfoService.selectSurProjectUserinfoList(where));
List<SurProjectUserinfo> list = surProjectUserinfoService.selectSurProjectUserinfoList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);
}

View File

@ -3,7 +3,6 @@ package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.yanzhu.jh.project.domain.SurProject;
import com.yanzhu.jh.project.domain.SurProjectCostOutput;
import com.yanzhu.jh.project.service.ISurProjectCostOutputService;
import com.yanzhu.jh.project.service.ISurProjectService;
@ -16,14 +15,16 @@ import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/costOut")
public class ProjectCostOutputController {
@Autowired
private ISurProjectCostOutputService surProjectCostOutputService;
@Autowired
private RedisCache redisCache;
@Autowired
private ISurProjectService projectService;
@Autowired
private ISurProjectCostOutputService surProjectCostOutputService;
@PostMapping("/selectYearAndMonth")
public AjaxResult selectYearAndMonth(@RequestBody SurProjectCostOutput where){
String key="bgscreen_costOut_selectYearAndMonth_"+where.getYear()+"-"+where.getMonth()+"-"+where.getProjectId();
@ -42,7 +43,7 @@ public class ProjectCostOutputController {
@PostMapping("/sumByDeptId")
public AjaxResult sumByDeptId(@RequestBody SurProjectCostOutput where){
String key="bgscreen_costOut_sumByDeptId_"+where.getYear()+"-"+where.getMonth()+"-"+where.getId()+"-"+where.getProjectId();
String key="bgscreen_costOut_sumByDeptId_"+where.getYear()+"-"+where.getMonth()+"-"+where.getId()+"-"+where.getProjectId()+"_"+where.getProType();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);

View File

@ -8,6 +8,7 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectInsurance;
import com.yanzhu.jh.project.service.ISurProjectInsuranceService;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@ -25,10 +27,12 @@ import java.util.concurrent.TimeUnit;
@RequestMapping("/bgscreen/insurance")
public class ProjectInsuranceController extends BaseController {
@Autowired
private ISurProjectInsuranceService surProjectInsuranceService;
@Autowired
private RedisCache redisCache;
@Autowired
private ISurProjectInsuranceService surProjectInsuranceService;
/**
*
* @param deptId
@ -36,7 +40,7 @@ public class ProjectInsuranceController extends BaseController {
* @return
*/
@GetMapping("/getProjectInsuranceList")
public TableDataInfo getProjectInsuranceList(String deptId,String projectId){
public TableDataInfo getProjectInsuranceList(String deptId,String projectId,String proType){
SurProjectInsurance surProjectInsurance = new SurProjectInsurance();
if(deptId!=null && !"0".equals(deptId)){
surProjectInsurance.setNowDept(deptId);
@ -44,12 +48,21 @@ public class ProjectInsuranceController extends BaseController {
if (SecurityUtils.isUserB()) {
surProjectInsurance.setPrjIds(getProjectIds());
}
}
String key="bgscreen_insurance_getProjectInsuranceList_"+deptId+"-"+projectId+"_"+proType+"_"+surProjectInsurance.getNowDept()+"_"+Md5Utils.hash(surProjectInsurance.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectInsurance.setProjectId(Convert.toLong(projectId));
}
return getDataTable(surProjectInsuranceService.selectBgscreenInsuranceList(surProjectInsurance));
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectInsurance.setProType(proType);
}
List<Map<String,Object>> list = surProjectInsuranceService.selectBgscreenInsuranceList(surProjectInsurance);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
/**
@ -62,11 +75,11 @@ public class ProjectInsuranceController extends BaseController {
String key="bgscreen_insurance_getProjectInsurance_"+id;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
return success(obj);
}
List list=surProjectInsuranceService.selectProjectInsuranceListByProjectId(id);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
return success(list);
}
}

View File

@ -3,9 +3,12 @@ package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectMaterialSeal;
import com.yanzhu.jh.project.service.ISurProjectMaterialSealService;
import org.springframework.beans.factory.annotation.Autowired;
@ -30,48 +33,61 @@ public class ProjectMaterialSealController extends BaseController {
@PostMapping("/selectTop20")
public AjaxResult selectTop20(@RequestBody SurProjectMaterialSeal where){
String key="bgscreen_materialSeal_selectTop20_"+where.getDeptId()+"-"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId=where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_materialSeal_selectTop20_"+where.getDeptId()+"-"+where.getProjectId()+"_"+where.getProType()+"_"+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
clearPage();
List<SurProjectMaterialSeal> list=materialSealService.selectTop20(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/groupTop12Month")
public AjaxResult groupTop12Month(@RequestBody SurProjectMaterialSeal where){
String key="bgscreen_materialSeal_groupTop12Month_"+where.getDeptId()+"-"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId=where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_materialSeal_groupTop12Month_"+where.getDeptId()+"-"+where.getProjectId()+"_"+where.getProType()+"_"+ Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
clearPage();
List<SurProjectMaterialSeal> list=materialSealService.groupTop12Month(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
return success(list);
}
@PostMapping("/selectTop12Month")
public TableDataInfo selectTop12Month(@RequestBody SurProjectMaterialSeal where){
startPage();
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
Long deptId=where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_materialSeal_selectTop12Month_"+pageNum+"_"+pageSize+"_"+where.getDeptId()+"-"+where.getProjectId()+"_"+where.getProType()+"_"+ Md5Utils.hash(where.getPrjIds());
List<Object> objs=redisCache.getCacheObject(key);
if(objs!=null){
return getDataTable(objs);
}
startPage();
List<SurProjectMaterialSeal> list=materialSealService.selectTop12Month(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectMeasure;
import com.yanzhu.jh.project.service.ISurProjectMeasureService;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,10 +20,13 @@ import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/measure")
public class ProjectMeasureController extends BaseController {
@Autowired
ISurProjectMeasureService measureService;
@Autowired
private RedisCache redisCache;
@Autowired
ISurProjectMeasureService measureService;
/**
*
* @param where measureType deptId projectId
@ -30,34 +34,36 @@ public class ProjectMeasureController extends BaseController {
*/
@PostMapping("/groupMeasureInfo")
public AjaxResult groupMeasureInfo(@RequestBody SurProjectMeasure where){
String key="bgscreen_measure_groupMeasureInfo_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_measure_groupMeasureInfo_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+"_"+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectMeasure> list=measureService.groupMeasureInfo(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@PostMapping("/getList")
public AjaxResult getList(@RequestBody SurProjectMeasure where){
String key="bgscreen_measure_getList_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_measure_getList_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+"_"+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectMeasure> list=measureService.getList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.yanzhu.jh.project.domain.SmzProjectQuarterlyAssess;
import com.yanzhu.jh.project.service.ISmzProjectQuarterlyAssessService;
import org.springframework.beans.factory.annotation.Autowired;
@ -26,8 +27,8 @@ public class ProjectQuarterlyAssessController extends BaseController {
@GetMapping("/currentListByDept")
public TableDataInfo currentListByDept(Long deptId){
String key="bgscreen_asscess_currentListByDept"+deptId;
public TableDataInfo currentListByDept(Long deptId,String proType){
String key="bgscreen_asscess_currentListByDept"+deptId+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return getDataTable((List<?>) obj);
@ -43,6 +44,10 @@ public class ProjectQuarterlyAssessController extends BaseController {
smzProjectQuarterlyAssess.setYear((long)calendar.get(Calendar.YEAR));
int month=calendar.get(Calendar.MONTH)+1;
smzProjectQuarterlyAssess.setQuarterly((long)(month+2)/3);
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
smzProjectQuarterlyAssess.setProType(proType);
}
List list= smzProjectQuarterlyAssessService.currentListByDept(smzProjectQuarterlyAssess);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
@ -55,7 +60,7 @@ public class ProjectQuarterlyAssessController extends BaseController {
*/
@PostMapping("/queryByProjectType")
public AjaxResult queryByProjectType(@RequestBody SmzProjectQuarterlyAssess where){
String key="bgscreen_asscess_queryByProjectType_"+where.getId()+"_"+where.getYear()+"_"+where.getQuarterly()+"-"+where.getDeptId();
String key="bgscreen_asscess_queryByProjectType_"+where.getId()+"_"+where.getYear()+"_"+where.getQuarterly()+"-"+where.getDeptId()+"_"+where.getProType();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.yanzhu.jh.project.domain.SurProjectSchedule;
import com.yanzhu.jh.project.domain.vo.SurProjectScheduleWhere;
import com.yanzhu.jh.project.service.ISurProjectScheduleService;
@ -20,10 +21,12 @@ import java.util.concurrent.TimeUnit;
@RequestMapping("/bgscreen/schedule")
public class ProjectScheduleController extends BaseController {
@Autowired
private ISurProjectScheduleService isurProjectScheduleService;
@Autowired
private RedisCache redisCache;
@Autowired
private ISurProjectScheduleService isurProjectScheduleService;
@GetMapping("/projectConstructionProgress")
public AjaxResult getProjectConstructionProgress(Long projectId){
SurProjectSchedule surProjectSchedule= isurProjectScheduleService.getProjectConstructionProgress(projectId);
@ -31,7 +34,7 @@ public class ProjectScheduleController extends BaseController {
}
@GetMapping("/constructionProgressByDept")
public AjaxResult getConstructionProgressByDept(Long deptId){
public AjaxResult getConstructionProgressByDept(Long deptId,String proType){
SurProjectSchedule where=new SurProjectSchedule();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
@ -40,6 +43,9 @@ public class ProjectScheduleController extends BaseController {
}else{
where.setDeptId(deptId);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<SurProjectSchedule> list=isurProjectScheduleService.getConstructionProgressByDept(where);
return AjaxResult.success(list);
}
@ -49,8 +55,8 @@ public class ProjectScheduleController extends BaseController {
* @return
*/
@GetMapping("/selectByProjectType")
public AjaxResult selectByProjectType(Long type,Long deptId){
String key="bgscreen_schedule_selectByProjectType_"+type+"_"+deptId;
public AjaxResult selectByProjectType(Long type,Long deptId,String proType){
String key="bgscreen_schedule_selectByProjectType_"+type+"_"+deptId+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
@ -63,6 +69,9 @@ public class ProjectScheduleController extends BaseController {
where.setPrjIds(getProjectIds());
}
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<SurProjectSchedule> list=isurProjectScheduleService.selectByProjectType(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -30,7 +30,7 @@ public class ProjectSpecialController extends BaseController {
* @return
*/
@GetMapping("/getProjectSpecialView")
public TableDataInfo getProjectSpecialView(String deptId,String projectId){
public TableDataInfo getProjectSpecialView(String deptId,String projectId,String proType){
SurProjectWorkSpecial surProjectWorkSpecial = new SurProjectWorkSpecial();
if(deptId!=null && !"0".equals(deptId)){
surProjectWorkSpecial.setNowDept(deptId);
@ -42,6 +42,9 @@ public class ProjectSpecialController extends BaseController {
if(projectId!=null && !"0".equals(projectId)){
surProjectWorkSpecial.setProjectId(Convert.toLong(projectId));
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectWorkSpecial.setProType(proType);
}
return getDataTable(surProjectWorkSpecialService.selectBgscreenWorkSpecialList(surProjectWorkSpecial));
}
@ -51,7 +54,7 @@ public class ProjectSpecialController extends BaseController {
* @return
*/
@GetMapping("/getProjectSpecialList")
public TableDataInfo getProjectSpecialList(String projectId, String activeName, String specialType){
public TableDataInfo getProjectSpecialList(String projectId, String activeName, String specialType,String proType){
SurProjectWorkSpecial surProjectWorkSpecial = new SurProjectWorkSpecial();
if(projectId!=null && !"0".equals(projectId)){
surProjectWorkSpecial.setProjectId(Convert.toLong(projectId));
@ -62,6 +65,9 @@ public class ProjectSpecialController extends BaseController {
if(specialType!=null && !"0".equals(specialType)){
surProjectWorkSpecial.setSpecialType(specialType);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectWorkSpecial.setProType(proType);
}
return getDataTable(surProjectWorkSpecialService.selectSurProjectWorkSpecialList(surProjectWorkSpecial));
}
@ -69,7 +75,7 @@ public class ProjectSpecialController extends BaseController {
*
*/
@GetMapping("/findWorkSpecialCount")
public AjaxResult findWorkSpecialCount(String projectId, String specialType)
public AjaxResult findWorkSpecialCount(String projectId, String specialType,String proType)
{
SurProjectWorkSpecial surProjectWorkSpecial = new SurProjectWorkSpecial();
if(projectId!=null && !"0".equals(projectId)){
@ -78,6 +84,9 @@ public class ProjectSpecialController extends BaseController {
if(specialType!=null && !"0".equals(specialType)){
surProjectWorkSpecial.setSpecialType(specialType);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectWorkSpecial.setProType(proType);
}
return success(surProjectWorkSpecialService.findWorkSpecialCount(surProjectWorkSpecial));
}
}

View File

@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.yanzhu.jh.project.domain.SurProjectStandard;
import com.yanzhu.jh.project.service.ISurProjectStandardService;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,11 +26,12 @@ public class ProjectStandardController extends BaseController {
private RedisCache redisCache;
@GetMapping("/getList")
public AjaxResult getList(Long deptId,Long projectId){
public AjaxResult getList(Long deptId,Long projectId,String proType){
SurProjectStandard where=new SurProjectStandard();
where.setProjectId(projectId);
where.setIsDel(0l);
String key="bgscreen_standard_getList_"+projectId;
String key="bgscreen_standard_getList_"+projectId+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
@ -56,17 +58,18 @@ public class ProjectStandardController extends BaseController {
@PostMapping("/groupByType")
public AjaxResult groupByType(@RequestBody SurProjectStandard where){
String key="bgscreen_standard_groupByType_"+where.getProjectId()+"_"+where.getDeptId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_standard_groupByType_"+where.getProjectId()+"_"+where.getDeptId()+"_"+where.getProType()+"_"+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SysDictData> list=standardService.groupByType(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.SysRoleEnum;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.yanzhu.jh.video.domain.DevAiProjectData;
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
@ -45,7 +46,7 @@ public class VideoAiBoxController extends BaseController {
* AI
*/
@GetMapping("/listView")
public AjaxResult listView(String deptId, String projectId)
public AjaxResult listView(String deptId, String projectId,String proType)
{
DevAiProjectData devAiProjectData = new DevAiProjectData();
devAiProjectData.setNowRole(Convert.toStr(getUserFirstRole()));
@ -55,7 +56,7 @@ public class VideoAiBoxController extends BaseController {
devAiProjectData.setNowDept(Convert.toStr(getDeptId()));
}
devAiProjectData.setNowUser(Convert.toStr(getUserId()));
String key="bgscreen_aiBoxVideo_listView_"+deptId+"_"+projectId+"_"+devAiProjectData.getNowRole()+"_"+devAiProjectData.getNowDept()+"_"+devAiProjectData.getNowUser();
String key="bgscreen_aiBoxVideo_listView_"+deptId+"_"+projectId+"_"+devAiProjectData.getNowRole()+"_"+devAiProjectData.getNowDept()+"_"+devAiProjectData.getNowUser()+"_"+deptId+"_"+projectId+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
@ -66,6 +67,9 @@ public class VideoAiBoxController extends BaseController {
if(projectId!=null && !"0".equals(projectId)){
devAiProjectData.setProjectId(Convert.toLong(projectId));
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
devAiProjectData.setProType(proType);
}
//默认查询当天数据
/*Map<String, Object> params = new HashMap<>();
params.put("date",new Date());
@ -80,7 +84,7 @@ public class VideoAiBoxController extends BaseController {
*
*/
@GetMapping(value = "/getVideoPassage")
public AjaxResult getVideoPassage(String deptId, String projectId, String passageType, String importance)
public AjaxResult getVideoPassage(String deptId, String projectId, String passageType, String importance,String proType)
{
Map<String, Object> map = new HashMap<>();
String nowRole = Convert.toStr(getUserFirstRole());
@ -91,7 +95,7 @@ public class VideoAiBoxController extends BaseController {
map.put("nowDept",Convert.toStr(getDeptId()));
}
map.put("nowUser",Convert.toStr(getUserId()));
String key="bgscreen_aiBoxVideo_getVideoPassage_"+deptId+"_"+projectId+"_"+passageType+"_"+importance+"_"+map.get("nowRole")+"_"+map.get("nowDept")+"_"+map.get("nowUser");
String key="bgscreen_aiBoxVideo_getVideoPassage_"+deptId+"_"+projectId+"_"+passageType+"_"+importance+"_"+map.get("nowRole")+"_"+map.get("nowDept")+"_"+map.get("nowUser")+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
@ -108,6 +112,9 @@ public class VideoAiBoxController extends BaseController {
if(importance!=null && !"".equals(importance)){
map.put("importance",importance);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
map.put("proType",proType);
}
clearPage();
List<SurProjectVideoConfig> list = surProjectVideoConfigService.selectSurProjectVideoConfigByParams(map);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
@ -118,7 +125,7 @@ public class VideoAiBoxController extends BaseController {
*
*/
@GetMapping("/groupCountByAlarmType")
public AjaxResult groupCountByAlarmType(String deptId,String projectId,String now)
public AjaxResult groupCountByAlarmType(String deptId,String projectId,String now,String proType)
{
DevAiProjectData devAiProjectData = new DevAiProjectData();
devAiProjectData.setNowRole(Convert.toStr(getUserFirstRole()));
@ -128,7 +135,7 @@ public class VideoAiBoxController extends BaseController {
devAiProjectData.setNowDept(Convert.toStr(getDeptId()));
}
devAiProjectData.setNowUser(Convert.toStr(getUserId()));
String key="bgscreen_aiBoxVideo_groupCountByAlarmType_"+deptId+"_"+projectId+"_"+now+"_"+devAiProjectData.getNowRole()+"_"+devAiProjectData.getNowDept()+"_"+devAiProjectData.getNowUser();
String key="bgscreen_aiBoxVideo_groupCountByAlarmType_"+deptId+"_"+projectId+"_"+now+"_"+devAiProjectData.getNowRole()+"_"+devAiProjectData.getNowDept()+"_"+devAiProjectData.getNowUser()+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
@ -139,6 +146,9 @@ public class VideoAiBoxController extends BaseController {
if(projectId!=null && !"0".equals(projectId)){
devAiProjectData.setProjectId(Convert.toLong(projectId));
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
devAiProjectData.setProType(proType);
}
//查询当天数据
if(now!=null && "Y".equals(now)){
Map<String, Object> params = new HashMap<>();
@ -154,7 +164,7 @@ public class VideoAiBoxController extends BaseController {
*
*/
@GetMapping("/selectGroupCountVideoConfig")
public AjaxResult selectGroupCountVideoConfig(String deptId,String projectId)
public AjaxResult selectGroupCountVideoConfig(String deptId,String projectId,String proType)
{
Map<String, Object> map = new HashMap<>();
String nowRole = Convert.toStr(getUserFirstRole());
@ -165,7 +175,7 @@ public class VideoAiBoxController extends BaseController {
map.put("nowDept",Convert.toStr(getDeptId()));
}
map.put("nowUser",Convert.toStr(getUserId()));
String key="bgscreen_aiBoxVideo_selectGroupCountVideoConfig_"+deptId+"_"+projectId+"_"+map.get("nowRole")+"_"+map.get("nowDept")+"_"+map.get("nowUser");
String key="bgscreen_aiBoxVideo_selectGroupCountVideoConfig_"+deptId+"_"+projectId+"_"+map.get("nowRole")+"_"+map.get("nowDept")+"_"+map.get("nowUser")+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
@ -176,6 +186,9 @@ public class VideoAiBoxController extends BaseController {
if(projectId!=null && !"0".equals(projectId)){
map.put("projectId",projectId);
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
map.put("proType",proType);
}
List<Map<String, Object>> list = surProjectVideoConfigService.selectGroupCountVideoConfig(map);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);

View File

@ -1,20 +1,23 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.SysRoleEnum;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
import com.yanzhu.jh.video.service.ISurProjectVideoConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Conller
@ -23,6 +26,9 @@ import java.util.Map;
@RequestMapping("/bgscreen/video")
public class VideoController extends BaseController {
@Autowired
private RedisCache redisCache;
@Autowired
private ISysDeptService sysDeptService;
@ -33,15 +39,9 @@ public class VideoController extends BaseController {
*
*/
@GetMapping("/listView")
public AjaxResult listView(String deptId,String projectId)
public AjaxResult listView(String deptId,String projectId,String proType)
{
SurProjectVideoConfig surProjectVideoConfig = new SurProjectVideoConfig();
if(deptId!=null && !"0".equals(deptId)){
surProjectVideoConfig.setProjectDeptId(deptId);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectVideoConfig.setProjectId(Convert.toLong(projectId));
}
surProjectVideoConfig.setNowRole(Convert.toStr(getUserFirstRole()));
if(SysRoleEnum.ZGS.getCode().equals(surProjectVideoConfig.getNowRole())){
surProjectVideoConfig.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
@ -49,7 +49,23 @@ public class VideoController extends BaseController {
surProjectVideoConfig.setNowDept(Convert.toStr(getDeptId()));
}
surProjectVideoConfig.setNowUser(Convert.toStr(getUserId()));
String key="bgscreen_video_listView_"+surProjectVideoConfig.getNowRole()+"_"+surProjectVideoConfig.getNowDept()+"_"+surProjectVideoConfig.getNowUser()+"_"+deptId+"_"+projectId+"_"+proType;
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return success(obj);
}
if(deptId!=null && !"0".equals(deptId)){
surProjectVideoConfig.setProjectDeptId(deptId);
}
if(projectId!=null && !"0".equals(projectId)){
surProjectVideoConfig.setProjectId(Convert.toLong(projectId));
}
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
surProjectVideoConfig.setProType(proType);
}
List<SurProjectVideoConfig> list = surProjectVideoConfigService.selectSurProjectVideoConfigList(surProjectVideoConfig);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return success(list);
}

View File

@ -111,7 +111,6 @@ public class SurProjectCheckingServiceImpl extends WxMessageImpl implements ISur
for(Map<String, Object> map:list){
sum += Convert.toInt(map.get("total"));
//"1"为验收合格
if(map.get("check_result")!=null && "1".equals(map.get("check_result").toString())){
okSum+=Convert.toInt(map.get("total"));
}

View File

@ -56,13 +56,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, project_id, year, quarterly, date, plan_target, cur_progress, lagging_matters, problem, plan_date, finish_date, status, remark, is_del, create_by, create_time, update_by, update_time from smz_project_quarterly_assess
</sql>
<select id="currentListByDept" parameterType="SmzProjectQuarterlyAssess" resultMap="SmzProjectQuarterlyAssessResultToProject">
SELECT a.*,p.projectName,d.dept_name,p.paretProjectName,p.projectSchedule
FROM smz_project_quarterly_assess a,sur_project p,sys_dept d
WHERE a.project_id IN
(SELECT id FROM sur_project
<where>
<if test="deptId>0"> deptid=#{deptId} </if>
<if test="deptId>0"> deptId=#{deptId} </if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -83,13 +83,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM sur_project p LEFT JOIN smz_project_quarterly_assess a ON a.project_id=p.id
WHERE p.projecttype=#{id} AND a.year=#{year} AND a.quarterly=#{quarterly} AND p.isdel=0
<if test="deptId>0">and p.deptId=#{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and p.id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
order by p.projectSort
</select>
<select id="selectSmzProjectQuarterlyAssessList" parameterType="SmzProjectQuarterlyAssess" resultMap="SmzProjectQuarterlyAssessResult">

View File

@ -351,16 +351,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
group by g.companyTypeId
</select>
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
left join sur_project sp on c.project_id = sp.id
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.state=0
and g.companyTypeId in (0,1,2,3,4,5,6,8)
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}
</if>
<if test="subDeptId!=null and subDeptId>0">
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{subDeptId})
and sp.deptId=#{subDeptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and c.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -402,51 +405,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="todayAttendance" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select * from sur_project_attendance_data_${year}
select ady.* from sur_project_attendance_data_${year} ady
left join sur_project sp on sp.id = ady.projectId
<where>
<if test="projectId!=null and projectId>0">
and ady.projectId=#{projectId}
</if>
<if test="id==1">
and companyTypeId in (1,6)
and ady.companyTypeId in (1,6)
</if>
<if test="id==2">
and companyTypeId in (0,2,3,4,5)
and ady.companyTypeId in (0,2,3,4,5)
</if>
<if test="id==8">
and companyTypeId =8
</if>
<if test="projectId!=null and projectId>0">
and projectId=#{projectId}
and ady.companyTypeId =8
</if>
<if test="deptId!=null and deptId>0">
and projectId in (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ady.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) =date(#{attendanceTime})</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
</where>
</select>
<select id="groupTodayCompanyTypeId" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select companyTypeId,count(1) id from sur_project_attendance_data_${year}
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
left join sur_project sp on sp.id = ady.projectId
<where>
<if test="projectId!=null and projectId>0">
and projectId=#{projectId}
and ady.projectId=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and projectId in (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ady.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) =date(#{attendanceTime})</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
</where>
group by companyTypeId
group by ady.companyTypeId
</select>
</mapper>

View File

@ -511,7 +511,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="queryWorkerOnDuty" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
@ -519,9 +518,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g
left join sur_project sp on b.project_id = sp.id
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId
<if test="id==101">
and g.companyTypeId in (1,6)
</if>
@ -535,8 +534,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and b.project_id=#{projectId}
</if>
<if test="deptId!=null and deptId>0">
and b.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and b.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -545,14 +545,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</select>
<select id="groupByWorkerOnDutyByDept" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
and g.companyTypeId in (1,6,0,2,3,4,5,8)
<if test="deptId!=null and deptId>0">
and b.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
and p.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and b.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -562,4 +564,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by p.projectName,c.dept_name,g.companyTypeId,p.id
order by p.id
</select>
</mapper>

View File

@ -147,74 +147,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectScheduledAlerts" parameterType="SurProjectBuildNodeData" resultMap="SurProjectBuildNodeDataResultNode">
SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current
WHERE LENGTH(node_lvl)=2
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
<if test="id!=null and id!=0">and project_id in (SELECT id FROM sur_project WHERE deptid=#{id})</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY project_id) order by projectSort
SELECT MAX(vbn.id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>
<if test="id!=null and id!=0">and sp.deptId=#{id}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and vbn.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY vbn.project_id) order by projectSort
</select>
<select id="selectCurrent" parameterType="SurProjectBuildNodeData" resultMap="SurProjectBuildNodeDataResultNode">
SELECT a.* FROM vw_sur_project_build_node_data_current a,(
SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
WHERE LENGTH(node_lvl)=2
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
GROUP BY project_id)) b WHERE a.project_id=b.project_id AND LEFT(a.node_lvl,2)=b.node_lvl
</select>
<select id="countCompletionRate" parameterType="SurProjectBuildNodeData" resultMap="SurProjectBuildNodeDataResultNode">
SELECT IF(b.cnt,b.cnt,0) id ,IF(c.cnt,c.cnt,0) node_id,a.project_id,a.projectName,a.node_text,a.node_lvl FROM (
SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current
WHERE LENGTH(node_lvl)=2
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
<if test="id!=null and id!=0">and project_id in (SELECT id FROM sur_project WHERE deptid=#{id})</if>
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>
<if test="id!=null and id!=0">and sp.deptId=#{id}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and vbn.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY project_id)) a LEFT JOIN (
GROUP BY vbn.project_id)) a LEFT JOIN (
SELECT a.project_id,COUNT(1) cnt FROM vw_sur_project_build_node_data_current a,
(SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current
WHERE LENGTH(node_lvl)=2
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
<if test="id!=null and id!=0">and project_id in (SELECT id FROM sur_project WHERE deptid=#{id})</if>
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>
<if test="id!=null and id!=0">and sp.deptId=#{id}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and vbn.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY project_id)) b WHERE a.project_id=b.project_id AND LEFT(a.node_lvl,2)=b.node_lvl AND LENGTH(a.node_lvl)>2
GROUP BY vbn.project_id)) b WHERE a.project_id=b.project_id AND LEFT(a.node_lvl,2)=b.node_lvl AND LENGTH(a.node_lvl)>2
GROUP BY a.project_id) b ON a.project_id =b.project_id
LEFT JOIN(
SELECT a.project_id,COUNT(1) cnt FROM vw_sur_project_build_node_data_current a,
(SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current
WHERE LENGTH(node_lvl)=2
<if test="projectId !=null and projectId !=0">and project_id=#{projectId}</if>
<if test="id!=null and id!=0">and project_id in (SELECT id FROM sur_project WHERE deptid=#{id})</if>
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>
<if test="id!=null and id!=0">and sp.deptId=#{id}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and vbn.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY project_id)) b WHERE a.project_id=b.project_id AND LEFT(a.node_lvl,2)=b.node_lvl AND LENGTH(a.node_lvl)>2 AND a.end_date IS NOT NULL
GROUP BY vbn.project_id)) b WHERE a.project_id=b.project_id AND LEFT(a.node_lvl,2)=b.node_lvl AND LENGTH(a.node_lvl)>2 AND a.end_date IS NOT NULL
GROUP BY a.project_id
) c ON a.project_id=c.project_id
</select>
@ -222,7 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryByProjectType" parameterType="Long" resultMap="SurProjectBuildNodeDataResultNode">
<include refid="selectSurProjectBuildNodeDataVoByNode"/>
WHERE is_del=0 AND project_id IN (
SELECT id FROM sur_project WHERE isdel=0 AND projecttype=#{type})
SELECT id FROM sur_project WHERE isdel=0 AND projectType=#{type})
</select>

View File

@ -232,63 +232,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="groupByCheckType" parameterType="SurProjectCheckDetection" resultMap="SurProjectCheckDetectionResult">
SELECT 1 id,COUNT(1) project_id,'送检数' check_type
FROM sur_project_check_detection WHERE is_del='0'
FROM sur_project_check_detection spcd
left join sur_project sp on sp.id = spcd.project_id
WHERE spcd.is_del='0'
<if test='checkType !=null and checkType !="0"'>
and check_type= #{checkType}
and spcd.check_type= #{checkType}
</if>
<if test="deptId !=null and deptId > 0 ">
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and spcd.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId !=null and projectId > 0 ">
and project_id=#{projectId}
and spcd.project_id=#{projectId}
</if>
UNION
SELECT 2 id,COUNT(1) project_id,'待检数' check_type
FROM sur_project_check_detection WHERE check_state='1'
and is_del='0'
FROM sur_project_check_detection spcd
left join sur_project sp on sp.id = spcd.project_id
WHERE spcd.check_state='1'
and spcd.is_del='0'
<if test='checkType !=null and checkType !="0"'>
and check_type= #{checkType}
and spcd.check_type= #{checkType}
</if>
<if test="deptId !=null and deptId > 0 ">
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and spcd.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId !=null and projectId > 0 ">
and project_id=#{projectId}
and spcd.project_id=#{projectId}
</if>
UNION
SELECT 3 id,COUNT(1) project_id,'合格数' check_type
FROM sur_project_check_detection WHERE detection_result='1'
and is_del='0'
FROM sur_project_check_detection spcd
left join sur_project sp on sp.id = spcd.project_id
WHERE spcd.detection_result='1'
and spcd.is_del='0'
<if test='checkType !=null and checkType !="0"'>
and check_type= #{checkType}
and spcd.check_type= #{checkType}
</if>
<if test="deptId !=null and deptId > 0 ">
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and spcd.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId !=null and projectId > 0 ">
and project_id=#{projectId}
and spcd.project_id=#{projectId}
</if>
</select>
@ -296,10 +305,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getList" parameterType="SurProjectCheckDetection" resultMap="SurProjectCheckDetectionResult">
<include refid="selectSurProjectCheckDetectionVo"/>
WHERE spcd.is_del=0
<if test="checkType!=null and checkType>0">AND spcd.check_type= #{checkType}</if>
<if test="checkType!=null and checkType>0">and spcd.check_type= #{checkType}</if>
<if test="deptId !=null and deptId > 0 ">
and spcd.project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spcd.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">

View File

@ -106,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
and spc.is_del=0
<if test="projectId != null "> and spc.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spc.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -154,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
and spc.is_del=0
<if test="projectId != null "> and spc.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spc.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -196,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and spc.is_del=0
<if test="projectId != null "> and spc.project_id = #{projectId}</if>
<if test="projectDeptId != null "> and sp.deptId = #{projectDeptId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spc.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -352,6 +355,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectProjectCheckingGroupFoChart" parameterType="SurProjectChecking" resultMap="SurProjectCheckingResult">
select a.dict_value data_type_lvl2,dict_label main_image,a.css_class check_type,b.cnt id from
(
@ -365,6 +369,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.is_del=0
<if test="projectId != null "> and a.project_id = #{projectId}</if>
<if test="projectDeptId != null "> and b.deptId = #{projectDeptId}</if>
<if test="proType != null and proType != ''"> and b.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -375,12 +380,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) b
on a.dict_value=b.data_type_lvl2
</select>
<select id="groupCheckingByProjectId" parameterType="SurProjectChecking" resultMap="SurProjectCheckingResult">
SELECT a.project_id,COUNT(1) id,b.projectName
FROM sur_project_checking a,sur_project b WHERE a.project_id=b.id AND a.data_type_lvl2=#{dataTypeLvl2}
and a.is_del=0
<if test="projectId != null "> and a.project_id = #{projectId}</if>
<if test="projectDeptId != null "> and b.deptId = #{projectDeptId}</if>
<if test="proType != null and proType != ''"> and b.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -389,4 +396,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
GROUP BY a.project_id
</select>
</mapper>

View File

@ -112,33 +112,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="sumByDeptId" parameterType="SurProjectCostOutput" resultMap="SurProjectCostOutputResult">
SELECT 10 cost_type , SUM(money) money FROM sur_project_cost_output
WHERE (cost_type=2 AND YEAR &lt;=#{year} )
<if test="id!=null and id>0">
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{id})
</if>
SELECT 10 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
left join sur_project sp on sp.id = spco.project_id
WHERE (spco.cost_type=2 AND spco.YEAR &lt;=#{year} )
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and project_id=#{projectId}
and spco.project_id=#{projectId}
</if>
UNION
SELECT 2 cost_type , SUM(money) money FROM sur_project_cost_output
WHERE (cost_type=9 AND YEAR=#{year} AND MONTH &lt;= #{month} )
<if test="id!=null and id>0">
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{id})
</if>
SELECT 2 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
left join sur_project sp on sp.id = spco.project_id
WHERE (spco.cost_type=9 AND spco.YEAR=#{year} AND spco.MONTH &lt;= #{month} )
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and project_id=#{projectId}
and spco.project_id=#{projectId}
</if>
UNION
SELECT 9 cost_type , SUM(money) money FROM sur_project_cost_output
WHERE (cost_type=9 AND YEAR=#{year} AND MONTH= #{month} )
<if test="id!=null and id>0">
and project_id IN (SELECT id FROM sur_project WHERE deptid=#{id})
</if>
SELECT 9 cost_type , SUM(spco.money) money FROM sur_project_cost_output spco
left join sur_project sp on sp.id = spco.project_id
WHERE (spco.cost_type=9 AND spco.YEAR=#{year} AND spco.MONTH= #{month} )
<if test="id!=null and id>0"> and sp.deptId = #{id}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId!=null and projectId>0">
and project_id=#{projectId}
and spco.project_id=#{projectId}
</if>

View File

@ -180,6 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND yqx.insurance_type = 1 and yqx.is_del=0
where sp.isDel=0
<if test="nowDept != null and nowDept != ''"> and sp.deptId = #{nowDept}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectId != null "> and sp.id = #{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and sp.id in

View File

@ -286,6 +286,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
cnt FROM sur_project a, sys_dict_data b,sur_project_cost_output c WHERE b.dict_type='project_category' AND a.id=c.project_id AND c.cost_type=2 and c.year=#{isDel}
AND a.projectType=b.dict_value and a.isDel=0
<if test="deptId>0">AND deptid=#{deptId}</if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if>
GROUP BY dict_value,dict_label
) a RIGHT JOIN sys_dict_data b ON a.dict_value=b.dict_value WHERE b.dict_type='project_category' ORDER BY cnt DESC
</if>
@ -298,10 +299,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
cnt FROM sur_project a, sys_dict_data b,vw_sur_project_cost_output c WHERE b.dict_type='project_category' AND a.id=c.project_id
AND a.projectType=b.dict_value and a.isDel=0
<if test="deptId>0">AND deptid=#{deptId}</if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if>
GROUP BY dict_value,dict_label
) a RIGHT JOIN sys_dict_data b ON a.dict_value=b.dict_value WHERE b.dict_type='project_category' ORDER BY cnt DESC
</if>
</select>
<select id="groupByLevel" parameterType="SurProject" resultMap="SurProjectResult">
<if test="id==2">
SELECT b.dict_value id,b.dict_label projectName,cnt deptId FROM (
@ -309,6 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM sur_project a,sys_dict_data b ,sur_project_cost_output c WHERE b.dict_type='project_level' AND a.id=c.project_id AND c.cost_type=2 and c.year=#{isDel}
AND a.projiectLevel=b.dict_value and a.isDel=0
<if test="deptId>0">AND deptid=#{deptId}</if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if>
GROUP BY dict_value,dict_label
) a RIGHT JOIN sys_dict_data b ON a.dict_value=b.dict_value WHERE b.dict_type='project_level' ORDER BY cnt DESC
</if>
@ -321,6 +325,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
cnt FROM sur_project a, sys_dict_data b ,vw_sur_project_cost_output c WHERE b.dict_type='project_level' AND a.id=c.project_id
AND a.projiectLevel=b.dict_value and a.isDel=0
<if test="deptId>0">AND deptid=#{deptId}</if>
<if test="proType != null and proType != ''"> and projectType = #{proType}</if>
GROUP BY dict_value,dict_label
) a RIGHT JOIN sys_dict_data b ON a.dict_value=b.dict_value WHERE b.dict_type='project_level' ORDER BY cnt DESC
@ -331,6 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSurProjectVo"/>
where progressVisible = 0
<if test="deptId!=0">and deptid=#{deptId}</if>
<if test="projectType != null and projectType != ''"> and projectType = #{projectType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -345,7 +351,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(SELECT * FROM sys_dict_data WHERE dict_type='project_category') d
LEFT JOIN
(SELECT projectType,IF(projectSchedule IS NULL,1,projectSchedule) projectSchedule FROM sur_project WHERE isDel=0
<if test="deptId!=null and deptId>0">and deptid=#{deptId}</if>
<if test="deptId!=null and deptId>0">and deptid=#{deptId}</if>
<if test="projectType != null and projectType != ''"> and projectType = #{projectType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">

View File

@ -178,6 +178,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectTop20" parameterType="SurProjectMaterialSeal" resultMap="SurProjectMaterialSealResult">
select spme.id, spme.project_id, spme.dept_id, spme.main_image, spme.image_urls, spme.material_name, spme.use_position, spme.contract_brand, spme.use_brand, spme.seal_date, spme.sign_files, spme.alteration_files, spme.is_del, spme.create_by, spme.create_time, spme.update_by, spme.update_time, spme.remark, spme.projectName,
spme.dept_name
@ -188,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where spme.is_del=0
<if test="deptId != null and deptId > 0"> and sp.deptId = #{deptId} </if>
<if test="projectId != null and projectId > 0">and sp.id = #{projectId}</if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and sp.id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -198,21 +200,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by spme.create_time desc
LIMIT 0,20
</select>
<select id="groupTop12Month" parameterType="SurProjectMaterialSeal" resultMap="SurProjectMaterialSealResult">
select year(seal_date) project_id,month(seal_date) dept_id,count(1) id
from sur_project_material_seal where is_del=0
<if test="deptId != null and deptId > 0"> and project_id in ( SELECT id FROM sur_project WHERE deptid= #{deptId}) </if>
<select id="groupTop12Month" parameterType="SurProjectMaterialSeal" resultMap="SurProjectMaterialSealResult">
select year(spms.seal_date) project_id, month(spms.seal_date) dept_id,count(1) id
from sur_project_material_seal spms
left join sur_project sp on spms.project_id = sp.id
where spms.is_del=0
<if test="deptId != null and deptId > 0"> and sp.deptId= #{deptId} </if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="projectId != null and projectId > 0">and spms.project_id = #{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and spms.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId != null and projectId > 0">and project_id = #{projectId}</if>
and seal_date>=DATE_SUB(CURDATE(),interval 12 month)
group by year(seal_date),month(seal_date)
order by year(seal_date) desc,month(seal_date) desc
and spms.seal_date &gt;= DATE_SUB(CURDATE(),interval 12 month)
group by year(spms.seal_date),month(spms.seal_date)
order by year(spms.seal_date) desc,month(spms.seal_date) desc
</select>
<select id="selectTop12Month" parameterType="SurProjectMaterialSeal" resultMap="SurProjectMaterialSealResult">
select *
@ -223,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where spme.is_del=0
and spme.seal_date>=DATE_SUB(CURDATE(),interval 12 month)
<if test="deptId != null and deptId > 0"> and sp.deptId = #{deptId} </if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="projectId != null and projectId > 0">and sp.id = #{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and sp.id in

View File

@ -188,25 +188,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT * FROM sys_dict_data WHERE dict_type='project_measure_info_type') a
LEFT JOIN
(
SELECT measure_info,COUNT(1) cnt
FROM sur_project_measure
WHERE IF(is_del IS NULL,0,is_del)=0
SELECT spm.measure_info,COUNT(1) cnt
FROM sur_project_measure spm
left join sur_project sp on sp.id = spm.project_id
WHERE spm.is_del=0
<if test='measureType !=null and measureType !="0"'>
and measure_type = #{measureType}
and spm.measure_type = #{measureType}
</if>
<if test="deptId !=null and deptId >0">
AND project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
AND sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
and spm.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId !=null and projectId >0">
AND project_id=#{projectId}
AND spm.project_id=#{projectId}
</if>
GROUP BY measure_info
GROUP BY spm.measure_info
) b
ON a.dict_value=b.measure_info
</select>
@ -220,14 +222,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_dict_data sdd2 ON sdd2.dict_type = 'project_measure_info_type' AND sdd2.dict_value = spm.measure_info
LEFT JOIN sys_user u1 ON spm.create_by=u1.phonenumber
LEFT JOIN sys_user u2 ON spm.update_by=u2.phonenumber
WHERE IF(spm.is_del IS NULL,0,spm.is_del)=0
WHERE spm.is_del=0
<if test='measureType !=null and measureType !="0"'>
and spm.measure_type = #{measureType}
</if>
<if test="deptId !=null and deptId >0">
AND spm.project_id IN (SELECT id FROM sur_project WHERE deptid=#{deptId})
AND sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spm.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">

View File

@ -175,44 +175,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectByProjectType" parameterType="SurProjectScheduleWhere" resultMap="SurProjectScheduleResult">
select * from vw_sur_project_schedule
WHERE id IN (
SELECT MAX(id) FROM sur_project_schedule
WHERE project_id IN (
SELECT id FROM sur_project WHERE
isdel=0 AND projecttype=#{prjType}
<if test="deptId>0">and deptId=#{deptId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) AND IF(is_del IS NULL ,0,is_del)=0
GROUP BY project_id
select * from vw_sur_project_schedule c
left join sur_project p on c.project_id = p.id
WHERE c.id IN (
SELECT MAX(spc.id) FROM sur_project_schedule spc
left join sur_project sp on spc.project_id = sp.id
where spc.is_del=0 and sp.projectType=#{prjType}
<if test="deptId>0">and sp.deptId=#{deptId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spc.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY spc.project_id
)
order by projectSort
order by p.projectSort
</select>
<select id="getConstructionProgressByDept" parameterType="SurProjectScheduleWhere" resultMap="SurProjectScheduleResult">
select s.*,p.projectName from (
select * from sur_project_schedule where id in (
select max(id)
from sur_project_schedule where
IF(is_del IS NULL ,0,is_del)=0
select max(spc.id)
from sur_project_schedule spc
left join sur_project sp on sp.id=spc.project_id
where spc.is_del=0
<if test="deptId!=null and deptId>0">
and project_id in (SELECT id FROM sur_project WHERE deptid= #{deptId})
and sp.deptId= #{deptId}
</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spc.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="prjIds !=null and prjIds.size()>0">
and id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<!--
and ( (existing_problem is not null and existing_problem not like '暂无%' and existing_problem not like '无%' and length(trim(existing_problem))>0 )
or (problem_progress IS NOT NULL AND problem_progress NOT LIKE '暂无%' AND problem_progress NOT LIKE '无%' AND LENGTH(TRIM(problem_progress))>0 ))
-->
group by project_id
group by spc.project_id
)
) s LEFT JOIN sur_project AS p ON s.project_id=p.id order by p.projectSort
</select>

View File

@ -26,14 +26,15 @@
select sps.id, sps.project_id, sps.dept_id, sd.dept_name, sps.image_file, sps.standard_desc, sps.ord, sps.standard_type, sdd.dict_label as standard_type_name, sdd.remark as standard_type_remark, sps.is_del, sps.create_by, sps.create_time, sps.update_by, sps.update_time from sur_project_standard sps
left join sys_dict_data sdd on sps.standard_type = sdd.dict_value and sdd.dict_type='prj_standard_type'
left join sys_dept sd on sd.dept_id = sps.dept_id
left join sur_project sp on sp.id = sps.project_id
</sql>
<select id="selectSurProjectStandardList" parameterType="SurProjectStandard" resultMap="SurProjectStandardResult">
<include refid="selectSurProjectStandardVo"/>
<where>
<if test="projectId != null "> and sps.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="deptId != null "> and sps.dept_id = #{deptId}</if>
<if test="imageFile != null and imageFile != ''"> and sps.image_file = #{imageFile}</if>
<if test="standardDesc != null and standardDesc != ''"> and sps.standard_desc = #{standardDesc}</if>
<if test="ord != null "> and sps.ord = #{ord}</if>
<if test="standardType != null and standardType != ''"> and sps.standard_type = #{standardType}</if>
@ -125,8 +126,9 @@
where a.is_del =0
<if test="projectId!=null and projectId>0"> and a.project_id=#{projectId}</if>
<if test="deptId!=null and deptId>0">
and a.project_id in (SELECT id FROM sur_project WHERE deptid= #{deptId})
and sp.deptId= #{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -151,8 +153,9 @@
where sps.is_del =0
<if test="projectId!=null and projectId>0"> and sps.project_id=#{projectId}</if>
<if test="deptId!=null and deptId>0">
and sps.project_id in (SELECT id FROM sur_project WHERE deptid= #{deptId})
and sp.deptId= #{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0" '> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and sps.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">

View File

@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and spwp.is_del=0
<if test="projectId != null "> and spwp.project_id = #{projectId}</if>
<if test="deptId != null "> and spwp.dept_id = #{deptId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="name != null and name != ''"> and spwp.name like concat('%', #{name}, '%')</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<if test="isCredential != null and isCredential != ''"> and spwp.is_credential = #{isCredential}</if>
@ -74,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and spwp.is_del=0
and date(spwp.credential_expiration_time) <![CDATA[ <= ]]> date(NOW())
<if test="projectId != null "> and spwp.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="deptId != null "> and spwp.dept_id = #{deptId}</if>
<if test="name != null and name != ''"> and spwp.name like concat('%', #{name}, '%')</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
@ -101,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and spwp.is_del=0
and date(spwp.credential_expiration_time) <![CDATA[ > ]]> date(NOW())
<if test="projectId != null "> and spwp.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="deptId != null "> and spwp.dept_id = #{deptId}</if>
<if test="name != null and name != ''"> and spwp.name like concat('%', #{name}, '%')</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
@ -161,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s1.is_del = 0
<if test="nowDept != null and nowDept != ''"> and sp1.deptId = #{nowDept}</if>
<if test="projectId != null "> and s1.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp1.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and s1.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -187,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s2.is_del = 0
<if test="nowDept != null and nowDept != ''"> and sp2.deptId = #{nowDept}</if>
<if test="projectId != null "> and s2.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp2.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and s2.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -201,6 +206,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
spws.is_del = 0
<if test="nowDept != null and nowDept != ''"> and sp.deptId = #{nowDept}</if>
<if test="projectId != null "> and spws.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spws.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">

View File

@ -442,6 +442,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endDate!=null">and DATE(sp.createtime) &lt;= DATE(#{endDate})</if>
<if test="projectId>0">and sp.projectId=#{projectId}</if>
<if test="deptId >0 ">AND p.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and sp.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -463,6 +464,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select projectId,prjName,count(1) proble from vw_smz_ssp_problemmodify_audit
where infoType=#{infoType} AND isDel=0
<if test="projectId>0">and projectId=#{projectId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and projectType = #{proType}</if>
<if test="deptId >0 ">AND deptid = #{deptId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
@ -536,22 +538,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="countByDate" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
SELECT infotype,COUNT(1) id FROM smz_ssp_problemmodify WHERE isDel=0
<if test="projectId > 0"> and projectId=#{projectId}</if>
<if test="projectId &lt;= 0">
AND projectId IN (
SELECT id FROM sur_project WHERE isdel=0
<if test="deptId >0 ">AND deptid = #{deptId}</if>
)
</if>
SELECT ssp.infotype,COUNT(1) id FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE ssp.isDel=0
<if test="projectId > 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId >0 ">and sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ssp.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and DATE(createTime)=Date(#{startDate})
GROUP BY infotype
and DATE(ssp.createTime)=Date(#{startDate})
GROUP BY ssp.infotype
</select>
<select id="countByDateNew" parameterType="SmzSspProblemmodifyWhere" resultType="map">
@ -561,7 +561,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sur_project sp on sp.id=p.projectId
WHERE p.isDel=0
<if test="projectId > 0"> and p.projectId=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test="deptId > 0 ">and sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and p.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -576,6 +577,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where 1=1
<if test="projectId &gt; 0"> and ad.project_id=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and ad.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -587,53 +589,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="countByDateRange" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
SELECT infotype,COUNT(1) id FROM smz_ssp_problemmodify WHERE isDel=0 and infoType=#{infoType}
<if test="projectId > 0"> and projectId=#{projectId}</if>
<if test="projectId &lt;= 0">
AND projectId IN (
SELECT id FROM sur_project WHERE isdel=0
<if test="deptId >0 ">AND deptid = #{id}</if>
)
</if>
SELECT ssp.infotype,COUNT(1) id FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE ssp.isDel=0 and ssp.infoType=#{infoType}
<if test="projectId > 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId > 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ssp.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<![CDATA[
and DATE(createTime)>=Date(#{startDate}) and Date(createTime)<=Date(#{endDate})
and DATE(ssp.createTime)>=Date(#{startDate}) and Date(ssp.createTime)<=Date(#{endDate})
]]>
GROUP BY infotype
GROUP BY ssp.infotype
</select>
<select id="countByDateRangeNew" parameterType="SmzSspProblemmodifyWhere" resultType="map">
select * from (
SELECT infotype,COUNT(1) as total FROM smz_ssp_problemmodify WHERE isDel=0
<if test="projectId > 0"> and projectId=#{projectId}</if>
<if test="projectId &lt;= 0">
AND projectId IN (
SELECT id FROM sur_project WHERE isdel=0
<if test="deptId >0 ">AND deptid = #{id}</if>
)
</if>
SELECT ssp.infotype,COUNT(1) as total FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE ssp.isDel=0
<if test="projectId > 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId > 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ssp.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<![CDATA[
and DATE(createTime)>=Date(#{startDate}) and Date(createTime)<=Date(#{endDate})
and DATE(ssp.createTime)>=Date(#{startDate}) and Date(ssp.createTime)<=Date(#{endDate})
]]>
GROUP BY infotype
GROUP BY ssp.infotype
)s1 where 1=1
UNION ALL
select '96' as infotype,count(1) as total from dev_ai_project_data ad
select '96' as infotype,count(1) as total from dev_ai_project_data ad
left join sur_project sp on ad.project_id=sp.id
where 1=1
<if test="projectId &gt; 0"> and ad.project_id=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and ad.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -645,25 +644,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="groupByInfotypeCheckState" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
SELECT infotype,checkState,COUNT(1) id FROM vw_smz_ssp_problemmodify_audit WHERE isDel=0
<if test="infoType !=null">and infoType=#{infoType}</if>
<if test="roleType !=null and roleType>0">and roleType=#{roleType}</if>
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if>
<if test="projectId &gt; 0"> and projectId=#{projectId}</if>
<if test="projectId &lt;= 0">
AND projectId IN (
SELECT id FROM sur_project WHERE isdel=0
<if test="deptId >0 ">AND deptid = #{deptId}</if>
)
</if>
SELECT ssp.infotype,ssp.checkState,COUNT(1) id FROM smz_ssp_problemmodify ssp
left join sur_project sp on sp.id=ssp.projectId
WHERE isDel=0
<if test="infoType !=null">and ssp.infoType=#{infoType}</if>
<if test="roleType !=null and roleType>0">and ssp.roleType=#{roleType}</if>
<if test="startDate!=null">and DATE(ssp.createtime) &gt;= DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(ssp.createtime) &lt;= DATE(#{endDate})</if>
<if test="projectId &gt; 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId > 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ssp.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY infotype,checkState
GROUP BY ssp.infotype,ssp.checkState
</select>
<select id="groupByInfotypeCheckStateNew" parameterType="SmzSspProblemmodifyWhere" resultType="map">
@ -673,6 +670,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE p.isDel=0
<if test="projectId &gt; 0"> and p.projectId=#{projectId}</if>
<if test="deptId >0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and p.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -686,6 +684,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where 1=1
<if test="projectId &gt; 0"> and ad.project_id=#{projectId}</if>
<if test="deptId &gt; 0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and ad.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -697,28 +696,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countTimeout" parameterType="SmzSspProblemmodifyWhere" resultType="Integer">
select count(1) cnt
FROM vw_smz_ssp_problemmodify_audit WHERE isDel=0
<if test="infoType !=null">and infoType=#{infoType}</if>
<if test="roleType !=null and roleType>0">and roleType=#{roleType}</if>
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if>
and ((updateTime is null and date(nickedTime) &lt; date(now()) ) or date(updateTime )>date(nickedTime))
<if test="projectId > 0"> and projectId=#{projectId}</if>
<if test="projectId &lt;= 0">
AND projectId IN (
SELECT id FROM sur_project WHERE isdel=0
<if test="deptId >0 ">AND deptid = #{deptId}</if>
)
</if>
FROM smz_ssp_problemmodify ssp
left join sur_project sp on p.projectId=sp.id
WHERE ssp.isDel=0
<if test="infoType !=null">and ssp.infoType=#{infoType}</if>
<if test="roleType !=null and roleType>0">and ssp.roleType=#{roleType}</if>
<if test="startDate!=null">and DATE(ssp.createtime) &gt;= DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(ssp.createtime) &lt;= DATE(#{endDate})</if>
and ((ssp.updateTime is null and date(ssp.nickedTime) &lt; date(now()) ) or date(ssp.updateTime ) &gt; date(ssp.nickedTime))
<if test="projectId > 0"> and ssp.projectId=#{projectId}</if>
<if test="deptId >0 ">AND sp.deptid = #{deptId}</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and projectId in
and ssp.projectId in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="selectSmzSspProblemmodifyListAndUnitName" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
select ssp.id, ssp.projectId, ssp.infoType, ssp.problemArea, ssp.workParts, ssp.changeInfo, ssp.lordSent, ssp.lordSentUser, ssp.copySend, ssp.copySendUser, ssp.checkState, ssp.nickedArea, ssp.nickedTime, ssp.projectType, ssp.processName, ssp.projectName, ssp.nickedInfo, ssp.checkUser, ssp.checkUserPhone, ssp.isDel, ssp.createUser, ssp.createTime, ssp.updateUser, ssp.updateTime, ssp.marks_picture, ssp.marks_video, ssp.smark_url, ssp.danger_type,
ssp.recheckSend, ssp.recheckSendUser, ssp.roleType, ssp.createBy, ssp.problemType,
@ -728,6 +724,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
vw_smz_ssp_problemmodify_audit c,sys_dict_data a,sys_dict_data b WHERE c.danger_Type=a.dict_value AND a.dict_type='ssp_aqyhlx'
AND c.checkState=b.dict_value AND b.dict_type='smz_ssp_checkstate'
) ssp
left join sur_project sp on ssp.projectId=sp.id
left join (
SELECT p.dept_Name,p.dept_id,u.phonenumber
FROM sys_user u,sur_project_userinfo p WHERE u.user_id=p.user_id AND p.dept_type=2
@ -743,6 +740,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="infoType != null "> and ssp.infoType = #{infoType}</if>
<if test="roleType != null and roleType >0 "> and ssp.roleType = #{roleType}</if>
<if test="problemArea != null and problemArea != ''"> and ssp.problemArea like concat('%', #{problemArea}, '%')</if>

View File

@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
and dapd.is_del='0'
<if test="projectId != null "> and dapd.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<if test="deptId != null "> and dapd.dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
@ -87,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
and dapd.is_del='0'
<if test="projectId != null "> and dapd.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
<if test="deptId != null "> and dapd.dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>

View File

@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null "> and spvc.project_id = #{projectId}</if>
<if test="projectName != null "> and sp.projectName like concat('%', #{projectName}, '%')</if>
<if test="deptId != null "> and spvc.dept_id = #{deptId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="deptName != null "> and sd.dept_name like concat('%', #{deptName}, '%')</if>
<if test="videoName != null "> and spvc.video_name like concat('%', #{videoName}, '%')</if>
<if test="videoOnlyType != null and videoOnlyType != ''"> and spvc.video_only_type = #{videoOnlyType}</if>
@ -103,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join dev_ai_project_config_passage dacp on dacp.video_passage_id = b.id
where dacp.is_del=0 and dacp.channel_id is NOT NULL and dacp.channel_id!=''
<if test="projectId != null "> and a.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and p.projectType = #{proType}</if>
<if test="deptId != null "> and p.deptId = #{deptId}</if>
<if test='importance == "Y" '> and dacp.is_importance = #{importance}</if>
<if test="passageType != null "> and FIND_IN_SET(#{passageType},dacp.passage_type) > 0</if>
@ -126,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join dev_ai_project_config_passage dacp on dacp.video_passage_id = b.id
where dacp.is_del=0 and dacp.channel_id is NOT NULL and dacp.channel_id!=''
<if test="projectId != null "> and a.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and p.projectType = #{proType}</if>
<if test="deptId != null "> and p.deptId = #{deptId}</if>
<!-- 查询条件-项目部门 -->
<if test="projectDeptId != null "> and p.deptId = #{projectDeptId}</if>

View File

@ -111,8 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
and wt.is_del=0
<if test="nowDept != null and nowDept != ''"> and sp.deptId = #{nowDept}</if>
<if test="trainType != null and trainType != ''"> and wt.train_type = #{trainType}</if>
<if test="trainType != null and trainType != ''"> and wt.train_type = #{trainType}</if>
<if test="projectId != null"> and wt.project_id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and wt.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -258,6 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
( #{item.trainId}, #{item.deptId}, #{item.isMain})
</foreach>
</insert>
<select id="getGroupByDataType" parameterType="WorkTrain" resultMap="WorkTrainResult">
SELECT a.dict_value data_type,dict_label train_title,css_class train_type,b.cnt id
FROM (
@ -269,7 +271,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM work_train wt left join sur_project sp on sp.id = wt.project_id
<where>
<if test="nowDept != null and nowDept != ''"> and sp.deptId = #{nowDept}</if>
<if test="projectId != null"> and wt.project_id = #{projectId}</if>
<if test="projectId != null"> and sp.id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and wt.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
@ -280,6 +283,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY data_type
) b ON a.dict_value=b.data_type
</select>
<select id="queryWorkTrainList" parameterType="WorkTrain" resultMap="WorkTrainResult">
select wt.id, wt.project_id, wt.project_name, wt.main_image, wt.train_type, wt.train_title, wt.train_nature, sdd.dict_label as train_nature_name, wt.train_participants, wt.begin_date, wt.end_date, wt.train_content, wt.train_file, wt.is_del, wt.create_by, wt.create_time, wt.update_by, wt.update_time, wt.remark, group_concat(sd.dept_id) as trainDeptIds, group_concat(sd.dept_name) as trainDeptNames
from work_train wt
@ -293,7 +297,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dataType != null and dataType != 0 "> and wt.data_type = #{dataType}</if>
<if test="nowDept != null and nowDept != ''"> and sp.deptId = #{nowDept}</if>
<if test="trainType != null and trainType != ''"> and wt.train_type = #{trainType}</if>
<if test="projectId != null and projectId!=0"> and wt.project_id = #{projectId}</if>
<if test="projectId != null and projectId!=0"> and sp.id = #{projectId}</if>
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and wt.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">