update code

dev_xds
haha 2024-01-17 23:58:43 +08:00
parent f0ddfdc118
commit c5193f0c10
10 changed files with 112 additions and 4 deletions

View File

@ -6,12 +6,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
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.yanzhu.jh.work.domain.WorkTrain;
import com.yanzhu.jh.work.service.IWorkTrainService;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Conller
@ -65,5 +66,19 @@ public class BgWorkTrainController extends BaseController {
return AjaxResult.success(workTrainService.getGroupByDataType(workTrain));
}
@PostMapping("/queryWorkTrainList")
public TableDataInfo queryWorkTrainList(@RequestBody WorkTrain where){
Long deptId= where.getDeptId();
if(deptId!=null && deptId>0){
where.setNowDept(""+deptId);
}else{
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
startPage();
List<WorkTrain> list=workTrainService.queryWorkTrainList(where);
return getDataTable(list);
}
}

View File

@ -65,4 +65,26 @@ public class ProjectCheckingController extends BaseController {
}
return success(surProjectCheckingService.selectBgscreenProjectCheckingView(surProjectChecking));
}
/**
* 2-
* @param deptId
* @param projectId
* @return
*/
@GetMapping("/getProjectCheckingGroupFoChart")
public AjaxResult getProjectCheckingGroupFoChart(String deptId, String projectId){
SurProjectChecking surProjectChecking = new SurProjectChecking();
if(deptId!=null && !"0".equals(deptId)){
surProjectChecking.setProjectDeptId(deptId);
}else{
if (SecurityUtils.isUserB()) {
surProjectChecking.setPrjIds(getProjectIds());
}
}
if(projectId!=null && !"0".equals(projectId)){
surProjectChecking.setProjectId(Convert.toLong(projectId));
}
return success(surProjectCheckingService.getProjectCheckingGroupFoChart(surProjectChecking));
}
}

View File

@ -84,4 +84,6 @@ public interface SurProjectCheckingMapper
* @return
*/
public List<Map<String,Object>> findStatisticsByProjectId(Long projectId);
public List<SurProjectChecking> getProjectCheckingGroupFoChart(SurProjectChecking where);
}

View File

@ -92,4 +92,11 @@ public interface ISurProjectCheckingService
* @return
*/
public List<Map<String,Object>> findStatisticsByProjectId(Long projectId);
/**
* 2-
* @param surProjectChecking
* @return
*/
public List<SurProjectChecking> getProjectCheckingGroupFoChart(SurProjectChecking surProjectChecking);
}

View File

@ -229,4 +229,9 @@ public class SurProjectCheckingServiceImpl implements ISurProjectCheckingService
public List<Map<String,Object>> findStatisticsByProjectId(Long projectId) {
return surProjectCheckingMapper.findStatisticsByProjectId(projectId);
}
@Override
public List<SurProjectChecking> getProjectCheckingGroupFoChart(SurProjectChecking surProjectChecking) {
return surProjectCheckingMapper.getProjectCheckingGroupFoChart(surProjectChecking);
}
}

View File

@ -120,4 +120,6 @@ public interface WorkTrainMapper
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<WorkTrain> getGroupByDataType(WorkTrain workTrain);
public List<WorkTrain> queryWorkTrainList(WorkTrain where);
}

View File

@ -94,4 +94,6 @@ public interface IWorkTrainService
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<WorkTrain> getGroupByDataType(WorkTrain workTrain);
public List<WorkTrain> queryWorkTrainList(WorkTrain where);
}

View File

@ -225,4 +225,9 @@ public class WorkTrainServiceImpl implements IWorkTrainService
public List<WorkTrain> getGroupByDataType(WorkTrain workTrain) {
return workTrainMapper.getGroupByDataType(workTrain);
}
@Override
public List<WorkTrain> queryWorkTrainList(WorkTrain where) {
return workTrainMapper.queryWorkTrainList(where);
}
}

View File

@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY
spc.project_id
</select>
<insert id="insertSurProjectChecking" parameterType="SurProjectChecking" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_checking
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -292,4 +292,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getProjectCheckingGroupFoChart" parameterType="SurProjectChecking" resultMap="SurProjectCheckingResult">
select a.dict_value data_type_lvl2,dict_label main_image,a.css_class check_type,b.cnt id from
(
SELECT *
FROM sys_dict_data WHERE dict_type='project_checking_data_type_lvl2'
) a
left join
(
SELECT data_type_lvl2,count(1) cnt
FROM sur_project_checking a,sur_project b WHERE a.project_id=b.id
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="prjIds !=null and prjIds.size()>0">
and a.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by data_type_lvl2
) b
on a.dict_value=b.data_type_lvl2
</select>
</mapper>

View File

@ -263,6 +263,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT COUNT(1) cnt,data_type
FROM work_train
<where>
<if test="nowDept != null and nowDept != ''"> and sp.deptId = #{nowDept}</if>
<if test="projectId != null"> and project_id = #{projectId}</if>
<if test="prjIds !=null and prjIds.size()>0">
and project_id in
@ -274,4 +275,28 @@ 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
left join work_train_dept wtd on wtd.train_id = wt.id
left join sys_dept sd on sd.dept_id = wtd.dept_id
left join sur_project sp on sp.id = wt.project_id
<if test='trainType != null and trainType == "0"'> left join sys_dict_data sdd on sdd.dict_type = 'train_nature_zxpx' and wt.train_nature = sdd.dict_value</if>
<if test='trainType != null and trainType == "1"'> left join sys_dict_data sdd on sdd.dict_type = 'train_nature_yjyl' and wt.train_nature = sdd.dict_value</if>
<where>
and wt.is_del=0
<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="prjIds !=null and prjIds.size()>0">
and wt.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
group by wt.id
order by wt.create_time desc
</select>
</mapper>