|
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigInteger;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -87,6 +88,7 @@ public class ApiAppDeviceLogController {
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "批次入库 --> 入库 搜索 & 重置")
|
|
|
@RequestMapping(value = "instorage/batch/inStorageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO inStorageBatchInStorageQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
@@ -107,12 +109,11 @@ public class ApiAppDeviceLogController {
|
|
|
public ApiPageDTO inStoragePageQuery(@RequestBody LibraryInQueryParam param) {
|
|
|
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
- if(CollectionUtils.isEmpty(param.getCheckStatus())){
|
|
|
+ if (CollectionUtils.isEmpty(param.getCheckStatus())) {
|
|
|
sql.append("SELECT * FROM app_device_log WHERE type=1");
|
|
|
- }
|
|
|
- else{
|
|
|
- sql.append("SELECT * FROM app_device_log WHERE type=1 AND sn IN(SELECT sn FROM app_device WHERE check_status="+
|
|
|
- param.getCheckStatus().get(0).toString()+")");
|
|
|
+ } else {
|
|
|
+ sql.append("SELECT * FROM app_device_log WHERE type=1 AND sn IN(SELECT sn FROM app_device WHERE check_status=" +
|
|
|
+ param.getCheckStatus().get(0).toString() + ")");
|
|
|
}
|
|
|
|
|
|
log.info("SQL: {}", sql.toString());
|
|
@@ -153,9 +154,10 @@ public class ApiAppDeviceLogController {
|
|
|
deviceLogService.transfer(param);
|
|
|
return ApiDTO.ok();
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "调回平台 ")
|
|
|
@RequestMapping(value = "transferBack", method = RequestMethod.POST)
|
|
|
- public ApiDTO transferBack(@RequestBody @ApiParam(name = "回调参数", value = "输入sn", required = true) TransferFormParam param) {
|
|
|
+ public ApiDTO transferBack(@RequestBody @ApiParam(name = "回调参数", value = "输入sn", required = true) TransferFormParam param) {
|
|
|
deviceLogService.transferBack(param);
|
|
|
return ApiDTO.ok();
|
|
|
}
|
|
@@ -164,7 +166,6 @@ public class ApiAppDeviceLogController {
|
|
|
@RequestMapping(value = "transfer/detialQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO transferDetialQuery(@RequestBody detialQueryParam param) {
|
|
|
QueryParam query = new QueryParam();
|
|
|
-
|
|
|
query.addParam(QueryParamExp.eq("operateID", param.getOperateID()));
|
|
|
query.addParam(QueryParamExp.eq("type", 2));
|
|
|
Page<AppDeviceLog> deviceLogPage = deviceLogService.findByParam(query);
|
|
@@ -173,13 +174,17 @@ public class ApiAppDeviceLogController {
|
|
|
AppDevice device = new AppDevice();
|
|
|
device.setImei(p.getImei());
|
|
|
appDeviceService.addImeiTitle(device);
|
|
|
+ device.setImei(p.getImei());
|
|
|
+ appDeviceService.addImeiTitle(device);
|
|
|
p.appendFormDevice(device);
|
|
|
+ p.appendInTime(device);
|
|
|
});
|
|
|
+
|
|
|
return new ApiPageDTO(null, deviceLogPage);
|
|
|
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "设备调拨 搜索 & 重置")
|
|
|
+ @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");
|
|
@@ -202,7 +207,7 @@ public class ApiAppDeviceLogController {
|
|
|
|
|
|
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) {
|
|
|
p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
@@ -249,7 +254,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) {
|
|
@@ -307,18 +312,20 @@ public class ApiAppDeviceLogController {
|
|
|
@RequestMapping(value = "outstorage/detialQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO outDetialQuery(@RequestBody detialQueryParam param) {
|
|
|
QueryParam query = new QueryParam();
|
|
|
-
|
|
|
query.addParam(QueryParamExp.eq("operateID", param.getOperateID()));
|
|
|
query.addParam(QueryParamExp.eq("type", 3));
|
|
|
-
|
|
|
Page<AppDeviceLog> deviceLogPage = deviceLogService.findByParam(query);
|
|
|
|
|
|
deviceLogPage.getContent().forEach(p -> {
|
|
|
AppDevice device = new AppDevice();
|
|
|
device.setImei(p.getImei());
|
|
|
appDeviceService.addImeiTitle(device);
|
|
|
+ device.setImei(p.getImei());
|
|
|
+ appDeviceService.addImeiTitle(device);
|
|
|
p.appendFormDevice(device);
|
|
|
+ p.appendInTime(device);
|
|
|
});
|
|
|
+
|
|
|
return new ApiPageDTO(null, deviceLogPage);
|
|
|
|
|
|
}
|
|
@@ -326,7 +333,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,t1.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.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())) {
|
|
@@ -338,7 +345,7 @@ public class ApiAppDeviceLogController {
|
|
|
sql.append(StringUtils.isEmpty(param.getSn()) ? "where" : "and");
|
|
|
sql.append(" t.out_type = '").append(param.getOutType()).append("'");
|
|
|
}
|
|
|
- sql.append(" group by t1.operate_id");
|
|
|
+ sql.append(" group by t.operate_id");
|
|
|
if (!StringUtils.isEmpty(param.getOrderBy())) {
|
|
|
sql.append(param.getOrderBy());
|
|
|
}
|
|
@@ -352,7 +359,7 @@ public class ApiAppDeviceLogController {
|
|
|
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")));
|
|
|
+ p.put("out_type", String.valueOf(p.get("out_type")));
|
|
|
}
|
|
|
page.setData(list);
|
|
|
}
|
|
@@ -393,7 +400,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) {
|
|
@@ -427,8 +434,4 @@ public class ApiAppDeviceLogController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|