|
@@ -63,14 +63,14 @@ public class ApiAppDeviceLogController {
|
|
|
public ApiPageDTO inStorageBatchQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
- sql.append("select t1.batch_num,t1.operate_id,t1.sn,t1.check_status,t1.imei,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
+ sql.append("select t1.batch_num,t1.operate_id,t1.operator,t1.sn,t1.check_status,t1.imei,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
sql.append("count(if(status = 3,true,null)) as out_storage,count(if(status = 4,true,null)) as handle,");
|
|
|
sql.append("t1.add_time,t1.received_place from app_device t1");
|
|
|
|
|
|
if (!StringUtils.isEmpty(param.getBatchNum())) {
|
|
|
sql.append(" where t1.batch_num like '%").append(param.getBatchNum()).append("%'");
|
|
|
}
|
|
|
- sql.append(" group by t1.batch_num");
|
|
|
+ sql.append(" group by t1.operate_id");
|
|
|
if (!StringUtils.isEmpty(param.getOrderBy())) {
|
|
|
sql.append(param.getOrderBy());
|
|
|
}
|
|
@@ -91,7 +91,6 @@ public class ApiAppDeviceLogController {
|
|
|
p.put("pack_title", device.getPackTitle());
|
|
|
p.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("deliver_time")), DateUtils.YMD));
|
|
|
p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
- p.put("operator", "admin");
|
|
|
}
|
|
|
page.setData(list);
|
|
|
}
|
|
@@ -151,7 +150,7 @@ public class ApiAppDeviceLogController {
|
|
|
pTemp.put("status", appDevice.getStatus());
|
|
|
pTemp.put("received_place", appDevice.getReceivedPlace());
|
|
|
pTemp.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(appDevice.getDeliverTime()), DateUtils.YMD));
|
|
|
- pTemp.put("operator", "admin");
|
|
|
+
|
|
|
listRes.add(pTemp);
|
|
|
}
|
|
|
page.setData(listRes);
|
|
@@ -196,7 +195,7 @@ 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.operator,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())) {
|
|
@@ -219,7 +218,6 @@ public class ApiAppDeviceLogController {
|
|
|
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);
|
|
|
}
|
|
@@ -254,7 +252,7 @@ public class ApiAppDeviceLogController {
|
|
|
@RequestMapping(value = "transfer/byBatch/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO transferByBatchPageQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
- sql.append("select t1.batch_num,t1.operate_id,t1.sn,t1.imei,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
+ sql.append("select t1.batch_num,t1.operator,t1.operate_id,t1.sn,t1.imei,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
sql.append("count(if(status = 3,true,null)) as out_storage,count(if(status = 4,true,null)) as handle,");
|
|
|
sql.append("t1.add_time,t1.received_place from app_device t1");
|
|
|
|
|
@@ -281,7 +279,6 @@ public class ApiAppDeviceLogController {
|
|
|
p.put("pack_title", device.getPackTitle());
|
|
|
p.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("deliver_time")), DateUtils.YMD));
|
|
|
p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
- p.put("operator", "admin");
|
|
|
p.put("instorageTime", device.getInstorageTime());
|
|
|
}
|
|
|
page.setData(list);
|
|
@@ -345,7 +342,7 @@ public class ApiAppDeviceLogController {
|
|
|
@ApiOperation(value = "设备出库 搜索 & 重置")
|
|
|
@RequestMapping(value = "outstorage/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO outPageQuery(@RequestBody OutQueryParam param) {
|
|
|
- StringBuffer sql = new StringBuffer("select t.batch_num,t.operate_id,t.add_time,count(0) as total,t.out_type,t.receiver_name,t.receiver_phone,t.remarks,t.out_custom_id,t.operator,t.update_time from app_device_log t where t.type = 3");
|
|
|
+ StringBuffer sql = new StringBuffer("select t.batch_num,t.operator,t.operate_id,t.add_time,count(0) as total,t.out_type,t.receiver_name,t.receiver_phone,t.remarks,t.out_custom_id,t.operator,t.update_time from app_device_log t where t.type = 3");
|
|
|
|
|
|
// sn搜索
|
|
|
if (!StringUtils.isEmpty(param.getSn())) {
|
|
@@ -369,7 +366,6 @@ public class ApiAppDeviceLogController {
|
|
|
for (Map<String, Object> p : list) {
|
|
|
p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
p.put("update_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("update_time")), DateUtils.YMDHMS));
|
|
|
- p.put("operator", "admin");
|
|
|
p.put("out_type", String.valueOf(p.get("out_type")));
|
|
|
}
|
|
|
page.setData(list);
|
|
@@ -395,7 +391,7 @@ public class ApiAppDeviceLogController {
|
|
|
@RequestMapping(value = "outstorage/byBatch/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO outByBatchPageQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
- sql.append("select t1.batch_num,t1.operate_id,t1.sn,t1.imei,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
+ sql.append("select t1.batch_num,t1.operate_id,t1.operator,t1.sn,t1.imei,t1.deliver_time,count(0) as total,count(if(status = 1,true,null)) as in_storage,count(if(status = 2,true,null)) as transfer,");
|
|
|
sql.append("count(if(status = 3,true,null)) as out_storage,count(if(status = 4,true,null)) as handle,");
|
|
|
sql.append("t1.add_time,t1.received_place from app_device t1");
|
|
|
|
|
@@ -422,7 +418,6 @@ public class ApiAppDeviceLogController {
|
|
|
p.put("pack_title", device.getPackTitle());
|
|
|
p.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("deliver_time")), DateUtils.YMD));
|
|
|
p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
- p.put("operator", "admin");
|
|
|
p.put("instorageTime", device.getInstorageTime());
|
|
|
}
|
|
|
page.setData(list);
|
|
@@ -441,7 +436,13 @@ public class ApiAppDeviceLogController {
|
|
|
@RequestMapping(value = "handle/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO deviceLogPageQuery(@RequestBody HandelQueryParam param) {
|
|
|
param.addParam(QueryParamExp.eq("type", 4));
|
|
|
- return new ApiPageDTO(null, deviceLogService.findByParam(param));
|
|
|
+
|
|
|
+ Page<AppDeviceLog> devicePage = deviceLogService.findByParam(param);
|
|
|
+ devicePage.getContent().forEach(p -> {
|
|
|
+ AppDevice device = appDeviceService.getOne(QueryParamExp.eq("sn", p.getSn()));
|
|
|
+ p.appendInTime(device);
|
|
|
+ });
|
|
|
+ return new ApiPageDTO(null,devicePage);
|
|
|
}
|
|
|
|
|
|
|