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 | 114 | // 设置下载响应头 |
| 115 | 115 | response.reset(); |
| 116 | 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 | 127 | try (InputStream in = resource.getInputStream(); |
| 123 | 128 | XSSFWorkbook workbook = new XSSFWorkbook(in); |
| ... | ... | @@ -204,7 +209,7 @@ public class CostFeeController{ |
| 204 | 209 | String unit = cell.getStringCellValue(); |
| 205 | 210 | // 默认赋值【第一个单位】,你可以根据业务改成其他值 |
| 206 | 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 | 87 | ErrorCode INSPECTION_CYCLE_ERROR = new ErrorCode(1-200-100-003, "获取两个时间之间间隔天数错误"); |
| 88 | 88 | ErrorCode INSPECTION_PLAN_EXISTS = new ErrorCode(1-200-100-007, "道路对应类型已存在记录"); |
| 89 | 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 | 92 | // ========== 养护计划汇总 TODO 补充编号 ========== |
| 92 | 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 | 96 | //========== 频次 TODO 补充编号 ========== |
| 95 | 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 | 18 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanCommitDO; |
| 19 | 19 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; |
| 20 | 20 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 21 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommitDO; | |
| 21 | 22 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; |
| 22 | 23 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanCommitMapper; |
| 23 | 24 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; |
| ... | ... | @@ -43,7 +44,7 @@ import java.util.*; |
| 43 | 44 | import java.util.stream.Collectors; |
| 44 | 45 | |
| 45 | 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 | 77 | |
| 77 | 78 | @Override |
| 78 | 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 | 85 | InspectionPlanCommitDO inspectionPlanCommit = BeanUtils.toBean(createReqVO, InspectionPlanCommitDO.class); |
| 81 | 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 | 63 | |
| 64 | 64 | @Override |
| 65 | 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 | 71 | MaintainPlanCommitDO maintainPlanCommit = BeanUtils.toBean(createReqVO, MaintainPlanCommitDO.class); |
| 68 | 72 | maintainPlanCommitMapper.insert(maintainPlanCommit); | ... | ... |