lxy_01 преди 2 седмици
родител
ревизия
841e0150c4

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/MealApplicationsController.java

@@ -170,7 +170,7 @@ public class MealApplicationsController {
     }
 
     @RequestMapping("/getMealApplicationList")
-    private HttpRespMsg getMealApplicationList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize,Integer mealTypeId){
+    public HttpRespMsg getMealApplicationList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize,Integer mealTypeId){
         return  mealApplicationsService.getMealApplicationList(deptIds,userId,startDate,endDate,pageIndex,pageSize,mealTypeId);
     }
 

+ 10 - 4
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/MealTypesController.java

@@ -3,16 +3,16 @@ package com.management.platform.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.MealTypes;
+import com.management.platform.mapper.MealApplicationsMapper;
+import com.management.platform.mapper.MealTypesMapper;
 import com.management.platform.service.MealApplicationsService;
 import com.management.platform.service.MealTypesService;
 import com.management.platform.util.HttpRespMsg;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import java.time.LocalDateTime;
 
 /**
@@ -26,9 +26,15 @@ import java.time.LocalDateTime;
 @RestController
 @RequestMapping("/meal-types")
 public class MealTypesController {
-    @Autowired
+    @Resource
     private MealTypesService mealTypesService;
 
+    @Resource
+    private MealTypesMapper mealTypesMapper;
+
+    @Resource
+    private MealApplicationsMapper mealApplicationsMapper;
+
     @RequestMapping("/getMeals")
     public HttpRespMsg getMeals(){
         HttpRespMsg msg = new HttpRespMsg();

+ 6 - 3
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/MealApplicationsServiceImpl.java

@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
 @Service
 public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMapper, MealApplications> implements MealApplicationsService {
 
-    @Autowired
+    @Resource
     private HttpServletRequest request;
     @Resource
     private MealApplicationsMapper mealApplicationsMapper;
@@ -278,6 +278,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
 
         mealList.addAll(totalList);
 
+
         List<Map<String,Object>> records= new ArrayList<>();
         if(!StringUtils.isEmpty(deptIds)){
             String[] split = deptIds.split(",");
@@ -286,7 +287,9 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
                 deptIdList.addAll(branchDepartment);
             }
         }
-
+        User count = new User();//小计一栏
+        count.setId("0");
+        userList.add(count);
 
         for(User itemUser:userList){
             Map<String,Object> map=new HashMap<>();
@@ -304,7 +307,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
 
             List<Map<String,Object>> personList = new ArrayList<>();
             if (personId!= null){
-                personList = totalList.stream().filter(p -> p.get("userId").equals(personId)).collect(Collectors.toList());
+                personList = mealList.stream().filter(p -> p.get("userId").equals(personId)).collect(Collectors.toList());
             }
             map.put("personList",personList);
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/MealApplicationsMapper.xml

@@ -50,6 +50,8 @@
                 and ma.meal_type_id = #{mealTypeIdString}
             </if>
 
+        group by u.id, ma.application_date
+
     </select>
 
 </mapper>