sunyadv 5 jaren geleden
bovenliggende
commit
f88d7a830a

+ 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

+ 5 - 1
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: {
@@ -150,6 +151,7 @@ const lang = {
 		indate: "Creat Time",
         addPro: "Add Project",
         invalid: "Invalid",
+        expired: "Expired",
 		// 项目详情
 		detail: "Basic Project Information",
 		projectNo: "Project No",
@@ -233,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",

+ 5 - 1
ys_int/src/i18n/lang/zh.js

@@ -135,6 +135,7 @@ const lang = {
         remove: "安装被拆",
         temperature: "温度",
         initialModulus: "累计开合次数",
+        theoryCycle: "理论周期",
 	},
 	// 项目管理
     project: {
@@ -150,6 +151,7 @@ const lang = {
 		indate: "创建时间",
         addPro: "新增项目",
         invalid: "失效",
+        expired: "已失效",
 		// 项目详情
 		detail: "项目基本信息",
 		projectNo: "项目编号",
@@ -234,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">

+ 30 - 12
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>
@@ -543,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;
@@ -612,7 +614,7 @@
                             series: [{
                                 name: this.$t('runTest.maxOpenCycle'),
                                 type: 'line',
-                                stack: this.$t('runTest.openCycle'),
+                                // stack: this.$t('runTest.openCycle'),
                                 data:[],
                                 itemStyle : { 
                                     normal : { 
@@ -626,7 +628,7 @@
                             {
                                 name: this.$t('runTest.minOpenCycle'),
                                 type:'line',
-                                stack: this.$t('runTest.openCycle'),
+                                // stack: this.$t('runTest.openCycle'),
                                 data:[],
                                 itemStyle : { 
                                     normal : { 
@@ -640,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 : { 
@@ -654,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 {

+ 2 - 107
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) {
@@ -154,12 +67,12 @@
                             width: 6,
                             height: 6,
                             // fillStyle:'rgba(0, 236, 252, 0.9)'
-                            fillStyle:'rgba(255, 0, 0, 1)'
+                            fillStyle:'rgba(255, 0, 0, 1)',
                         },
                         //鼠标hover时的title信息
                         hoverTitleStyle: {
                             position: 'top'
-                        }
+                        },
                     }
                 });
 
@@ -242,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);
@@ -267,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,
@@ -294,10 +200,6 @@
                     },
                 });
 
-                map.on('click', function(item) {
-                    console.log(item);
-                });
-
                 window.distCluster = distCluster;
 
                 map.on('zoomend', function() {
@@ -315,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">

+ 20 - 2
ys_int/src/views/project/project.vue

@@ -34,7 +34,8 @@
 			</el-table-column>
 			<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 type="danger" size="small" @click="invalid(scope.row.id)">{{$t('project.invalid')}}</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>
@@ -257,7 +258,24 @@
             },
 
             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'
+                    });
+                })
             },
 
             //选择公司切换人员