bug修复

This commit is contained in:
马三炮 2025-12-30 15:38:22 +08:00
parent 3abb4bc6b4
commit 395c17e5cb
8 changed files with 27 additions and 3 deletions

View File

@ -54,7 +54,7 @@ public class DownloadController {
} }
@GetMapping(value = "monthReport") @PostMapping(value = "monthReport")
@ApiOperation(notes = "月报下载", value = "月报下载") @ApiOperation(notes = "月报下载", value = "月报下载")
public void downloadMonthReport(HttpServletRequest request, HttpServletResponse response, ParamsDto dto) { public void downloadMonthReport(HttpServletRequest request, HttpServletResponse response, ParamsDto dto) {
if(StringUtils.isEmpty(dto.getMonth())) { if(StringUtils.isEmpty(dto.getMonth())) {

View File

@ -73,8 +73,10 @@ public class MonthlyPlanController extends BaseController {
public AjaxResult addMonthlyPlan(@RequestBody List<MonthlyPlanVo> monthlyPlanVo) { public AjaxResult addMonthlyPlan(@RequestBody List<MonthlyPlanVo> monthlyPlanVo) {
try { try {
int res = monthlyPlanService.addMonthlyPlanList(monthlyPlanVo); int res = monthlyPlanService.addMonthlyPlanList(monthlyPlanVo);
if (res > 0) { if (res ==1) {
return AjaxResult.success(); return AjaxResult.success();
} else if (res ==2) {
return AjaxResult.error("已存在相同的月计划");
} else { } else {
return AjaxResult.error("新增失败"); return AjaxResult.error("新增失败");
} }

View File

@ -143,7 +143,7 @@ public class PlanManagementController extends BaseController {
} }
@ApiOperation("模板下载") @ApiOperation("模板下载")
@GetMapping("/downloadTeamExcel") @PostMapping("/downloadTeamExcel")
public void downloadTeamExcel(HttpServletRequest request, HttpServletResponse response) { public void downloadTeamExcel(HttpServletRequest request, HttpServletResponse response) {
InputStream inputStream = null; InputStream inputStream = null;
ServletOutputStream servletOutputStream = null; ServletOutputStream servletOutputStream = null;

View File

@ -1,5 +1,6 @@
package com.bonus.digital.dao; package com.bonus.digital.dao;
import com.bonus.common.annotation.Excel;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -19,21 +20,25 @@ public class PlanManagementVo {
/** /**
* 计划管理月份 * 计划管理月份
*/ */
@Excel(name = "月份")
private String planManagementMonth; private String planManagementMonth;
/** /**
* 项目名称 * 项目名称
*/ */
@Excel(name = "项目名称")
private String projectName; private String projectName;
/** /**
* 作业内容 * 作业内容
*/ */
@Excel(name = "作业内容")
private String workContent; private String workContent;
/** /**
* 实施部门 * 实施部门
*/ */
@Excel(name = "实施部门")
private Integer inspectionStationId; private Integer inspectionStationId;
/** /**
@ -44,21 +49,25 @@ public class PlanManagementVo {
/** /**
* 计划开始时间 * 计划开始时间
*/ */
@Excel(name = "计划开始时间")
private String stareDate; private String stareDate;
/** /**
* 计划结束时间 * 计划结束时间
*/ */
@Excel(name = "计划结束时间")
private String endDate; private String endDate;
/** /**
* 风险等级 * 风险等级
*/ */
@Excel(name = "风险等级")
private String riskLevel; private String riskLevel;
/** /**
* 备注 * 备注
*/ */
@Excel(name = "备注")
private String remark; private String remark;
/** /**

View File

@ -84,4 +84,6 @@ public interface MonthlyPlanMapper {
* @return * @return
*/ */
List<DayPlanVo> getDayPlanByMonthPlanId(MonthlyPlanVo monthlyPlanVo); List<DayPlanVo> getDayPlanByMonthPlanId(MonthlyPlanVo monthlyPlanVo);
MonthlyPlanVo getMonthlyPlan(MonthlyPlanVo monthlyPlanVo2);
} }

View File

@ -82,6 +82,10 @@ public class MonthlyPlanServiceImpl implements MonthlyPlanService {
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
monthlyPlanVo2.setCreateUser(userId.toString()); monthlyPlanVo2.setCreateUser(userId.toString());
monthlyPlanVo2.setCreateTime(new Date()); monthlyPlanVo2.setCreateTime(new Date());
MonthlyPlanVo monthlyPlan = monthlyPlanMapper.getMonthlyPlan(monthlyPlanVo2);
if (monthlyPlan!=null){
return 2;
}
monthlyPlanMapper.addMonthlyPlanList(monthlyPlanVo2); monthlyPlanMapper.addMonthlyPlanList(monthlyPlanVo2);
} }
return 1; return 1;

View File

@ -182,6 +182,9 @@
<if test="inspectionStationId!= null " > <if test="inspectionStationId!= null " >
AND tmp.inspectionStationId = #{inspectionStationId} AND tmp.inspectionStationId = #{inspectionStationId}
</if> </if>
<if test="workContent!= null " >
AND tmp.work_content = #{workContent}
</if>
</select> </select>
<select id="getWorkloadSummary" resultType="com.bonus.digital.dao.MonthlyPlanVo"> <select id="getWorkloadSummary" resultType="com.bonus.digital.dao.MonthlyPlanVo">

View File

@ -528,5 +528,9 @@
tdp.proposed_assistance_personnel AS proposedAssistancePersonnel tdp.proposed_assistance_personnel AS proposedAssistancePersonnel
from tb_day_plan tdp where monthly_plan_id=#{monthlyPlanId} and is_active ='1' from tb_day_plan tdp where monthly_plan_id=#{monthlyPlanId} and is_active ='1'
</select> </select>
<select id="getMonthlyPlan" resultType="com.bonus.digital.dao.MonthlyPlanVo">
select monthly_plan_id,monthly_plan from tb_monthly_plan
where plan_management_id = #{planManagementId} and monthly_plan = #{monthlyPlan} and is_active ='1'
</select>
</mapper> </mapper>