Commit 12ee5aa5fb734a14a283d816dd8581f285d8742f
1 parent
ad64c285
任务趋势图返回时间格式修改
Showing
4 changed files
with
23 additions
and
5 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/homepage/vo/CommitTaskStatisticsRespVo.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialSaveReqVO.java
| ... | ... | @@ -69,7 +69,6 @@ public class MaterialSaveReqVO { |
| 69 | 69 | private String unitName; |
| 70 | 70 | |
| 71 | 71 | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") |
| 72 | - @NotEmpty(message = "备注不能为空") | |
| 73 | 72 | private String remark; |
| 74 | 73 | |
| 75 | 74 | @Schema(description = "是否关联工单:0-否,1-是") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/homepage/MaintainSummaryServiceImpl.java
| ... | ... | @@ -138,7 +138,7 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 138 | 138 | // 遍历默认数据列表,匹配并赋值巡检计划数据 |
| 139 | 139 | for (CommitTaskStatisticsRespVo defaultVo : defaultVoList) { |
| 140 | 140 | // 构建默认VO的唯一标识(与巡检计划的标识保持一致) |
| 141 | - String matchKey = defaultVo.getDateValue() + "_" + defaultVo.getBusiLine(); | |
| 141 | + String matchKey = defaultVo.getCurrentDate() + "_" + defaultVo.getBusiLine(); | |
| 142 | 142 | if (inspectionMap.containsKey(matchKey)) { |
| 143 | 143 | CommitTaskStatisticsRespVo inspectVo = inspectionMap.get(matchKey); |
| 144 | 144 | defaultVo.setInspectionPlanNum(inspectVo.getInspectionPlanNum()); |
| ... | ... | @@ -164,7 +164,7 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 164 | 164 | |
| 165 | 165 | // 遍历默认数据列表,匹配并赋值养护计划数据 |
| 166 | 166 | for (CommitTaskStatisticsRespVo defaultVo : defaultVoList) { |
| 167 | - String matchKey = defaultVo.getDateValue() + "_" + defaultVo.getBusiLine(); | |
| 167 | + String matchKey = defaultVo.getCurrentDate() + "_" + defaultVo.getBusiLine(); | |
| 168 | 168 | if (maintainMap.containsKey(matchKey)) { |
| 169 | 169 | CommitTaskStatisticsRespVo maintainVo = maintainMap.get(matchKey); |
| 170 | 170 | // 赋值: |
| ... | ... | @@ -185,7 +185,12 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 185 | 185 | |
| 186 | 186 | chartData.put("data", defaultData); |
| 187 | 187 | //日期集合 |
| 188 | - chartData.put("timeData",days); | |
| 188 | + List<String> monthDays = days.stream() | |
| 189 | + .map(dateStr -> dateStr.substring(5, 7) + "." + dateStr.substring(8)) | |
| 190 | + .collect(Collectors.toList()); | |
| 191 | + chartData.put("timeData",monthDays); | |
| 192 | + | |
| 193 | + | |
| 189 | 194 | return chartData; |
| 190 | 195 | } |
| 191 | 196 | /** |
| ... | ... | @@ -562,7 +567,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { |
| 562 | 567 | //1、日期赋值 |
| 563 | 568 | days.forEach(dayy->{ |
| 564 | 569 | CommitTaskStatisticsRespVo vo = new CommitTaskStatisticsRespVo(); |
| 565 | - vo.setDateValue(dayy); | |
| 570 | + vo.setDateValue(dayy.substring(5).replace("-",".")); | |
| 571 | + vo.setCurrentDate(dayy); | |
| 566 | 572 | vo.setPlanNum(0); // 默认总数为0 |
| 567 | 573 | vo.setPlanFinishNum(0); |
| 568 | 574 | vo.setInspectionPlanNum(0); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.material; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 4 | +import com.zteits.urbanops.module.system.api.dept.DeptApi; | |
| 5 | +import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; | |
| 4 | 6 | import org.springframework.stereotype.Service; |
| 5 | 7 | import jakarta.annotation.Resource; |
| 6 | 8 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -17,6 +19,7 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo |
| 17 | 19 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 18 | 20 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; |
| 19 | 21 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; |
| 22 | +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getCompanyId; | |
| 20 | 23 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; |
| 21 | 24 | |
| 22 | 25 | /** |
| ... | ... | @@ -31,6 +34,9 @@ public class MaterialServiceImpl implements MaterialService { |
| 31 | 34 | @Resource |
| 32 | 35 | private MaterialMapper materialMapper; |
| 33 | 36 | |
| 37 | + @Resource | |
| 38 | + private DeptApi deptApi; | |
| 39 | + | |
| 34 | 40 | @Override |
| 35 | 41 | public Long createMaterial(MaterialSaveReqVO createReqVO) { |
| 36 | 42 | QueryWrapper<MaterialDO> queryWrapper = new QueryWrapper<>(); |
| ... | ... | @@ -46,6 +52,11 @@ public class MaterialServiceImpl implements MaterialService { |
| 46 | 52 | createReqVO.setFullCode(createReqVO.getTypeDetailId()+createReqVO.getMaterialCode()+createReqVO.getSpecCode()); |
| 47 | 53 | // 插入 |
| 48 | 54 | MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); |
| 55 | + material.setBelongCompanyId(getCompanyId()); | |
| 56 | + DeptRespDTO deptRespDTO = deptApi.getDept(getCompanyId()); | |
| 57 | + if (deptRespDTO != null) { | |
| 58 | + material.setBelongCompanyName(deptRespDTO.getName()); | |
| 59 | + } | |
| 49 | 60 | materialMapper.insert(material); |
| 50 | 61 | |
| 51 | 62 | // 返回 | ... | ... |