Browse Source

化学平台

Bridge 3 years ago
parent
commit
9ba069ba31

+ 16 - 4
src/main/java/cn/fastfun/service/entity/AppDevice.java

@@ -123,18 +123,30 @@ public class AppDevice extends DateEntity {
         return sn.substring(1, 3);
     }
 
+    public String getChemistry() { // 化学体系
+        return sn.substring(6, 1);
+    }
+
+    public String getPlatform() { // 电池平台
+        return sn.substring(7, 1);
+    }
+
+    public String getCapacity() {// 容量
+        return sn.substring(8, 2);
+    }
+
     // 显示名称
     @Transient
-    private String typeTitle = "";
+    private String typeTitle = "";// 产品类型
 
     @Transient
-    private String packTitle = "";
+    private String packTitle = ""; // PACK制造商
 
     @Transient
-    private String specTitle = "";
+    private String specTitle = ""; // 产品规格
 
     @Transient
-    private String expandTitle = "";
+    private String expandTitle = ""; // 产品扩展
 
 
     /**

+ 2 - 2
src/main/java/cn/fastfun/service/impl/AppDeviceServiceImp.java

@@ -39,7 +39,7 @@ public class AppDeviceServiceImp extends JpaServiceImp<AppDevice, String> implem
         DeviceAttrDTO diffAttrDTO = null;
         for (Map<String, Object> p : list) {
             AppDevice device = new AppDevice(p);
-            if(null == device.getDeliverTime()) new ApiRuntimeException("发货时间读取错误");
+            if (null == device.getDeliverTime()) new ApiRuntimeException("发货时间读取错误");
             // 数据效验
             if (null == diffAttrDTO) {
                 diffAttrDTO = new DeviceAttrDTO(device.getBatchNum(), device.getSn());
@@ -69,7 +69,7 @@ public class AppDeviceServiceImp extends JpaServiceImp<AppDevice, String> implem
         device.setTypeTitle(getProductTitle("产品类型", device.getType()));
         device.setExpandTitle("");
         device.setPackTitle(getProductTitle("PACK制造商", device.getPack()));
-        device.setSpecTitle("");
+        device.setSpecTitle(getProductTitle("化学体系", device.getChemistry()).concat(getProductTitle("电池平台", device.getPlatform())).concat(getProductTitle("容量", device.getCapacity())));
     }
 
     @Override