联调问题

This commit is contained in:
马三炮 2025-12-24 16:05:43 +08:00
parent e366dda054
commit 2490e40c6c
11 changed files with 103 additions and 49 deletions

View File

@ -66,7 +66,7 @@ public class MonthlyPlanController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('monthly:plan:add')")
@PostMapping("/addMonthlyPlan")
public AjaxResult addMonthlyPlan(@RequestBody MonthlyPlanVo monthlyPlanVo) {
public AjaxResult addMonthlyPlan(@RequestBody List<MonthlyPlanVo> monthlyPlanVo) {
try {
int res = monthlyPlanService.addMonthlyPlanList(monthlyPlanVo);
if (res > 0) {

View File

@ -42,6 +42,21 @@ public class PersonnelController extends BaseController {
}
}
/**
* 获取人员管理列表(不分页)
*/
@PreAuthorize("@ss.hasPermi('tb:personnel:list')")
@GetMapping("/getPersonnelListSelect")
public TableDataInfo getPersonnelListSelect(PersonnelVo personnelVo) {
try {
List<PersonnelVo> list = personnelService.getPersonnelList(personnelVo);
return getDataTable(list);
} catch (Exception e) {
return getDataTable(null);
}
}
//人员所属下拉
//0运检站1项目部
@GetMapping("/getInspectionStationSelect")

View File

@ -191,4 +191,10 @@ public class DayPlanVo {
// 实际投入地面作业人员data_source=5
private String actualGroundPersonnelNames;
private Integer actualGroundPersonnelNum;
/**
* 风险等级
*/
private String riskLevel;
}

View File

@ -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,27 @@ public class MonthlyPlanVo {
/**
* 计划投入管理车辆数量
*/
private int planCarNum;
private Integer planCarNum;
/**
* 计划投入熟练工人员数量
*/
private int planSkilledWorkerNum;
private Integer planSkilledWorkerNum;
/**
* 计划投入辅助工人员数量
*/
private int planAuxiliaryWorkerNum;
private Integer planAuxiliaryWorkerNum;
/**
* 计划投入分包车辆数量
*/
private int planSubCarNum;
private Integer planSubCarNum;
/**
* 实际工作天数
*/
private int actualWorkingDay;
private Integer actualWorkingDay;
/**
* 创建人
@ -162,4 +162,10 @@ public class MonthlyPlanVo {
private Integer totalSubCarDays;
/**
* 风险等级
*/
private String riskLevel;
}

View File

@ -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;
}

View File

@ -13,7 +13,7 @@ public interface MonthlyPlanService {
/**
* 新增月计划
*/
int addMonthlyPlanList(MonthlyPlanVo monthlyPlanVo);
int addMonthlyPlanList(List<MonthlyPlanVo> monthlyPlanVo);
/**
* 删除月计划

View File

@ -1,6 +1,7 @@
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;
@ -36,17 +37,20 @@ public class MonthlyPlanServiceImpl implements MonthlyPlanService {
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);
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);
}
}
return Collections.emptyList();
return monthlyPlanVoList;
}
/**
@ -54,25 +58,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;
}
/**

View File

@ -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 ','), '')

View File

@ -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)
@ -81,6 +81,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 +117,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

View File

@ -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,

View File

@ -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>