|
@@ -9,10 +9,7 @@ import cn.fastfun.service.entity.AppDevice;
|
|
|
import cn.fastfun.util.DateUtils;
|
|
|
import cn.fastfun.util.ObjectUtil;
|
|
|
import cn.fastfun.util.VerifyUtil;
|
|
|
-import com.bridge.dto.ApiDTO;
|
|
|
-import com.bridge.dto.ApiPageDTO;
|
|
|
-import com.bridge.dto.IdParam;
|
|
|
-import com.bridge.dto.QueryParamExp;
|
|
|
+import com.bridge.dto.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -41,9 +38,6 @@ public class ApiAppDeviceLogController {
|
|
|
@Resource(name = "appDeviceService")
|
|
|
AppDeviceService appDeviceService;
|
|
|
|
|
|
- @Resource
|
|
|
- SysExcelFieldService sysExcelFieldService;
|
|
|
-
|
|
|
@Resource
|
|
|
AppDeviceLogService deviceLogService;
|
|
|
|
|
@@ -76,6 +70,76 @@ public class ApiAppDeviceLogController {
|
|
|
return ApiDTO.ok();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "记录搜索列表")
|
|
|
+ @RequestMapping(value = "pageQuery", method = RequestMethod.POST)
|
|
|
+ public ApiDTO deviceLogPageQuery(@RequestBody QueryParam param) {
|
|
|
+ return ApiDTO.ok(deviceLogService.findByParam(param));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @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");
|
|
|
+
|
|
|
+ // sn搜索
|
|
|
+ if (!StringUtils.isEmpty(param.getSn())) {
|
|
|
+ sql.append(" where t.sn like '%").append(param.getSn()).append("%'");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 类型搜索
|
|
|
+ if(!StringUtils.isEmpty(param.getType())){
|
|
|
+ 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");
|
|
|
+ if (!StringUtils.isEmpty(param.getOrderBy())) {
|
|
|
+ sql.append(param.getOrderBy());
|
|
|
+ }
|
|
|
+ log.info("SQL: {}", sql.toString());
|
|
|
+
|
|
|
+ ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
|
|
|
+ // 组装数据
|
|
|
+ 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("operator", "admin");
|
|
|
+ }
|
|
|
+ page.setData(list);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "出库分页搜索列表")
|
|
|
+ @RequestMapping(value = "batchNum/out/pageQuery", method = RequestMethod.POST)
|
|
|
+ public ApiPageDTO outPageQuery(@RequestBody LogTransferQueryParam param) {
|
|
|
+ StringBuffer sql = new StringBuffer("select t.batch_num,t.add_time,count(0) as total,t.out_type,t.receiver_name,t.receiver_phone,t.remarks,t.out_custom_id,t.operator from app_device_log t where t.type = 3");
|
|
|
|
|
|
+ // sn搜索
|
|
|
+ if (!StringUtils.isEmpty(param.getSn())) {
|
|
|
+ sql.append(" where t.sn like '%").append(param.getSn()).append("%'");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 类型搜索
|
|
|
+ if(!StringUtils.isEmpty(param.getType())){
|
|
|
+ sql.append(StringUtils.isEmpty(param.getSn()) ? "where" : "and");
|
|
|
+ sql.append(" t.out_type = '").append(param.getType()).append("'");
|
|
|
+ }
|
|
|
+ sql.append(" group by t.batch_num,t.add_time,t.out_type,t.receiver_name,t.receiver_phone,t.remarks,t.out_custom_id,t.operator");
|
|
|
+ if (!StringUtils.isEmpty(param.getOrderBy())) {
|
|
|
+ sql.append(param.getOrderBy());
|
|
|
+ }
|
|
|
+ log.info("SQL: {}", sql.toString());
|
|
|
+
|
|
|
+ ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
|
|
|
+ // 组装数据
|
|
|
+ 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("operator", "admin");
|
|
|
+ }
|
|
|
+ page.setData(list);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
|
|
|
}
|