|
@@ -1,6 +1,5 @@
|
|
|
package cn.fastfun.controller.api;
|
|
|
|
|
|
-import cn.fastfun.controller.dto.DevicePageStatDTO;
|
|
|
import cn.fastfun.controller.param.*;
|
|
|
import cn.fastfun.service.AppDeviceLogService;
|
|
|
import cn.fastfun.service.AppDeviceService;
|
|
@@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.math.BigInteger;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -238,7 +236,9 @@ public class ApiAppDeviceLogController {
|
|
|
@ApiOperation(value = "设备调拨 搜索 & 重置")
|
|
|
@RequestMapping(value = "transfer/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO transferPageQuery(@RequestBody LogTransferQueryParam param) {
|
|
|
- StringBuffer sql = new StringBuffer("select t.batch_num,t.operate_id, 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 ");
|
|
|
+ StringBuffer sql = new StringBuffer("select t.batch_num,t.operate_id, 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())) {
|
|
@@ -274,12 +274,22 @@ public class ApiAppDeviceLogController {
|
|
|
log.info("SQL: {}", sql.toString());
|
|
|
|
|
|
ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
|
|
|
+
|
|
|
+ List<Map<String,Object>> customerList = appDeviceService.getListBySQL("select id,title from app_custom", new HashMap<>());
|
|
|
// 组装数据
|
|
|
if (null != page.getData()) {
|
|
|
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", "骑享科技");
|
|
|
+ if(p.get("out_custom_id")!=null) {
|
|
|
+ if (customerList.size() > 0) {
|
|
|
+ customerList.forEach(o -> {
|
|
|
+ if (o.get("id").toString().equals(p.get("out_custom_id").toString())) {
|
|
|
+ p.put("customTitle", o.get("title").toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
page.setData(list);
|
|
|
}
|