From 6ee0bdbdd8167164a6e9e5ae0e8143535a235da2 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Thu, 18 Dec 2025 14:55:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digital/controller/DayPlanController.java | 66 +++-------- .../controller/PersonnelController.java | 6 + .../java/com/bonus/digital/dao/DayPlanVo.java | 2 +- .../com/bonus/digital/dao/PersonnelVo.java | 30 ++--- .../bonus/digital/mapper/DayPlanMapper.java | 21 ++++ .../digital/mapper/MonthlyPlanMapper.java | 2 - .../bonus/digital/mapper/PersonnelMapper.java | 2 +- .../bonus/digital/service/DayPlanService.java | 12 ++ .../service/impl/DayPlanServiceImpl.java | 31 ++++++ .../main/resources/mapper/DayPlanMapper.xml | 104 ++++++++++++++++++ .../main/resources/mapper/MonthPlanMapper.xml | 6 - .../main/resources/mapper/PersonnalMapper.xml | 3 +- .../resources/mapper/PlanManagementMapper.xml | 18 +-- 13 files changed, 219 insertions(+), 84 deletions(-) create mode 100644 bonus-business/src/main/java/com/bonus/digital/mapper/DayPlanMapper.java create mode 100644 bonus-business/src/main/resources/mapper/DayPlanMapper.xml diff --git a/bonus-business/src/main/java/com/bonus/digital/controller/DayPlanController.java b/bonus-business/src/main/java/com/bonus/digital/controller/DayPlanController.java index b20434c..803af88 100644 --- a/bonus-business/src/main/java/com/bonus/digital/controller/DayPlanController.java +++ b/bonus-business/src/main/java/com/bonus/digital/controller/DayPlanController.java @@ -1,4 +1,3 @@ -/* package com.bonus.digital.controller; import com.bonus.business.controller.tool.MonthPlanExcelExporter; @@ -11,7 +10,6 @@ import com.bonus.digital.dao.DayPlanVo; import com.bonus.digital.dao.ExportMonthPlanPersonVo; import com.bonus.digital.dao.MonthlyPlanVo; import com.bonus.digital.service.DayPlanService; -import com.bonus.digital.service.MonthlyPlanService; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; @@ -24,11 +22,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; -*/ -/** - * @author 马三炮 - * @date 2025/12/16 - *//* @Slf4j @RestController @@ -38,12 +31,8 @@ public class DayPlanController extends BaseController { @Resource private DayPlanService dayPlanService; - */ -/** - * 月计划列表 - *//* - - @PreAuthorize("@ss.hasPermi('monthly:plan:list')") + //日计划列表 + @PreAuthorize("@ss.hasPermi('day:plan:list')") @GetMapping("/getDayPlanList") public TableDataInfo getMonthlyPlanList(DayPlanVo dayPlanVo) { try { @@ -55,16 +44,12 @@ public class DayPlanController extends BaseController { } } - */ -/** - * 新增月计划 - *//* - - @PreAuthorize("@ss.hasPermi('monthly:plan:add')") - @PostMapping("/addMonthlyPlan") - public AjaxResult addMonthlyPlan(MonthlyPlanVo monthlyPlanVo) { + //新增日计划 + @PreAuthorize("@ss.hasPermi('day:plan:add')") + @PostMapping("/addDayPlan") + public AjaxResult addMonthlyPlan(DayPlanVo dayPlanVo) { try { - int res = dayPlanService.addMonthlyPlanList(monthlyPlanVo); + int res = dayPlanService.addMonthlyPlan(dayPlanVo); if (res > 0) { return AjaxResult.success(); } else { @@ -75,16 +60,12 @@ public class DayPlanController extends BaseController { } } - */ -/** - * 删除月计划 - *//* - - @PreAuthorize("@ss.hasPermi('monthly:plan:del')") - @PostMapping("/delMonthlyPlan") - public AjaxResult delMonthlyPlan(MonthlyPlanVo monthlyPlanVo) { + //删除日计划 + @PreAuthorize("@ss.hasPermi('day:plan:del')") + @PostMapping("/delDayPlan") + public AjaxResult delMonthlyPlan(DayPlanVo dayPlanVo) { try { - int res = dayPlanService.delMonthlyPlanList(monthlyPlanVo); + int res = dayPlanService.delDayPlan(dayPlanVo); if (res > 0) { return AjaxResult.success(); } else { @@ -95,16 +76,12 @@ public class DayPlanController extends BaseController { } } - */ -/** - * 修改月计划 - *//* - - @PreAuthorize("@ss.hasPermi('monthly:plan:update')") - @PostMapping("/updateMonthlyPlan") - public AjaxResult updateMonthlyPlan(MonthlyPlanVo monthlyPlanVo) { + // 修改日计划 + @PreAuthorize("@ss.hasPermi('day:plan:update')") + @PostMapping("/updateDayPlan") + public AjaxResult updateMonthlyPlan(DayPlanVo dayPlanVo) { try { - int res = dayPlanService.updateMonthlyPlan(monthlyPlanVo); + int res = dayPlanService.updateDayPlan(dayPlanVo); if (res > 0) { return AjaxResult.success(); } else { @@ -114,13 +91,4 @@ public class DayPlanController extends BaseController { return AjaxResult.error("系统异常,请联系管理员"); } } - - @Log(title = "导出人员安排表", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('monthly:plan:export')") - @PostMapping("/export") - public void export(HttpServletResponse response, MonthlyPlanVo monthlyPlanVo) throws IOException { - List list = dayPlanService.exportMonthlyPlanPerson(monthlyPlanVo); - MonthPlanExcelExporter.exportToExcel(response, list, 2025, 10, "10月运检人员安排"); - } } -*/ diff --git a/bonus-business/src/main/java/com/bonus/digital/controller/PersonnelController.java b/bonus-business/src/main/java/com/bonus/digital/controller/PersonnelController.java index ab8aa6e..434525c 100644 --- a/bonus-business/src/main/java/com/bonus/digital/controller/PersonnelController.java +++ b/bonus-business/src/main/java/com/bonus/digital/controller/PersonnelController.java @@ -4,6 +4,7 @@ import com.bonus.common.core.controller.BaseController; import com.bonus.common.core.domain.AjaxResult; import com.bonus.common.core.page.TableDataInfo; import com.bonus.digital.dao.InspectionStationVo; +import com.bonus.digital.dao.PersonnelClassificationVo; import com.bonus.digital.dao.PersonnelVo; import com.bonus.digital.dao.SelectDto; import com.bonus.digital.service.PersonnelService; @@ -41,6 +42,8 @@ public class PersonnelController extends BaseController { } } + //人员所属下拉 + //0:运检站1:项目部 @GetMapping("/getInspectionStationSelect") public AjaxResult getInspectionStationSelect(InspectionStationVo vo) { try { @@ -50,6 +53,9 @@ public class PersonnelController extends BaseController { return AjaxResult.error("接口异常"); } } + + //人员性质/人员分类/岗位下拉 + // 0:人员分类1:人员性质2:岗位列表 @GetMapping("/getPersonnelClassificationSelect") public AjaxResult getPersonnelClassificationSelect(InspectionStationVo vo) { try { diff --git a/bonus-business/src/main/java/com/bonus/digital/dao/DayPlanVo.java b/bonus-business/src/main/java/com/bonus/digital/dao/DayPlanVo.java index cf2357b..e5e3727 100644 --- a/bonus-business/src/main/java/com/bonus/digital/dao/DayPlanVo.java +++ b/bonus-business/src/main/java/com/bonus/digital/dao/DayPlanVo.java @@ -144,7 +144,7 @@ public class DayPlanVo { /** * 创建时间 */ - private String createTime; + private Date createTime; /** * 修改人 diff --git a/bonus-business/src/main/java/com/bonus/digital/dao/PersonnelVo.java b/bonus-business/src/main/java/com/bonus/digital/dao/PersonnelVo.java index cafe108..36c77d7 100644 --- a/bonus-business/src/main/java/com/bonus/digital/dao/PersonnelVo.java +++ b/bonus-business/src/main/java/com/bonus/digital/dao/PersonnelVo.java @@ -15,80 +15,80 @@ public class PersonnelVo { /** * 人员id */ - private int id; + private Integer id; /** * 人员所属 */ - private int inspectionStationId; + private Integer inspectionStationId; /** * 单位名称 */ - private String inspectionStationName; + private String inspectionStationName; /** * 姓名 */ - private String name; + private String name; /** * 性别 */ - private String sex; + private String sex; /** * 电话 */ - private String phone; + private String phone; /** * 岗位 */ - private int positionId; + private Integer positionId; /** * 岗位 */ - private String positionName; + private String positionName; /** * 人员性质 */ - private int personnelNatureId; + private Integer personnelNatureId; /** * 人员性质 */ - private String personnelNatureName; + private String personnelNatureName; /** * 人员分类 */ - private int personnelClassificationId; + private Integer personnelClassificationId; /** * 人员分类 */ - private String personnelClassificationName; + private String personnelClassificationName; /** * 长期借调1是0否 */ - private String longTermSecondment; + private String longTermSecondment; /** * 是否有效1有效0无效 */ - private String isActive; + private String isActive; /** * 创建人 */ - private String createUser; + private String createUser; /** * 创建时间 */ diff --git a/bonus-business/src/main/java/com/bonus/digital/mapper/DayPlanMapper.java b/bonus-business/src/main/java/com/bonus/digital/mapper/DayPlanMapper.java new file mode 100644 index 0000000..4ba191e --- /dev/null +++ b/bonus-business/src/main/java/com/bonus/digital/mapper/DayPlanMapper.java @@ -0,0 +1,21 @@ +package com.bonus.digital.mapper; + +import com.bonus.digital.dao.DayPlanVo; +import com.bonus.digital.dao.MonthlyPlanVo; + +import java.util.List; + +/** + * @Author:liang.chao + * @Date:2025/12/18 - 13:19 + */ +public interface DayPlanMapper { + + Integer addMonthlyPlan(DayPlanVo dayPlanVo); + + Integer delDayPlan(DayPlanVo dayPlanVo); + + Integer updateDayPlan(DayPlanVo dayPlanVo); + + List getDayPlanList(DayPlanVo dayPlanVo); +} diff --git a/bonus-business/src/main/java/com/bonus/digital/mapper/MonthlyPlanMapper.java b/bonus-business/src/main/java/com/bonus/digital/mapper/MonthlyPlanMapper.java index 976372a..8923447 100644 --- a/bonus-business/src/main/java/com/bonus/digital/mapper/MonthlyPlanMapper.java +++ b/bonus-business/src/main/java/com/bonus/digital/mapper/MonthlyPlanMapper.java @@ -52,7 +52,5 @@ public interface MonthlyPlanMapper { */ int updateMonthlyPlan(MonthlyPlanVo monthlyPlanVo); - List getMonthlyPlanPerson(MonthlyPlanVo monthlyPlanVo); - List getPlanMajorListByMonth(MonthlyPlanVo monthlyPlanVo); } diff --git a/bonus-business/src/main/java/com/bonus/digital/mapper/PersonnelMapper.java b/bonus-business/src/main/java/com/bonus/digital/mapper/PersonnelMapper.java index c2bbe91..13c91fc 100644 --- a/bonus-business/src/main/java/com/bonus/digital/mapper/PersonnelMapper.java +++ b/bonus-business/src/main/java/com/bonus/digital/mapper/PersonnelMapper.java @@ -30,5 +30,5 @@ public interface PersonnelMapper { List getInspectionStationSelect(@Param("category") String category); - List getPersonnelClassificationSelect(String category); + List getPersonnelClassificationSelect(@Param("category") String category); } diff --git a/bonus-business/src/main/java/com/bonus/digital/service/DayPlanService.java b/bonus-business/src/main/java/com/bonus/digital/service/DayPlanService.java index 9ffe164..4e2967b 100644 --- a/bonus-business/src/main/java/com/bonus/digital/service/DayPlanService.java +++ b/bonus-business/src/main/java/com/bonus/digital/service/DayPlanService.java @@ -1,9 +1,21 @@ package com.bonus.digital.service; +import com.bonus.digital.dao.DayPlanVo; +import com.bonus.digital.dao.MonthlyPlanVo; + +import java.util.List; + /** * @Author:liang.chao * @Date:2025/12/18 - 10:48 */ public interface DayPlanService { + int addMonthlyPlan(DayPlanVo dayPlanVo); + + int delDayPlan(DayPlanVo dayPlanVo); + + int updateDayPlan(DayPlanVo dayPlanVo); + + List getDayPlanList(DayPlanVo dayPlanVo); } diff --git a/bonus-business/src/main/java/com/bonus/digital/service/impl/DayPlanServiceImpl.java b/bonus-business/src/main/java/com/bonus/digital/service/impl/DayPlanServiceImpl.java index be59525..823696b 100644 --- a/bonus-business/src/main/java/com/bonus/digital/service/impl/DayPlanServiceImpl.java +++ b/bonus-business/src/main/java/com/bonus/digital/service/impl/DayPlanServiceImpl.java @@ -1,12 +1,43 @@ package com.bonus.digital.service.impl; +import com.bonus.common.utils.SecurityUtils; +import com.bonus.digital.dao.DayPlanVo; +import com.bonus.digital.dao.MonthlyPlanVo; +import com.bonus.digital.mapper.DayPlanMapper; import com.bonus.digital.service.DayPlanService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + /** * @Author:liang.chao * @Date:2025/12/18 - 10:48 */ @Service public class DayPlanServiceImpl implements DayPlanService { + @Resource + private DayPlanMapper dayPlanMapper; + @Override + public int addMonthlyPlan(DayPlanVo dayPlanVo) { + dayPlanVo.setCreateUser(SecurityUtils.getUserId().toString()); + dayPlanVo.setCreateTime(new Date()); + return dayPlanMapper.addMonthlyPlan(dayPlanVo); + } + + @Override + public int delDayPlan(DayPlanVo dayPlanVo) { + return dayPlanMapper.delDayPlan(dayPlanVo); + } + + @Override + public int updateDayPlan(DayPlanVo dayPlanVo) { + return dayPlanMapper.updateDayPlan(dayPlanVo); + } + + @Override + public List getDayPlanList(DayPlanVo dayPlanVo) { + return dayPlanMapper.getDayPlanList(dayPlanVo); + } } diff --git a/bonus-business/src/main/resources/mapper/DayPlanMapper.xml b/bonus-business/src/main/resources/mapper/DayPlanMapper.xml new file mode 100644 index 0000000..bb818b7 --- /dev/null +++ b/bonus-business/src/main/resources/mapper/DayPlanMapper.xml @@ -0,0 +1,104 @@ + + + + + + INSERT INTO tb_day_plan + + day_plan, + planned_workload, + proposed_personnel, + proposed_proficient_personnel, + proposed_proficient_day, + proposed_assistance_personnel, + proposed_assistance_day, + proposed_long_time_car, + proposed_temporary_car, + proposed_sub_car, + actual_proficient_personnel, + actual_assistance_personnel, + actual_personnel, + actual_long_time_car, + actual_temporary_car, + actual_sub_car, + actual_work_content, + actual_workload, + completion_percentage, + plan_completion_status, + plan_changes, + create_user, + create_time, + status, + + + #{dayPlan}, + #{plannedWorkload}, + #{proposedPersonnel}, + #{proposedProficientPersonnel}, + #{proposedProficientDay}, + #{proposedAssistancePersonnel}, + #{proposedAssistanceDay}, + #{proposedLongTimeCar}, + #{proposedTemporaryCar}, + #{proposedSubCar}, + #{actualProficientPersonnel}, + #{actualAssistancePersonnel}, + #{actualPersonnel}, + #{actualLongTimeCar}, + #{actualTemporaryCar}, + #{actualSubCar}, + #{actualWorkContent}, + #{actualWorkload}, + #{completionPercentage}, + #{planCompletionStatus}, + #{planChanges}, + #{createUser}, + #{createTime}, + #{status}, + + + + UPDATE tb_day_plan + + monthly_plan_id = #{monthlyPlanId}, + day_plan = #{dayPlan}, + planned_workload = #{plannedWorkload}, + proposed_personnel = #{proposedPersonnel}, + proposed_proficient_personnel = #{proposedProficientPersonnel}, + proposed_proficient_day = #{proposedProficientDay}, + proposed_assistance_personnel = #{proposedAssistancePersonnel}, + proposed_assistance_day = #{proposedAssistanceDay}, + proposed_long_time_car = #{proposedLongTimeCar}, + proposed_temporary_car = #{proposedTemporaryCar}, + proposed_sub_car = #{proposedSubCar}, + actual_proficient_personnel = #{actualProficientPersonnel}, + actual_assistance_personnel = #{actualAssistancePersonnel}, + actual_personnel = #{actualPersonnel}, + actual_long_time_car = #{actualLongTimeCar}, + actual_temporary_car = #{actualTemporaryCar}, + actual_sub_car = #{actualSubCar}, + actual_work_content = #{actualWorkContent}, + actual_workload = #{actualWorkload}, + completion_percentage = #{completionPercentage}, + plan_completion_status = #{planCompletionStatus}, + plan_changes = #{planChanges}, + update_time = #{updateTime}, + update_user = #{updateUser}, + status = #{status}, + + WHERE day_plan_id = #{dayPlanId} + + + update tb_day_plan set is_active = '0' where day_plan_id = #{dayPlanId} + + + diff --git a/bonus-business/src/main/resources/mapper/MonthPlanMapper.xml b/bonus-business/src/main/resources/mapper/MonthPlanMapper.xml index b66c4ae..7d303b2 100644 --- a/bonus-business/src/main/resources/mapper/MonthPlanMapper.xml +++ b/bonus-business/src/main/resources/mapper/MonthPlanMapper.xml @@ -117,17 +117,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tmp.actual_working_day from tb_monthly_plan tmp left join tb_plan_major tpm on tmp.plan_major_id = tpm.plan_major_id - left join tb_plan_major tpm2 on tmp.plan_major_id = tpm2.plan_major_id - left join tb_plan_major tpm3 on tmp.plan_major_id = tpm3.plan_major_id where tmp.is_active = '1' - - select tis.id, tis.inspection_station_id as inspectionStationId, + tis2.inspection_station_name as inspectionStationName, tis.name, tis.sex, tis.phone, diff --git a/bonus-business/src/main/resources/mapper/PlanManagementMapper.xml b/bonus-business/src/main/resources/mapper/PlanManagementMapper.xml index 9cddc91..9fffa57 100644 --- a/bonus-business/src/main/resources/mapper/PlanManagementMapper.xml +++ b/bonus-business/src/main/resources/mapper/PlanManagementMapper.xml @@ -47,16 +47,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT - * + tdp.* FROM tb_day_plan tdp LEFT JOIN tb_monthly_plan tmp ON tdp.monthly_plan_id = tmp.monthly_plan_id LEFT JOIN tb_plan_management tpm ON tmp.plan_management_id = tpm.plan_management_id + WHERE + tdp.is_active = '1' + + AND DATE_FORMAT( tdp.day_plan, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} + diff --git a/bonus-business/src/main/resources/mapper/PersonnalMapper.xml b/bonus-business/src/main/resources/mapper/PersonnalMapper.xml index 652f0d4..70be471 100644 --- a/bonus-business/src/main/resources/mapper/PersonnalMapper.xml +++ b/bonus-business/src/main/resources/mapper/PersonnalMapper.xml @@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update tb_personnel - inspectionStationId=#{inspectionStationId}, + inspection_station_id = #{inspectionStationId}, NAME=#{name}, @@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time=#{updateTime}, - where personnel_classification_id = #{personnelClassificationId} + where id = #{id} update tb_personnel set is_active ='0' where id = #{id} @@ -92,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + and tis.is_active = '1'