|
@@ -3,16 +3,16 @@ package cn.fastfun.controller.api;
|
|
|
import cn.fastfun.controller.param.*;
|
|
|
import cn.fastfun.service.AppDeviceLogService;
|
|
|
import cn.fastfun.service.AppDeviceService;
|
|
|
+import cn.fastfun.service.entity.AppDevice;
|
|
|
+import cn.fastfun.service.entity.AppDeviceLog;
|
|
|
import cn.fastfun.util.DateUtils;
|
|
|
import cn.fastfun.util.ObjectUtil;
|
|
|
-import com.bridge.dto.ApiDTO;
|
|
|
-import com.bridge.dto.ApiPageDTO;
|
|
|
-import com.bridge.dto.QueryParam;
|
|
|
-import com.bridge.dto.QueryParamExp;
|
|
|
+import com.bridge.dto.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -74,11 +74,25 @@ public class ApiAppDeviceLogController {
|
|
|
return ApiDTO.ok(deviceLogService.findByParam(param));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "调拨详细搜索")
|
|
|
+ @RequestMapping(value = "transfer/pageQuery", method = RequestMethod.POST)
|
|
|
+ public ApiPageDTO pageQuery(@RequestBody BatchNumQueryParam param) {
|
|
|
+ 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 = "batchNum/transfer/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO batchNumPageQuery(@RequestBody LogTransferQueryParam param) {
|
|
|
- StringBuffer sql = new StringBuffer("select t.batch_num,t.add_time,count(0) as total,t.tf_event,t.tf_device_type,t.tf_used,t.tf_describe,t.out_custom_id,t.operator from app_device_log t where t.type = 2");
|
|
|
+ StringBuffer sql = new StringBuffer("select t.batch_num,t.add_time,count(0) as total,t.tf_event,t.tf_device_type,t.tf_used,t.tf_describe,t.out_custom_id,t.operator,t.remarks from app_device_log t where t.type = 2");
|
|
|
|
|
|
// sn搜索
|
|
|
if (!StringUtils.isEmpty(param.getSn())) {
|
|
@@ -90,7 +104,7 @@ public class ApiAppDeviceLogController {
|
|
|
sql.append(StringUtils.isEmpty(param.getSn()) ? "where" : "and");
|
|
|
sql.append(" t.tf_device_type = '").append(param.getType()).append("'");
|
|
|
}
|
|
|
- sql.append(" group by t.batch_num,t.add_time,t.tf_event,t.tf_device_type,t.tf_used,t.tf_describe,t.out_custom_id,t.operator");
|
|
|
+ sql.append(" group by t.batch_num,t.add_time,t.tf_event,t.tf_device_type,t.tf_used,t.tf_describe,t.out_custom_id,t.operator,t.remarks");
|
|
|
if (!StringUtils.isEmpty(param.getOrderBy())) {
|
|
|
sql.append(param.getOrderBy());
|
|
|
}
|
|
@@ -101,6 +115,7 @@ public class ApiAppDeviceLogController {
|
|
|
List<Map<String, Object>> list = (List<Map<String, Object>>) page.getData();
|
|
|
for (Map<String, Object> p : list) {
|
|
|
p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
+ p.put("customTitle", "骑享科技");
|
|
|
p.put("operator", "admin");
|
|
|
}
|
|
|
page.setData(list);
|