Yansen 2 years ago
parent
commit
cbef77398c

+ 16
- 16
src/main/java/com/yunzhi/inte/controller/PostsController.java View File

104
         return ResponseBean.success(posts);
104
         return ResponseBean.success(posts);
105
     }
105
     }
106
 
106
 
107
-//    /**
108
-//     * 更新数据
109
-//     *
110
-//     * @param posts 实例对象
111
-//     * @return 实例对象
112
-//     */
113
-//    @ApiOperation("更新数据")
114
-//    @PutMapping("/posts/{id}")
115
-//    public ResponseBean edit(@ApiParam("对象实体") @RequestBody Posts posts,
116
-//                             @ApiParam("对象ID") @PathVariable Integer id) throws Exception {
117
-//
118
-//        posts.setId(id);
119
-//
120
-//        postsService.updateById(posts);
121
-//        return ResponseBean.success(posts);
122
-//    }
107
+    /**
108
+     * 更新数据
109
+     *
110
+     * @param posts 实例对象
111
+     * @return 实例对象
112
+     */
113
+    @ApiOperation("更新数据")
114
+    @PutMapping("/posts/{id}")
115
+    public ResponseBean edit(@ApiParam("对象实体") @RequestBody Posts posts,
116
+                             @ApiParam("对象ID") @PathVariable Integer id) throws Exception {
117
+
118
+        posts.setId(id);
119
+
120
+        postsService.updateById(posts);
121
+        return ResponseBean.success(posts);
122
+    }
123
 
123
 
124
     /**
124
     /**
125
      * 通过主键删除数据
125
      * 通过主键删除数据

+ 5
- 5
src/main/java/com/yunzhi/inte/controller/StatisController.java View File

3
 import com.yunzhi.inte.common.BaseController;
3
 import com.yunzhi.inte.common.BaseController;
4
 import com.yunzhi.inte.common.DateUtils;
4
 import com.yunzhi.inte.common.DateUtils;
5
 import com.yunzhi.inte.common.ResponseBean;
5
 import com.yunzhi.inte.common.ResponseBean;
6
-import com.yunzhi.inte.service.GuaranteeTaskService;
7
-import com.yunzhi.inte.service.PurchaseService;
8
-import com.yunzhi.inte.service.StoreService;
9
-import com.yunzhi.inte.service.UsersService;
6
+import com.yunzhi.inte.service.*;
10
 import io.swagger.annotations.Api;
7
 import io.swagger.annotations.Api;
11
 import io.swagger.annotations.ApiOperation;
8
 import io.swagger.annotations.ApiOperation;
12
 import io.swagger.annotations.ApiParam;
9
 import io.swagger.annotations.ApiParam;
38
     @Autowired
35
     @Autowired
39
     PurchaseService purchaseService;
36
     PurchaseService purchaseService;
40
 
37
 
38
+    @Autowired
39
+    EvaluateService evaluateService;
40
+
41
     @ApiOperation("汇总统计")
41
     @ApiOperation("汇总统计")
42
     @GetMapping("/summary")
42
     @GetMapping("/summary")
43
     public ResponseBean getSummary() {
43
     public ResponseBean getSummary() {
47
         // 接待军人总数
47
         // 接待军人总数
48
         Integer personNum = guaranteeTaskService.sumPerson();
48
         Integer personNum = guaranteeTaskService.sumPerson();
49
         // 总体评价
49
         // 总体评价
50
-        String evaValue = "良";
50
+        String evaValue = evaluateService.getTop1();
51
         // 设备数量
51
         // 设备数量
52
         Integer deviceNum = storeService.countDevice();
52
         Integer deviceNum = storeService.countDevice();
53
 
53
 

+ 2
- 2
src/main/java/com/yunzhi/inte/controller/StoreLogController.java View File

68
     public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
68
     public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
69
                              @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
69
                              @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
70
                              @ApiParam("库存ID") @RequestParam(value ="storeId", required = false) Integer storeId,
70
                              @ApiParam("库存ID") @RequestParam(value ="storeId", required = false) Integer storeId,
71
-                             @ApiParam("名称") @RequestParam(value ="name", required = false) String name,
71
+                             @ApiParam("名称") @RequestParam(value ="storeName", required = false) String storeName,
72
                              @ApiParam("分类ID") @RequestParam(value ="typeId", required = false) Integer typeId) throws Exception {
72
                              @ApiParam("分类ID") @RequestParam(value ="typeId", required = false) Integer typeId) throws Exception {
73
 
73
 
74
         IPage<StoreLog> pg = new Page<>(pageNum, pageSize);
74
         IPage<StoreLog> pg = new Page<>(pageNum, pageSize);
75
-        IPage<StoreLog> result = storeLogService.getPageBy(pg, storeId, name, typeId);
75
+        IPage<StoreLog> result = storeLogService.getPageBy(pg, storeId, storeName, typeId);
76
 
76
 
77
         return ResponseBean.success(result);
77
         return ResponseBean.success(result);
78
     }
78
     }

+ 3
- 2
src/main/java/com/yunzhi/inte/mapper/EvaluateMapper.java View File

12
  */
12
  */
13
 @Mapper
13
 @Mapper
14
 public interface EvaluateMapper  extends BaseMapper<Evaluate>{
14
 public interface EvaluateMapper  extends BaseMapper<Evaluate>{
15
-    
16
-}
15
+
16
+     String getTop1();
17
+ }

+ 1
- 1
src/main/java/com/yunzhi/inte/mapper/StoreMapper.java View File

19
 
19
 
20
     IPage<Store> getPageBy(IPage<Store> pg, @Param("id") Integer id, @Param("name") String name, @Param("typeId") String typeId, @Param("isDish") Integer isDish);
20
     IPage<Store> getPageBy(IPage<Store> pg, @Param("id") Integer id, @Param("name") String name, @Param("typeId") String typeId, @Param("isDish") Integer isDish);
21
 
21
 
22
-    List<Store> getListBy(@Param("name") String name, @Param("typeId") String typeId, @Param("isDish") Integer isDish);
22
+    List<Store> getListBy(@Param("id") Integer id, @Param("name") String name, @Param("typeId") String typeId, @Param("isDish") Integer isDish);
23
 
23
 
24
     List<Map<String, Integer>> countByDeviceType();
24
     List<Map<String, Integer>> countByDeviceType();
25
 
25
 

+ 3
- 2
src/main/java/com/yunzhi/inte/service/EvaluateService.java View File

9
  * @date : 2022-10-13
9
  * @date : 2022-10-13
10
  */
10
  */
11
 public interface EvaluateService extends IBaseService<Evaluate> {
11
 public interface EvaluateService extends IBaseService<Evaluate> {
12
-    
13
-}
12
+
13
+     String getTop1();
14
+ }

+ 9
- 3
src/main/java/com/yunzhi/inte/service/impl/EvaluateServiceImpl.java View File

5
 import com.yunzhi.inte.entity.Evaluate;
5
 import com.yunzhi.inte.entity.Evaluate;
6
 import com.yunzhi.inte.mapper.EvaluateMapper;
6
 import com.yunzhi.inte.mapper.EvaluateMapper;
7
 import com.yunzhi.inte.service.EvaluateService;
7
 import com.yunzhi.inte.service.EvaluateService;
8
- /**
8
+
9
+/**
9
  * 评价表;(evaluate)表服务实现类
10
  * 评价表;(evaluate)表服务实现类
11
+ *
10
  * @author : http://www.chiner.pro
12
  * @author : http://www.chiner.pro
11
  * @date : 2022-10-13
13
  * @date : 2022-10-13
12
  */
14
  */
13
 @Service
15
 @Service
14
 public class EvaluateServiceImpl extends BaseServiceImpl<EvaluateMapper, Evaluate> implements EvaluateService {
16
 public class EvaluateServiceImpl extends BaseServiceImpl<EvaluateMapper, Evaluate> implements EvaluateService {
15
-    
16
-}
17
+
18
+    @Override
19
+    public String getTop1() {
20
+        return baseMapper.getTop1();
21
+    }
22
+}

+ 1
- 1
src/main/java/com/yunzhi/inte/service/impl/StoreServiceImpl.java View File

39
             name = "%" + name + "%";
39
             name = "%" + name + "%";
40
         }
40
         }
41
 
41
 
42
-        return baseMapper.getListBy(name, typeId, isDish);
42
+        return baseMapper.getListBy(null, name, typeId, isDish);
43
     }
43
     }
44
 
44
 
45
     @Override
45
     @Override

+ 4
- 1
src/main/resources/mapper/EvaluateMapper.xml View File

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 
3
 
4
 <mapper namespace="com.yunzhi.inte.mapper.EvaluateMapper">
4
 <mapper namespace="com.yunzhi.inte.mapper.EvaluateMapper">
5
-    
5
+
6
+    <select id="getTop1" resultType="java.lang.String">
7
+
8
+    </select>
6
 </mapper>
9
 </mapper>