Commit 993f725b by zzrdark

1.add 产线上传 查询产线数据

parent 6daccf97
......@@ -342,3 +342,14 @@ DROP COLUMN `channel_nums`;
-- 2020-05-14
ALTER TABLE `cneeds_server`.`device_log`
ADD COLUMN `device_version` varchar(255) COMMENT '设备版本号' AFTER `log_accept_id`;
-- 2020-06-29
ALTER TABLE `cneeds_server`.`device_info`
ADD COLUMN `sn` varchar(255) COMMENT 'sn号' AFTER `channel_rules`,
ADD COLUMN `ca_certificate_status` varchar(255) COMMENT 'ca证书状态 -1 未下载,0 已下载 类型:非量产 1 已下载 类型:量产,2 已下载 类型:非量产,未验证 3 已下载 类型:量产,未验证' AFTER `sn`;
ALTER TABLE `cneeds_server`.`device_info`
CHANGE COLUMN `status` `active_status` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci
DEFAULT NULL COMMENT '状态0未激活,1已激活' AFTER `iccid`;
\ No newline at end of file
......@@ -42,9 +42,9 @@ public class DeviceInfoEntity implements Serializable {
private String iccid;
/**
* 状态0未激活,1已激活
* 状态 -1激活失败, 0未激活,1已激活
*/
private String status;
private String activeStatus;
/**
* 设备版本
......@@ -77,9 +77,20 @@ public class DeviceInfoEntity implements Serializable {
private Integer channelRules;
/**
* sn号
*/
private String sn;
/**
* ca证书状态
* 0未下载,1已下载
*/
private String caCertificateStatus;
/**
* 产品系列号
*/
@TableField( exist=false )
@TableField(exist=false)
private String seriesNum;
}
......@@ -9,7 +9,7 @@
<result property="deptId" column="dept_id"/>
<result property="imei" column="imei"/>
<result property="iccid" column="iccid"/>
<result property="status" column="status"/>
<result property="activeStatus" column="active_status"/>
<result property="deviceVersion" column="device_version"/>
<result property="seriesId" column="series_id"/>
<result property="createTime" column="create_time"/>
......@@ -17,6 +17,8 @@
<result property="channelNumsMessage" column="channel_nums_message"/>
<result property="channelRules" column="channel_rules"/>
<result property="seriesNum" column="series_num"/>
<result property="caCertificateStatus" column="ca_certificate_status" />
<result property="sn" column="sn" />
</resultMap>
......
......@@ -37,7 +37,7 @@ public class DeviceInfoDto {
/**
* 状态0未激活,1已激活
*/
private String status;
private String activeStatus;
/**
* 设备版本
......@@ -84,4 +84,13 @@ public class DeviceInfoDto {
*/
private List<Long> channelIds;
/**
* sn号
*/
private String sn;
/**
* ca证书状态
*/
private String caCertificateStatus;
}
......@@ -37,7 +37,7 @@ public class DeviceInfoVo {
/**
* 状态0未激活,1已激活
*/
private String status;
private String activeStatus;
/**
* 设备版本
......@@ -84,4 +84,15 @@ public class DeviceInfoVo {
*/
private List<Long> channelIds;
/**
* sn号
*/
private String sn;
/**
* ca证书状态
* 0未下载,1已下载
*/
private String caCertificateStatus;
}
spring:
profiles:
active: dev
active: prod
application:
name: cneeds-server-authorization
server:
......
......@@ -5,6 +5,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Set;
......@@ -64,6 +65,9 @@ public interface DeviceClient {
@PostMapping("/device/info/updateDeviceSeriesBatch")
void updateDeviceSeriesBatch(@RequestBody DevicesDto dto);
@PostMapping("/device/info/updateByImei")
void updateDevice(@RequestBody DeviceInfoDto dto);
@PostMapping("/device/info/delete")
void deleteDevice(@RequestBody List<Long> ids);
......
......@@ -23,6 +23,7 @@ public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter {
http.authorizeRequests()
.antMatchers("/user/login",
"/device/device/getChannel_nums",
"/device/device/uploadNewDeviceInfo",
"/wechat/wechatFileUpload",
"/wechat/wechatDownload/**",
"/wechat/wechatMessageHttp",
......
......@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.HttpHeaders;
......@@ -401,4 +402,30 @@ public class DeviceController {
return R.ok();
}
@RequestMapping("/device/uploadNewDeviceInfo")
public R uploadNewDeviceInfo(DeviceInfoVo vo){
if (vo.getImei() == null){
return R.error(ResultCode.PARAMERROR,"没有传入imei");
}
DeviceInfoDto dto = new DeviceInfoDto();
BeanUtils.copyProperties(vo,dto);
// 先检查是否有该imei设备 ,如果没有则返回没有该设备的状态码
DeviceInfoDto deviceInfoDto = deviceClient.queryDeviceByImei(vo.getImei());
if (deviceInfoDto == null){
return R.error(ResultCode.NOTFOUND_IMEI,"系统没有该设备");
}
// 再进行设置
deviceClient.updateDevice(dto);
return R.ok();
}
}
......@@ -68,6 +68,7 @@ public class WechatJsonMessage {
private String content;
private String fromGroup;
private String fromUser;
private int msgType;
private int msgId;
private long newMsgId;
private boolean self;
......@@ -77,6 +78,13 @@ public class WechatJsonMessage {
private Long voiceLength;
public int getMsgType() {
return msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
public String getContent() {
return content;
......@@ -142,11 +150,11 @@ public class WechatJsonMessage {
this.toUser = toUser;
}
public String getWId() {
public String getwId() {
return wId;
}
public void setWId(String wId) {
public void setwId(String wId) {
this.wId = wId;
}
......
......@@ -71,6 +71,7 @@ public class WechatMessageRequest implements Message {
private String content;
private String fromGroup;
private String fromUser;
private int msgType;
private int msgId;
private long newMsgId;
private boolean self;
......@@ -80,6 +81,13 @@ public class WechatMessageRequest implements Message {
private Long voiceLength;
public int getMsgType() {
return msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
public String getContent() {
return content;
......@@ -145,11 +153,11 @@ public class WechatMessageRequest implements Message {
this.toUser = toUser;
}
public String getWId() {
public String getwId() {
return wId;
}
public void setWId(String wId) {
public void setwId(String wId) {
this.wId = wId;
}
......
......@@ -61,6 +61,7 @@ public class WechatMessageResponse implements Message {
private String fromGroup;
private String fromUser;
private int msgId;
private int msgType;
private long newMsgId;
private boolean self;
private int timestamp;
......@@ -68,7 +69,13 @@ public class WechatMessageResponse implements Message {
private String wId;
private Long voiceLength;
public int getMsgType() {
return msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
public String getContent() {
return content;
......@@ -134,11 +141,11 @@ public class WechatMessageResponse implements Message {
this.toUser = toUser;
}
public String getWId() {
public String getwId() {
return wId;
}
public void setWId(String wId) {
public void setwId(String wId) {
this.wId = wId;
}
......
.pagination-container[data-v-f3b72548]{background:#fff;padding:32px 16px}.pagination-container.hidden[data-v-f3b72548]{display:none}.waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}
\ No newline at end of file
......@@ -28,5 +28,7 @@ public interface DeviceInfoService extends IService<DeviceInfoEntity> {
List<DeviceInfoEntity> queryDeviceByIds(Set<Long> ids);
List<DeviceInfoEntity> queryDeviceByDeviceIdAndChannelRules(Integer channelRules, List<Long> deviceIds);
void updateByImei(DeviceInfoEntity deviceInfoEntity);
}
......@@ -104,5 +104,10 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoDao, DeviceInfo
return deviceInfoEntities;
}
@Override
public void updateByImei(DeviceInfoEntity deviceInfoEntity) {
getBaseMapper().update(deviceInfoEntity,new QueryWrapper<DeviceInfoEntity>().eq("imei",deviceInfoEntity.getImei()));
}
}
......@@ -171,7 +171,20 @@ public class DeviceInfoController {
public R update(@RequestBody DeviceInfoEntity deviceInfo){
ValidatorUtils.validateEntity(deviceInfo);
deviceInfoService.updateById(deviceInfo);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/updateByImei")
public R updateByImei(@RequestBody DeviceInfoDto dto){
DeviceInfoEntity deviceInfo = new DeviceInfoEntity();
BeanUtils.copyProperties(dto,deviceInfo);
ValidatorUtils.validateEntity(deviceInfo);
deviceInfoService.updateByImei(deviceInfo);
return R.ok();
}
......@@ -355,4 +368,7 @@ public class DeviceInfoController {
});
deviceInfoChannelService.saveBatch(deviceInfoChannelEntityList);
}
}
spring:
profiles:
active: dev
active: prod
application:
name: cneeds-server-logupload
......
spring:
profiles:
active: dev
active: prod
application:
name: cneeds-server-user
......
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