Browse Source

更改--字段使用错误

buzhanyi 8 months ago
parent
commit
56fd7a6273

+ 7 - 7
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/mapper/ManHourMapper.java

@@ -26,15 +26,15 @@ public interface ManHourMapper extends JpaRepository<ManHourInfoEntity, Integer>
             "man.start_date startDate,man.end_date endDate,man.create_time createTime,man.flow_task_status flowTaskStatus, " +
             "man.process_instance_id processInstanceId ,man.process_definition_id processDefinitionId " +
             "from man_hour_info man WHERE " +
-            "if( ?1 !='', (man.create_user = ?1 or man.ratify_user like %?1% ) , 1=1) and " +
-            "if( ?2 !='', man.flow_task_status = ?2 , 1=1) and " +
-            "if( ?3 !='', man.create_date >=?3 , 1=1) and " +
-            "if( ?4 !='', man.end_date <=?4 , 1=1)  order by man.create_date desc"
+            "if( ?1 !=null, (man.create_user = ?1 or man.ratify_user like %?1% ) , 1=1) and " +
+            "if( ?2 !='' , man.flow_task_status = ?2 , 1=1) and " +
+            "if( ?3 !=null, man.start_date >=?3 , 1=1) and " +
+            "if( ?4 !=null, man.end_date <=?4 , 1=1)  order by man.create_time desc"
             , countQuery = "SELECT count(1) from man_hour_info man WHERE  1=1 and " +
-            "if( ?1 !='', (man.create_user = ?1 or man.ratify_user like %?1% ) , 1=1) and " +
+            "if( ?1 !=null, (man.create_user = ?1 or man.ratify_user like %?1% ) , 1=1) and " +
             "if( ?2 !='', man.flow_task_status = ?2 , 1=1) and " +
-            "if( ?3 !='', man.create_date >=?3 , 1=1) and " +
-            "if( ?4 !='', man.end_date <=?4 , 1=1)   "
+            "if( ?3 !=null, man.start_date >=?3 , 1=1) and " +
+            "if( ?4 !=null, man.end_date <=?4 , 1=1)   "
             , nativeQuery = true)
     Page<Map<String, String>> findManHourAll(String userId, Integer flowTaskStatus, Date createDate, String endDate, Pageable page);
 

+ 2 - 2
application-webadmin/src/main/java/com/ankaibei/workFlow/webadmin/ankaibei/service/impl/ManHourServiceImpl.java

@@ -71,12 +71,12 @@ public class ManHourServiceImpl implements ManHourService {
         return new ResMsg(CodeEnum.OK, ResMsg.getMap(manHourAll.map(map -> {
             Map<Object, Object> map1 = new HashMap<>(map);
             for (TaskInfoEntity task : finishedTasks) {
-                if (map1.get("taskId").equals(task.getTaskId())) {
+                if (map1.get("taskId").equals(task.getTaskId().toString())) {
                     map1.put("taskName", task.getTargetTask());
                     break;
                 }
             }
-            String projectId = map.get("projectName");
+            String projectId = map.get("projectId");
             for (ProjectInfoEntity projectInfo : projectInfos) {
                 if (Integer.valueOf(projectId).equals(projectInfo.getProjectId())) {
                     map1.put("projectName", projectInfo.getProjectName());