Commit 31f681f2 authored by yf's avatar yf

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/ruoyi-vue-master into dev-yf

parents eed88514 285566cb
......@@ -198,7 +198,7 @@ public class RiskPlanAppController extends BaseController {
,RiskPlanStatusType.PROJECT_REPORT,RiskPlanStatusType.FINISH);
state = "已完成";
}
List<RiskPlanAppListDto> list = riskPlanService.getRiskPlanAppListDtoList(statusList, getUserId(),null,null);
List<RiskPlanAppListDto> list = riskPlanService.getRiskPlanAppListDtoList(statusList, null,getUserId(),null);
String finalState = state;
list.forEach(dto -> {
Long finishNumber = riskPlanUserBuildingService.countStatusByPlanIdAndStatus(dto.getId(), "finish");
......@@ -312,6 +312,18 @@ public class RiskPlanAppController extends BaseController {
return R.ok(riskPlanInherentListService.getInherentListByPlanId(null, buildingId, floorId, roomId));
}
/**
* 根据计划id、楼宇id、楼层id、房间id获取固有风险列表
*
* @param planId 计划id
* @real_return {@link R<List<RiskPlanAppInherentListDto>>}
*/
@GetMapping("/inherent/list/{planId}")
public R<List<RiskPlanAppInherentListDto>> getInherentListByPlanId(@PathVariable("planId") Long planId) {
RiskPlan riskPlan = riskPlanService.selectRiskPlanById(planId);
return R.ok(riskPlanInherentListService.getInherentListByPlanId(riskPlan.getProjectId(), null, null, null));
}
/**
* 添加固有风险
*
......@@ -464,7 +476,15 @@ public class RiskPlanAppController extends BaseController {
*/
@GetMapping("/approve/list")
public R<List<RiskPlanAppListDto>> getRiskPlanAppListDtoListByApproveUser(String status) {
return R.ok(riskPlanService.getRiskPlanAppListDtoListByApproveUser(getUserId(),status));
String result = null;
if ("completed".equals(status)){
status = "completed";
result = "1";
}else if ("return".equals(status)){
status = "completed";
result = "0";
}
return R.ok(riskPlanService.getRiskPlanAppListDtoListByApproveUser(getUserId(),status,result));
}
......
......@@ -43,6 +43,9 @@ public class RiskPlanAppDetailsDto {
/** 任务详情 */
private RiskPlanAppTaskDetailsDto detailsDto;
/** 风险清单 */
private List<RiskPlanAppInherentListDto> inherentListDtos;
/** 风险清单 */
private List<RiskPlanAppRiskBuildingListDto> riskBuildingListDtos;
......
......@@ -17,6 +17,9 @@ public class RiskPlanAppTaskDetailsDto {
/** id */
private Long id;
/** 任务名称 */
private String name;
/** 任务编号 */
private String no;
......@@ -42,10 +45,10 @@ public class RiskPlanAppTaskDetailsDto {
private String projectName;
/** 所属单位id */
private Long projectDeptId;
private Long deptId;
/** 所属单位 */
private String projectDeptName;
private String deptName;
/** 所在城市 */
private String city;
......
......@@ -64,7 +64,7 @@ public interface RiskPlanInherentListMapper
*/
public int deleteRiskPlanInherentListByIds(Long[] ids);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(@Param("planId") Long planId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId, @Param("roomId") Long roomId);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(@Param("projectId") Long projectId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId, @Param("roomId") Long roomId);
RiskPlanAppInherentListDetailsDto getRiskPlanAppInherentListDetailsDtoByInherentId(@Param("inherentId") Long inherentId);
......
......@@ -76,7 +76,8 @@ public interface RiskPlanMapper
List<RiskPlanAppApproveListDto> getApproveListDtoByPlanId(@Param("planId") Long planId);
List<RiskPlanAppListDto> getRiskPlanAppListDtoListByApproveUser(@Param("userId") Long userId,@Param("status") String status);
List<RiskPlanAppListDto> getRiskPlanAppListDtoListByApproveUser(@Param("userId") Long userId
,@Param("status") String status,@Param("result") String result);
List<RiskPlanAppListDto> getRiskPlanAppListDtoListByCreateUserDeptId(@Param("deptId") Long deptId);
}
......@@ -64,7 +64,7 @@ public interface IRiskPlanInherentListService
*/
public int deleteRiskPlanInherentListById(Long id);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long planId, Long buildingId, Long floorId, Long roomId);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long projectId, Long buildingId, Long floorId, Long roomId);
Integer saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto);
......
......@@ -78,7 +78,7 @@ public interface IRiskPlanService
int revokeByPlanId(Long planId, Long userId);
List<RiskPlanAppListDto> getRiskPlanAppListDtoListByApproveUser(Long userId,String status);
List<RiskPlanAppListDto> getRiskPlanAppListDtoListByApproveUser(Long userId,String status,String result);
List<RiskPlanAppListDto> getRiskPlanAppListDtoListByCreateUserDeptId(Long deptId);
}
......@@ -241,8 +241,8 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
}
@Override
public List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long planId, Long buildingId, Long floorId, Long roomId) {
return riskPlanInherentListMapper.getInherentListByPlanId(planId, buildingId, floorId, roomId);
public List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long projectId, Long buildingId, Long floorId, Long roomId) {
return riskPlanInherentListMapper.getInherentListByPlanId(projectId, buildingId, floorId, roomId);
}
@Override
......
......@@ -13,10 +13,7 @@ import com.censoft.censoftrongtong.domain.dto.RiskPlanAppDetailsDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppListDto;
import com.censoft.censoftrongtong.enums.RiskPlanStatusType;
import com.censoft.censoftrongtong.mapper.RiskPlanMapper;
import com.censoft.censoftrongtong.service.ILedgerBuildingService;
import com.censoft.censoftrongtong.service.IRiskPlanService;
import com.censoft.censoftrongtong.service.IRiskPlanTaskService;
import com.censoft.censoftrongtong.service.IRiskPlanUserBuildingService;
import com.censoft.censoftrongtong.service.*;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -43,6 +40,9 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
@Resource
private IRiskPlanUserBuildingService riskPlanUserBuildingService;
@Resource
private IRiskPlanInherentListService riskPlanInherentListService;
/**
* 查询风险计划
*
......@@ -187,6 +187,9 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
dto.getDetailsDto().setBuildingNames(ledgerBuilding.getName());
}
//风险清单
dto.setInherentListDtos(riskPlanInherentListService.getInherentListByPlanId(null, buildingId, null, null));
//风险清单
dto.setRiskBuildingListDtos(riskPlanMapper.getRiskBuildingListDtoByPlanId(planId,buildingId));
......@@ -222,7 +225,8 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
if ("0".equals(appApproveDto.getTaskResult())) {
//组长退回
if (riskPlan.getStatus().equals(RiskPlanStatusType.WAIT_LEADER_APPROVE.getStatus())){
if (riskPlan.getStatus().equals(RiskPlanStatusType.WAIT_LEADER_APPROVE.getStatus())
||riskPlan.getStatus().equals(RiskPlanStatusType.WAIT_LEADER_RETURN.getStatus())){
//如果是组长审批 同时退回修改 楼宇单子的状态
riskPlanUserBuildingService.updateByRiskPlanAppApproveBuildingDto(appApproveDto.getId(),appApproveDto.getUserId()
,appApproveDto.getBuildingDtos());
......@@ -331,9 +335,9 @@ public class RiskPlanServiceImpl implements IRiskPlanService {
}
@Override
public List<RiskPlanAppListDto> getRiskPlanAppListDtoListByApproveUser(Long userId,String status) {
public List<RiskPlanAppListDto> getRiskPlanAppListDtoListByApproveUser(Long userId,String status,String result) {
//查询并把状态值转化为状态名称
return riskPlanMapper.getRiskPlanAppListDtoListByApproveUser(userId,status)
return riskPlanMapper.getRiskPlanAppListDtoListByApproveUser(userId,status,result)
.stream()
.map(dto -> {
String statusName = RiskPlanStatusType.getTitleByStatus(dto.getStatus()).getTitle();
......
......@@ -87,8 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ledger_room lr ON lr.id = rpil.room_id
LEFT JOIN ledger_floor lf ON lf.id = floor_id
LEFT JOIN sys_user su ON su.user_id = rpil.user_id
LEFT JOIN ledger_building lb ON lb.id = lf.building_id
<where>
<if test="planId != null"> AND rpil.plan_id = #{planId}</if>
<if test="projectId != null"> AND lb.project_id = #{projectId}</if>
<if test="buildingId != null"> AND lf.building_id = #{buildingId}</if>
<if test="floorId != null"> AND lf.id = #{floorId}</if>
<if test="roomId != null"> AND lr.id = #{roomId}</if>
......
......@@ -101,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
rp.id,
rp.`no`,
rp.`name`,
su1.user_id AS createUserId,
su1.nick_name AS createUserName,
sd1.dept_id AS createDeptId,
......@@ -108,8 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rp.create_time AS createTime,
lp.id AS projectId,
lp.`name` AS projectName,
sd2.dept_id AS projectDeptId,
sd2.dept_name AS projectDeptName,
sd2.dept_id AS deptId,
sd2.dept_name AS deptName,
lp.city,
rp.building_ids AS buildingIds,
( SELECT GROUP_CONCAT( `name` ) FROM ledger_building WHERE project_id = lp.id ) AS buildingNames,
......@@ -197,6 +198,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != '' ">
and rpt.`status` = #{status}
</if>
<if test="result != null and result != '' ">
and rpt.task_result = #{result}
</if>
</where>
GROUP BY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment