update code
parent
e43e9e0225
commit
76fcef9140
|
@ -1,6 +1,5 @@
|
|||
package com.ruoyi.flowable.config;
|
||||
|
||||
import com.sun.prism.paint.Color;
|
||||
import org.flowable.bpmn.model.AssociationDirection;
|
||||
import org.flowable.image.impl.DefaultProcessDiagramCanvas;
|
||||
|
||||
|
|
|
@ -49,7 +49,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();
|
||||
String key="bgscreen_asscess_queryByProjectType_"+where.getId()+"_"+where.getYear()+"_"+where.getQuarterly()+"-"+where.getDeptId();
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.SurProjectSchedule;
|
||||
import com.yanzhu.jh.project.domain.vo.SurProjectScheduleWhere;
|
||||
import com.yanzhu.jh.project.service.ISurProjectScheduleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -33,13 +34,16 @@ public class ProjectScheduleController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByProjectType")
|
||||
public AjaxResult selectByProjectType(Long type){
|
||||
String key="bgscreen_schedule_selectByProjectType_"+type;
|
||||
public AjaxResult selectByProjectType(Long type,Long deptId){
|
||||
String key="bgscreen_schedule_selectByProjectType_"+type+"_"+deptId;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
List<SurProjectSchedule> list=isurProjectScheduleService.selectByProjectType(type);
|
||||
SurProjectScheduleWhere where =new SurProjectScheduleWhere();
|
||||
where.setPrjType(type);
|
||||
where.setDeptId(deptId);
|
||||
List<SurProjectSchedule> list=isurProjectScheduleService.selectByProjectType(where);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package com.yanzhu.jh.project.domain.vo;
|
||||
|
||||
import com.yanzhu.jh.project.domain.SurProjectSchedule;
|
||||
|
||||
public class SurProjectScheduleWhere extends SurProjectSchedule {
|
||||
private long deptId;
|
||||
private long prjType;
|
||||
|
||||
public long getPrjType() {
|
||||
return prjType;
|
||||
}
|
||||
|
||||
public void setPrjType(long prjType) {
|
||||
this.prjType = prjType;
|
||||
}
|
||||
|
||||
public long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.yanzhu.jh.project.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.yanzhu.jh.project.domain.SurProjectSchedule;
|
||||
import com.yanzhu.jh.project.domain.vo.SurProjectScheduleWhere;
|
||||
|
||||
/**
|
||||
* 形象进度Mapper接口
|
||||
|
@ -66,5 +67,5 @@ public interface SurProjectScheduleMapper
|
|||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectSchedule> selectByProjectType(Long type);
|
||||
public List<SurProjectSchedule> selectByProjectType(SurProjectScheduleWhere where);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.yanzhu.jh.project.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.yanzhu.jh.project.domain.SurProjectSchedule;
|
||||
import com.yanzhu.jh.project.domain.vo.SurProjectScheduleWhere;
|
||||
|
||||
/**
|
||||
* 形象进度Service接口
|
||||
|
@ -65,5 +66,5 @@ public interface ISurProjectScheduleService
|
|||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectSchedule> selectByProjectType(Long type);
|
||||
public List<SurProjectSchedule> selectByProjectType(SurProjectScheduleWhere where);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.yanzhu.jh.project.domain.SurProject;
|
||||
import com.yanzhu.jh.project.domain.vo.SurProjectScheduleWhere;
|
||||
import com.yanzhu.jh.project.mapper.SurProjectMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -118,7 +119,7 @@ public class SurProjectScheduleServiceImpl implements ISurProjectScheduleService
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SurProjectSchedule> selectByProjectType(Long type) {
|
||||
return surProjectScheduleMapper.selectByProjectType(type);
|
||||
public List<SurProjectSchedule> selectByProjectType(SurProjectScheduleWhere where) {
|
||||
return surProjectScheduleMapper.selectByProjectType(where);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT p.id, p.projectName,p.projectSchedule,a.plan_target
|
||||
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>
|
||||
order by p.projectSort
|
||||
</select>
|
||||
<select id="selectSmzProjectQuarterlyAssessList" parameterType="SmzProjectQuarterlyAssess" resultMap="SmzProjectQuarterlyAssessResult">
|
||||
|
|
|
@ -174,12 +174,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByProjectType" parameterType="Long" resultMap="SurProjectScheduleResult">
|
||||
<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=#{type} ) AND IF(is_del IS NULL ,0,is_del)=0
|
||||
SELECT id FROM sur_project WHERE
|
||||
isdel=0 AND projecttype=#{prjType}
|
||||
<if test="deptId>0">and deptId=#{deptId}</if>
|
||||
) AND IF(is_del IS NULL ,0,is_del)=0
|
||||
GROUP BY project_id
|
||||
)
|
||||
order by projectSort
|
||||
|
|
Loading…
Reference in New Issue