Ver código fonte

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

# Conflicts:
#	target/classes/main/resources/application-prod.properties
#	target/classes/main/resources/application-prod.yml
#	target/classes/main/resources/application.properties
#	target/classes/main/resources/application.yml
#	target/classes/main/resources/mapper/AppVersionMapper.xml
#	target/classes/main/resources/mapper/AssetCustomCompanyMapper.xml
#	target/classes/main/resources/mapper/CompanyMapper.xml
#	target/classes/main/resources/mapper/CustomCompanyMapper.xml
#	target/classes/main/resources/mapper/DictionaryDataMapper.xml
#	target/classes/main/resources/mapper/FactoryMapper.xml
#	target/classes/main/resources/mapper/InvitationRecordMapper.xml
#	target/classes/main/resources/mapper/LngLatCompanyMapper.xml
#	target/classes/main/resources/mapper/MouldEquipmentMapper.xml
#	target/classes/main/resources/mapper/MouldFileMapper.xml
#	target/classes/main/resources/mapper/MouldMaintainMapper.xml
#	target/classes/main/resources/mapper/MouldMapper.xml
#	target/classes/main/resources/mapper/MouldOperationDynamicsMapper.xml
#	target/classes/main/resources/mapper/NewsNoticeMapper.xml
#	target/classes/main/resources/mapper/NewsNoticeUserMapper.xml
#	target/classes/main/resources/mapper/PartMapper.xml
#	target/classes/main/resources/mapper/PdfFileMapper.xml
#	target/classes/main/resources/mapper/PowerMapper.xml
#	target/classes/main/resources/mapper/ProjectApproveMapper.xml
#	target/classes/main/resources/mapper/ProjectFileMapper.xml
#	target/classes/main/resources/mapper/ProjectMapper.xml
#	target/classes/main/resources/mapper/ProjectOperationDynamicsMapper.xml
#	target/classes/main/resources/mapper/ProjectUserMapper.xml
#	target/classes/main/resources/mapper/UserCompanyMapper.xml
#	target/classes/main/resources/mapper/UserMapper.xml
#	target/classes/main/resources/mapper/VnoticeUserMapper.xml
#	target/classes/main/resources/static/logout.html
sunyadv 5 anos atrás
pai
commit
e8162a185a

+ 11 - 11
.idea/yunsu.iml

@@ -32,18 +32,9 @@
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.6.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.6.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.8.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
     <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
-    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
     <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
     <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.26" level="project" />
@@ -53,10 +44,10 @@
     <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.11.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.5.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.6.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
     <orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.6.RELEASE" level="project" />
-    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.8.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.9" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.9" level="project" />
@@ -71,9 +62,16 @@
     <orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
     <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
     <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.8.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.8.RELEASE" level="project" />
     <orderEntry type="library" name="Maven: net.lingala.zip4j:zip4j:1.3.2" level="project" />
     <orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.6.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.6.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.6.RELEASE" level="project" />
     <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:8.0.16" level="project" />
     <orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.8" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.6.RELEASE" level="project" />
@@ -84,15 +82,17 @@
     <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
-    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.11.1" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.23.4" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.9.13" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.13" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.8.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.8.RELEASE" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.1.8.RELEASE" level="project" />
     <orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.2" level="project" />
     <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.15" level="project" />

BIN
target/classes/main/resources/lib/jodconverter-2.2.2.jar


BIN
target/classes/main/resources/lib/jodconverter-cli-2.2.2.jar


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

@@ -67,6 +67,7 @@
         <result column="equipmentNo" property="equipmentNo"/>
         <result column="stage" property="stage"/>
         <result column="endTime" property="endTime"/>
+        <result column="lastopentime" property="lastOpenTime"/>
         <result column="hillNumber" property="hillNumber"/>
         <result column="ownerCompanyName" property="ownerCompanyName"/>
         <result column="companyName" property="companyName"/>
@@ -87,7 +88,7 @@
         tbmp.end_time endTime,tbm.state state,tbp.project_name projectName,tbc.company_name companyName,tbco.company_name produceCompany,tbm.pre_update_id,
         tbp.manager mangerName,tbco.company_address area,tbmp.hill_number hillNumber,tbm.oc_cycle oc_cycle,tbp.manager_id managerId,
         tbmp.equipment_no equipmentNo,tbm.setting_life setting_life,tbp.owner_company_name ownerCompanyName,tbm.run_times run_times,
-        tbmp.lng,tbmp.lat,tbmp.stage
+        tbmp.lng,tbmp.lat,tbmp.stage,(SELECT open_time FROM `mould_history_time` WHERE equipment_no=equipmentNo ORDER BY indate DESC LIMIT 1) lastopentime
         from
         tb_mould tbm
         left join
@@ -133,7 +134,7 @@
         tbmp.end_time endTime,tbm.state state,tbp.project_name projectName,tbc.company_name companyName,tbm.holes,tbm.pre_update_id,tbco.company_name produceCompany,
         tbp.manager mangerName,tbco.company_address area,tbmp.hill_number hillNumber,tbm.oc_cycle oc_cycle,tbm.creator_id creator_id,
         tbmp.equipment_no equipmentNo,tbm.setting_life setting_life,tbp.owner_company_name ownerCompanyName,tbm.run_times run_times,
-        tbmp.lng,tbmp.lat,tbmp.stage
+        tbmp.lng,tbmp.lat,tbmp.stage,(SELECT open_time FROM `mould_history_time` WHERE equipment_no=equipmentNo ORDER BY indate DESC LIMIT 1) lastopentime
         from
         tb_mould tbm
         left join

+ 2 - 1
ys_int/build/webpack.dev.conf.js

@@ -20,7 +20,8 @@ module.exports = merge(baseWebpackConfig, {
   plugins: [
     new webpack.DefinePlugin({
       'process.env': config.dev.env,
-      'BASE_URL' : '"/api"'
+      'BASE_URL' : '"/api"',
+      'LINK_URL' : '"/ips"'
     }),
     // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
     new webpack.HotModuleReplacementPlugin(),

+ 2 - 1
ys_int/build/webpack.prod.conf.js

@@ -28,7 +28,8 @@ var webpackConfig = merge(baseWebpackConfig, {
     // http://vuejs.github.io/vue-loader/en/workflow/production.html
     new webpack.DefinePlugin({
       'process.env': env,
-      'BASE_URL' : '"/api"'
+      'BASE_URL' : '"/api"',
+      'LINK_URL' : '"/ips"'
     }),
     new webpack.optimize.UglifyJsPlugin({
       compress: {

+ 9 - 1
ys_int/config/index.js

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

+ 5 - 1
ys_int/src/http.js

@@ -22,7 +22,11 @@ function handleResults (response) {
 }
 
 function handleUrl (url) {
-    url = BASE_URL + url    
+    if(url.indexOf('.do') > -1) {
+        url = LINK_URL + url;
+    } else {
+        url = BASE_URL + url;
+    }
     return url
 }
 

+ 14 - 3
ys_int/src/i18n/lang/en.js

@@ -331,18 +331,29 @@ const lang = {
 		inputequipmentNo: "Please enter the equipment number",
 		useLife: "Years of use",
 		inputUseLife: "Please enter the years of use",
-		inputUseLifeNum: "The age must be a numeric value",
+		inputUseLifeNum: "Service Life must be a number",
 		agent: "Agent",
 		inputAgent: "Please enter the agent",
 		inputBlongComp: "You can activate the mold after entering your company.",
-		inUse: "Equipment is enabled",
+        inUse: "Equipment is enabled",
+        offUse: "Equipment is disable",
 		equipmentState: "Equipment State",
 		diffTime: "Count Down",
 		year: "year",
 		compName: "Corporate Name",
 		state0: "Not Enabled",
 		state1: "Enabled",
-		use: "Use"
+        use: "Enable",
+        disuse: "Disable",
+        issued: "Issued",
+        alarmBattery: "Alarm Battery Power",
+        inputAlarmBattery: "Please input the power of alarm battery",
+        inputAlarmBatteryNum: "Alarm Battery Power must be a number",
+        alarmDegree: "Thermal Alarm Degree",
+        inputAlarmDegree: "Please enter the heat alarm degree.",
+        inputAlarmDegreeNum: "Thermal Alarm Degree must be a number",
+        chooseEquipment: "Please select the equipment you want to send.",
+        issuedSuccess: "Issued Success",
     },
     // 后台翻译
     port: {

+ 14 - 3
ys_int/src/i18n/lang/zh.js

@@ -332,18 +332,29 @@ const lang = {
 		inputequipmentNo: "请输入云模盒编号",
 		useLife: "使用年限",
 		inputUseLife: "请输入使用年限",
-		inputUseLifeNum: "使用年限必须为数字",
+		inputUseLifeNum: "使用年限必须为数字",
 		agent: "代理商",
 		inputAgent: "请输入代理商",
 		inputBlongComp: "填写所属公司后才能启用模具",
-		inUse: "设备已启用",
+        inUse: "设备已启用",
+        offUse: "设备已停用",
 		equipmentState: "云模盒状态",
 		diffTime: "倒计时",
 		year: "年",
 		compName: "公司名称",
 		state0: "未启用",
 		state1: "已启用",
-		use: "启用"	
+        use: "启用",
+        disuse: "停用",
+        issued: "下发",
+        alarmBattery: "报警电池电量",
+        inputAlarmBattery: "请输入报警电池电量",
+        inputAlarmBatteryNum: "报警电池电量必须为数字",
+        alarmDegree: "热报警度数",
+        inputAlarmDegree: "请输入热报警度数",
+        inputAlarmDegreeNum: "热报警度数必须为数字",
+        chooseEquipment: "请选择要下发的云模盒",
+        issuedSuccess: "下发成功",
     },
     ...locale
 }

+ 1 - 0
ys_int/src/port.js

@@ -107,6 +107,7 @@ export default {
         moulds: '/mouldequipment/getMouldEquipmentList', // 创建模具时获取资产方的云模盒列表
         importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
         
+        setPacket: '/JSKBT/setPacket.do',// 云平台下行配置数据包接口
     },
     file: {
         view: '/pdffile/getPdfFile' // 文件预览

+ 136 - 6
ys_int/src/views/base/allocation.vue

@@ -20,7 +20,7 @@
                 <el-form-item style="float: right;">
                     <a class="download" href="/upload/云模盒批量导入模板.xlsx" download="云模盒批量导入模板.xlsx">
                         <el-button type="primary">
-                            下载模板
+                            {{$t('mold.downloadMould')}}
                         </el-button>
                     </a>
                 </el-form-item>
@@ -32,13 +32,17 @@
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">{{$t('base.add')}}</el-button>
                 </el-form-item>
+                <el-form-item style="float: right;">
+                    <el-button type="primary" @click="issued">{{$t('base.issued')}}</el-button>
+                </el-form-item>
             </el-form>
         </el-col>
 
         <!--列表-->
-        <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
+        <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" @selection-change="handleSelectionChange" style="width: 100%;">
+            <el-table-column type="selection" width="50"></el-table-column>
             <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="130" sortable></el-table-column>
+            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="180" sortable></el-table-column>
             <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" width="80" align="center" sortable></el-table-column>
             <el-table-column prop="useLife" :label="$t('basic.useLife')" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.useLife}}{{$t('basic.year')}}</template>
@@ -58,7 +62,8 @@
             </el-table-column>
             <el-table-column :label="$t('base.operate')" align="center" width="160">
                 <template slot-scope="scope">
-                    <el-button size="small" v-if="scope.row.modelNo != null" type="primary" @click="openEnable(scope.$index)">{{$t('basic.use')}}</el-button>
+                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 0" type="primary" @click="openEnable(scope.$index)">{{$t('basic.use')}}</el-button>
+                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 1" type="danger" @click="disableEquipment(scope.$index)">{{$t('basic.disuse')}}</el-button>
                     <!--  :disabled="scope.row.isUse == 1" -->
                     <el-button size="small" :style="scope.row.modelNo!=null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">{{$t('base.edit')}}</el-button>
                 </template>
@@ -138,6 +143,24 @@
                 <el-button type="primary" @click="enable">{{$t('base.use')}}</el-button>
             </span>
         </el-dialog>
+
+        <!-- 下发弹窗 -->
+        <el-dialog :title="$t('basic.issued')" :visible.sync="issuedVisible" width="450px">
+            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
+                <el-form-item :label="$t('basic.alarmBattery')" prop="alarmBattery">
+                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" :placeholder="$t('basic.inputAlarmBattery')" style="width:250px;"></el-input>
+                    %
+                </el-form-item>
+                <el-form-item :label="$t('basic.alarmDegree')" prop="alarmDegree">
+                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" :placeholder="$t('basic.inputAlarmDegree')" style="width:250px;"></el-input>
+                    ℃
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="issuedVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click="saveIssued">{{$t('basic.issued')}}</el-button>
+            </span>
+        </el-dialog>
     </section>
 </template>
 
@@ -160,6 +183,12 @@
                         case "agent":
                             return callback(new Error(this.$t('basic.inputAgent')));
                             break;
+                        case "alarmBattery":
+                            return callback(new Error(this.$t('basic.inputAlarmBattery')));
+                            break;
+                        case "alarmDegree":
+                            return callback(new Error(this.$t('basic.inputAlarmDegree')));
+                            break;
                         default:
                             callback();
                     } 
@@ -197,7 +226,15 @@
                     ],
                     agent: [
                         { required: true, validator: msg , trigger: "blur" }
-                    ]
+                    ],
+                    alarmBattery: [
+                        { required: true, validator: msg },
+                        { type: 'number', message: this.$t('basic.inputAlarmBatteryNum')}
+                    ],
+                    alarmDegree: [
+                        { required: true, validator: msg },
+                        { type: 'number', message: this.$t('basic.inputAlarmDegreeNum')}
+                    ],
                 },
 
                 listLoading: false,
@@ -213,7 +250,14 @@
                 addFormVisible: false,
                 editFormVisible: false,
                 operateDialogVisible: false,
-                activeIndex: 0
+                activeIndex: 0,
+
+                issuedVal: {
+                    alarmBattery: 30,
+                    alarmDegree: 80,
+                },
+                issuedVisible: false,
+                multipleSelection: [],
             };
         },
         methods: {
@@ -442,6 +486,43 @@
                 }
             },
 
+            //停用云模盒
+            disableEquipment(index) {
+                if(this.allocations[index].belongCompanyId == null){
+                    this.$message({
+                        message: this.$t("basic.inputBlongComp"),
+                        type: "error"
+                    });
+                }else{
+                    this.operateDialogVisible = false;
+                    this.allocations[index].isUse = 1;
+                    this.http.post( this.port.base.enableMould, {
+                        id: this.allocations[index].id,
+                        isUse: 0
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t("basic.offUse"),
+                                type: "success"
+                            });
+                            this.getMoulds();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+
             //导入云模盒
             uploadFile(params) {
                 var fileObj = params.file;
@@ -473,6 +554,55 @@
                         type: "error"
                     });
                 });
+            },
+
+            //下发云模盒
+            issued() {
+                this.issuedVisible = true;
+            },
+
+            saveIssued() {
+                console.log(this.multipleSelection)
+                console.log(this.issuedVal)
+                console.log(this.issuedVal.alarmBattery.toString(16))
+                console.log(this.issuedVal.alarmDegree.toString(16))
+                if(this.multipleSelection.length == 0) {
+                    this.$message({
+                        message: this.$t('basic.chooseEquipment'),
+                        type: "error"
+                    });
+                } else {
+                    var str = '';
+                    for(var i in this.multipleSelection) {
+                        str += this.multipleSelection[i].equipmentNo + ',';
+                    }
+                    str = str.substring(0,str.length-1)
+                    this.http.post( this.port.base.setPacket, {
+                        lowPowerLimit: this.issuedVal.alarmBattery.toString(16),
+                        hotAlarmLimit: this.issuedVal.alarmDegree.toString(16),
+                        equipmentNo: str
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t('basic.issuedSuccess'),
+                                type: "success"
+                            });
+                            this.getMoulds();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
             }
         },
         created() {

+ 1 - 1
ys_int/src/views/mold/moldDownload.vue

@@ -27,7 +27,7 @@
 
         <!--列表-->
         <el-table :data="documents" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;" @selection-change="selectionChanged">
-            <el-table-column type="selection" width="40"></el-table-column>
+            <el-table-column type="selection" width="50"></el-table-column>
             <el-table-column type="index" width="60"></el-table-column>
             <el-table-column :label="$t('mold.modelName')">
                 <template slot-scope="scope">

+ 2 - 1
ys_vue/build/webpack.dev.conf.js

@@ -20,7 +20,8 @@ module.exports = merge(baseWebpackConfig, {
   plugins: [
     new webpack.DefinePlugin({
       'process.env': config.dev.env,
-      'BASE_URL' : '"/api"'
+      'BASE_URL' : '"/api"',
+      'LINK_URL' : '"/ips"'
     }),
     // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
     new webpack.HotModuleReplacementPlugin(),

+ 2 - 1
ys_vue/build/webpack.prod.conf.js

@@ -28,7 +28,8 @@ var webpackConfig = merge(baseWebpackConfig, {
     // http://vuejs.github.io/vue-loader/en/workflow/production.html
     new webpack.DefinePlugin({
       'process.env': env,
-      'BASE_URL' : '"/api"'
+      'BASE_URL' : '"/api"',
+      'LINK_URL' : '"/ips"'
     }),
     new webpack.optimize.UglifyJsPlugin({
       compress: {

+ 9 - 1
ys_vue/config/index.js

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

+ 5 - 1
ys_vue/src/http.js

@@ -12,7 +12,11 @@ function handleResults (response) {
 }
 
 function handleUrl (url) {
-    url = BASE_URL + url    
+    if(url.indexOf('.do') > -1) {
+        url = LINK_URL + url;
+    } else {
+        url = BASE_URL + url;
+    }
     return url
 }
 

+ 1 - 0
ys_vue/src/port.js

@@ -107,6 +107,7 @@ export default {
         moulds: '/mouldequipment/getMouldEquipmentList', // 创建模具时获取资产方的云模盒列表
         importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
         
+        setPacket: '/JSKBT/setPacket.do',// 云平台下行配置数据包接口
     },
     file: {
         view: '/pdffile/getPdfFile' // 文件预览

+ 152 - 88
ys_vue/src/views/base/allocation.vue

@@ -32,13 +32,19 @@
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">新建</el-button>
                 </el-form-item>
+                <el-form-item style="float: right;">
+                    <el-button type="primary" @click="issued">下发</el-button>
+                </el-form-item>
             </el-form>
         </el-col>
 
         <!--列表-->
-        <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
+        <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" @selection-change="handleSelectionChange" style="width: 100%;">
+            <el-table-column type="selection" width="50"></el-table-column>
             <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="130" sortable></el-table-column>
+            <el-table-column prop="equipmentNo" label="云模盒编号" width="180" sortable>
+                <template slot-scope="scope">12345678998765432132</template>
+            </el-table-column>
             <el-table-column prop="hillNumber" label="电量" width="80" align="center" sortable></el-table-column>
             <el-table-column prop="useLife" label="使用年限" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.useLife}}年</template>
@@ -58,9 +64,10 @@
             </el-table-column>
             <el-table-column label="操作" align="center" width="160">
                 <template slot-scope="scope">
-                    <el-button size="small" v-if="scope.row.modelNo != null" type="primary" @click="openEnable(scope.$index)">启用</el-button>
+                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 0" type="primary" @click="openEnable(scope.$index)">启用</el-button>
+                    <el-button size="small" v-if="scope.row.modelNo != null && scope.row.isUse == 1" type="danger" @click="disableEquipment(scope.$index)">停用</el-button>
                     <!--  :disabled="scope.row.isUse == 1" -->
-                    <el-button size="small" :style="scope.row.modelNo!=null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">修改</el-button>
+                    <el-button size="small" :style="scope.row.modelNo != null?'':'float:right;margin-right:6px'" @click="showEdit(scope.$index, scope.row, scope.row.isUse == 1)">修改</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -80,48 +87,20 @@
 
         <!--新增界面-->
         <el-dialog title="新建云模盒" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form
-                :model="newAllocation"
-                label-width="100px"
-                :rules="formRules"
-                ref="newAllocation"
-                :inline="true"
-                class="demo-form-inline"
-            >
+            <el-form :model="newAllocation" label-width="100px" :rules="formRules" ref="newAllocation" :inline="true" class="demo-form-inline">
                 <el-form-item label="云模盒编号" prop="equipmentNo">
                     <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
                 </el-form-item>
                 <el-form-item label="所属公司" prop="belongCompanyId">
-                    <el-select
-                        v-model="newAllocation.belongCompanyId"
-                        filterable
-                        clearable
-                        placeholder="请选择所属公司"
-                        style="width: 202px"
-                    >
-                        <el-option
-                        v-for="item in companies"
-                        :key="item.id"
-                        :label="item.companyName"
-                        :value="item.id"
-                        ></el-option>
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable placeholder="请选择所属公司" style="width: 202px">
+                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="使用年限" prop="useLife">
-                    <el-input
-                        v-model.number="newAllocation.useLife"
-                        type="age"
-                        autocomplete="off"
-                        placeholder="请输入使用年限"
-                    ></el-input>
+                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" placeholder="请输入使用年限"></el-input>
                 </el-form-item>
                 <el-form-item label="代理商" prop="agent">
-                    <el-input
-                        v-model="newAllocation.agent"
-                        autocomplete="off"
-                        placeholder="请输入代理商"
-                        style="width: 202px"
-                    ></el-input>
+                    <el-input v-model="newAllocation.agent" autocomplete="off" placeholder="请输入代理商" style="width: 202px"></el-input>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -131,56 +110,21 @@
         </el-dialog>
 
         <!--修改界面-->
-        <el-dialog
-            title="修改云模盒"
-            v-if="editFormVisible"
-            :visible.sync="editFormVisible"
-            :close-on-click-modal="false"
-            customClass="customWidth"
-        >
-            <el-form
-                :model="newAllocation"
-                label-width="100px"
-                :rules="formRules"
-                ref="newAllocation"
-                :inline="true"
-                class="demo-form-inline"
-            >
+        <el-dialog title="修改云模盒" v-if="editFormVisible" :visible.sync="editFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="newAllocation" label-width="100px" :rules="formRules" ref="newAllocation" :inline="true" class="demo-form-inline">
                 <el-form-item label="云模盒编号" prop="equipmentNo">
                     <el-input v-model="newAllocation.equipmentNo" autocomplete="off" placeholder="请输入云模盒编号"></el-input>
                 </el-form-item>
                 <el-form-item label="所属公司" prop="belongCompanyId">
-                    <el-select
-                        v-model="newAllocation.belongCompanyId"
-                        filterable
-                        clearable
-                        placeholder="请选择所属公司"
-                        style="width: 202px"
-                        :disabled="newAllocation.usage"
-                    >
-                        <el-option
-                        v-for="item in companies"
-                        :key="item.id"
-                        :label="item.companyName"
-                        :value="item.id"
-                        ></el-option>
+                    <el-select v-model="newAllocation.belongCompanyId" filterable clearable placeholder="请选择所属公司" style="width: 202px" :disabled="newAllocation.usage">
+                        <el-option v-for="item in companies" :key="item.id" :label="item.companyName" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="使用年限" prop="useLife">
-                    <el-input
-                        v-model.number="newAllocation.useLife"
-                        type="age"
-                        autocomplete="off"
-                        placeholder="请输入使用年限"
-                    ></el-input>
+                    <el-input v-model.number="newAllocation.useLife" type="age" autocomplete="off" placeholder="请输入使用年限"></el-input>
                 </el-form-item>
                 <el-form-item label="代理商" prop="agent">
-                    <el-input
-                        v-model="newAllocation.agent"
-                        autocomplete="off"
-                        placeholder="请输入代理商"
-                        style="width: 202px"
-                    ></el-input>
+                    <el-input v-model="newAllocation.agent" autocomplete="off" placeholder="请输入代理商" style="width: 202px"></el-input>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
@@ -191,21 +135,34 @@
 
         <!-- 启用弹窗 -->
         <el-dialog title="启用" :visible.sync="operateDialogVisible" width="400px">
-            <el-form
-                label-width="100px"
-                :rules="formRules"
-                :inline="true"
-                class="demo-form-inline"
-            >
-                <el-form-item label="某个参数">
+            <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
+                <!-- <el-form-item label="某个参数">
                     <el-input autocomplete="off" placeholder="填了也不会发生什么"></el-input>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="operateDialogVisible = false">取消</el-button>
                 <el-button type="primary" @click="enable">启用</el-button>
             </span>
         </el-dialog>
+
+        <!-- 下发弹窗 -->
+        <el-dialog title="下发" :visible.sync="issuedVisible" width="450px">
+            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
+                <el-form-item label="报警电池电量" prop="alarmBattery">
+                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" placeholder="请输入报警电池电量" style="width:250px;"></el-input>
+                    %
+                </el-form-item>
+                <el-form-item label="热报警度数" prop="alarmDegree">
+                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" placeholder="请输入热报警度数" style="width:250px;"></el-input>
+                    ℃
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="issuedVisible = false">取消</el-button>
+                <el-button type="primary" @click="saveIssued">下发</el-button>
+            </span>
+        </el-dialog>
     </section>
 </template>
 
@@ -242,7 +199,15 @@
                     ],
                     agent: [
                         { required: true, message: "请输入代理商", trigger: "blur" }
-                    ]
+                    ],
+                    alarmBattery: [
+                        { required: true, message: '请输入报警电池电量'},
+                        { type: 'number', message: '报警电池电量必须为数字值'}
+                    ],
+                    alarmDegree: [
+                        { required: true, message: '请输入热报警度数'},
+                        { type: 'number', message: '热报警度数必须为数字值'}
+                    ],
                 },
 
                 listLoading: false,
@@ -258,7 +223,14 @@
                 addFormVisible: false,
                 editFormVisible: false,
                 operateDialogVisible: false,
-                activeIndex: 0
+                activeIndex: 0,
+
+                issuedVal: {
+                    alarmBattery: 30,
+                    alarmDegree: 80,
+                },
+                issuedVisible: false,
+                multipleSelection: [],
             };
         },
         methods: {
@@ -487,6 +459,43 @@
                 }
             },
 
+            //停用云模盒
+            disableEquipment(index) {
+                if(this.allocations[index].belongCompanyId == null){
+                    this.$message({
+                        message: "输入所属公司后才能启用模具",
+                        type: "error"
+                    });
+                }else{
+                    this.operateDialogVisible = false;
+                    this.allocations[index].isUse = 0;
+                    this.http.post( this.port.base.enableMould, {
+                        id: this.allocations[index].id,
+                        isUse: 0
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "设备已停用",
+                                type: "success"
+                            });
+                            this.getMoulds();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+
             //导入云模盒
             uploadFile(params) {
                 var fileObj = params.file;
@@ -518,7 +527,62 @@
                         type: "error"
                     });
                 });
+            },
+
+            //列表选择
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+
+            //下发云模盒
+            issued() {
+                this.issuedVisible = true;
+            },
+
+            saveIssued() {
+                console.log(this.multipleSelection)
+                console.log(this.issuedVal)
+                console.log(this.issuedVal.alarmBattery.toString(16))
+                console.log(this.issuedVal.alarmDegree.toString(16))
+                if(this.multipleSelection.length == 0) {
+                    this.$message({
+                        message: "请选择要下发的云模盒",
+                        type: "error"
+                    });
+                } else {
+                    var str = '';
+                    for(var i in this.multipleSelection) {
+                        str += this.multipleSelection[i].equipmentNo + ',';
+                    }
+                    str = str.substring(0,str.length-1)
+                    this.http.post( this.port.base.setPacket, {
+                        lowPowerLimit: this.issuedVal.alarmBattery.toString(16),
+                        hotAlarmLimit: this.issuedVal.alarmDegree.toString(16),
+                        equipmentNo: str
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "下发成功",
+                                type: "success"
+                            });
+                            this.getMoulds();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
             }
+
         },
         created() {
             let height = window.innerHeight;

+ 43 - 50
ys_vue/src/views/mold/moldDownload.vue

@@ -29,56 +29,49 @@
     </el-col>
 
     <!--列表-->
-    <el-table
-      :data="documents"
-      :height="tableHeight"
-      highlight-current-row
-      v-loading="listLoading"
-      style="width: 100%;"
-      @selection-change="selectionChanged"
-    >
-      <el-table-column type="selection" width="40"></el-table-column>
-      <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column label="模具名称">
-        <template slot-scope="scope">
-            <router-link :to="'/moldList/' + scope.row.id + '/0'" tag="span" style="color: #409eff;cursor: pointer;">{{scope.row.modelName}}</router-link>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="模具3D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.mould3DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.mould3DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="模具2D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.mould2DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.mould2DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="零件3D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.sparepart3DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.sparepart3DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="零件2D图档">
-        <template slot-scope="scope">
-          <span v-if="scope.row.sparepart2DFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.sparepart2DFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
-      <el-table-column width="250" label="保养方案">
-        <template slot-scope="scope">
-          <span v-if="scope.row.maintainFiles.length == 0">未上传</span>
-          <span v-else-if="scope.row.maintainFilesState">已通过</span>
-          <span v-else>未通过</span>
-        </template>
-      </el-table-column>
+    <el-table :data="documents" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;" @selection-change="selectionChanged">
+        <el-table-column type="selection" width="50"></el-table-column>
+        <el-table-column type="index" width="60"></el-table-column>
+        <el-table-column label="模具名称">
+            <template slot-scope="scope">
+                <router-link :to="'/moldList/' + scope.row.id + '/0'" tag="span" style="color: #409eff;cursor: pointer;">{{scope.row.modelName}}</router-link>
+            </template>
+        </el-table-column>
+        <el-table-column width="250" label="模具3D图档">
+            <template slot-scope="scope">
+            <span v-if="scope.row.mould3DFiles.length == 0">未上传</span>
+            <span v-else-if="scope.row.mould3DFilesState">已通过</span>
+            <span v-else>未通过</span>
+            </template>
+        </el-table-column>
+        <el-table-column width="250" label="模具2D图档">
+            <template slot-scope="scope">
+            <span v-if="scope.row.mould2DFiles.length == 0">未上传</span>
+            <span v-else-if="scope.row.mould2DFilesState">已通过</span>
+            <span v-else>未通过</span>
+            </template>
+        </el-table-column>
+        <el-table-column width="250" label="零件3D图档">
+            <template slot-scope="scope">
+            <span v-if="scope.row.sparepart3DFiles.length == 0">未上传</span>
+            <span v-else-if="scope.row.sparepart3DFilesState">已通过</span>
+            <span v-else>未通过</span>
+            </template>
+        </el-table-column>
+        <el-table-column width="250" label="零件2D图档">
+            <template slot-scope="scope">
+            <span v-if="scope.row.sparepart2DFiles.length == 0">未上传</span>
+            <span v-else-if="scope.row.sparepart2DFilesState">已通过</span>
+            <span v-else>未通过</span>
+            </template>
+        </el-table-column>
+        <el-table-column width="250" label="保养方案">
+            <template slot-scope="scope">
+            <span v-if="scope.row.maintainFiles.length == 0">未上传</span>
+            <span v-else-if="scope.row.maintainFilesState">已通过</span>
+            <span v-else>未通过</span>
+            </template>
+        </el-table-column>
     </el-table>
 
     <!--工具条-->