Merge remote-tracking branch 'origin/main'
# Conflicts: # bonus-business/src/main/java/com/bonus/digital/controller/MonthlyPlanController.java
This commit is contained in:
commit
c833988769
|
|
@ -42,6 +42,21 @@ public class PersonnelController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人员管理列表(不分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tb:personnel:list')")
|
||||
@GetMapping("/getPersonnelListSelect")
|
||||
public AjaxResult getPersonnelListSelect(PersonnelVo personnelVo) {
|
||||
try {
|
||||
|
||||
List<PersonnelVo> list = personnelService.getPersonnelList(personnelVo);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
return error("接口异常");
|
||||
}
|
||||
}
|
||||
|
||||
//人员所属下拉
|
||||
//0:运检站1:项目部
|
||||
@GetMapping("/getInspectionStationSelect")
|
||||
|
|
|
|||
|
|
@ -43,6 +43,21 @@ public class PlanMajorController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表类别0:计划专业1:业务分类2:计划类别
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('plan:major:list')")
|
||||
@GetMapping("/getPlanMajorListSelect")
|
||||
public AjaxResult getPlanMajorListSelect(PlanMajorVo planMajorVo)
|
||||
{
|
||||
try {
|
||||
List<PlanMajorVo> list = planMajorService.getPlanMajorList(planMajorVo);
|
||||
return success(list);
|
||||
}catch (Exception e) {
|
||||
return error("系统异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增类别0:计划专业1:业务分类2:计划类别
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -191,4 +191,10 @@ public class DayPlanVo {
|
|||
// 实际投入地面作业人员(data_source=5)
|
||||
private String actualGroundPersonnelNames;
|
||||
private Integer actualGroundPersonnelNum;
|
||||
|
||||
|
||||
/**
|
||||
* 风险等级
|
||||
*/
|
||||
private String riskLevel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class MonthlyPlanVo {
|
|||
/**
|
||||
* 月计划填报id
|
||||
*/
|
||||
private int monthlyPlanId;
|
||||
private Integer monthlyPlanId;
|
||||
|
||||
/**
|
||||
* 计划月份
|
||||
|
|
@ -25,7 +25,7 @@ public class MonthlyPlanVo {
|
|||
/**
|
||||
* 运检站id
|
||||
*/
|
||||
private int inspectionStationId;
|
||||
private Integer inspectionStationId;
|
||||
|
||||
/**
|
||||
* 运检站名称
|
||||
|
|
@ -35,17 +35,17 @@ public class MonthlyPlanVo {
|
|||
/**
|
||||
* 计划专业id
|
||||
*/
|
||||
private int planMajorId;
|
||||
private Integer planMajorId;
|
||||
|
||||
/**
|
||||
* 业务类型id
|
||||
*/
|
||||
private int businessTypeId;
|
||||
private Integer businessTypeId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private int projectName;
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 作业内容
|
||||
|
|
@ -55,12 +55,12 @@ public class MonthlyPlanVo {
|
|||
/**
|
||||
* 计划类别id
|
||||
*/
|
||||
private int planCategoryId;
|
||||
private Integer planCategoryId;
|
||||
|
||||
/**
|
||||
* 塔基数
|
||||
*/
|
||||
private int towerBaseNumber;
|
||||
private Integer towerBaseNumber;
|
||||
|
||||
/**
|
||||
* 计划开始时间
|
||||
|
|
@ -80,27 +80,37 @@ public class MonthlyPlanVo {
|
|||
/**
|
||||
* 计划投入管理车辆数量
|
||||
*/
|
||||
private int planCarNum;
|
||||
private Integer planCarNum;
|
||||
|
||||
/**
|
||||
* 计划投入熟练工人员数量
|
||||
*/
|
||||
private int planSkilledWorkerNum;
|
||||
private Integer planSkilledWorkerNum;
|
||||
|
||||
/**
|
||||
* 计划投入熟练工工日
|
||||
*/
|
||||
private Integer planSkilledWorkerDay;
|
||||
|
||||
/**
|
||||
* 计划投入辅助工人员数量
|
||||
*/
|
||||
private int planAuxiliaryWorkerNum;
|
||||
private Integer planAuxiliaryWorkerNum;
|
||||
|
||||
/**
|
||||
* 计划投入辅助工人工日
|
||||
*/
|
||||
private Integer planAuxiliaryWorkerDay;
|
||||
|
||||
/**
|
||||
* 计划投入分包车辆数量
|
||||
*/
|
||||
private int planSubCarNum;
|
||||
private Integer planSubCarNum;
|
||||
|
||||
/**
|
||||
* 实际工作天数
|
||||
*/
|
||||
private int actualWorkingDay;
|
||||
private Integer actualWorkingDay;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
|
@ -162,4 +172,10 @@ public class MonthlyPlanVo {
|
|||
|
||||
private Integer totalSubCarDays;
|
||||
|
||||
|
||||
/**
|
||||
* 风险等级
|
||||
*/
|
||||
private String riskLevel;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class PlanManagementVo {
|
|||
/**
|
||||
* 计划管理id
|
||||
*/
|
||||
private int planManagementId;
|
||||
private Integer planManagementId;
|
||||
|
||||
/**
|
||||
* 计划管理月份
|
||||
|
|
@ -34,7 +34,7 @@ public class PlanManagementVo {
|
|||
/**
|
||||
* 实施部门
|
||||
*/
|
||||
private int inspectionStationId;
|
||||
private Integer inspectionStationId;
|
||||
|
||||
/**
|
||||
* 实施部门
|
||||
|
|
@ -86,4 +86,9 @@ public class PlanManagementVo {
|
|||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@ public class WorkloadVo {
|
|||
/**
|
||||
* 工作量id
|
||||
*/
|
||||
private int workloadId;
|
||||
private Integer workloadId;
|
||||
|
||||
/**
|
||||
* 计划填报id
|
||||
*/
|
||||
private int planId;
|
||||
private Integer planId;
|
||||
|
||||
/**
|
||||
* 工作量类别id
|
||||
*/
|
||||
private int workloadCategoryId;
|
||||
private Integer workloadCategoryId;
|
||||
|
||||
/**
|
||||
* 工作量类别名称
|
||||
|
|
@ -37,7 +37,7 @@ public class WorkloadVo {
|
|||
/**
|
||||
*工作量
|
||||
*/
|
||||
private int workloadNum;
|
||||
private Integer workloadNum;
|
||||
|
||||
/**
|
||||
* 数据来源:0月计划:1日计划
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.digital.mapper;
|
||||
|
||||
import com.bonus.digital.dao.WorkloadCategoryVo;
|
||||
import com.bonus.digital.dao.WorkloadVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -12,4 +13,6 @@ public interface WorkloadCategoryMapper {
|
|||
int delWorkloadCategory(WorkloadCategoryVo workloadCategoryVo);
|
||||
|
||||
int updateWorkloadCategory(WorkloadCategoryVo workloadCategoryVo);
|
||||
|
||||
List<WorkloadVo> getWorkloadList(WorkloadVo workloadVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public interface MonthlyPlanService {
|
|||
/**
|
||||
* 新增月计划
|
||||
*/
|
||||
int addMonthlyPlanList(MonthlyPlanVo monthlyPlanVo);
|
||||
int addMonthlyPlanList(List<MonthlyPlanVo> monthlyPlanVo);
|
||||
|
||||
/**
|
||||
* 删除月计划
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.bonus.digital.service.impl;
|
||||
|
||||
import com.bonus.common.utils.SecurityUtils;
|
||||
import com.bonus.common.utils.StringUtils;
|
||||
import com.bonus.digital.dao.*;
|
||||
import com.bonus.digital.mapper.MonthlyPlanMapper;
|
||||
import com.bonus.digital.mapper.PersonnelMapper;
|
||||
import com.bonus.digital.mapper.WorkloadCategoryMapper;
|
||||
import com.bonus.digital.service.MonthlyPlanService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -29,24 +31,38 @@ public class MonthlyPlanServiceImpl implements MonthlyPlanService {
|
|||
@Resource
|
||||
private PersonnelMapper personnelMapper;
|
||||
|
||||
@Resource
|
||||
private WorkloadCategoryMapper workloadCategoryMapper;
|
||||
|
||||
/**
|
||||
* 月计划列表
|
||||
*/
|
||||
@Override
|
||||
public List<MonthlyPlanVo> getPlanMajorList(MonthlyPlanVo monthlyPlanVo) {
|
||||
List<MonthlyPlanVo> monthlyPlanVoList = monthlyPlanMapper.getPlanMajorList(monthlyPlanVo);
|
||||
for (MonthlyPlanVo monthlyPlanVo2 : monthlyPlanVoList) {
|
||||
//获取每个月计划投入的管理人员
|
||||
List<String> plannedIdList = Arrays.asList(monthlyPlanVo2.getPlanPersonnel().split(","));
|
||||
PersonnelVo personnelVo = new PersonnelVo();
|
||||
personnelVo.setIdList(plannedIdList);
|
||||
List<PersonnelVo> plannedList = personnelMapper.getPersonnelList(personnelVo);
|
||||
monthlyPlanVo2.setPersonneltList(plannedList);
|
||||
//获取人员安排信息
|
||||
List<PersonnelArrangementVo> personnelArrangementVoList = monthlyPlanMapper.getPersonnelArrangementList(monthlyPlanVo2);
|
||||
monthlyPlanVo2.setPersonnelArrangementList(personnelArrangementVoList);
|
||||
try {
|
||||
List<MonthlyPlanVo> monthlyPlanVoList = monthlyPlanMapper.getPlanMajorList(monthlyPlanVo);
|
||||
for (MonthlyPlanVo monthlyPlanVo2 : monthlyPlanVoList) {
|
||||
if (StringUtils.isNotEmpty(monthlyPlanVo2.getPlanPersonnel())){
|
||||
//获取每个月计划投入的管理人员
|
||||
List<String> plannedIdList = Arrays.asList(monthlyPlanVo2.getPlanPersonnel().split(","));
|
||||
PersonnelVo personnelVo = new PersonnelVo();
|
||||
personnelVo.setIdList(plannedIdList);
|
||||
List<PersonnelVo> plannedList = personnelMapper.getPersonnelList(personnelVo);
|
||||
monthlyPlanVo2.setPersonneltList(plannedList);
|
||||
//获取人员安排信息
|
||||
List<PersonnelArrangementVo> personnelArrangementVoList = monthlyPlanMapper.getPersonnelArrangementList(monthlyPlanVo2);
|
||||
monthlyPlanVo2.setPersonnelArrangementList(personnelArrangementVoList);
|
||||
}
|
||||
WorkloadVo workloadVo = new WorkloadVo();
|
||||
workloadVo.setPlanId(monthlyPlanVo2.getMonthlyPlanId());
|
||||
workloadVo.setDataSource("0");
|
||||
List<WorkloadVo> workloadVoList = workloadCategoryMapper.getWorkloadList(workloadVo);
|
||||
monthlyPlanVo2.setWorkloadList(workloadVoList);
|
||||
}
|
||||
return monthlyPlanVoList;
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -54,25 +70,14 @@ public class MonthlyPlanServiceImpl implements MonthlyPlanService {
|
|||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int addMonthlyPlanList(MonthlyPlanVo monthlyPlanVo) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
monthlyPlanVo.setCreateUser(userId.toString());
|
||||
monthlyPlanVo.setCreateTime(new Date());
|
||||
int res = monthlyPlanMapper.addMonthlyPlanList(monthlyPlanVo);
|
||||
//保存人员安排信息
|
||||
List<PersonnelArrangementVo> personnelArrangementList = monthlyPlanVo.getPersonnelArrangementList();
|
||||
for (PersonnelArrangementVo p : personnelArrangementList) {
|
||||
p.setMonthlyPlanId(monthlyPlanVo.getMonthlyPlanId());
|
||||
monthlyPlanMapper.addPersonnelArrangement(p);
|
||||
public int addMonthlyPlanList(List<MonthlyPlanVo> monthlyPlanVo) {
|
||||
for (MonthlyPlanVo monthlyPlanVo2 : monthlyPlanVo) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
monthlyPlanVo2.setCreateUser(userId.toString());
|
||||
monthlyPlanVo2.setCreateTime(new Date());
|
||||
monthlyPlanMapper.addMonthlyPlanList(monthlyPlanVo2);
|
||||
}
|
||||
//保存工作量信息
|
||||
List<WorkloadVo> workloadVoList = monthlyPlanVo.getWorkloadList();
|
||||
for (WorkloadVo w : workloadVoList) {
|
||||
w.setPlanId(monthlyPlanVo.getMonthlyPlanId());
|
||||
w.setDataSource("0");
|
||||
monthlyPlanMapper.addWorkload(w);
|
||||
}
|
||||
return res;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
<if test="createTime != null">create_time,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="dayPlanType != null and dayPlanType != ''">day_plan_type,</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">risk_level,</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="dayPlan != null and dayPlan != ''">#{dayPlan},</if>
|
||||
|
|
@ -59,6 +60,7 @@
|
|||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="dayPlanType != null and dayPlanType != ''">#{dayPlanType},</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">#{riskLevel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateDayPlan">
|
||||
|
|
@ -89,6 +91,7 @@
|
|||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateUser != null and updateUser != ''">update_user = #{updateUser},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="riskLevel != null and riskLevel != ''">risk_level = #{riskLevel},</if>
|
||||
</trim>
|
||||
WHERE day_plan_id = #{dayPlanId}
|
||||
</update>
|
||||
|
|
@ -143,6 +146,7 @@
|
|||
tdp.day_plan_type AS dayPlanType,
|
||||
tdp.start_time AS startTime,
|
||||
tdp.end_time AS endTime,
|
||||
tdp.risk_level AS reskLevel,
|
||||
|
||||
-- 新增:拟投入高处作业人员(data_source=2):姓名 + 数量
|
||||
(SELECT IFNULL(GROUP_CONCAT(tpp.personnel_name SEPARATOR ','), '')
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
insert into tb_monthly_plan (monthly_plan,inspection_station_id,inspection_station_name,plan_major_id,business_type_id,
|
||||
project_name,work_content,plan_category_id,tower_base_number,planned_start_time,
|
||||
planned_end_time,plan_personnel,plan_car_num,plan_skilled_worker_num,plan_auxiliary_worker_num,
|
||||
plan_sub_car_num,create_user,create_time,actual_working_day)
|
||||
plan_sub_car_num,create_user,create_time,actual_working_day,risk_level)
|
||||
values (#{monthlyPlan},#{inspectionStationId},#{inspectionStationName},#{planMajorId},#{businessTypeId},
|
||||
#{projectName},#{workContent},#{planCategoryId},#{towerBaseNumber},#{plannedStartTime},#{plannedEndTime},
|
||||
#{planPersonnel},#{planCarNum},#{planSkilledWorkerNum},#{planAuxiliaryWorkerNum},#{planSubCarNum},
|
||||
#{createUser},#{createTime},#{actualWorkingDay})
|
||||
#{createUser},#{createTime},#{actualWorkingDay},#{riskLevel})
|
||||
</insert>
|
||||
<insert id="addPersonnelArrangement">
|
||||
insert into tb_personnel_arrangement (monthly_plan_id,day,personnel_names)
|
||||
|
|
@ -66,9 +66,15 @@
|
|||
<if test="planSkilledWorkerNum!= null " >
|
||||
plan_skilled_worker_num=#{planSkilledWorkerNum},
|
||||
</if>
|
||||
<if test="planSkilledWorkerDay!= null " >
|
||||
plan_skilled_worker_day=#{planSkilledWorkerDay},
|
||||
</if>
|
||||
<if test="planAuxiliaryWorkerNum!= null " >
|
||||
plan_auxiliary_worker_num=#{planAuxiliaryWorkerNum},
|
||||
</if>
|
||||
<if test="planAuxiliaryWorkerDay!= null " >
|
||||
plan_auxiliary_worker_day=#{planAuxiliaryWorkerDay},
|
||||
</if>
|
||||
<if test="planSubCarNum!= null " >
|
||||
plan_sub_car_num=#{planSubCarNum},
|
||||
</if>
|
||||
|
|
@ -81,6 +87,9 @@
|
|||
<if test="actualWorkingDay!= null " >
|
||||
actual_working_day=#{actualWorkingDay},
|
||||
</if>
|
||||
<if test="riskLevel!= null " >
|
||||
risk_level=#{riskLevel},
|
||||
</if>
|
||||
</trim>
|
||||
where monthly_plan_id = #{monthlyPlanId}
|
||||
</update>
|
||||
|
|
@ -114,6 +123,7 @@
|
|||
tmp.plan_sub_car_num,
|
||||
tmp.create_user,
|
||||
tmp.create_time,
|
||||
tmp.risk_level,
|
||||
tmp.actual_working_day
|
||||
from tb_monthly_plan tmp
|
||||
left join tb_plan_major tpm on tmp.plan_major_id = tpm.plan_major_id
|
||||
|
|
|
|||
|
|
@ -98,7 +98,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getInspectionStationSelect" resultType="com.bonus.digital.dao.SelectDto">
|
||||
select inspection_station_id as id,
|
||||
inspection_station_name as value
|
||||
from tb_inspection_station where is_active = '1' and category = #{category}
|
||||
from tb_inspection_station where is_active = '1'
|
||||
<if test="category!= null " >
|
||||
and category = #{category}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getPersonnelClassificationSelect" resultType="com.bonus.digital.dao.SelectDto">
|
||||
select personnel_classification_id as id,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime!= null " >
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="remark!= null " >
|
||||
remark=#{remark},
|
||||
</if>
|
||||
</trim>
|
||||
where plan_management_id = #{planManagementId}
|
||||
</update>
|
||||
|
|
@ -52,13 +55,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tpm.project_name,
|
||||
tpm.work_content,
|
||||
tpm.inspection_station_id,
|
||||
tis2.inspection_station_name as inspectionStationName
|
||||
tis2.inspection_station_name as inspectionStationName,
|
||||
tpm.stare_date,
|
||||
tpm.end_date,
|
||||
tpm.risk_level,
|
||||
tpm.remark,
|
||||
tpm.create_user
|
||||
from tb_plan_management tpm
|
||||
left join tb_inspection_station tis2 on tpm.inspection_station_id = tis2.inspection_station_id
|
||||
where category = #{category} and is_active = '1'
|
||||
where tpm.is_active = '1'
|
||||
<if test="planManagementMonth!= null " >
|
||||
and tpm.plan_management_month=#{planManagementMonth}
|
||||
</if>
|
||||
<if test="inspectionStationId!= null " >
|
||||
and tpm.inspection_station_id=#{inspectionStationId}
|
||||
</if>
|
||||
<if test="riskLevel!= null " >
|
||||
and tpm.risk_level=#{riskLevel}
|
||||
</if>
|
||||
<if test="keyWord!= null " >
|
||||
AND (tpm.project_name like concat('%', #{keyWord}, '%')
|
||||
or tpm.work_content like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -39,4 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and workload_category_name like concat('%',#{workloadCategoryName},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getWorkloadList" resultType="com.bonus.digital.dao.WorkloadVo">
|
||||
select workload_id,plan_id,workload_category_id,workload_category_name,unit_price,workload_num,data_source
|
||||
from tb_workload where plan_id = #{planId} and data_source = #{dataSource}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue