ソースを参照

货位总数接口增加查询条件启用/弃用

fanxw 5 年 前
コミット
a0cfdd787e

+ 4 - 3
src/main/java/com/chinaitop/depot/basic/controller/BasicWarehouseController.java

@@ -351,12 +351,13 @@ public class BasicWarehouseController {
351 351
 	@RequestMapping(value="/getCountWhs", method=RequestMethod.GET)
352 352
 	@ApiOperation(value="查询货位数", notes = "查询货位数")
353 353
 	@ApiImplicitParams({
354
-		@ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query")
354
+		@ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query"),
355
+		@ApiImplicitParam(name = "delFlag", value = "启用状态(1:启用,0:弃用)", paramType = "query")
355 356
 	})
356
-	public Integer getCountWhs(Integer orgId) {
357
+	public Integer getCountWhs(Integer orgId, Integer delFlag) {
357 358
 		Integer hws = 0;
358 359
 		try {
359
-			hws = basicWarehouseService.getCountWhs(orgId);
360
+			hws = basicWarehouseService.getCountWhs(orgId, delFlag);
360 361
 		} catch (Exception e) {
361 362
 			hws = 0;
362 363
 			e.printStackTrace();

+ 2 - 1
src/main/java/com/chinaitop/depot/basic/service/BasicWarehouseService.java

@@ -60,9 +60,10 @@ public interface BasicWarehouseService {
60 60
 	 * 查询当前单位下货位总数
61 61
 	 * 
62 62
 	 * @param orgId 单位ID
63
+	 * @param delFlag 启用状态(1:启用,0:弃用)
63 64
 	 * @return
64 65
 	 * @throws Exception
65 66
 	 */
66
-	Integer getCountWhs(Integer orgId) throws Exception;
67
+	Integer getCountWhs(Integer orgId, Integer delFlag) throws Exception;
67 68
 
68 69
 }

+ 4 - 1
src/main/java/com/chinaitop/depot/basic/service/impl/BasicWarehouseServiceImpl.java

@@ -94,13 +94,16 @@ public class BasicWarehouseServiceImpl implements BasicWarehouseService {
94 94
 	}
95 95
 
96 96
 	@Override
97
-	public Integer getCountWhs(Integer orgId) throws Exception {
97
+	public Integer getCountWhs(Integer orgId, Integer delFlag) throws Exception {
98 98
 		BasicWarehouseExample example = new BasicWarehouseExample();
99 99
 		BasicWarehouseExample.Criteria criteria = example.createCriteria();
100 100
 		criteria.andLibraryTypeEqualTo("0");//查询本库的,不查第三方库的
101 101
 		if (null != orgId) {
102 102
 			criteria.andOrgIdEqualTo(orgId);
103 103
 		}
104
+		if (null != delFlag) {
105
+			criteria.andDelFlagEqualTo(delFlag);
106
+		}
104 107
 		Integer hws = mapper.countByExample(example);
105 108
 		return hws;
106 109
 	}