Browse Source

解决返回数据部门名称为空问题

fuyuhchuan 1 year ago
parent
commit
a8515d8201

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionAttendanceService.java

@@ -21,5 +21,5 @@ public interface PatrolInspectionAttendanceService extends CrudService<PatrolIns
 
     void add(PatrolInspectionAttendance patrolInspectionAttendance);
 
-    String getDeptName(Long id);
+    String getDeptName(Integer id);
 }

+ 2 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAttendanceServiceImpl.java

@@ -74,7 +74,7 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
             Map<String, Object> map = new HashMap<>();
             map.put("id", attendance.getId());
             Long deptId = attendance.getDeptId();
-            String deptName = deptId != null ? getDeptName(deptId) : "";
+            String deptName = deptId != null ? getDeptName(Math.toIntExact(deptId)) : "";
             map.put("deptName", deptName);
             map.put("tenantId", attendance.getTenantId());
             map.put("operator", attendance.getOperator());
@@ -123,7 +123,7 @@ public class PatrolInspectionAttendanceServiceImpl extends AbstractCrudService<P
      * @return
      */
     @Override
-        public String getDeptName(Long id) {
+        public String getDeptName(Integer id) {
             String name = "";
             List<Map<String, Object>> deptList = remoteDeptService.getDeptList(SecurityUtils.getTenantId());
             for (int i = 0; i < deptList.size(); i++) {