Commit 0557a7f6 by zzrdark

修改bug 设备可以添加多个相同的IMEI 产品系列可以添加多个相同的系列

parent 4f90a0d6
......@@ -287,3 +287,10 @@ CREATE TABLE `sys_user_func` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 489 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '功能与角色映射表' ROW_FORMAT = Dynamic;
-- 2020-05-06 加唯一索引
ALTER TABLE `cneeds_server`.`device_info`
ADD UNIQUE INDEX `IMEI_UNIQUE`(`imei`) USING BTREE COMMENT 'imei唯一';
ALTER TABLE `cneeds_server`.`product_series`
ADD UNIQUE INDEX `SERIES_NUM_UNIQUE`(`series_num`) USING BTREE COMMENT '系列号唯一';
\ No newline at end of file
......@@ -7,12 +7,28 @@ package com.mx.cneeds.common.constant;
* @Description TODO
**/
public class ResultCode {
//没有发现IMEI
/**
* 没有发现IMEI
*/
public static Integer NOTFOUND_IMEI = 1;
//没有设置渠道商
/**
* 没有设置渠道商
*/
public static Integer NOTSET_CHANNEL = 2;
// 参数有误
/**
* 参数有误
*/
public static Integer PARAMERROR = 3;
/**
* 没找到对应的Log日志信息
*/
public static Integer NOTFOUNDLOG = 4;
/**
* 数据重复
* 可表示imei,系列号 重复
*/
public static Integer DATA_REPEATITION = 5;
}
......@@ -33,6 +33,9 @@ public interface DeviceClient {
@PostMapping("/device/series/save")
void addSeries(@RequestBody SeriesDto dto);
@PostMapping("/device/series/querySeriesDto")
SeriesDto querySeries(@RequestBody String seriesNum);
@PostMapping("/device/series/update")
void updateSeries(@RequestBody SeriesDto dto);
......
......@@ -40,7 +40,12 @@ public interface LogFileClient {
@PostMapping(value = "/log/upload/queryLogFileByLogid")
DeviceLogDto queryLogFileByLogid(@RequestBody Long logId);
@PostMapping(value = "/log/upload/queryLogFileByLogAcceptId")
DeviceLogDto queryLogFileByLogAcceptId(@RequestBody String logAcceptId);
@PostMapping(value = "/log/upload/wechatUploadAloneFile")
void wechatUploadAloneFile(@RequestBody WechatFileDto wechatFileDto);
}
......@@ -109,6 +109,11 @@ public class DeviceController {
@PostMapping("/series/add")
public R addSeries(SeriesVo seriesVo){
SeriesDto querySeries = deviceClient.querySeries(seriesVo.getSeriesNum());
if (querySeries != null){
return R.error(ResultCode.DATA_REPEATITION,"系列号重复");
}
SeriesDto seriesDto = new SeriesDto();
BeanUtils.copyProperties(seriesVo,seriesDto);
......
......@@ -115,9 +115,31 @@ public class LogFlieController {
return R.ok();
}
@PostMapping("/logfile/proDeviceUploadLogFile")
@ResponseBody
public R proDeviceUploadLogFile(DeviceLogFileVo vo){
DeviceLogFileDto dto = new DeviceLogFileDto();
BeanUtils.copyProperties(vo, dto);
log.debug(vo.toString());
DeviceInfoDto deviceInfoDto = deviceClient.queryDeviceByImei(dto.getImei());
if (deviceInfoDto == null){
log.debug("ResultCode: "+ResultCode.NOTFOUND_IMEI);
return R.error(ResultCode.NOTFOUND_IMEI,"没有该imei");
}
DeviceLogDto deviceLogDto = logFileClient.queryLogFileByLogAcceptId(vo.getLogAcceptId());
if ( deviceLogDto == null ){
log.debug("ResultCode: "+ResultCode.NOTFOUNDLOG);
return R.error(ResultCode.NOTFOUNDLOG,"没找到对应的Log日志信息");
}
return R.ok();
}
@PostMapping("/logfile/DeviceLogFileUpload")
@ResponseBody
public R uploadLogFile(DeviceLogFileVo vo, MultipartFile file) throws IOException {
public R deviceUploadLogFile(DeviceLogFileVo vo, MultipartFile file) throws IOException {
DeviceLogFileDto dto = new DeviceLogFileDto();
BeanUtils.copyProperties(vo, dto);
......@@ -128,6 +150,13 @@ public class LogFlieController {
log.debug("ResultCode: "+ResultCode.NOTFOUND_IMEI);
return R.error(ResultCode.NOTFOUND_IMEI,"没有该imei");
}
DeviceLogDto deviceLogDto = logFileClient.queryLogFileByLogAcceptId(vo.getLogAcceptId());
if ( deviceLogDto == null ){
log.debug("ResultCode: "+ResultCode.NOTFOUNDLOG);
return R.error(ResultCode.NOTFOUNDLOG,"没找到对应的Log日志信息");
}
// 把图片存入oos 返回路径
StringBuffer dir = new StringBuffer(FilePath.LogFilePath);
dir.append(vo.getLogAcceptId());
......
spring:
profiles:
active: prod
active: dev
application:
name: cneeds-server-datashow
server:
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=./favicon.ico><title>springSecurity登陆demo</title><link href=static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=static/css/app.826c7dc3.css rel=stylesheet></head><body><div id=app></div><script src=static/js/chunk-elementUI.a6c12691.js></script><script src=static/js/chunk-libs.ddf89aa7.js></script><script>(function(e){function n(n){for(var t,u,d=n[0],f=n[1],o=n[2],h=0,b=[];h<d.length;h++)u=d[h],r[u]&&b.push(r[u][0]),r[u]=0;for(t in f)Object.prototype.hasOwnProperty.call(f,t)&&(e[t]=f[t]);i&&i(n);while(b.length)b.shift()();return a.push.apply(a,o||[]),c()}function c(){for(var e,n=0;n<a.length;n++){for(var c=a[n],t=!0,u=1;u<c.length;u++){var d=c[u];0!==r[d]&&(t=!1)}t&&(a.splice(n--,1),e=f(f.s=c[0]))}return e}var t={},u={runtime:0},r={runtime:0},a=[];function d(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-06aa7494":"06e9eb28","chunk-0b251b6b":"c62cffd6","chunk-113720ab":"c13124c4","chunk-116c2bab":"26f3ae67","chunk-1a07b08b":"8495daf0","chunk-1d606ab9":"36c5da6b","chunk-218bb4cf":"2c87854b","chunk-2b4823a9":"8b477be6","chunk-2d2105d3":"c38e1553","chunk-2d230a36":"77c3129c","chunk-2d230fe7":"8023f254","chunk-3b59103a":"8d86d081","chunk-403c80dd":"94c0ac41","chunk-47af9ee4":"a003a3e1","chunk-4a8d06a6":"81dbed13","chunk-4ab8490a":"d0b52c5a","chunk-5411756c":"80e1e589","chunk-56d3065a":"f080c714","chunk-10f36354":"7f6359fa","chunk-636f8118":"2d5d0784","chunk-64238bd4":"b5c58bf5","chunk-73bfcbf0":"a5fec1ff","chunk-79a85582":"dd8d44e5","chunk-7b66cc0a":"d0fee21d","chunk-acf60ff8":"f55e1c1c","chunk-e33fc590":"edc65535","chunk-e652b80c":"323c7f1f"}[e]+".js"}function f(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,f),c.l=!0,c.exports}f.e=function(e){var n=[],c={"chunk-06aa7494":1,"chunk-113720ab":1,"chunk-116c2bab":1,"chunk-1a07b08b":1,"chunk-218bb4cf":1,"chunk-2b4823a9":1,"chunk-4a8d06a6":1,"chunk-4ab8490a":1,"chunk-5411756c":1,"chunk-10f36354":1,"chunk-64238bd4":1,"chunk-e33fc590":1};u[e]?n.push(u[e]):0!==u[e]&&c[e]&&n.push(u[e]=new Promise((function(n,c){for(var t="static/css/"+({}[e]||e)+"."+{"chunk-06aa7494":"9d63d053","chunk-0b251b6b":"31d6cfe0","chunk-113720ab":"9d63d053","chunk-116c2bab":"eedc5334","chunk-1a07b08b":"830e1851","chunk-1d606ab9":"31d6cfe0","chunk-218bb4cf":"9d63d053","chunk-2b4823a9":"9d63d053","chunk-2d2105d3":"31d6cfe0","chunk-2d230a36":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-3b59103a":"31d6cfe0","chunk-403c80dd":"31d6cfe0","chunk-47af9ee4":"31d6cfe0","chunk-4a8d06a6":"e9a4618c","chunk-4ab8490a":"9d63d053","chunk-5411756c":"9d63d053","chunk-56d3065a":"31d6cfe0","chunk-10f36354":"129625a4","chunk-636f8118":"31d6cfe0","chunk-64238bd4":"70564041","chunk-73bfcbf0":"31d6cfe0","chunk-79a85582":"31d6cfe0","chunk-7b66cc0a":"31d6cfe0","chunk-acf60ff8":"31d6cfe0","chunk-e33fc590":"9d63d053","chunk-e652b80c":"31d6cfe0"}[e]+".css",r=f.p+t,a=document.getElementsByTagName("link"),d=0;d<a.length;d++){var o=a[d],h=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(h===t||h===r))return n()}var b=document.getElementsByTagName("style");for(d=0;d<b.length;d++){o=b[d],h=o.getAttribute("data-href");if(h===t||h===r)return n()}var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.onload=n,i.onerror=function(n){var t=n&&n.target&&n.target.src||r,a=new Error("Loading CSS chunk "+e+" failed.\n("+t+")");a.request=t,delete u[e],i.parentNode.removeChild(i),c(a)},i.href=r;var k=document.getElementsByTagName("head")[0];k.appendChild(i)})).then((function(){u[e]=0})));var t=r[e];if(0!==t)if(t)n.push(t[2]);else{var a=new Promise((function(n,c){t=r[e]=[n,c]}));n.push(t[2]=a);var o,h=document.createElement("script");h.charset="utf-8",h.timeout=120,f.nc&&h.setAttribute("nonce",f.nc),h.src=d(e),o=function(n){h.onerror=h.onload=null,clearTimeout(b);var c=r[e];if(0!==c){if(c){var t=n&&("load"===n.type?"missing":n.type),u=n&&n.target&&n.target.src,a=new Error("Loading chunk "+e+" failed.\n("+t+": "+u+")");a.type=t,a.request=u,c[1](a)}r[e]=void 0}};var b=setTimeout((function(){o({type:"timeout",target:h})}),12e4);h.onerror=h.onload=o,document.head.appendChild(h)}return Promise.all(n)},f.m=e,f.c=t,f.d=function(e,n,c){f.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:c})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,n){if(1&n&&(e=f(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(f.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)f.d(c,t,function(n){return e[n]}.bind(null,t));return c},f.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(n,"a",n),n},f.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},f.p="",f.oe=function(e){throw console.error(e),e};var o=window["webpackJsonp"]=window["webpackJsonp"]||[],h=o.push.bind(o);o.push=n,o=o.slice();for(var b=0;b<o.length;b++)n(o[b]);var i=h;c()})([]);</script><script src=static/js/app.ce6e6113.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=./favicon.ico><title>springSecurity登陆demo</title><link href=static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=static/css/app.826c7dc3.css rel=stylesheet></head><body><div id=app></div><script src=static/js/chunk-elementUI.a6c12691.js></script><script src=static/js/chunk-libs.ddf89aa7.js></script><script>(function(e){function n(n){for(var t,u,d=n[0],f=n[1],o=n[2],h=0,b=[];h<d.length;h++)u=d[h],r[u]&&b.push(r[u][0]),r[u]=0;for(t in f)Object.prototype.hasOwnProperty.call(f,t)&&(e[t]=f[t]);i&&i(n);while(b.length)b.shift()();return a.push.apply(a,o||[]),c()}function c(){for(var e,n=0;n<a.length;n++){for(var c=a[n],t=!0,u=1;u<c.length;u++){var d=c[u];0!==r[d]&&(t=!1)}t&&(a.splice(n--,1),e=f(f.s=c[0]))}return e}var t={},u={runtime:0},r={runtime:0},a=[];function d(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-06aa7494":"06e9eb28","chunk-0b251b6b":"eb155394","chunk-113720ab":"c13124c4","chunk-116c2bab":"26f3ae67","chunk-1a07b08b":"8495daf0","chunk-1d606ab9":"36c5da6b","chunk-218bb4cf":"2c87854b","chunk-2b4823a9":"8b477be6","chunk-2d2105d3":"c38e1553","chunk-2d230a36":"77c3129c","chunk-2d230fe7":"8023f254","chunk-3b59103a":"8d86d081","chunk-403c80dd":"94c0ac41","chunk-47af9ee4":"a003a3e1","chunk-4a8d06a6":"81dbed13","chunk-4ab8490a":"d0b52c5a","chunk-5411756c":"80e1e589","chunk-56d3065a":"f080c714","chunk-10f36354":"7f6359fa","chunk-636f8118":"2d5d0784","chunk-64238bd4":"b5c58bf5","chunk-73bfcbf0":"a5fec1ff","chunk-79a85582":"dd8d44e5","chunk-7b66cc0a":"d0fee21d","chunk-acf60ff8":"f55e1c1c","chunk-e33fc590":"edc65535","chunk-e652b80c":"323c7f1f"}[e]+".js"}function f(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,f),c.l=!0,c.exports}f.e=function(e){var n=[],c={"chunk-06aa7494":1,"chunk-113720ab":1,"chunk-116c2bab":1,"chunk-1a07b08b":1,"chunk-218bb4cf":1,"chunk-2b4823a9":1,"chunk-4a8d06a6":1,"chunk-4ab8490a":1,"chunk-5411756c":1,"chunk-10f36354":1,"chunk-64238bd4":1,"chunk-e33fc590":1};u[e]?n.push(u[e]):0!==u[e]&&c[e]&&n.push(u[e]=new Promise((function(n,c){for(var t="static/css/"+({}[e]||e)+"."+{"chunk-06aa7494":"9d63d053","chunk-0b251b6b":"31d6cfe0","chunk-113720ab":"9d63d053","chunk-116c2bab":"eedc5334","chunk-1a07b08b":"830e1851","chunk-1d606ab9":"31d6cfe0","chunk-218bb4cf":"9d63d053","chunk-2b4823a9":"9d63d053","chunk-2d2105d3":"31d6cfe0","chunk-2d230a36":"31d6cfe0","chunk-2d230fe7":"31d6cfe0","chunk-3b59103a":"31d6cfe0","chunk-403c80dd":"31d6cfe0","chunk-47af9ee4":"31d6cfe0","chunk-4a8d06a6":"e9a4618c","chunk-4ab8490a":"9d63d053","chunk-5411756c":"9d63d053","chunk-56d3065a":"31d6cfe0","chunk-10f36354":"129625a4","chunk-636f8118":"31d6cfe0","chunk-64238bd4":"70564041","chunk-73bfcbf0":"31d6cfe0","chunk-79a85582":"31d6cfe0","chunk-7b66cc0a":"31d6cfe0","chunk-acf60ff8":"31d6cfe0","chunk-e33fc590":"9d63d053","chunk-e652b80c":"31d6cfe0"}[e]+".css",r=f.p+t,a=document.getElementsByTagName("link"),d=0;d<a.length;d++){var o=a[d],h=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(h===t||h===r))return n()}var b=document.getElementsByTagName("style");for(d=0;d<b.length;d++){o=b[d],h=o.getAttribute("data-href");if(h===t||h===r)return n()}var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.onload=n,i.onerror=function(n){var t=n&&n.target&&n.target.src||r,a=new Error("Loading CSS chunk "+e+" failed.\n("+t+")");a.request=t,delete u[e],i.parentNode.removeChild(i),c(a)},i.href=r;var k=document.getElementsByTagName("head")[0];k.appendChild(i)})).then((function(){u[e]=0})));var t=r[e];if(0!==t)if(t)n.push(t[2]);else{var a=new Promise((function(n,c){t=r[e]=[n,c]}));n.push(t[2]=a);var o,h=document.createElement("script");h.charset="utf-8",h.timeout=120,f.nc&&h.setAttribute("nonce",f.nc),h.src=d(e),o=function(n){h.onerror=h.onload=null,clearTimeout(b);var c=r[e];if(0!==c){if(c){var t=n&&("load"===n.type?"missing":n.type),u=n&&n.target&&n.target.src,a=new Error("Loading chunk "+e+" failed.\n("+t+": "+u+")");a.type=t,a.request=u,c[1](a)}r[e]=void 0}};var b=setTimeout((function(){o({type:"timeout",target:h})}),12e4);h.onerror=h.onload=o,document.head.appendChild(h)}return Promise.all(n)},f.m=e,f.c=t,f.d=function(e,n,c){f.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:c})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,n){if(1&n&&(e=f(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(f.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)f.d(c,t,function(n){return e[n]}.bind(null,t));return c},f.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(n,"a",n),n},f.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},f.p="",f.oe=function(e){throw console.error(e),e};var o=window["webpackJsonp"]=window["webpackJsonp"]||[],h=o.push.bind(o);o.push=n,o=o.slice();for(var b=0;b<o.length;b++)n(o[b]);var i=h;c()})([]);</script><script src=static/js/app.ce6e6113.js></script></body></html>
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0b251b6b"],{aa98:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return c})),t.d(n,"e",(function(){return l})),t.d(n,"a",(function(){return s})),t.d(n,"d",(function(){return u}));t("55dd");var a=t("b775");function i(e){return Object(a["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function c(e){return Object(a["a"])({url:"/device/device/importDevice",method:"post",data:e})}function l(e){return Object(a["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function s(e){return Object(a["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function u(e){return Object(a["a"])({url:"/device/device/saveChannel",method:"post",data:e})}},ee85:function(e,n,t){"use strict";t.r(n);var a=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("el-container",[t("el-main",[t("el-form",{ref:"setChannel",attrs:{model:e.device,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{prop:"channelNumsMessage",label:"终端提示文字"}},[t("el-input",{model:{value:e.device.channelNumsMessage,callback:function(n){e.$set(e.device,"channelNumsMessage",n)},expression:"device.channelNumsMessage"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"channelRules",label:"规则"}},[t("el-select",{attrs:{placeholder:"选择"},model:{value:e.device.channelRules,callback:function(n){e.$set(e.device,"channelRules",n)},expression:"device.channelRules"}},[t("el-option",{attrs:{label:"黑名单",value:"0"}}),e._v(" "),t("el-option",{attrs:{label:"白名单",value:"1"}})],1)],1),e._v(" "),e._l(e.device.channelNums,(function(n,a){return t("el-form-item",{key:a,attrs:{label:"第"+(a+1)+"个渠道号: ",prop:"channelNums."+a+".value","label-width":"20"}},[t("el-row",[t("el-col",{attrs:{span:14}},[t("el-input",{model:{value:n.value,callback:function(t){e.$set(n,"value",t)},expression:"channelNum.value"}})],1),e._v(" "),t("el-col",{attrs:{span:5}},[t("el-button",{on:{click:function(t){return t.preventDefault(),e.removeChannelNums(n)}}},[e._v("\n 删除\n ")])],1)],1)],1)})),e._v(" "),t("el-form-item",[t("el-button",{on:{click:e.addChannelNums}},[e._v("新增渠道号")]),e._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("修改")]),e._v(" "),t("el-button",{on:{click:e.toDeviceList}},[e._v("取消")])],1)],2)],1)],1)},i=[],c=(t("456d"),t("ac6a"),t("96cf"),t("3b8d")),l=t("aa98"),s={channelNumsMessage:"终端提示文字",channelRules:"规则"},u={data:function(){var e=function(e,n,t){void 0===n||null===n||0===n.length?t(new Error(s[e.field]+"必须填写")):t()};return{loading:!1,device:{channelNums:[{value:""}],channelNumsMessage:"",channelRules:"",imeis:[]},rules:{channelNumsMessage:[{validator:e}],channelRules:[{validator:e}]},selectSeriesOptions:[]}},mounted:function(){this.device.imeis=this.$route.query.imeis,this.getFormData()},methods:{getFormData:function(){var e=Object(c["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}(),setDefault:function(){this.$refs.device=[]},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.setChannel.validate((function(n,t){if(n){var a=e.device.channelNums;e.device.channelNums=[],a.forEach((function(n){e.device.channelNums.push(n.value)})),Object(l["d"])(e.device).then((function(n){var t=n.msg;e.$notify({title:"操作成功",message:t,type:"success",duration:2e3}),e.setDefault(),e.toDeviceList(),e.loading=!1})).catch((function(){e.loading=!1}))}else{var i=t[Object.keys(t)[0]][0].message;e.$message({message:i,type:"error"}),e.loading=!1}})))},toDeviceList:function(){this.$router.push({path:"/deviceManagement/device"})},addChannelNums:function(){this.device.channelNums.push({value:""})},removeChannelNums:function(e){var n=this.device.channelNums.indexOf(e);-1!==n&&this.device.channelNums.splice(n,1)}}},r=u,o=t("2877"),d=Object(o["a"])(r,a,i,!1,null,"6cae8d7a",null);n["default"]=d.exports}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0b251b6b"],{aa98:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"c",(function(){return c})),t.d(n,"e",(function(){return l})),t.d(n,"a",(function(){return s})),t.d(n,"d",(function(){return u}));t("55dd");var a=t("b775");function i(e){return Object(a["a"])({url:"/device/device/list",method:"post",params:{page:e.page,pageSize:e.pageSize,sort:e.sort}})}function c(e){return Object(a["a"])({url:"/device/device/importDevice",method:"post",data:e})}function l(e){return Object(a["a"])({url:"/device/device/updateDeviceSeriesBatch",method:"post",data:e})}function s(e){return Object(a["a"])({url:"/device/device/delete",method:"post",data:{ids:e}})}function u(e){return Object(a["a"])({url:"/device/device/saveChannel",method:"post",data:e})}},ee85:function(e,n,t){"use strict";t.r(n);var a=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("el-container",[t("el-main",[t("el-form",{ref:"setChannel",attrs:{model:e.device,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{prop:"channelNumsMessage",label:"终端提示文字"}},[t("el-input",{model:{value:e.device.channelNumsMessage,callback:function(n){e.$set(e.device,"channelNumsMessage",n)},expression:"device.channelNumsMessage"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"channelRules",label:"规则"}},[t("el-select",{attrs:{placeholder:"选择"},model:{value:e.device.channelRules,callback:function(n){e.$set(e.device,"channelRules",n)},expression:"device.channelRules"}},[t("el-option",{attrs:{label:"白名单",value:"0"}}),e._v(" "),t("el-option",{attrs:{label:"黑名单",value:"1"}})],1)],1),e._v(" "),e._l(e.device.channelNums,(function(n,a){return t("el-form-item",{key:a,attrs:{label:"第"+(a+1)+"个渠道号: ",prop:"channelNums."+a+".value","label-width":"20"}},[t("el-row",[t("el-col",{attrs:{span:14}},[t("el-input",{model:{value:n.value,callback:function(t){e.$set(n,"value",t)},expression:"channelNum.value"}})],1),e._v(" "),t("el-col",{attrs:{span:5}},[t("el-button",{on:{click:function(t){return t.preventDefault(),e.removeChannelNums(n)}}},[e._v("\n 删除\n ")])],1)],1)],1)})),e._v(" "),t("el-form-item",[t("el-button",{on:{click:e.addChannelNums}},[e._v("新增渠道号")]),e._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("修改")]),e._v(" "),t("el-button",{on:{click:e.toDeviceList}},[e._v("取消")])],1)],2)],1)],1)},i=[],c=(t("456d"),t("ac6a"),t("96cf"),t("3b8d")),l=t("aa98"),s={channelNumsMessage:"终端提示文字",channelRules:"规则"},u={data:function(){var e=function(e,n,t){void 0===n||null===n||0===n.length?t(new Error(s[e.field]+"必须填写")):t()};return{loading:!1,device:{channelNums:[{value:""}],channelNumsMessage:"",channelRules:"",imeis:[]},rules:{channelNumsMessage:[{validator:e}],channelRules:[{validator:e}]},selectSeriesOptions:[]}},mounted:function(){this.device.imeis=this.$route.query.imeis,this.getFormData()},methods:{getFormData:function(){var e=Object(c["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}(),setDefault:function(){this.$refs.device=[]},onSubmit:function(){var e=this;this.loading||(this.loading=!0,this.$refs.setChannel.validate((function(n,t){if(n){var a=e.device.channelNums;e.device.channelNums=[],a.forEach((function(n){e.device.channelNums.push(n.value)})),Object(l["d"])(e.device).then((function(n){var t=n.msg;e.$notify({title:"操作成功",message:t,type:"success",duration:2e3}),e.setDefault(),e.toDeviceList(),e.loading=!1})).catch((function(){e.loading=!1}))}else{var i=t[Object.keys(t)[0]][0].message;e.$message({message:i,type:"error"}),e.loading=!1}})))},toDeviceList:function(){this.$router.push({path:"/deviceManagement/device"})},addChannelNums:function(){this.device.channelNums.push({value:""})},removeChannelNums:function(e){var n=this.device.channelNums.indexOf(e);-1!==n&&this.device.channelNums.splice(n,1)}}},r=u,o=t("2877"),d=Object(o["a"])(r,a,i,!1,null,"4506f574",null);n["default"]=d.exports}}]);
\ No newline at end of file
......@@ -24,5 +24,7 @@ public interface ProductSeriesService extends IService<ProductSeriesEntity> {
List<ProductSeriesEntity> queryList(Map<String, Object> params);
ProductSeriesEntity queryOne(Long seriesId);
ProductSeriesEntity queryBySeriesNum(String seriesNum);
}
......@@ -49,5 +49,12 @@ public class ProductSeriesServiceImpl extends ServiceImpl<ProductSeriesDao, Prod
return seriesEntity;
}
@Override
public ProductSeriesEntity queryBySeriesNum(String seriesNum){
ProductSeriesEntity seriesEntity =
getOne(new QueryWrapper<ProductSeriesEntity>().eq("series_num", seriesNum));
return seriesEntity;
}
}
......@@ -150,11 +150,14 @@ public class DeviceInfoController {
List<DeviceInfoEntity> deviceInfoEntityList = new LinkedList<>();
if (devicesDto.getImeis() != null && devicesDto.getImeis().size() != 0) {
devicesDto.getImeis().forEach(str -> {
DeviceInfoEntity deviceInfoEntity = new DeviceInfoEntity();
deviceInfoEntity.setImei(str);
deviceInfoEntity.setSeriesId(devicesDto.getSeriesId());
deviceInfoEntity.setDeptId(devicesDto.getDeptId());
deviceInfoEntityList.add(deviceInfoEntity);
DeviceInfoEntity queryDeviceByImei = deviceInfoService.queryDeviceByImei(str);
if (queryDeviceByImei == null){
DeviceInfoEntity deviceInfoEntity = new DeviceInfoEntity();
deviceInfoEntity.setImei(str);
deviceInfoEntity.setSeriesId(devicesDto.getSeriesId());
deviceInfoEntity.setDeptId(devicesDto.getDeptId());
deviceInfoEntityList.add(deviceInfoEntity);
}
});
}
deviceInfoService.updateBatchByImei(deviceInfoEntityList);
......
......@@ -87,6 +87,21 @@ public class ProductSeriesController {
return R.ok();
}
@RequestMapping("/querySeriesDto")
public SeriesDto querySeriesDto(@RequestBody String seriesNum){
ProductSeriesEntity seriesEntity = productSeriesService.queryBySeriesNum(seriesNum);
if (seriesEntity==null){
return null;
}
SeriesDto dto = new SeriesDto();
BeanUtils.copyProperties(seriesEntity,dto);
return dto;
}
/**
* 修改
*/
......
spring:
profiles:
active: prod
active: dev
application:
name: cneeds-server-device
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mx.cneeds.common.dto.DeviceLogDto;
import com.mx.cneeds.common.pager.PageUtils;
import com.mx.cneeds.common.pager.Query;
import com.mx.cneeds.server.dao.DeviceLogDao;
......@@ -56,13 +57,12 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogDao, DeviceLogEnt
public Long wechatUploadLog(DeviceLogEntity deviceLogEntity){
DeviceLogEntity logEntity = queryOneBylogAcceptId(deviceLogEntity.getLogAcceptId());
if(logEntity != null){
//未处理状态
/*//未处理状态
deviceLogEntity.setStatus(0);
deviceLogEntity.setLogfileStatus(1);
getBaseMapper().update(deviceLogEntity,
new UpdateWrapper<DeviceLogEntity>()
.eq("log_accept_id", deviceLogEntity.getLogAcceptId()));
.eq("log_accept_id", deviceLogEntity.getLogAcceptId()));*/
}else {
deviceLogEntity.setCreateTime(new Date());
deviceLogEntity.setStatus(-1);
......@@ -86,11 +86,12 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogDao, DeviceLogEnt
getBaseMapper().update(deviceLogEntity,
new UpdateWrapper<DeviceLogEntity>()
.eq("log_accept_id", deviceLogEntity.getLogAcceptId()));
}else {
}
/*else {
deviceLogEntity.setCreateTime(new Date());
deviceLogEntity.setStatus(-1);
getBaseMapper().insert(deviceLogEntity);
}
}*/
}
@Override
......@@ -98,4 +99,5 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogDao, DeviceLogEnt
return getBaseMapper().selectOne(new QueryWrapper<DeviceLogEntity>()
.eq("log_accept_id",logAcceptId));
}
}
......@@ -45,10 +45,6 @@ public class LogUploadController {
deviceLogEntity.setRepetitionProbability(dto.getProbability());
deviceLogEntity.setRepetitionSteps(dto.getSteps());
Long logId = deviceLogService.wechatUploadLog(deviceLogEntity);
/*if (dto.getFileMap()!=null && dto.getFileMap().size() != 0){
deviceLogMediaService.savewechatMedias(logId, dto.getFileMap());
}*/
}
@RequestMapping("/wechatUploadAloneFile")
......@@ -71,6 +67,14 @@ public class LogUploadController {
return dto;
}
@RequestMapping("/queryLogFileByLogAcceptId")
public DeviceLogDto queryLogFileByLogAcceptId(@RequestBody String logAcceptId){
DeviceLogEntity deviceLogEntity = deviceLogService.queryOneBylogAcceptId(logAcceptId);
DeviceLogDto dto = new DeviceLogDto();
BeanUtils.copyProperties(deviceLogEntity, dto);
return dto;
}
@RequestMapping("/uploadLogFile")
public void uploadLogFile(@RequestBody DeviceLogFileDto dto){
......@@ -114,4 +118,5 @@ public class LogUploadController {
}
spring:
profiles:
active: prod
active: dev
application:
name: cneeds-server-logupload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment