Преглед на файлове

1、库存状态且有调拨记录的才允许处置
2、处置搜索页面
3、修改工作台处置数量统计

su-lmstack преди 3 години
родител
ревизия
4eccb08917

+ 8 - 1
src/main/java/cn/fastfun/controller/api/ApiAppDeviceLogController.java

@@ -506,9 +506,16 @@ public class ApiAppDeviceLogController {
         param.addParam(QueryParamExp.eq("type", 4));
 
         Page<AppDeviceLog> devicePage = deviceLogService.findByParam(param);
+        List<Map<String, Object>> resList = new ArrayList<>();
         devicePage.getContent().forEach(p -> {
+            HashMap<String, Object> res = new HashMap<>();
             AppDevice device = appDeviceService.getOne(QueryParamExp.eq("sn", p.getSn()));
-            p.appendInTime(device);
+            res.put("addTime", device.getAddTime());
+            res.put("sn", device.getSn());
+            res.put("imei", device.getImei());
+            res.put("handleType", p.getHfEvent());
+            res.put("handleTime", device.getHandleTime());
+            res.put("handleProduct", 1);
         });
         return new ApiPageDTO(null,devicePage);
     }

+ 1 - 1
src/main/java/cn/fastfun/controller/api/IndexController.java

@@ -91,7 +91,7 @@ public class IndexController {
         Long stock = ((BigInteger) q.getSingleResult()).longValue();
 
         sql = new StringBuffer();
-        sql.append("select count(distinct sn) from app_device_log where type=5 ");
+        sql.append("select count(distinct sn) from app_device_log where type=4 ");
         log.info("SQL: {}", sql.toString());
         q = appDeviceService.getQueryBySQL(sql.toString(), new HashMap<>());
         Long batteryHistoryHandle = ((BigInteger) q.getSingleResult()).longValue();

+ 1 - 0
src/main/java/cn/fastfun/service/impl/AppDeviceLogServiceImpl.java

@@ -278,6 +278,7 @@ public class AppDeviceLogServiceImpl extends JpaServiceImp<AppDeviceLog, String>
             AppDevice appDevice = appDeviceService.getOne(QueryParamExp.eq("sn", p));
             if (null == appDevice) throw new ApiRuntimeException("设备信息不存在!");
             if (1 != appDevice.getStatus()) throw new ApiRuntimeException("设备不是入库状态!");
+            if (StringUtils.isEmpty(appDevice.getTransferTime())) throw new ApiRuntimeException("设备未被调拨过!");
             batchNum = appDevice.getBatchNum();
             appDevice.setHandleTime(time);
             appDevice.setStatus(4); // 处置