Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

zhangcl 3 dni temu
rodzic
commit
d758efdea8

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/qhse/measure/vo/IotMeasureBookSaveReqVO.java

@@ -17,6 +17,7 @@ public class IotMeasureBookSaveReqVO {
     private String measureCode;
 
     @Schema(description = "序列号")
+    @NotEmpty(message = "序列号不能为空")
     private String serialNo;
 
     @Schema(description = "计量器具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")

+ 10 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/qhse/report/QhseMonthReportController.java

@@ -11,6 +11,8 @@ import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthRepo
 import cn.iocoder.yudao.module.pms.controller.admin.qhse.report.vo.QhseMonthReportSaveReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.report.QhseMonthReportDO;
 import cn.iocoder.yudao.module.pms.service.qhse.report.QhseMonthReportService;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
 import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
 import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import io.swagger.v3.oas.annotations.Operation;
@@ -43,6 +45,8 @@ public class QhseMonthReportController {
     private QhseMonthReportService qhseMonthReportService;
     @Autowired
     private AdminUserApi adminUserApi;
+    @Autowired
+    private DeptApi deptApi;
 
     @PostMapping("/create")
     @Operation(summary = "创建资料")
@@ -90,6 +94,12 @@ public class QhseMonthReportController {
                 if (Objects.nonNull(user)){
                     qhseMonthReportRespVO.setPersonName(user.getNickname());
                 }
+            }
+            if (Objects.nonNull(qhseMonthReportRespVO.getDeptId())){
+                DeptRespDTO dept = deptApi.getDept(qhseMonthReportRespVO.getDeptId());
+                if (Objects.nonNull(dept)){
+                    qhseMonthReportRespVO.setDeptName(dept.getName());
+                }
             }
              return qhseMonthReportRespVO;
         }).collect(Collectors.toList());

+ 2 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/qhse/report/vo/QhseMonthReportRespVO.java

@@ -157,4 +157,6 @@ public class QhseMonthReportRespVO {
 
     @Schema(description = "工单填报人")
     private String personName;
+
+    private String deptName;
 }

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/qhse/QhseMonthReportMapper.xml → yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/QhseMonthReportMapper.xml

@@ -6,7 +6,7 @@
         一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
         无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
-        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/1234
      -->
 
 
@@ -15,7 +15,7 @@
         select distinct year_months,'科瑞石油技术' as title from rq_qhse_month_report finall
         <where>
             <if test="reqVO.yearMonths!=null and reqVO.yearMonths!=''">
-                and finall.device_name LIKE CONCAT('%',#{reqVO.deviceName},'%')
+                and finall.year_months LIKE CONCAT('%',#{reqVO.yearMonths},'%')
             </if>
             <if test="reqVO.createTime != null and reqVO.createTime.length > 0">
                 <choose>