update code

dev_xds
haha 2023-10-11 23:48:11 +08:00
parent 5fd792ded5
commit 334cfae105
4 changed files with 38 additions and 1 deletions

View File

@ -34,6 +34,11 @@ public class ProjectQuarterlyAssessController extends BaseController {
}
SmzProjectQuarterlyAssess smzProjectQuarterlyAssess=new SmzProjectQuarterlyAssess();
smzProjectQuarterlyAssess.setDeptId(deptId);
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
smzProjectQuarterlyAssess.setPrjIds(getProjectIds());
}
}
Calendar calendar=Calendar.getInstance();
smzProjectQuarterlyAssess.setYear((long)calendar.get(Calendar.YEAR));
int month=calendar.get(Calendar.MONTH);
@ -55,6 +60,12 @@ public class ProjectQuarterlyAssessController extends BaseController {
if(obj!=null){
return AjaxResult.success(obj);
}
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
List list=smzProjectQuarterlyAssessService.queryByProjectType(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

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.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.yanzhu.jh.project.domain.SurProjectSchedule;
import com.yanzhu.jh.project.domain.vo.SurProjectScheduleWhere;
import com.yanzhu.jh.project.service.ISurProjectScheduleService;
@ -16,7 +18,7 @@ import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/schedule")
public class ProjectScheduleController {
public class ProjectScheduleController extends BaseController {
@Autowired
private ISurProjectScheduleService isurProjectScheduleService;
@ -43,6 +45,11 @@ public class ProjectScheduleController {
SurProjectScheduleWhere where =new SurProjectScheduleWhere();
where.setPrjType(type);
where.setDeptId(deptId);
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
List<SurProjectSchedule> list=isurProjectScheduleService.selectByProjectType(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -65,6 +65,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(SELECT id FROM sur_project
<where>
<if test="deptId>0"> 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>
</where>
) AND a.project_id=p.id and plan_target is not null AND p.deptId=d.dept_id
@ -79,6 +85,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="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

@ -182,6 +182,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
)