update code
parent
75223b9f64
commit
4ed6580320
|
@ -1,6 +1,8 @@
|
|||
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.SurProjectSchedule;
|
||||
import com.yanzhu.jh.project.service.ISurProjectScheduleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -8,16 +10,37 @@ 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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/bgscreen/schedule")
|
||||
public class ProjectScheduleController {
|
||||
|
||||
@Autowired
|
||||
private ISurProjectScheduleService isurProjectScheduleService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@GetMapping("/projectConstructionProgress")
|
||||
public AjaxResult getProjectConstructionProgress(Long projectId){
|
||||
SurProjectSchedule surProjectSchedule= isurProjectScheduleService.getProjectConstructionProgress(projectId);
|
||||
return AjaxResult.success(surProjectSchedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按项目类型查询形象进度数据
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByProjectType")
|
||||
public AjaxResult selectByProjectType(Long type){
|
||||
String key="bgscreen_schedule_selectByProjectType_"+type;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return AjaxResult.success(obj);
|
||||
}
|
||||
List<SurProjectSchedule> list=isurProjectScheduleService.selectByProjectType(type);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,16 @@ public class SurProjectSchedule extends BaseEntity
|
|||
@Excel(name = "数据状态")
|
||||
private Long isDel;
|
||||
|
||||
private SurProject surProject;
|
||||
|
||||
public SurProject getSurProject() {
|
||||
return surProject;
|
||||
}
|
||||
|
||||
public void setSurProject(SurProject surProject) {
|
||||
this.surProject = surProject;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
@ -60,4 +60,11 @@ public interface SurProjectScheduleMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectScheduleByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 按项目类型查询形象进度数据
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectSchedule> selectByProjectType(Long type);
|
||||
}
|
||||
|
|
|
@ -59,4 +59,11 @@ public interface ISurProjectScheduleService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectScheduleById(Long id);
|
||||
|
||||
/**
|
||||
* 按项目类型查询形象进度数据
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public List<SurProjectSchedule> selectByProjectType(Long type);
|
||||
}
|
||||
|
|
|
@ -99,4 +99,14 @@ public class SurProjectScheduleServiceImpl implements ISurProjectScheduleService
|
|||
{
|
||||
return surProjectScheduleMapper.deleteSurProjectScheduleById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按项目类型查询形象进度数据
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SurProjectSchedule> selectByProjectType(Long type) {
|
||||
return surProjectScheduleMapper.selectByProjectType(type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
<select id="currentListByDept" parameterType="SmzProjectQuarterlyAssess" resultMap="SmzProjectQuarterlyAssessResultToProject">
|
||||
|
||||
SELECT a.*,p.projectName,d.dept_name,d. paretProjectName,d.projectSchedule
|
||||
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
|
||||
|
|
|
@ -24,14 +24,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<association property="surProject" javaType="SurProject">
|
||||
<result property="id" column="project_id" />
|
||||
<result property="projectName" column="projectName"/>
|
||||
<result property="projectSort" column="projectSort"/>
|
||||
<result property="projectSchedule" column="projectSchedule"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectScheduleVo">
|
||||
SELECT * from (
|
||||
SELECT s.*,p.projectName
|
||||
FROM sur_project_schedule AS s LEFT JOIN sur_project AS p ON s.project_id=p.id ) as a
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectSurProjectScheduleList" parameterType="SurProjectSchedule" resultMap="SurProjectScheduleResult">
|
||||
SELECT * from (
|
||||
SELECT s.*,p.projectName
|
||||
|
@ -162,4 +170,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByProjectType" parameterType="Long" 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
|
||||
GROUP BY project_id
|
||||
)
|
||||
order by projectSort
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue