Browse Source

添加出库列表

jaikuai 3 years ago
parent
commit
1f2404a0e3

+ 15 - 1
src/main/java/cn/fastfun/controller/api/ApiAppDeviceLogController.java

@@ -60,6 +60,20 @@ public class ApiAppDeviceLogController {
         return ApiDTO.ok();
     }
 
+    @ApiOperation(value = "出库分页搜索")
+    @RequestMapping(value = "outstorage/pageQuery", method = RequestMethod.POST)
+    public ApiPageDTO outPageQuery(@RequestBody OutQueryParam param) {
+        param.addParam(QueryParamExp.eq("type", 3));
+        Page<AppDeviceLog> deviceLogPage = deviceLogService.findByParam(param);
+        deviceLogPage.getContent().forEach(p -> {
+            AppDevice device = new AppDevice();
+            device.setSn(p.getSn());
+            appDeviceService.addSnTitle(device);
+            p.appendFormDevice(device);
+        });
+        return new ApiPageDTO(null, deviceLogPage);
+    }
+
     @ApiOperation(value = "处置")
     @RequestMapping(value = "handle", method = RequestMethod.POST)
     public ApiDTO handle(@RequestBody @ApiParam(name = "出库参数", value = "传入json格式", required = true) HandelFormParam param) {
@@ -145,7 +159,7 @@ public class ApiAppDeviceLogController {
         log.info("SQL: {}", sql.toString());
 
         ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
-        if(null != page.getData()) {
+        if (null != page.getData()) {
             // 组装数据
             List<Map<String, Object>> list = (List<Map<String, Object>>) page.getData();
             for (Map<String, Object> p : list) {

+ 26 - 0
src/main/java/cn/fastfun/controller/param/OutQueryParam.java

@@ -0,0 +1,26 @@
+package cn.fastfun.controller.param;
+
+import com.bridge.dto.QueryParam;
+import com.bridge.dto.QueryParamExp;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.util.StringUtils;
+
+@Setter
+@Getter
+public class OutQueryParam extends QueryParam {
+
+
+    @ApiModelProperty(value = "SN号", name = "sn")
+    public void setSn(String sn) {
+        if (!StringUtils.isEmpty(sn))
+            addParam(QueryParamExp.like("sn", "%".concat(sn).concat("%")));
+    }
+
+    @ApiModelProperty(value = "批次号", name = "batchNum", required = true)
+    public void setBatchNum(String batchNum) {
+        if (!StringUtils.isEmpty(batchNum))
+            addParam(QueryParamExp.eq("batchNum", batchNum));
+    }
+}