Browse Source

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu.git

quyueting 5 năm trước cách đây
mục cha
commit
60cfcdc861
32 tập tin đã thay đổi với 676 bổ sung278 xóa
  1. 21 0
      cloud-model/src/main/java/com/hssx/cloudmodel/controller/InjectionMoldingController.java
  2. 6 2
      cloud-model/src/main/java/com/hssx/cloudmodel/controller/MouldController.java
  3. 4 0
      cloud-model/src/main/java/com/hssx/cloudmodel/controller/VnoticeUserController.java
  4. 242 0
      cloud-model/src/main/java/com/hssx/cloudmodel/entity/InjectionMolding.java
  5. 34 8
      cloud-model/src/main/java/com/hssx/cloudmodel/entity/MouldEquipment.java
  6. 16 0
      cloud-model/src/main/java/com/hssx/cloudmodel/mapper/InjectionMoldingMapper.java
  7. 16 0
      cloud-model/src/main/java/com/hssx/cloudmodel/service/InjectionMoldingService.java
  8. 2 1
      cloud-model/src/main/java/com/hssx/cloudmodel/service/MouldService.java
  9. 20 0
      cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/InjectionMoldingServiceImpl.java
  10. 7 1
      cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldEquipmentServiceImpl.java
  11. 1 0
      cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldHistoryServiceImpl.java
  12. 12 1
      cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldServiceImpl.java
  13. 9 8
      cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/VnoticeUserServiceImpl.java
  14. 2 2
      cloud-model/src/main/java/com/hssx/cloudmodel/util/CodeGenerator.java
  15. 1 0
      cloud-model/src/main/resources/application.properties
  16. 28 0
      cloud-model/src/main/resources/mapper/InjectionMoldingMapper.xml
  17. 6 3
      cloud-model/src/main/resources/mapper/MouldEquipmentMapper.xml
  18. 112 99
      cloud-socket/src/com/js/kbt/socket/UserHandler.java
  19. 1 0
      target/classes/main/resources/application.properties
  20. 6 3
      target/classes/main/resources/mapper/MouldEquipmentMapper.xml
  21. 3 1
      target/classes/main/resources/mapper/MouldMapper.xml
  22. 1 1
      target/classes/main/resources/mapper/ProjectMapper.xml
  23. 2 2
      ys_int/config/index.js
  24. 7 2
      ys_int/src/i18n/lang/en.js
  25. 7 2
      ys_int/src/i18n/lang/zh.js
  26. 1 0
      ys_int/src/port.js
  27. 7 5
      ys_int/src/views/detection/detection.vue
  28. 59 21
      ys_int/src/views/detection/maintenance.vue
  29. 3 103
      ys_int/src/views/map/map.vue
  30. 7 5
      ys_int/src/views/mold/moldDetail.vue
  31. 8 3
      ys_int/src/views/mold/moldList.vue
  32. 25 5
      ys_int/src/views/project/project.vue

+ 21 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/controller/InjectionMoldingController.java

@@ -0,0 +1,21 @@
+package com.hssx.cloudmodel.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-29
+ */
+@RestController
+@RequestMapping("/injection-molding")
+public class InjectionMoldingController {
+
+}
+

+ 6 - 2
cloud-model/src/main/java/com/hssx/cloudmodel/controller/MouldController.java

@@ -2,6 +2,7 @@ package com.hssx.cloudmodel.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.hssx.cloudmodel.entity.InjectionMolding;
 import com.hssx.cloudmodel.entity.Mould;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.entity.vo.MouldVO;
@@ -45,18 +46,21 @@ public class MouldController {
      * 修改参数:id 模具id, settingLife 使用年限, initialModulus 初始模次 equipmentId 设备id,
      * produceCompanyId 生产方公司id,ocCycle 每模平均周期,rfid rfid码,maintainCount 保养设定次数:"1,2,3"
      *
+     * materialType 材料牌号,color 颜色,size 模具尺寸,machineTonnage 吨位,mallWeight 成品重量(单位:G),headWeight 料头重量(单位:G)
+     * maxShotWeight 最大射胶量(单位:G),minShotWeight 最小射胶量(单位:G),cycle 成型周期,commonModelTemperature 公模(动模)模温
+     * motherModelTemperature 母模(定模)模温
      * 模具更新时多传的参数  preUpdateId 要被更新的模具的id dynamicId
      * @return
      */
     @ApiOperation("添加/修改模具")
     @RequestMapping("/addOrUpdate")
     @ResponseBody
-    public HttpRespMsg addOrUpdate(Mould mould, String token, @RequestParam(required = false) Integer dynamicId) {
+    public HttpRespMsg addOrUpdate(Mould mould, InjectionMolding injectionMolding, String token, @RequestParam(required = false) Integer dynamicId) {
         HttpRespMsg msg = new HttpRespMsg();
         QueryWrapper<User> qw = new QueryWrapper<>();
         qw.eq("head_imgurl",token);
         User user = userService.getOne(qw);
-        msg = mouldService.addAndUpdateMould(mould,user,dynamicId);
+        msg = mouldService.addAndUpdateMould(mould,user,dynamicId,injectionMolding);
         return msg;
     }
 

+ 4 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/controller/VnoticeUserController.java

@@ -1,6 +1,9 @@
 package com.hssx.cloudmodel.controller;
 
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hssx.cloudmodel.entity.VnoticeUser;
 import com.hssx.cloudmodel.service.VnoticeUserService;
 import com.hssx.cloudmodel.util.HttpRespMsg;
 import com.hssx.cloudmodel.util.PageUtil;
@@ -54,3 +57,4 @@ public class VnoticeUserController {
     }
 }
 
+

+ 242 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/entity/InjectionMolding.java

@@ -0,0 +1,242 @@
+package com.hssx.cloudmodel.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-29
+ */
+public class InjectionMolding extends Model<InjectionMolding> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 模具注塑工艺信息表主键
+     */
+    @TableId(value = "injection_id", type = IdType.AUTO)
+    private Integer injectionId;
+
+    /**
+     * 材料牌号
+     */
+    @TableField("material_type")
+    private String materialType;
+
+    /**
+     * 颜色
+     */
+    @TableField("color")
+    private String color;
+
+    /**
+     * 模具尺寸
+     */
+    @TableField("size")
+    private String size;
+
+    /**
+     * 吨位
+     */
+    @TableField("machine_tonnage")
+    private String machineTonnage;
+
+    /**
+     * 成品重量(单位:G)
+     */
+    @TableField("all_weight")
+    private Double allWeight;
+
+    /**
+     * 料头重量(单位:G)
+     */
+    @TableField("head_weight")
+    private Double headWeight;
+
+    /**
+     * 最大射胶量(单位:G)
+     */
+    @TableField("min_shot_weight")
+    private Integer minShotWeight;
+
+    /**
+     * 最小射胶量(单位:G)
+     */
+    @TableField("max_shot_weight")
+    private Integer maxShotWeight;
+
+    /**
+     * 成型周期
+     */
+    @TableField("cycle")
+    private Integer cycle;
+
+    /**
+     * 公模(动模)模温
+     */
+    @TableField("common_model_temperature")
+    private String commonModelTemperature;
+
+    /**
+     * 母模(定模)模温
+     */
+    @TableField("mother_model_temperature")
+    private String motherModelTemperature;
+
+    /**
+     * 模具id
+     */
+    @TableField("mould_id")
+    private Integer mouldId;
+
+    /**
+     * 设备编号
+     */
+    @TableField("equipment_no")
+    private String equipmentNo;
+
+
+    public Integer getInjectionId() {
+        return injectionId;
+    }
+
+    public void setInjectionId(Integer injectionId) {
+        this.injectionId = injectionId;
+    }
+
+    public String getMaterialType() {
+        return materialType;
+    }
+
+    public void setMaterialType(String materialType) {
+        this.materialType = materialType;
+    }
+
+    public String getColor() {
+        return color;
+    }
+
+    public void setColor(String color) {
+        this.color = color;
+    }
+
+    public String getSize() {
+        return size;
+    }
+
+    public void setSize(String size) {
+        this.size = size;
+    }
+
+    public String getMachineTonnage() {
+        return machineTonnage;
+    }
+
+    public void setMachineTonnage(String machineTonnage) {
+        this.machineTonnage = machineTonnage;
+    }
+
+    public Double getAllWeight() {
+        return allWeight;
+    }
+
+    public void setAllWeight(Double allWeight) {
+        this.allWeight = allWeight;
+    }
+
+    public Double getHeadWeight() {
+        return headWeight;
+    }
+
+    public void setHeadWeight(Double headWeight) {
+        this.headWeight = headWeight;
+    }
+
+    public Integer getMinShotWeight() {
+        return minShotWeight;
+    }
+
+    public void setMinShotWeight(Integer minShotWeight) {
+        this.minShotWeight = minShotWeight;
+    }
+
+    public Integer getMaxShotWeight() {
+        return maxShotWeight;
+    }
+
+    public void setMaxShotWeight(Integer maxShotWeight) {
+        this.maxShotWeight = maxShotWeight;
+    }
+
+    public Integer getCycle() {
+        return cycle;
+    }
+
+    public void setCycle(Integer cycle) {
+        this.cycle = cycle;
+    }
+
+    public String getCommonModelTemperature() {
+        return commonModelTemperature;
+    }
+
+    public void setCommonModelTemperature(String commonModelTemperature) {
+        this.commonModelTemperature = commonModelTemperature;
+    }
+
+    public String getMotherModelTemperature() {
+        return motherModelTemperature;
+    }
+
+    public void setMotherModelTemperature(String motherModelTemperature) {
+        this.motherModelTemperature = motherModelTemperature;
+    }
+
+    public Integer getMouldId() {
+        return mouldId;
+    }
+
+    public void setMouldId(Integer mouldId) {
+        this.mouldId = mouldId;
+    }
+
+    public String getEquipmentNo() {
+        return equipmentNo;
+    }
+
+    public void setEquipmentNo(String equipmentNo) {
+        this.equipmentNo = equipmentNo;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.injectionId;
+    }
+
+    @Override
+    public String toString() {
+        return "InjectionMolding{" +
+        "injectionId=" + injectionId +
+        ", materialType=" + materialType +
+        ", color=" + color +
+        ", size=" + size +
+        ", machineTonnage=" + machineTonnage +
+        ", allWeight=" + allWeight +
+        ", headWeight=" + headWeight +
+        ", minShotWeight=" + minShotWeight +
+        ", maxShotWeight=" + maxShotWeight +
+        ", cycle=" + cycle +
+        ", commonModelTemperature=" + commonModelTemperature +
+        ", motherModelTemperature=" + motherModelTemperature +
+        ", mouldId=" + mouldId +
+        ", equipmentNo=" + equipmentNo +
+        "}";
+    }
+}

+ 34 - 8
cloud-model/src/main/java/com/hssx/cloudmodel/entity/MouldEquipment.java

@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.annotation.JsonFormat;
-
 import java.io.Serializable;
 
 /**
@@ -16,7 +14,7 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-10-10
+ * @since 2019-10-28
  */
 @TableName("tb_mould_equipment")
 public class MouldEquipment extends Model<MouldEquipment> {
@@ -39,14 +37,12 @@ public class MouldEquipment extends Model<MouldEquipment> {
      * 启动时间
      */
     @TableField("start_time")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime startTime;
 
     /**
      * 结束时间
      */
     @TableField("end_time")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime endTime;
 
     /**
@@ -74,7 +70,7 @@ public class MouldEquipment extends Model<MouldEquipment> {
     private Integer isUse;
 
     /**
-     * 告警电量(默认30%)
+     * 告警电量
      */
     @TableField("hill_number")
     private String hillNumber;
@@ -92,7 +88,7 @@ public class MouldEquipment extends Model<MouldEquipment> {
     private Double lat;
 
     /**
-     * 告警模盒温度(默认80度)
+     * 告警模盒温度
      */
     @TableField("temperature")
     private Integer temperature;
@@ -104,7 +100,7 @@ public class MouldEquipment extends Model<MouldEquipment> {
     private String agent;
 
     /**
-     * 状态,0-正常,1-温度过高,2-电量过低,3-温度过高且电量低
+     * 状态,0-正常,1-温度过高,2-电量过低,3-安装被拆
      */
     @TableField("stage")
     private Integer stage;
@@ -115,6 +111,18 @@ public class MouldEquipment extends Model<MouldEquipment> {
     @TableField("sim")
     private String sim;
 
+    /**
+     * 当前电量
+     */
+    @TableField("curhill_number")
+    private String curhillNumber;
+
+    /**
+     * 当前温度
+     */
+    @TableField("curtemperature")
+    private Integer curtemperature;
+
 
     public Integer getId() {
         return id;
@@ -236,6 +244,22 @@ public class MouldEquipment extends Model<MouldEquipment> {
         this.sim = sim;
     }
 
+    public String getCurhillNumber() {
+        return curhillNumber;
+    }
+
+    public void setCurhillNumber(String curhillNumber) {
+        this.curhillNumber = curhillNumber;
+    }
+
+    public Integer getCurtemperature() {
+        return curtemperature;
+    }
+
+    public void setCurtemperature(Integer curtemperature) {
+        this.curtemperature = curtemperature;
+    }
+
     @Override
     protected Serializable pkVal() {
         return this.id;
@@ -259,6 +283,8 @@ public class MouldEquipment extends Model<MouldEquipment> {
         ", agent=" + agent +
         ", stage=" + stage +
         ", sim=" + sim +
+        ", curhillNumber=" + curhillNumber +
+        ", curtemperature=" + curtemperature +
         "}";
     }
 }

+ 16 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/InjectionMoldingMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.cloudmodel.mapper;
+
+import com.hssx.cloudmodel.entity.InjectionMolding;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-28
+ */
+public interface InjectionMoldingMapper extends BaseMapper<InjectionMolding> {
+
+}

+ 16 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/InjectionMoldingService.java

@@ -0,0 +1,16 @@
+package com.hssx.cloudmodel.service;
+
+import com.hssx.cloudmodel.entity.InjectionMolding;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-28
+ */
+public interface InjectionMoldingService extends IService<InjectionMolding> {
+
+}

+ 2 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/MouldService.java

@@ -1,5 +1,6 @@
 package com.hssx.cloudmodel.service;
 
+import com.hssx.cloudmodel.entity.InjectionMolding;
 import com.hssx.cloudmodel.entity.Mould;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.hssx.cloudmodel.entity.User;
@@ -17,7 +18,7 @@ import com.hssx.cloudmodel.util.HttpRespMsg;
  */
 public interface MouldService extends IService<Mould> {
 
-    HttpRespMsg addAndUpdateMould(Mould mould, User user,Integer dynamicId);
+    HttpRespMsg addAndUpdateMould(Mould mould, User user,Integer dynamicId,InjectionMolding injectionMolding);
 
     HttpRespMsg getMoildDetail(MouldVO mould);
 

+ 20 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/InjectionMoldingServiceImpl.java

@@ -0,0 +1,20 @@
+package com.hssx.cloudmodel.service.impl;
+
+import com.hssx.cloudmodel.entity.InjectionMolding;
+import com.hssx.cloudmodel.mapper.InjectionMoldingMapper;
+import com.hssx.cloudmodel.service.InjectionMoldingService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-28
+ */
+@Service
+public class InjectionMoldingServiceImpl extends ServiceImpl<InjectionMoldingMapper, InjectionMolding> implements InjectionMoldingService {
+
+}

+ 7 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldEquipmentServiceImpl.java

@@ -116,7 +116,13 @@ public class MouldEquipmentServiceImpl extends ServiceImpl<MouldEquipmentMapper,
             for (String str : split) {
                 packet = mouldDownPacketMapper.selectOne(new QueryWrapper<MouldDownPacket>().eq("equipment_no", str));
                 MouldEquipment equipment = new MouldEquipment();
-                equipment.setIsUse(mouldEquipment.getIsUse());
+                if(1 == mouldEquipment.getIsUse()){
+                    //启用中
+                    equipment.setIsUse(2);
+                }else if(0 == mouldEquipment.getIsUse()){
+                    //停用中
+                    equipment.setIsUse(3);
+                }
                 equipment.setEquipmentNo(mouldEquipment.getEquipmentNo());
                 equipment.setHillNumber(mouldEquipment.getLowPowerLimit()+"");
                 equipment.setTemperature(mouldEquipment.getHotAlarmLimit());

+ 1 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldHistoryServiceImpl.java

@@ -139,6 +139,7 @@ public class MouldHistoryServiceImpl extends ServiceImpl<MouldHistoryMapper, Mou
         Map<String, List<MouldHistoryVO>> mapList = list.stream().collect(Collectors.groupingBy(MouldHistoryVO::getTime));
         MouldHistoryTimeVO vo = new MouldHistoryTimeVO();
         for(Map.Entry<String, List<MouldHistoryVO>> entry:mapList.entrySet()){
+            System.out.println("-----"+entry);
             vo.setMinCycle(entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             vo.setMaxCycle(entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt());
             vo.setAvgCycle((int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());

+ 12 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldServiceImpl.java

@@ -12,6 +12,7 @@ import com.hssx.cloudmodel.entity.vo.MouldVO;
 import com.hssx.cloudmodel.entity.vo.ProjectVO;
 import com.hssx.cloudmodel.entity.vo.UserVO;
 import com.hssx.cloudmodel.mapper.*;
+import com.hssx.cloudmodel.service.InjectionMoldingService;
 import com.hssx.cloudmodel.service.MouldService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.hssx.cloudmodel.util.*;
@@ -60,9 +61,11 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
     NewsNoticeUserMapper newsNoticeUserMapper;
     @Resource
     MouldFileMapper mouldFileMapper;
+    @Resource
+    InjectionMoldingMapper injectionMoldingMapper;
 
     @Override
-    public HttpRespMsg addAndUpdateMould(Mould mould, User user, Integer dynamicId) {
+    public HttpRespMsg addAndUpdateMould(Mould mould, User user, Integer dynamicId,InjectionMolding injectionMolding) {
         HttpRespMsg msg = new HttpRespMsg();
         if (mould.getId() != null) {
             //修改
@@ -75,6 +78,9 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
                     mould.setArea(company.getCompanyAddress());
                 }
                 mouldMapper.updateById(mould);
+                InjectionMolding molding = injectionMoldingMapper.selectOne(new QueryWrapper<InjectionMolding>().eq("mould_id", mould.getId()));
+                injectionMolding.setInjectionId(molding.getInjectionId());
+                injectionMoldingMapper.updateById(injectionMolding);
                 msg.data = mould;
             } else {
                 msg.setError("当前模具编号已存在,请重新输入其他模具编号");
@@ -119,6 +125,9 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
                 mould.setBelongProjectGrade(0 + "");
                 mould.setHistoryRunTimes(model.getRunTimes());
                 mouldMapper.insert(mould);
+                InjectionMolding molding = injectionMoldingMapper.selectOne(new QueryWrapper<InjectionMolding>().eq("mould_id", model.getId()));
+                molding.setMouldId(mould.getId());
+                injectionMoldingMapper.updateById(injectionMolding);
                 msg.data = mould;
                 //将之前的模具与项目和设备解绑
                 mouldMapper.updateModelProjectIdAndEquipmentIdToNullById(model);
@@ -137,6 +146,8 @@ public class MouldServiceImpl extends ServiceImpl<MouldMapper, Mould> implements
                     mould.setCreatorId(user.getId());
                     mould.setCompanyId(user.getCompanyId());
                     mouldMapper.insert(mould);
+                    injectionMolding.setMouldId(mould.getId());
+                    injectionMoldingMapper.insert(injectionMolding);
                     msg.data = mould;
                 }
             }

+ 9 - 8
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/VnoticeUserServiceImpl.java

@@ -50,27 +50,28 @@ public class VnoticeUserServiceImpl extends ServiceImpl<VnoticeUserMapper, Vnoti
         if (user != null) {
             Map<String, Object> map = new HashMap<>();
             //加载全部
-            System.out.println(page.getPageNum()+" "+page.getPageSize());
             PageHelper.startPage(page.getPageNum(), page.getPageSize());
-            list = vnoticeUserMapper.selectList(new QueryWrapper<VnoticeUser>().eq("user_id", user.getId()).eq("notice_type", Constant.APPROVEL_TYPE).orderByDesc("id"));
-            long count = list.stream().filter(x -> x.getIsRead() == 0).count();
+            list = vnoticeUserMapper.selectList(new QueryWrapper<VnoticeUser>().eq("user_id", user.getId()).eq("notice_type", Constant.APPROVEL_TYPE).orderByDesc("id").last(""));
+            long count1 = list.stream().filter(x -> x.getIsRead() == 0).count();
             PageInfo<VnoticeUser> pageInfo = new PageInfo<VnoticeUser>(list);
             map.put("approvelList", pageInfo);
-            map.put("isNotReadCount", count);
+            map.put("isNotReadCount", count1);
             mapList.add(map);
+            PageHelper.startPage(page.getPageNum(), page.getPageSize());
             List<VnoticeUser> list1 = vnoticeUserMapper.selectList(new QueryWrapper<VnoticeUser>().eq("user_id", user.getId()).eq("notice_type",Constant.MAINTAIN_TYPE).orderByDesc("id"));
-            count = list.stream().filter(x -> x.getIsRead() == 0).count();
+            long count2 = list1.stream().filter(x -> x.getIsRead() == 0).count();
             PageInfo<VnoticeUser> pageInfo1 = new PageInfo<VnoticeUser>(list1);
             Map<String, Object> map1 = new HashMap<>();
             map1.put("matainList", pageInfo1);
-            map1.put("isNotReadCount", count);
+            map1.put("isNotReadCount", count2);
             mapList.add(map1);
+            PageHelper.startPage(page.getPageNum(), page.getPageSize());
             List<VnoticeUser> list2 = vnoticeUserMapper.selectList(new QueryWrapper<VnoticeUser>().eq("user_id", user.getId()).eq("notice_type",Constant.EMERGENCY_TYPE).orderByDesc("id"));
-            count = list.stream().filter(x -> x.getIsRead() == 0).count();
+            long count3 = list2.stream().filter(x -> x.getIsRead() == 0).count();
             PageInfo<VnoticeUser> pageInfo2 = new PageInfo<VnoticeUser>(list2);
             Map<String, Object> map2 = new HashMap<>();
             map2.put("emergencyList", pageInfo2);
-            map2.put("isNotReadCount", count);
+            map2.put("isNotReadCount", count3);
             mapList.add(map2);
             msg.data = mapList;
         } else {

+ 2 - 2
cloud-model/src/main/java/com/hssx/cloudmodel/util/CodeGenerator.java

@@ -92,7 +92,7 @@ public class CodeGenerator {
 
         // 数据源配置
         DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8");
+        dsc.setUrl("jdbc:mysql://118.190.47.230:3306/cloud_model_test?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8");
 //        dsc.setSchemaName("public");
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
         dsc.setUsername("root");
@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("mould_cycle_runtime");
+        strategy.setInclude("injection_molding");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 1 - 0
cloud-model/src/main/resources/application.properties

@@ -13,6 +13,7 @@ spring.thymeleaf.jackson.date-format=yyyy-MM-dd HH:mm:ss
 # ####################################################################################################
 # Êý¾ÝÔ´ÅäÖÃ
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model_test?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.username=root
 spring.datasource.password=p011430seya1026

+ 28 - 0
cloud-model/src/main/resources/mapper/InjectionMoldingMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hssx.cloudmodel.mapper.InjectionMoldingMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.InjectionMolding">
+        <id column="injection_id" property="injectionId" />
+        <result column="material_type" property="materialType" />
+        <result column="color" property="color" />
+        <result column="size" property="size" />
+        <result column="machine_tonnage" property="machineTonnage" />
+        <result column="all_weight" property="allWeight" />
+        <result column="head_weight" property="headWeight" />
+        <result column="min_shot_weight" property="minShotWeight" />
+        <result column="max_shot_weight" property="maxShotWeight" />
+        <result column="cycle" property="cycle" />
+        <result column="common_model_temperature" property="commonModelTemperature" />
+        <result column="mother_model_temperature" property="motherModelTemperature" />
+        <result column="mould_id" property="mouldId" />
+        <result column="equipment_no" property="equipmentNo" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        injection_id, material_type, color, size, machine_tonnage, all_weight, head_weight, min_shot_weight, max_shot_weight, cycle, common_model_temperature, mother_model_temperature, mould_id, equipment_no
+    </sql>
+
+</mapper>

+ 6 - 3
cloud-model/src/main/resources/mapper/MouldEquipmentMapper.xml

@@ -19,12 +19,15 @@
         <result column="agent" property="agent" />
         <result column="stage" property="stage" />
         <result column="sim" property="sim" />
+        <result column="curhill_number" property="curhillNumber" />
+        <result column="curtemperature" property="curtemperature" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, equipment_name, start_time, end_time, use_life, belong_company_id, equipment_no, is_use, hill_number, lng, lat, temperature, agent, stage, sim
+        id, equipment_name, start_time, end_time, use_life, belong_company_id, equipment_no, is_use, hill_number, lng, lat, temperature, agent, stage, sim, curhill_number, curtemperature
     </sql>
+
     <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.MouldEquipmentVO">
         <id column="id" property="id" />
         <result column="equipment_name" property="equipmentName" />
@@ -71,8 +74,8 @@
         select
         tbme.id id, tbme.equipment_no,tbme.equipment_name equipment_name, tbme.start_time start_time, tbme.end_time end_time,tbme.agent,
         tbme.use_life use_life, tbme.belong_company_id belong_company_id, tbme.equipment_no equipment_no,tbme.sim sim,
-        tbme.is_use, (SELECT battery  FROM `mould_history` WHERE tbme.equipment_no = equipment_no ORDER BY indate DESC LIMIT 1) hill_number,
-        (SELECT temperature  FROM `mould_history` WHERE equipment_no = tbme.equipment_no ORDER BY indate DESC LIMIT 1) temperature,tbc.company_name companyName,
+        tbme.is_use, tbme.curhill_number hill_number,
+        tbme.curtemperature temperature,tbc.company_name companyName,
         tbm.model_no modelNo,tbme.temperature alarmDegree,tbme.hill_number alarmBattery,
         tbm.model_name modelName,tbme.stage
         from

+ 112 - 99
cloud-socket/src/com/js/kbt/socket/UserHandler.java

@@ -76,7 +76,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		System.out.println("收到===" + arg1 + "\n");
 		String equipmentNo = processMsg(arg1);
 		// 以下是配置下行数据
-		// sendPackage(equipmentNo);
+		 sendPackage(equipmentNo);
 	}
 
 	private String processMsg(String input) throws ParseException {
@@ -176,7 +176,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 			// 本次运行周期内的开合模次数
 			int periodCnt = (end - start * 2) / 24;
 			logger.info("本次开合模次数==" + periodCnt);
-			long  aHeadOpenTimeLongVal = 0L;
+			long aHeadOpenTimeLongVal = 0L;
 			for (int pos = 0; pos < periodCnt; pos++) {
 				// 合模时间
 				MouldHistoryTime time = new MouldHistoryTime();
@@ -188,18 +188,18 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 				// 开模时间
 				Date openTime = parseDate(input, start, pos, 6);
 				time.setOpenTime(openTime);
-				if(pos==0){
+				if (pos == 0) {
 					time.setTimeCost(0);
-				}else{
-					logger.info("本次开合周期--"+(openTime.getTime() - aHeadOpenTimeLongVal));
-					time.setTimeCost((int)(openTime.getTime() - aHeadOpenTimeLongVal));
+				} else {
+					logger.info("本次开合周期--" + (openTime.getTime() - aHeadOpenTimeLongVal));
+					time.setTimeCost((int) (openTime.getTime() - aHeadOpenTimeLongVal));
 				}
 				mouldHistoryTimeMapper.insertSelective(time);
-				//处理周期逻辑
-				handleMouldCycleRuntimeLogic(openTime,item);
+				// 处理周期逻辑
+				handleMouldCycleRuntimeLogic(openTime, item);
 				logger.info("mouldHistoryTime数据添加完毕");
 				aHeadOpenTimeLongVal = openTime.getTime();
-				logger.info("上一包数据的开合时间戳--"+aHeadOpenTimeLongVal);
+				logger.info("上一包数据的开合时间戳--" + aHeadOpenTimeLongVal);
 			}
 		} else {
 			logger.info("本次开合模次数==0");
@@ -222,27 +222,29 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		List<MouldHistoryTime> historyList = mouldHistoryTimeMapper.selectByExample(mtExp);
 		int avgTime = 0;
 		int totalTime = 0;
-//		if (historyList.size() == 1) {
-//			// 证明盒子动了,找寻上一条记录
-//			if (newList.size() > 0) {
-//				MouldHistoryTime now = historyList.get(0);
-//				MouldHistoryTime last = mouldHistoryTimeMapper.getDateByHistory(newList.get(0).getId());
-//				if (null != now && null != last) {
-//					avgTime = (int)((now.getOpenTime().getTime()) - (last.getOpenTime().getTime()));
-//				}
-//			}
-//		} else {
-			if (historyList.size() > 1) {
-				for (int j = 0; j < historyList.size() - 1; j++) {
-					totalTime += (historyList.get(j + 1).getOpenTime().getTime()
-							- historyList.get(j).getOpenTime().getTime());
-				}
-				logger.info("totalTime" + totalTime);
-				avgTime = (int)(totalTime / (historyList.size() - 1));
+		// if (historyList.size() == 1) {
+		// // 证明盒子动了,找寻上一条记录
+		// if (newList.size() > 0) {
+		// MouldHistoryTime now = historyList.get(0);
+		// MouldHistoryTime last =
+		// mouldHistoryTimeMapper.getDateByHistory(newList.get(0).getId());
+		// if (null != now && null != last) {
+		// avgTime = (int)((now.getOpenTime().getTime()) -
+		// (last.getOpenTime().getTime()));
+		// }
+		// }
+		// } else {
+		if (historyList.size() > 1) {
+			for (int j = 0; j < historyList.size() - 1; j++) {
+				totalTime += (historyList.get(j + 1).getOpenTime().getTime()
+						- historyList.get(j).getOpenTime().getTime());
 			}
-//		}
+			logger.info("totalTime" + totalTime);
+			avgTime = (int) (totalTime / (historyList.size() - 1));
+		}
+		// }
 		logger.info("avgTime-->" + avgTime);
-		
+
 		handleModLogic(item, avgTime);
 		// 判断预留字节的
 		if ("02".equals(mobilePart)) {
@@ -266,9 +268,16 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		List<MouldDownPacket> list = mouldDownPacketMapper.selectByExample(exp);
 		if (list.size() > 0) {
 			MouldDownPacket packet = list.get(0);
-			if (0 == packet.getIsUse()) {
-				logger.info("开始下发数据包==>" + packet.getPacketStr());
-				sendMsg(packet.getPacketStr());
+			TbMouldEquipmentExample meqExp = new TbMouldEquipmentExample();
+			meqExp.createCriteria().andEquipmentNoEqualTo(equipmentNo);
+			long count = tbMouldEquipmentMapper.countByExample(meqExp);
+			// 下发数据包,下发完后修改状态
+			logger.info("开始下发数据包==>" + packet.getPacketStr());
+			sendMsg(packet.getPacketStr());
+			if (count > 0) {
+				TbMouldEquipment me = tbMouldEquipmentMapper.selectByExample(meqExp).get(0);
+				me.setIsUse(packet.getIsUse());
+				tbMouldEquipmentMapper.updateByPrimaryKeySelective(me);
 			}
 		}
 	}
@@ -294,7 +303,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 
 	private void handleModLogic(MouldHistory item, int avgTime) {
 		logger.info("进了handleModLogic逻辑--");
-		logger.info("item==>"+item);
+		logger.info("item==>" + item);
 		TbMouldEquipmentExample meqExp = new TbMouldEquipmentExample();
 		meqExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
 		if (tbMouldEquipmentMapper.countByExample(meqExp) > 0) {
@@ -362,15 +371,18 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	}
 
 	private static Date parseDate(String input, int start, int pos, int dateStartPos) {
-		//pos为开合的一组的下标,一个开合时间占位是12*2
+		// pos为开合的一组的下标,一个开合时间占位是12*2
 		String year = input.substring((start + pos * 12 + dateStartPos) * 2, (start + pos * 12 + 1 + dateStartPos) * 2);
 		String month = input.substring((start + pos * 12 + 1 + dateStartPos) * 2,
 				(start + pos * 12 + 2 + dateStartPos) * 2);
 		String day = input.substring((start + pos * 12 + 2 + dateStartPos) * 2,
 				(start + pos * 12 + 3 + dateStartPos) * 2);
-		String hh = input.substring((start + pos * 12 + 3 + dateStartPos) * 2, (start + pos * 12 + 4 + dateStartPos) * 2);
-		String mm = input.substring((start + pos * 12 + 4 + dateStartPos) * 2, (start + pos * 12 + 5 + dateStartPos) * 2);
-		String ss = input.substring((start + pos * 12 + 5 + dateStartPos) * 2, (start + pos * 12 + 6 + dateStartPos) * 2);
+		String hh = input.substring((start + pos * 12 + 3 + dateStartPos) * 2,
+				(start + pos * 12 + 4 + dateStartPos) * 2);
+		String mm = input.substring((start + pos * 12 + 4 + dateStartPos) * 2,
+				(start + pos * 12 + 5 + dateStartPos) * 2);
+		String ss = input.substring((start + pos * 12 + 5 + dateStartPos) * 2,
+				(start + pos * 12 + 6 + dateStartPos) * 2);
 		StringBuilder sb = new StringBuilder();
 		int yearInt = Integer.parseInt(year, 16);
 		if (yearInt == 0) {
@@ -395,86 +407,88 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		}
 		return parseDate;
 	}
-	
-	private void handleMouldCycleRuntimeLogic(Date openTime,MouldHistory item) throws ParseException{
+
+	private void handleMouldCycleRuntimeLogic(Date openTime, MouldHistory item) throws ParseException {
 		MouldCycleRuntime mcr = new MouldCycleRuntime();
 		Integer hours = openTime.getHours();
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 		SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:");
-		int housTime = openTime.getHours()-1;
+		int housTime = openTime.getHours() - 1;
 		openTime.setHours(housTime);
 		String lastOpenTime = sdf.format(openTime);
-		Date lastOpenTimeDate = sdf1.parse(lastOpenTime+"59:59");
+		Date lastOpenTimeDate = sdf1.parse(lastOpenTime + "59:59");
 		MouldHistoryTimeExample mExp = new MouldHistoryTimeExample();
 		mExp.setOrderByClause("open_time desc limit 1");
-		mExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo()).andOpenTimeLessThanOrEqualTo(lastOpenTimeDate);
+		mExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo())
+				.andOpenTimeLessThanOrEqualTo(lastOpenTimeDate);
 		List<MouldHistoryTime> list = mouldHistoryTimeMapper.selectByExample(mExp);
-		if(list.size()>0){
+		if (list.size() > 0) {
 			MouldHistory mouldHistory = mouldHistoryMapper.selectByPrimaryKey(list.get(0).getHistoryId());
 			mcr.setDateStr(sdf.format(openTime));
 			mcr.setEquipmentNo(item.getEquipmentNo());
 			mcr.setRuntime(item.getRunCnt() - mouldHistory.getRunCnt());
-			if(hours==0){
+			if (hours == 0) {
 				mcr.setTimeSlot("00:00-01:00");
-			}else if(hours==1){
+			} else if (hours == 1) {
 				mcr.setTimeSlot("01:00-02:00");
-			}else if(hours==2){
+			} else if (hours == 2) {
 				mcr.setTimeSlot("02:00-03:00");
-			}else if(hours==3){
+			} else if (hours == 3) {
 				mcr.setTimeSlot("03:00-04:00");
-			}else if(hours==4){
+			} else if (hours == 4) {
 				mcr.setTimeSlot("04:00-05:00");
-			}else if(hours==5){
+			} else if (hours == 5) {
 				mcr.setTimeSlot("05:00-06:00");
-			}else if(hours==6){
+			} else if (hours == 6) {
 				mcr.setTimeSlot("06:00-07:00");
-			}else if(hours==7){
+			} else if (hours == 7) {
 				mcr.setTimeSlot("07:00-08:00");
-			}else if(hours==8){
+			} else if (hours == 8) {
 				mcr.setTimeSlot("08:00-09:00");
-			}else if(hours==9){
+			} else if (hours == 9) {
 				mcr.setTimeSlot("09:00-10:00");
-			}else if(hours==10){
+			} else if (hours == 10) {
 				mcr.setTimeSlot("10:00-11:00");
-			}else if(hours==11){
+			} else if (hours == 11) {
 				mcr.setTimeSlot("11:00-12:00");
-			}else if(hours==12){
+			} else if (hours == 12) {
 				mcr.setTimeSlot("12:00-13:00");
-			}else if(hours==13){
+			} else if (hours == 13) {
 				mcr.setTimeSlot("13:00-14:00");
-			}else if(hours==14){
+			} else if (hours == 14) {
 				mcr.setTimeSlot("14:00-15:00");
-			}else if(hours==15){
+			} else if (hours == 15) {
 				mcr.setTimeSlot("15:00-16:00");
-			}else if(hours==16){
+			} else if (hours == 16) {
 				mcr.setTimeSlot("16:00-17:00");
-			}else if(hours==17){
+			} else if (hours == 17) {
 				mcr.setTimeSlot("17:00-18:00");
-			}else if(hours==18){
+			} else if (hours == 18) {
 				mcr.setTimeSlot("18:00-19:00");
-			}else if(hours==19){
+			} else if (hours == 19) {
 				mcr.setTimeSlot("19:00-20:00");
-			}else if(hours==20){
+			} else if (hours == 20) {
 				mcr.setTimeSlot("20:00-21:00");
-			}else if(hours==21){
+			} else if (hours == 21) {
 				mcr.setTimeSlot("21:00-22:00");
-			}else if(hours==22){
+			} else if (hours == 22) {
 				mcr.setTimeSlot("22:00-23:00");
-			}else if(hours==23){
+			} else if (hours == 23) {
 				mcr.setTimeSlot("23:00-00:00");
 			}
 			MouldCycleRuntimeExample mcrExp = new MouldCycleRuntimeExample();
-			mcrExp.createCriteria().andDateStrEqualTo(mcr.getDateStr()).andEquipmentNoEqualTo(item.getEquipmentNo()).andTimeSlotEqualTo(mcr.getTimeSlot());
+			mcrExp.createCriteria().andDateStrEqualTo(mcr.getDateStr()).andEquipmentNoEqualTo(item.getEquipmentNo())
+					.andTimeSlotEqualTo(mcr.getTimeSlot());
 			List<MouldCycleRuntime> mList = mouldCycleRuntimeMapper.selectByExample(mcrExp);
-			if(mList.size()>0){
+			if (mList.size() > 0) {
 				mcr.setId(mList.get(0).getId());
 				mouldCycleRuntimeMapper.updateByPrimaryKeySelective(mcr);
-			}else{
+			} else {
 				mouldCycleRuntimeMapper.insertSelective(mcr);
 			}
 		}
 	}
-	
+
 	private static String getStringFromHexStr(String hexStr) {
 		StringBuilder sb = new StringBuilder();
 		for (int i = 0; i < hexStr.length() / 2; i++) {
@@ -611,12 +625,12 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	}
 
 	public static void main(String[] args) throws ParseException {
-//		UserHandler h = new UserHandler();
-//		h.timeCalibration();
+		// UserHandler h = new UserHandler();
+		// h.timeCalibration();
 		String a = "00:25:32";
 		SimpleDateFormat s = new SimpleDateFormat("HH:mm:ss");
 		Date d = new Date();
-//		System.out.println(s.parse(a).getHours());
+		// System.out.println(s.parse(a).getHours());
 		// Date date = new Date();
 		// SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd,HH:mm:ss");
 		// String dateStr = sdf.format(date);
@@ -629,8 +643,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 
 		// String str = "1F51";
 		String input = "FAAF530000000000000000000000003137333030303239343310010000000000000000000"
-				+ "000000000000000000000001F51E85F00000000000045004A"
-				+ "54000100110000001308160F171F1308160F2D188FCA";
+				+ "000000000000000000000001F51E85F00000000000045004A" + "54000100110000001308160F171F1308160F2D188FCA";
 		// String temp = "0x"+str;
 		// int i = Integer.decode(temp);
 		// System.out.println(i);
@@ -640,29 +653,29 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		// System.out.println(str.substring(69*2));
 		// Date d = parseDate(str, start, 0, 0);
 		// System.out.println(d.toGMTString());
-//		int start = 69;
-//		int end = input.length() - 4; // 最后2位 0xXX,0xXX ,是CRC校验位
-//		logger.info("时间信息==" + input.substring(start * 2, end));
-//		if (end - start * 2 >= 24) {// 时间最少6位,1位显示0x00,开合算两个时间,所以是6*2*2=24
-//			// 本次运行周期内的开合模次数
-//			int periodCnt = (end - start * 2) / 24;
-//			logger.info("本次开合模次数==" + periodCnt);
-//			for (int pos = 0; pos < periodCnt; pos++) {
-//				// 合模时间
-//				MouldHistoryTime time = new MouldHistoryTime();
-//				time.setSeq(pos + 1);
-//				Date closeTime = parseDate(input, start, pos, 0);
-//				System.out.println(closeTime);
-//				time.setCloseTime(closeTime);
-//				// 开模时间
-//				Date openTime = parseDate(input, start, pos, 6);
-//				time.setOpenTime(openTime);
-//				System.out.println(openTime);
-//				int timeCost = (int) (openTime.getTime() - closeTime.getTime());
-//				time.setTimeCost(timeCost);
-//			}
-//		} else {
-//			logger.info("本次开合模次数==0");
-//		}
+		// int start = 69;
+		// int end = input.length() - 4; // 最后2位 0xXX,0xXX ,是CRC校验位
+		// logger.info("时间信息==" + input.substring(start * 2, end));
+		// if (end - start * 2 >= 24) {// 时间最少6位,1位显示0x00,开合算两个时间,所以是6*2*2=24
+		// // 本次运行周期内的开合模次数
+		// int periodCnt = (end - start * 2) / 24;
+		// logger.info("本次开合模次数==" + periodCnt);
+		// for (int pos = 0; pos < periodCnt; pos++) {
+		// // 合模时间
+		// MouldHistoryTime time = new MouldHistoryTime();
+		// time.setSeq(pos + 1);
+		// Date closeTime = parseDate(input, start, pos, 0);
+		// System.out.println(closeTime);
+		// time.setCloseTime(closeTime);
+		// // 开模时间
+		// Date openTime = parseDate(input, start, pos, 6);
+		// time.setOpenTime(openTime);
+		// System.out.println(openTime);
+		// int timeCost = (int) (openTime.getTime() - closeTime.getTime());
+		// time.setTimeCost(timeCost);
+		// }
+		// } else {
+		// logger.info("本次开合模次数==0");
+		// }
 	}
 }

+ 1 - 0
target/classes/main/resources/application.properties

@@ -13,6 +13,7 @@ spring.thymeleaf.jackson.date-format=yyyy-MM-dd HH:mm:ss
 # ####################################################################################################
 # Êý¾ÝÔ´ÅäÖÃ
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model_test?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.username=root
 spring.datasource.password=p011430seya1026

+ 6 - 3
target/classes/main/resources/mapper/MouldEquipmentMapper.xml

@@ -19,12 +19,15 @@
         <result column="agent" property="agent" />
         <result column="stage" property="stage" />
         <result column="sim" property="sim" />
+        <result column="curhill_number" property="curhillNumber" />
+        <result column="curtemperature" property="curtemperature" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, equipment_name, start_time, end_time, use_life, belong_company_id, equipment_no, is_use, hill_number, lng, lat, temperature, agent, stage, sim
+        id, equipment_name, start_time, end_time, use_life, belong_company_id, equipment_no, is_use, hill_number, lng, lat, temperature, agent, stage, sim, curhill_number, curtemperature
     </sql>
+
     <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.MouldEquipmentVO">
         <id column="id" property="id" />
         <result column="equipment_name" property="equipmentName" />
@@ -71,8 +74,8 @@
         select
         tbme.id id, tbme.equipment_no,tbme.equipment_name equipment_name, tbme.start_time start_time, tbme.end_time end_time,tbme.agent,
         tbme.use_life use_life, tbme.belong_company_id belong_company_id, tbme.equipment_no equipment_no,tbme.sim sim,
-        tbme.is_use, (SELECT battery  FROM `mould_history` WHERE tbme.equipment_no = equipment_no ORDER BY indate DESC LIMIT 1) hill_number,
-        (SELECT temperature  FROM `mould_history` WHERE equipment_no = tbme.equipment_no ORDER BY indate DESC LIMIT 1) temperature,tbc.company_name companyName,
+        tbme.is_use, tbme.curhill_number hill_number,
+        tbme.curtemperature temperature,tbc.company_name companyName,
         tbm.model_no modelNo,tbme.temperature alarmDegree,tbme.hill_number alarmBattery,
         tbm.model_name modelName,tbme.stage
         from

+ 3 - 1
target/classes/main/resources/mapper/MouldMapper.xml

@@ -111,8 +111,9 @@
         on
         tbco.id = tbm.produce_company_id
         <where>
+            tbp.is_delete = 0
             <if test="userVO.parentId != 0">
-                tbm.company_id = #{userVO.companyId}
+                AND  tbm.company_id = #{userVO.companyId}
             </if>
             <if test="userVO.searchType == 0 and userVO.keyName != '' and userVO.keyName != null">
                 AND tbm.model_no like concat('%',#{userVO.keyName},'%')
@@ -161,6 +162,7 @@
         on
         tbco.id = tbm.produce_company_id
         <where>
+            tbp.is_delete = 0
             <if test="userVO.searchType == 0 and userVO.keyName != '' and userVO.keyName != null">
                 AND tbm.model_no like concat('%',#{userVO.keyName},'%')
             </if>

+ 1 - 1
target/classes/main/resources/mapper/ProjectMapper.xml

@@ -72,7 +72,7 @@
         select
         p.id id,p.project_name project_name, p.creator creator,tbc.id owner_company,
         tbc.company_name owner_company_name,p.manager_id manager_id,p.manager manager,
-        p.indate indate
+        p.indate indate,p.is_delete
         from
         tb_project p
         left join tb_project_user pu

+ 2 - 2
ys_int/config/index.js

@@ -20,7 +20,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
         '/api': {    
-            target: 'http://192.168.101.6:8099',  // 接口域名 开发
+            target: 'http://192.168.101.166:8099',  // 接口域名 开发
             secure: true,  // 如果是https接口,需要配置这个参数
             changeOrigin: true,  //是否跨域
             pathRewrite: { // 如果接口本身没有api的路径,那么这里将发送到后端的请求重写为没有api的路径
@@ -28,7 +28,7 @@ module.exports = {
             }
         },
         '/ips': {    
-            target: 'http://192.168.101.6:8080',  // 接口域名 开发
+            target: 'http://192.168.101.166:8080',  // 接口域名 开发
             secure: true,  // 如果是https接口,需要配置这个参数
             changeOrigin: true,  //是否跨域
             pathRewrite: { // 如果接口本身没有api的路径,那么这里将发送到后端的请求重写为没有api的路径

+ 7 - 2
ys_int/src/i18n/lang/en.js

@@ -135,6 +135,7 @@ const lang = {
         remove: "Installation is removed",
         temperature: "Temperature",
         initialModulus: "Accumulative Open Frequency",
+        theoryCycle: "Theoretical Cycle",
 	},
 	// 项目管理
     project: {
@@ -148,7 +149,9 @@ const lang = {
 		manager: "Project Manager",
 		inputManager: "Please select project manager",
 		indate: "Creat Time",
-		addPro: "Add Project",
+        addPro: "Add Project",
+        invalid: "Invalid",
+        expired: "Expired",
 		// 项目详情
 		detail: "Basic Project Information",
 		projectNo: "Project No",
@@ -232,7 +235,9 @@ const lang = {
 		maintainCount: "Maintenance times",
 		inputmaintainCount: "Please choose the number of maintenance times.",
 		num0: "Please fill in numbers greater than 0",
-		num1: "Please fill in a number less than or equal to 100 million",
+        num1: "Please fill in a number less than or equal to 100 million",
+        abnormal: "Abnormal",
+        dropped: "Dropped",
 		// 模具详情
 		beScrapped: "To be scrapped",
 		scraped: "Scrap",

+ 7 - 2
ys_int/src/i18n/lang/zh.js

@@ -135,6 +135,7 @@ const lang = {
         remove: "安装被拆",
         temperature: "温度",
         initialModulus: "累计开合次数",
+        theoryCycle: "理论周期",
 	},
 	// 项目管理
     project: {
@@ -148,7 +149,9 @@ const lang = {
 		manager: "项目经理",
 		inputManager: "请选择项目经理",
 		indate: "创建时间",
-		addPro: "新增项目",
+        addPro: "新增项目",
+        invalid: "失效",
+        expired: "已失效",
 		// 项目详情
 		detail: "项目基本信息",
 		projectNo: "项目编号",
@@ -233,7 +236,9 @@ const lang = {
 		maintainCount: "保养次数",
 		inputmaintainCount: "请选择保养次数",
 		num0: "请填写大于0的数字",
-		num1: "请填写小于等于1亿的数字",
+        num1: "请填写小于等于1亿的数字",
+        abnormal: "异常",
+        dropped: "掉线",
 		// 模具详情
 		beScrapped: "待报废",
 		scraped: "已报废",

+ 1 - 0
ys_int/src/port.js

@@ -21,6 +21,7 @@ export default {
 
         addProject: '/project/add', // 添加或修改项目
         projectList: '/project/list', // 项目列表
+        invalidProject: '/project/setProjectDelete', //项目失效
         projectDetail: '/project/detail', // 项目详情
         projects: '/project/projectList', // 筛选模具列表时作为筛选条件所加载的项目列表
         projectByUser: '/project/getProjectListByUserAndCompany',// 获取创建人员分配项目时根据当前人和公司获取项目列表

+ 7 - 5
ys_int/src/views/detection/detection.vue

@@ -53,11 +53,13 @@
             </el-table-column>
             <el-table-column :label="$t('runTest.moldState')" align="center" width="100" sortable>
                 <template slot-scope="scope">
-                    <span v-if="scope.row.state == 0">{{$t('base.static')}}</span>
-                    <span v-else-if="scope.row.state == 1">{{$t('base.run')}}</span>
-                    <span v-else-if="scope.row.state == 2">{{$t('base.warning')}}</span>
-                    <span v-else-if="scope.row.state == 3">{{$t('mold.beScrapped')}}</span>
-                    <span v-else-if="scope.row.state == 4">{{$t('mold.scraped')}}</span>
+                    <span style="color:#909399" v-if="scope.row.state == 0">{{$t('base.static')}}</span>
+                    <span style="color:#00CD66" v-else-if="scope.row.state == 1">{{$t('base.run')}}</span>
+                    <span style="color:#F56C6C" v-else-if="scope.row.state == 2">{{$t('base.warning')}}</span>
+                    <span style="color:#909399" v-else-if="scope.row.state == 3">{{$t('mold.beScrapped')}}</span>
+                    <span style="color:#909399" v-else-if="scope.row.state == 4">{{$t('mold.scraped')}}</span>
+                    <span style="color:#F56C6C" v-else-if="scope.row.state == 5">{{$t('mold.abnormal')}}</span>
+                    <span style="color:#F56C6C" v-else-if="scope.row.state == 6">{{$t('mold.dropped')}}</span>
                 </template>
             </el-table-column>
             <el-table-column :label="$t('runTest.stage')" align="center" width="160">

+ 59 - 21
ys_int/src/views/detection/maintenance.vue

@@ -9,11 +9,13 @@
                 <el-form-item class="divLine"></el-form-item>
                 <el-form-item>{{mouldName}}</el-form-item>
                 <el-form-item class="state" style="float: right;">{{$t('runTest.state')}}:
-                    <span v-if="mouldState == 0">{{$t('base.static')}}</span>
-                    <span v-else-if="mouldState == 1">{{$t('base.motion')}}</span>
-                    <span v-else-if="mouldState == 2">{{$t('base.warning')}}</span>
-                    <span v-else-if="mouldState == 3">{{$t('mold.beScrapped')}}</span>
-                    <span v-else-if="mouldState == 4">{{$t('mold.scraped')}}</span>
+                    <span style="color:#909399" v-if="mouldState == 0">{{$t('base.static')}}</span>
+                    <span style="color:#00CD66" v-else-if="mouldState == 1">{{$t('base.run')}}</span>
+                    <span style="color:#F56C6C" v-else-if="mouldState == 2">{{$t('base.warning')}}</span>
+                    <span style="color:#909399" v-else-if="mouldState == 3">{{$t('mold.beScrapped')}}</span>
+                    <span style="color:#909399" v-else-if="mouldState == 4">{{$t('mold.scraped')}}</span>
+                    <span style="color:#F56C6C" v-else-if="mouldState == 5">{{$t('mold.abnormal')}}</span>
+                    <span style="color:#F56C6C" v-else-if="mouldState == 6">{{$t('mold.dropped')}}</span>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -52,9 +54,11 @@
                 <el-col :span="11" :offset="2">
                     <div style="padding:0 20px">
                         <b style="font-size:20px;text-align:center;margin-bottom:20px;">{{$t('runTest.openCycleChart')}}</b>
-                        <el-date-picker v-model="openCycle" style="float:right;width:210px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
+                        <!-- <el-date-picker v-model="openCycle" style="float:right;width:210px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
                         @change='changeOpen(2)' size="mini" :clearable="false" type="daterange" 
-                        :start-placeholder="$t('el.datepicker.startDate')" :end-placeholder="$t('el.datepicker.endDate')"></el-date-picker>
+                        :start-placeholder="$t('el.datepicker.startDate')" :end-placeholder="$t('el.datepicker.endDate')"></el-date-picker> -->
+                        <el-date-picker v-model="openCycle" style="float:right;width:125px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
+                        @change='changeOpen(2)' size="mini" :clearable="false" type="date" :placeholder="$t('el.datepicker.selectDate')"></el-date-picker>
                     </div>
                     <div id="myChart2" :style="{ height: '300px'}"></div>
                 </el-col>
@@ -224,7 +228,8 @@
                 },
                 imageUrl: "",
                 openNum: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
-                openCycle: [util.formatDate.format(new Date(), 'yyyy-MM-dd') , util.formatDate.format(new Date(), 'yyyy-MM-dd')],
+                // openCycle: [util.formatDate.format(new Date(), 'yyyy-MM-dd') , util.formatDate.format(new Date(), 'yyyy-MM-dd')],
+                openCycle: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
                 allDetail: {
                     overflow: 'auto',
                     padding: '0px 5px',
@@ -540,8 +545,8 @@
                         sData = [];
 
                         for(var i in list) {
-                            xData.push(i);
-                            sData.push(list[i])
+                            xData.push(list[i].timeSlot);
+                            sData.push(list[i].runtime)
                         }
                         option.xAxis.data = xData;
                         option.series[0].data = sData;
@@ -574,12 +579,12 @@
                             tooltip: {
                                 trigger: 'axis'
                             },
-                            grid: {
-                                left: '3%',
-                                right: '4%',
-                                bottom: '3%',
-                                containLabel: true
-                            },
+                            // grid: {
+                            //     left: '3%',
+                            //     right: '4%',
+                            //     bottom: '3%',
+                            //     containLabel: true
+                            // },
                             xAxis: {
                                 type: 'category',
                                 boundaryGap: false,
@@ -589,10 +594,27 @@
                                 name: this.$t('runTest.sec') + '(s)',
                                 type: 'value'
                             },
+                            dataZoom: [{
+                                type: 'inside',
+                                start: 0,
+                                end: 10
+                            }, {
+                                start: 0,
+                                end: 10,
+                                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
+                                handleSize: '80%',
+                                handleStyle: {
+                                    color: '#fff',
+                                    shadowBlur: 3,
+                                    shadowColor: 'rgba(0, 0, 0, 0.6)',
+                                    shadowOffsetX: 2,
+                                    shadowOffsetY: 2
+                                }
+                            }],
                             series: [{
                                 name: this.$t('runTest.maxOpenCycle'),
                                 type: 'line',
-                                stack: this.$t('runTest.openCycle'),
+                                // stack: this.$t('runTest.openCycle'),
                                 data:[],
                                 itemStyle : { 
                                     normal : { 
@@ -606,7 +628,7 @@
                             {
                                 name: this.$t('runTest.minOpenCycle'),
                                 type:'line',
-                                stack: this.$t('runTest.openCycle'),
+                                // stack: this.$t('runTest.openCycle'),
                                 data:[],
                                 itemStyle : { 
                                     normal : { 
@@ -620,7 +642,21 @@
                             {
                                 name: this.$t('runTest.avgOpenCycle'),
                                 type: 'line',
-                                stack: this.$t('runTest.openCycle'),
+                                // stack: this.$t('runTest.openCycle'),
+                                data:[],
+                                itemStyle : { 
+                                    normal : { 
+                                        color: "#7fb80e", //改变折线点的颜色
+                                        lineStyle:{ 
+                                            color: "#7fb80e" //改变折线颜色
+                                        } 
+                                    } 
+                                }
+                            },
+                            {
+                                name: this.$t('runTest.theoryCycle'),
+                                type: 'line',
+                                // stack: this.$t('runTest.openCycle'),
                                 data:[],
                                 itemStyle : { 
                                     normal : { 
@@ -634,18 +670,20 @@
                         },
                         list = res.data, 
                         xData = [], 
-                        avg = [] , max = [] , min = [];
+                        avg = [] , max = [] , min = [] , the = [];
 
                         for(var i in list) {
-                            xData.push(list[i].time);
+                            xData.push(i);
                             max.push(list[i].maxCycle/1000);
                             min.push(list[i].minCycle/1000);
                             avg.push(list[i].avgCycle/1000);
+                            the.push(list[i].theoryCycle/1000);
                         }
                         option.xAxis.data = xData;
                         option.series[0].data = max;
                         option.series[1].data = min;
                         option.series[2].data = avg;
+                        option.series[3].data = the;
 
                         this.drawEchart(2,JSON.stringify(option));
                     } else {

+ 3 - 103
ys_int/src/views/map/map.vue

@@ -12,91 +12,6 @@
 			}
 		},
 		methods: {
-            getMap() {
-                var _this = this
-                this.http.post( this.port.map.mapList, {},
-                res => {
-                    if (res.code == "ok") {
-                        var list = res.data;
-
-                        if(list != null && list.length > 0){
-                            var map = new AMap.Map('container', {
-                                resizeEnable: true,   
-                                zoom: 5
-                            });
-                            map.clearMap();  
-                            var markers = [] , 
-                                infoWindow , 
-                                data = list;
-
-                            var marker;
-                            for(var i in data){
-                                var jfong=[ data[i].ylng , data[i].xlat];
-                                marker = new AMap.Marker({
-                                    position: jfong,
-                                    zIndex: 101,
-                                    map:map
-                                });	
-                                marker.setMap(map);	
-                                marker.msg = data[i];
-                                marker.on('click', function(data){
-                                    var str = "<div class='window'>" +
-                                        "<div class='info-top'><div>"+ data.target.msg.companyName +"</div><i class='el-icon-close' @click='closeInfoWindow()'></i></div>" +
-                                        "<div class='info-middle'>";
-                                        for(var i in data.target.msg.list){
-                                            str += "<div class='info-item'><a @click='jumpToMold("+ data.target.msg.list[i].id +")'>" + data.target.msg.list[i].modelName + "(" + data.target.msg.list[i].modelNo + ")</a>"
-                                                if(data.target.msg.list[i].state=='0'){
-                                                    str += "<span class='info-state'><span class='info-ball' style='background:#999999;'></span>" + _this.$t('base.static') + "</span>"
-                                                } else {
-                                                    str += "<span class='info-state'><span class='info-ball' style='background:#00CD66;'></span>" + _this.$t('base.run') + "</span>"
-                                                }
-                                            str += "</div>"
-                                        }
-                                        str += "</div>" +
-                                    "</div>"
-
-                                    var MyComponent = Vue.extend({
-                                        template: str ,
-                                        methods:{
-                                            closeInfoWindow:function() {
-                                                map.clearInfoWindow();
-                                            },
-                                            jumpToMold:function(id) {
-                                                _this.$router.push("/moldList/" + id + "/0");
-                                            }
-                                        }
-                                    });
-                                    var component= new MyComponent().$mount();
-                                    infoWindow.setContent(component.$el);
-                                    infoWindow.open(map, data.lnglat);
-                                });
-                            }
-
-                            infoWindow = new AMap.InfoWindow({
-                                isCustom:	true,
-                                draggable: true,  //是否可拖动
-                                showShadow: true,
-                                autoMove: true,
-                                offset: new AMap.Pixel(0, -31),
-                                content:""
-                            });
-
-                            marker.setMap(map);
-                        }
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
-                        });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
-                    });
-                });
-            },
         },
         mounted() {
             //this.getMap();
@@ -130,9 +45,7 @@
                         if (!item) {
                             return null;
                         }
-                        //var parts = item.split(',');
                         //返回经纬度
-                        //return [parseFloat(parts[0]), parseFloat(parts[1])];
                         return [parseFloat(item.lng), parseFloat(item.lat)];
                     },
                     getHoverTitle: function(dataItem, idx) {
@@ -153,12 +66,13 @@
                         pointStyle: {
                             width: 6,
                             height: 6,
-                            fillStyle:'rgba(0, 236, 252, 0.9)'
+                            // fillStyle:'rgba(0, 236, 252, 0.9)'
+                            fillStyle:'rgba(255, 0, 0, 1)',
                         },
                         //鼠标hover时的title信息
                         hoverTitleStyle: {
                             position: 'top'
-                        }
+                        },
                     }
                 });
 
@@ -241,14 +155,9 @@
 
                             labelCtx.closePath();
                             labelCtx.fill();
-                            // labelCtx.fillRect(centerX - halfTxtWidth - 3 * pixelRatio,
-                            //     centerY - 11 * pixelRatio,
-                            //     textMetrics.width + 6 * pixelRatio,
-                            //     22 * pixelRatio);
 
                             labelCtx.fillStyle = '#ffffff';
                             labelCtx.textBaseline = 'middle';
-                            //labelCtx.stroke();
 
                             labelCtx.fillText(text, centerX - halfTxtWidth, centerY - 5);
                             labelCtx.fillText(num , centerX - halfNumWidth, centerY + 12);
@@ -266,9 +175,7 @@
                         if (!item) {
                             return null;
                         }
-                        // var parts = item.split(',');
                         //返回经纬度
-                        //return [parseFloat(parts[0]), parseFloat(parts[1])];
                         return [parseFloat(item.lng), parseFloat(item.lat)];
                     },
                     renderConstructor: MyRender,
@@ -310,13 +217,6 @@
                 pointStyle.width = pointStyle.height = 2 * Math.pow(1.2, map.getZoom() - 3);
 
                 $('<div id="loadingTip">加载数据,请稍候...</div>').appendTo(document.body);
-                // $.get('https://a.amap.com/amap-ui/static/data/10w.txt', function(csv) {
-                
-                //     $('#loadingTip').remove();
-                //     var data = csv.split('\n');
-                //     distCluster.setData(data);
-                //     pointSimplifierIns.setData(data);
-                // });
                 _this.http.post( _this.port.map.newMap, {},
                 res => {
                     $('#loadingTip').remove();

+ 7 - 5
ys_int/src/views/mold/moldDetail.vue

@@ -15,8 +15,10 @@
                     <a style="color: #909399; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 0">{{$t('base.static')}}</a>
                     <a style="color: #00CD66; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 1">{{$t('base.run')}}</a>
                     <a style="color: #F56C6C; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 2">{{$t('base.warning')}}</a>
-                    <a style="color: #909399; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 3">{{$t('mold.scraped')}}</a>
-                    <a style="color: #909399; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 4">{{$t('mold.moldDetail')}}</a>
+                    <a style="color: #909399; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 3">{{$t('mold.beScrapped')}}</a>
+                    <a style="color: #909399; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 4">{{$t('mold.scraped')}}</a>
+                    <a style="color: #F56C6C; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 5">{{$t('mold.abnormal')}}</a>
+                    <a style="color: #F56C6C; cursor: pointer" @click="toDetection" v-if="moldDetail.state == 6">{{$t('mold.dropped')}}</a>
                     <span class="tips">({{$t('mold.view')}})</span>
                 </el-form-item>
             </el-form>
@@ -45,11 +47,11 @@
                 </el-col> -->
                 <el-col :span="6" class="detail">
                     {{$t('mold.initial')}}:
-                    <span class="info">{{moldDetail.initialModulus.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
+                    <span class="info">{{moldDetail.initialModulus==null?'':moldDetail.initialModulus.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
                     {{$t('mold.life')}}:
-                    <span class="info">{{moldDetail.settingLife.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
+                    <span class="info">{{moldDetail.settingLife==null?'':moldDetail.settingLife.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}</span>
                 </el-col>
                 <el-col :span="6" class="detail">
                     {{$t('mold.rfid')}}:
@@ -190,7 +192,7 @@
                             <el-table-column prop="partName" :label="$t('mold.partName')" sortable></el-table-column>
                             <el-table-column prop="partLife" :label="$t('mold.partLife')" align="center" width="100" sortable>
                                 <template slot-scope="scope">
-                                    {{scope.row.partLife.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}
+                                    {{scope.row.partLife==null?'':scope.row.partLife.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')}}
                                 </template>
                             </el-table-column>
                             <el-table-column prop="isVulnerable" :label="$t('runTest.vulnerable')" align="center" width="100" sortable>

+ 8 - 3
ys_int/src/views/mold/moldList.vue

@@ -59,10 +59,15 @@
             </el-table-column>
             <el-table-column prop="holes" :label="$t('mold.hole')" width="100" align="center" sortable></el-table-column>
             <!-- <el-table-column prop="rfid" :label="$t('mold.rfid')" width="120" align="center" sortable></el-table-column> -->
-            <el-table-column :label="$t('runTest.state')" width="100" align="center" sortable>
+            <el-table-column :label="$t('runTest.moldState')" width="100" align="center" sortable>
                 <template slot-scope="scope">
-                    <span v-if="scope.row.state == 1" style="color:#00CD66;">{{$t('base.run')}}</span>
-                    <span v-else style="color:#999999;">{{$t('base.static')}}</span>
+                    <span style="color:#909399" v-if="scope.row.state == 0">{{$t('base.static')}}</span>
+                    <span style="color:#00CD66" v-else-if="scope.row.state == 1">{{$t('base.run')}}</span>
+                    <span style="color:#F56C6C" v-else-if="scope.row.state == 2">{{$t('base.warning')}}</span>
+                    <span style="color:#909399" v-else-if="scope.row.state == 3">{{$t('mold.beScrapped')}}</span>
+                    <span style="color:#909399" v-else-if="scope.row.state == 4">{{$t('mold.scraped')}}</span>
+                    <span style="color:#F56C6C" v-else-if="scope.row.state == 5">{{$t('mold.abnormal')}}</span>
+                    <span style="color:#F56C6C" v-else-if="scope.row.state == 6">{{$t('mold.dropped')}}</span>
                 </template>
             </el-table-column>
             <el-table-column :label="$t('base.operate')" width="150" align="center" sortable v-if="user.parentId == 1 && user.subordinateType == 0">

+ 25 - 5
ys_int/src/views/project/project.vue

@@ -32,13 +32,12 @@
 			</el-table-column>
 			<el-table-column prop="indate" :label="$t('project.indate')" width="200" align="center" sortable>
 			</el-table-column>
-			<!-- <el-table-column label="操作" width="250" align="center">
+			<el-table-column :label="$t('base.operate')" width="150" align="center" v-if="user.parentId == 1 && user.subordinateType == 0">
 				<template slot-scope="scope">
-                    <el-button size="small" type="primary" @click="toDetail(scope.row.id)">详情</el-button>
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
-					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
+					<el-button type="danger" size="small" @click="invalid(scope.row.id)" v-if="scope.row.isDelete != 1">{{$t('project.invalid')}}</el-button>
+                    <span style="color:red" v-else>{{$t('project.expired')}}</span>
 				</template>
-			</el-table-column> -->
+			</el-table-column>
 		</el-table>
 
 		<!--工具条-->
@@ -258,6 +257,27 @@
                 this.$router.push('/project/' + row.id);
             },
 
+            invalid(id) {
+                this.http.post(this.port.project.invalidProject, {
+                    id: id,
+                    isDelete: 1,
+                }, res => {
+                    if (res.code == "ok") {
+                        this.getProject();
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
             //选择公司切换人员
             companyChange() {
                 var param = {} ,