Commit 12ee5aa5fb734a14a283d816dd8581f285d8742f

Authored by wangqian
1 parent ad64c285

任务趋势图返回时间格式修改

urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/homepage/vo/CommitTaskStatisticsRespVo.java
@@ -13,6 +13,8 @@ public class CommitTaskStatisticsRespVo { @@ -13,6 +13,8 @@ public class CommitTaskStatisticsRespVo {
13 13
14 private String dateValue; 14 private String dateValue;
15 15
  16 + private String currentDate;
  17 +
16 private String busiLine; 18 private String busiLine;
17 19
18 private String busiLineName; 20 private String busiLineName;
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,7 +69,6 @@ public class MaterialSaveReqVO {
69 private String unitName; 69 private String unitName;
70 70
71 @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") 71 @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
72 - @NotEmpty(message = "备注不能为空")  
73 private String remark; 72 private String remark;
74 73
75 @Schema(description = "是否关联工单:0-否,1-是") 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,7 +138,7 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService {
138 // 遍历默认数据列表,匹配并赋值巡检计划数据 138 // 遍历默认数据列表,匹配并赋值巡检计划数据
139 for (CommitTaskStatisticsRespVo defaultVo : defaultVoList) { 139 for (CommitTaskStatisticsRespVo defaultVo : defaultVoList) {
140 // 构建默认VO的唯一标识(与巡检计划的标识保持一致) 140 // 构建默认VO的唯一标识(与巡检计划的标识保持一致)
141 - String matchKey = defaultVo.getDateValue() + "_" + defaultVo.getBusiLine(); 141 + String matchKey = defaultVo.getCurrentDate() + "_" + defaultVo.getBusiLine();
142 if (inspectionMap.containsKey(matchKey)) { 142 if (inspectionMap.containsKey(matchKey)) {
143 CommitTaskStatisticsRespVo inspectVo = inspectionMap.get(matchKey); 143 CommitTaskStatisticsRespVo inspectVo = inspectionMap.get(matchKey);
144 defaultVo.setInspectionPlanNum(inspectVo.getInspectionPlanNum()); 144 defaultVo.setInspectionPlanNum(inspectVo.getInspectionPlanNum());
@@ -164,7 +164,7 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { @@ -164,7 +164,7 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService {
164 164
165 // 遍历默认数据列表,匹配并赋值养护计划数据 165 // 遍历默认数据列表,匹配并赋值养护计划数据
166 for (CommitTaskStatisticsRespVo defaultVo : defaultVoList) { 166 for (CommitTaskStatisticsRespVo defaultVo : defaultVoList) {
167 - String matchKey = defaultVo.getDateValue() + "_" + defaultVo.getBusiLine(); 167 + String matchKey = defaultVo.getCurrentDate() + "_" + defaultVo.getBusiLine();
168 if (maintainMap.containsKey(matchKey)) { 168 if (maintainMap.containsKey(matchKey)) {
169 CommitTaskStatisticsRespVo maintainVo = maintainMap.get(matchKey); 169 CommitTaskStatisticsRespVo maintainVo = maintainMap.get(matchKey);
170 // 赋值: 170 // 赋值:
@@ -185,7 +185,12 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { @@ -185,7 +185,12 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService {
185 185
186 chartData.put("data", defaultData); 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 return chartData; 194 return chartData;
190 } 195 }
191 /** 196 /**
@@ -562,7 +567,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { @@ -562,7 +567,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService {
562 //1、日期赋值 567 //1、日期赋值
563 days.forEach(dayy->{ 568 days.forEach(dayy->{
564 CommitTaskStatisticsRespVo vo = new CommitTaskStatisticsRespVo(); 569 CommitTaskStatisticsRespVo vo = new CommitTaskStatisticsRespVo();
565 - vo.setDateValue(dayy); 570 + vo.setDateValue(dayy.substring(5).replace("-","."));
  571 + vo.setCurrentDate(dayy);
566 vo.setPlanNum(0); // 默认总数为0 572 vo.setPlanNum(0); // 默认总数为0
567 vo.setPlanFinishNum(0); 573 vo.setPlanFinishNum(0);
568 vo.setInspectionPlanNum(0); 574 vo.setInspectionPlanNum(0);
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java
1 package com.zteits.urbanops.module.garden.service.material; 1 package com.zteits.urbanops.module.garden.service.material;
2 2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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 import org.springframework.stereotype.Service; 6 import org.springframework.stereotype.Service;
5 import jakarta.annotation.Resource; 7 import jakarta.annotation.Resource;
6 import org.springframework.validation.annotation.Validated; 8 import org.springframework.validation.annotation.Validated;
@@ -17,6 +19,7 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo @@ -17,6 +19,7 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo
17 import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; 19 import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception;
18 import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; 20 import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0;
19 import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; 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 import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; 23 import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*;
21 24
22 /** 25 /**
@@ -31,6 +34,9 @@ public class MaterialServiceImpl implements MaterialService { @@ -31,6 +34,9 @@ public class MaterialServiceImpl implements MaterialService {
31 @Resource 34 @Resource
32 private MaterialMapper materialMapper; 35 private MaterialMapper materialMapper;
33 36
  37 + @Resource
  38 + private DeptApi deptApi;
  39 +
34 @Override 40 @Override
35 public Long createMaterial(MaterialSaveReqVO createReqVO) { 41 public Long createMaterial(MaterialSaveReqVO createReqVO) {
36 QueryWrapper<MaterialDO> queryWrapper = new QueryWrapper<>(); 42 QueryWrapper<MaterialDO> queryWrapper = new QueryWrapper<>();
@@ -46,6 +52,11 @@ public class MaterialServiceImpl implements MaterialService { @@ -46,6 +52,11 @@ public class MaterialServiceImpl implements MaterialService {
46 createReqVO.setFullCode(createReqVO.getTypeDetailId()+createReqVO.getMaterialCode()+createReqVO.getSpecCode()); 52 createReqVO.setFullCode(createReqVO.getTypeDetailId()+createReqVO.getMaterialCode()+createReqVO.getSpecCode());
47 // 插入 53 // 插入
48 MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); 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 materialMapper.insert(material); 60 materialMapper.insert(material);
50 61
51 // 返回 62 // 返回