|
@@ -53,7 +53,7 @@ public class ApiAppDeviceLogController {
|
|
|
public ApiPageDTO inStorageBatchQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
|
|
|
StringBuffer sql = new StringBuffer();
|
|
|
- sql.append("select t1.batch_num,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.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");
|
|
|
|
|
@@ -87,45 +87,20 @@ public class ApiAppDeviceLogController {
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
|
-// @ApiOperation(value = "批次入库 --> 入库 搜索 & 重置")
|
|
|
-// @RequestMapping(value = "instorage/batch/inStorageQuery", method = RequestMethod.POST)
|
|
|
-// public ApiPageDTO inStorageBatchQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
-//
|
|
|
-// StringBuffer sql = new StringBuffer();
|
|
|
-// sql.append("select t1.batch_num,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");
|
|
|
-//
|
|
|
-// if (!StringUtils.isEmpty(param.getBatchNum())) {
|
|
|
-// sql.append(" where t1.batch_num like '%").append(param.getBatchNum()).append("%'");
|
|
|
-// }
|
|
|
-// sql.append(" group by t1.batch_num");
|
|
|
-// if (!StringUtils.isEmpty(param.getOrderBy())) {
|
|
|
-// sql.append(param.getOrderBy());
|
|
|
-// }
|
|
|
-// log.info("SQL: {}", sql.toString());
|
|
|
-//
|
|
|
-//
|
|
|
-// ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
|
|
|
-// if (null != page.getData()) {
|
|
|
-// // 组装数据
|
|
|
-// List<Map<String, Object>> list = (List<Map<String, Object>>) page.getData();
|
|
|
-// for (Map<String, Object> p : list) {
|
|
|
-// AppDevice device = new AppDevice();
|
|
|
-// device.setImei(ObjectUtil.obj2String(p.get("imei")));
|
|
|
-// appDeviceService.addImeiTitle(device);
|
|
|
-//
|
|
|
-//
|
|
|
-// p.put("type_title", device.getTypeTitle());
|
|
|
-// 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);
|
|
|
-// }
|
|
|
-// return page;
|
|
|
-// }
|
|
|
+ @ApiOperation(value = "批次入库 --> 入库 搜索 & 重置")
|
|
|
+ @RequestMapping(value = "instorage/batch/inStorageQuery", method = RequestMethod.POST)
|
|
|
+ public ApiPageDTO inStorageBatchInStorageQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
+
|
|
|
+ QueryParam query = new QueryParam();
|
|
|
+ if (!StringUtils.isEmpty(param)) {
|
|
|
+ query.addParam(QueryParamExp.like("batchNum", "%".concat(param.getBatchNum()).concat("%")));
|
|
|
+ }
|
|
|
+ Page<AppDevice> devicePage = appDeviceService.findByParam(query);
|
|
|
+ devicePage.getContent().forEach(p -> {
|
|
|
+ appDeviceService.addImeiTitle(p);
|
|
|
+ });
|
|
|
+ return new ApiPageDTO(null, devicePage);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "设备入库 搜索 & 重置")
|
|
|
@RequestMapping(value = "instorage/pageQuery", method = RequestMethod.POST)
|
|
@@ -229,6 +204,8 @@ public class ApiAppDeviceLogController {
|
|
|
Page<AppDeviceLog> deviceLogPage = deviceLogService.findByParam(query);
|
|
|
|
|
|
deviceLogPage.getContent().forEach(p -> {
|
|
|
+
|
|
|
+ // 查看自检状态
|
|
|
AppDevice device = new AppDevice();
|
|
|
device.setImei(p.getImei());
|
|
|
appDeviceService.addImeiTitle(device);
|
|
@@ -241,7 +218,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.sn,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.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");
|
|
|
|
|
@@ -261,7 +238,7 @@ public class ApiAppDeviceLogController {
|
|
|
List<Map<String, Object>> list = (List<Map<String, Object>>) page.getData();
|
|
|
for (Map<String, Object> p : list) {
|
|
|
AppDevice device = new AppDevice();
|
|
|
- device.setSn(ObjectUtil.obj2String(p.get("sn")));
|
|
|
+ device.setImei(ObjectUtil.obj2String(p.get("imei")));
|
|
|
appDeviceService.addImeiTitle(device);
|
|
|
|
|
|
p.put("type_title", device.getTypeTitle());
|
|
@@ -275,6 +252,21 @@ public class ApiAppDeviceLogController {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "新增调拨 --> 选择批次 查看")
|
|
|
+ @RequestMapping(value = "transfer/batch/detailQuery", method = RequestMethod.POST)
|
|
|
+ public ApiPageDTO transferByBatchDetailQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
+
|
|
|
+ QueryParam query = new QueryParam();
|
|
|
+ if (!StringUtils.isEmpty(param)) {
|
|
|
+ query.addParam(QueryParamExp.like("batchNum", "%".concat(param.getBatchNum()).concat("%")));
|
|
|
+ }
|
|
|
+ Page<AppDevice> devicePage = appDeviceService.findByParam(query);
|
|
|
+ devicePage.getContent().forEach(p -> {
|
|
|
+ appDeviceService.addImeiTitle(p);
|
|
|
+ });
|
|
|
+ return new ApiPageDTO(null, devicePage);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "调回平台 搜索 & 重置")
|
|
|
@RequestMapping(value = "transferBack/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO transferBackPageQuery(@RequestBody TransferBySnQueryParam param) {
|
|
@@ -288,7 +280,6 @@ public class ApiAppDeviceLogController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "根据sn或batch出库")
|
|
|
@RequestMapping(value = "outstorage", method = RequestMethod.POST)
|
|
|
public ApiDTO outStorage(@RequestBody @ApiParam(name = "出库参数", value = "传入json格式", required = true) LibraryOutFormParam param) {
|
|
@@ -332,6 +323,21 @@ public class ApiAppDeviceLogController {
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "批次出库 --> 查看")
|
|
|
+ @RequestMapping(value = "outstorage/batch/detailQuery", method = RequestMethod.POST)
|
|
|
+ public ApiPageDTO outByBatchDetailQuery(@RequestBody DeviceBatchQueryParam param) {
|
|
|
+
|
|
|
+ QueryParam query = new QueryParam();
|
|
|
+ if (!StringUtils.isEmpty(param)) {
|
|
|
+ query.addParam(QueryParamExp.like("batchNum", "%".concat(param.getBatchNum()).concat("%")));
|
|
|
+ }
|
|
|
+ Page<AppDevice> devicePage = appDeviceService.findByParam(query);
|
|
|
+ devicePage.getContent().forEach(p -> {
|
|
|
+ appDeviceService.addImeiTitle(p);
|
|
|
+ });
|
|
|
+ return new ApiPageDTO(null, devicePage);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "批次出库 搜索 & 重置")
|
|
|
@RequestMapping(value = "outstorage/byBatch/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO outByBatchPageQuery(@RequestBody OutByBatchQueryParam param) {
|
|
@@ -356,7 +362,7 @@ public class ApiAppDeviceLogController {
|
|
|
@ApiOperation(value = "处置 搜索 & 重置")
|
|
|
@RequestMapping(value = "handle/pageQuery", method = RequestMethod.POST)
|
|
|
public ApiPageDTO deviceLogPageQuery(@RequestBody HandelQueryParam param) {
|
|
|
- param.addParam(QueryParamExp.eq("type", 3));
|
|
|
+ param.addParam(QueryParamExp.eq("type", 4));
|
|
|
return new ApiPageDTO(null, deviceLogService.findByParam(param));
|
|
|
}
|
|
|
|