Commit 68c7e7df4f2815f876c3b691e6082149e8c9f292
Merge branch 'dev'
Showing
4 changed files
with
22 additions
and
6 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/costfee/CostFeeController.java
| @@ -114,10 +114,15 @@ public class CostFeeController{ | @@ -114,10 +114,15 @@ public class CostFeeController{ | ||
| 114 | // 设置下载响应头 | 114 | // 设置下载响应头 |
| 115 | response.reset(); | 115 | response.reset(); |
| 116 | response.setContentType(EXCEL_MIME_TYPE); | 116 | response.setContentType(EXCEL_MIME_TYPE); |
| 117 | - // response.setCharacterEncoding("UTF-8"); | ||
| 118 | - String encodedName = URLEncoder.encode(downloadFileName, "UTF-8").replaceAll("\\+", "%20"); | ||
| 119 | - response.setHeader("Content-Disposition", "attachment;filename=" + encodedName); | ||
| 120 | - response.setHeader("Cache-Control", "no-store"); // 禁止缓存 | 117 | + // response.setCharacterEncoding("UTF-8"); |
| 118 | + String encodedName = URLEncoder.encode(downloadFileName, "UTF-8"); | ||
| 119 | + // 标准文件名编码(Chrome / Edge / Firefox 全兼容) | ||
| 120 | + response.setHeader("Content-Disposition", "attachment;filename*=UTF-8''" + encodedName); | ||
| 121 | + // 浏览器缓存配置(必须) | ||
| 122 | + response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); | ||
| 123 | + response.setHeader("Pragma", "no-cache"); | ||
| 124 | + response.setHeader("Expires", "0"); | ||
| 125 | + | ||
| 121 | 126 | ||
| 122 | try (InputStream in = resource.getInputStream(); | 127 | try (InputStream in = resource.getInputStream(); |
| 123 | XSSFWorkbook workbook = new XSSFWorkbook(in); | 128 | XSSFWorkbook workbook = new XSSFWorkbook(in); |
| @@ -204,7 +209,7 @@ public class CostFeeController{ | @@ -204,7 +209,7 @@ public class CostFeeController{ | ||
| 204 | String unit = cell.getStringCellValue(); | 209 | String unit = cell.getStringCellValue(); |
| 205 | // 默认赋值【第一个单位】,你可以根据业务改成其他值 | 210 | // 默认赋值【第一个单位】,你可以根据业务改成其他值 |
| 206 | if (!StringUtils.isEmpty(unit)) { | 211 | if (!StringUtils.isEmpty(unit)) { |
| 207 | - cell.setCellValue(options.get(2)); | 212 | + cell.setCellValue(options.get(0)); |
| 208 | } | 213 | } |
| 209 | } | 214 | } |
| 210 | 215 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
| @@ -87,9 +87,11 @@ public interface ErrorCodeConstants { | @@ -87,9 +87,11 @@ public interface ErrorCodeConstants { | ||
| 87 | ErrorCode INSPECTION_CYCLE_ERROR = new ErrorCode(1-200-100-003, "获取两个时间之间间隔天数错误"); | 87 | ErrorCode INSPECTION_CYCLE_ERROR = new ErrorCode(1-200-100-003, "获取两个时间之间间隔天数错误"); |
| 88 | ErrorCode INSPECTION_PLAN_EXISTS = new ErrorCode(1-200-100-007, "道路对应类型已存在记录"); | 88 | ErrorCode INSPECTION_PLAN_EXISTS = new ErrorCode(1-200-100-007, "道路对应类型已存在记录"); |
| 89 | ErrorCode INSPECTION_PLAN_NOT_ALLOW_DELETE = new ErrorCode(1-100-007-005, "计划已开始执行不能删除"); | 89 | ErrorCode INSPECTION_PLAN_NOT_ALLOW_DELETE = new ErrorCode(1-100-007-005, "计划已开始执行不能删除"); |
| 90 | + ErrorCode INSPECTION_COMMIT_PLAN__EXISTS = new ErrorCode(1-100-007-005, "巡检计划明细已提交"); | ||
| 90 | 91 | ||
| 91 | // ========== 养护计划汇总 TODO 补充编号 ========== | 92 | // ========== 养护计划汇总 TODO 补充编号 ========== |
| 92 | ErrorCode MAINTAIN_PLAN_NOT_EXISTS = new ErrorCode(1-100-007-001, "养护计划汇总不存在"); | 93 | ErrorCode MAINTAIN_PLAN_NOT_EXISTS = new ErrorCode(1-100-007-001, "养护计划汇总不存在"); |
| 94 | + ErrorCode MAINTAIN_COMMIT_PLAN__EXISTS = new ErrorCode(1-100-007-007, "养护计划明细已提交"); | ||
| 93 | 95 | ||
| 94 | //========== 频次 TODO 补充编号 ========== | 96 | //========== 频次 TODO 补充编号 ========== |
| 95 | ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-100-007-001, "养护频次已存在"); | 97 | ErrorCode PLAN_RATE_EXISTS = new ErrorCode(1-100-007-001, "养护频次已存在"); |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| @@ -18,6 +18,7 @@ import com.zteits.urbanops.module.garden.convert.AppGardenWorkOrderConvert; | @@ -18,6 +18,7 @@ import com.zteits.urbanops.module.garden.convert.AppGardenWorkOrderConvert; | ||
| 18 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; | 18 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; |
| 19 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | 19 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; |
| 20 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; | 20 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 21 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommitDO; | ||
| 21 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; | 22 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; |
| 22 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanCommitMapper; | 23 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanCommitMapper; |
| 23 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; | 24 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; |
| @@ -43,7 +44,7 @@ import java.util.*; | @@ -43,7 +44,7 @@ import java.util.*; | ||
| 43 | import java.util.stream.Collectors; | 44 | import java.util.stream.Collectors; |
| 44 | 45 | ||
| 45 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | 46 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 46 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.INSPECTION_PLAN_NOT_EXISTS; | 47 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; |
| 47 | 48 | ||
| 48 | 49 | ||
| 49 | /** | 50 | /** |
| @@ -76,6 +77,10 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ | @@ -76,6 +77,10 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ | ||
| 76 | 77 | ||
| 77 | @Override | 78 | @Override |
| 78 | public Long createInspectionPlanCommit(InspectionPlanCommitSaveReqVO createReqVO) { | 79 | public Long createInspectionPlanCommit(InspectionPlanCommitSaveReqVO createReqVO) { |
| 80 | + List<InspectionPlanCommitDO> list = inspectionPlanCommitMapper.selectList(InspectionPlanCommitDO::getPlanNo, createReqVO.getPlanNo()); | ||
| 81 | + if(!CollectionUtils.isEmpty(list)){ | ||
| 82 | + throw exception(INSPECTION_COMMIT_PLAN__EXISTS); | ||
| 83 | + } | ||
| 79 | // 插入 | 84 | // 插入 |
| 80 | InspectionPlanCommitDO inspectionPlanCommit = BeanUtils.toBean(createReqVO, InspectionPlanCommitDO.class); | 85 | InspectionPlanCommitDO inspectionPlanCommit = BeanUtils.toBean(createReqVO, InspectionPlanCommitDO.class); |
| 81 | inspectionPlanCommitMapper.insert(inspectionPlanCommit); | 86 | inspectionPlanCommitMapper.insert(inspectionPlanCommit); |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitServiceImpl.java
| @@ -63,6 +63,10 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService | @@ -63,6 +63,10 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService | ||
| 63 | 63 | ||
| 64 | @Override | 64 | @Override |
| 65 | public Long createMaintainPlanCommit(MaintainPlanCommitSaveReqVO createReqVO) { | 65 | public Long createMaintainPlanCommit(MaintainPlanCommitSaveReqVO createReqVO) { |
| 66 | + List<MaintainPlanCommitDO> list = maintainPlanCommitMapper.selectList(MaintainPlanCommitDO::getPlanNo, createReqVO.getPlanNo()); | ||
| 67 | + if(!CollectionUtils.isEmpty(list)){ | ||
| 68 | + throw exception(MAINTAIN_PLAN_NOT_EXISTS); | ||
| 69 | + } | ||
| 66 | // 插入 | 70 | // 插入 |
| 67 | MaintainPlanCommitDO maintainPlanCommit = BeanUtils.toBean(createReqVO, MaintainPlanCommitDO.class); | 71 | MaintainPlanCommitDO maintainPlanCommit = BeanUtils.toBean(createReqVO, MaintainPlanCommitDO.class); |
| 68 | maintainPlanCommitMapper.insert(maintainPlanCommit); | 72 | maintainPlanCommitMapper.insert(maintainPlanCommit); |