|
@@ -22,7 +22,9 @@ import org.springframework.web.bind.annotation.RestController; |
|
@@ -22,7 +22,9 @@ import org.springframework.web.bind.annotation.RestController; |
22
|
|
22
|
|
23
|
import java.lang.reflect.Method;
|
23
|
import java.lang.reflect.Method;
|
24
|
import java.util.Collection;
|
24
|
import java.util.Collection;
|
|
|
25
|
+import java.util.HashMap;
|
25
|
import java.util.List;
|
26
|
import java.util.List;
|
|
|
27
|
+import java.util.Map;
|
26
|
|
28
|
|
27
|
@RestController
|
29
|
@RestController
|
28
|
public class DepositController {
|
30
|
public class DepositController {
|
|
@@ -149,4 +151,55 @@ public class DepositController { |
|
@@ -149,4 +151,55 @@ public class DepositController { |
149
|
depositService.clearCacheByDepositCode(uid, depositCode);
|
151
|
depositService.clearCacheByDepositCode(uid, depositCode);
|
150
|
return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE);
|
152
|
return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE);
|
151
|
}
|
153
|
}
|
|
|
154
|
+
|
|
|
155
|
+ /**
|
|
|
156
|
+ * 仓库管理详情,几个尺码 几个库存接口
|
|
|
157
|
+ * @param uid
|
|
|
158
|
+ * @param productId
|
|
|
159
|
+ * @return
|
|
|
160
|
+ */
|
|
|
161
|
+ @RequestMapping(params = "method=ufo.deposit.queryUserDopositProduct")
|
|
|
162
|
+ @Cachable(expire = 180, pageArgs = {2,3})
|
|
|
163
|
+ public ApiResponse queryUserDopositingEx(@RequestParam("uid") Integer uid , @RequestParam("productId") Integer productId) {
|
|
|
164
|
+ LOG.info("method queryUserDopositingEx in, uid is {}, productId is {}", uid, productId);
|
|
|
165
|
+ DepositProductBo countBo = depositService.queryUserDepositProductCountInfo(uid, productId);
|
|
|
166
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
167
|
+ result.put("product", countBo);
|
|
|
168
|
+ LOG.info("end queryUserDopositingEx uid is {}, productId is {} result: {}", uid, productId, result);
|
|
|
169
|
+ return new ApiResponse.ApiResponseBuilder().code(200).data(result).build();
|
|
|
170
|
+ }
|
|
|
171
|
+
|
|
|
172
|
+ /**
|
|
|
173
|
+ * 查询 到期和不到期的 库存
|
|
|
174
|
+ * @param uid
|
|
|
175
|
+ * @param productId
|
|
|
176
|
+ * @param page
|
|
|
177
|
+ * @param limit
|
|
|
178
|
+ * @param sort
|
|
|
179
|
+ * @return
|
|
|
180
|
+ */
|
|
|
181
|
+ @RequestMapping(params = "method=ufo.deposit.queryUserDopositingSort")
|
|
|
182
|
+ @Cachable(expire = 180, pageArgs = {2,3})
|
|
|
183
|
+ public ApiResponse queryUserDopositingSort(@RequestParam("uid") Integer uid
|
|
|
184
|
+ , @RequestParam("productId") Integer productId
|
|
|
185
|
+ , @RequestParam(value = "page", required = false, defaultValue = "1") Integer page
|
|
|
186
|
+ , @RequestParam(value = "limit", required = false, defaultValue = "10") Integer limit,
|
|
|
187
|
+ @RequestParam(value = "sort") Integer sort ) {
|
|
|
188
|
+ if (uid == null || uid < 1) {
|
|
|
189
|
+ LOG.warn("queryUserDopositing failed, invalid uid: {}", uid);
|
|
|
190
|
+ return new ApiResponse.ApiResponseBuilder().code(500).message("查询失败").build();
|
|
|
191
|
+ }
|
|
|
192
|
+ if (productId == null || productId < 1) {
|
|
|
193
|
+ LOG.warn("queryUserDopositing failed, invalid productId: {}", productId);
|
|
|
194
|
+ return new ApiResponse.ApiResponseBuilder().code(500).message("查询失败").build();
|
|
|
195
|
+ }
|
|
|
196
|
+
|
|
|
197
|
+ PageResp<List<DepositDetailBo>> depositDetailBoList = depositService.queryUserProductDopositingDetail(uid, productId, page, limit);
|
|
|
198
|
+ DepositProductBo countBo = depositService.queryUserDepositProductCountInfo(uid, productId);
|
|
|
199
|
+ JSONObject result = new JSONObject();
|
|
|
200
|
+ result.put("product", countBo);
|
|
|
201
|
+ result.put("items", depositDetailBoList);
|
|
|
202
|
+ LOG.info("queryUserDopositing result: {}", result);
|
|
|
203
|
+ return new ApiResponse.ApiResponseBuilder().code(200).data(result).build();
|
|
|
204
|
+ }
|
152
|
} |
205
|
} |