Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java
mengkang 5 years ago
parent
commit
82cede4ea3

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -161,6 +161,7 @@ public class BaseRequestMapping {
        public static final String CHECK_MOBILE = "/check_mobile";
        public static final String findUserBaseInfo = "/findUserBaseInfo";
        public static final String resetPwd = "/resetPwd";
        public static final String updatePwd = "/updatePwd";
        public static final String queryOne = "/queryOne";
        public static final String orgTreeInfo = "/orgTreeInfo";
        public static final String userInfoList = "/userInfoList";

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java

@ -231,6 +231,7 @@ public class IotRequestMapping {
        public static final String updSim = "updSim";
        public static final String importDevice = "importDevice";
        public static final String isImportDevice = "isImportDevice";
        public static final String uploadDeviceInfo = "uploadDeviceInfo";
        public static final String queryImportRecordPage = "queryImportRecordPage";

+ 40 - 10
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/iot/device/IotDeviceImportVO.java

@ -13,20 +13,18 @@ import java.io.Serializable;
@ApiModel(description = "设备导入")
public class IotDeviceImportVO implements Serializable {
    @ApiModelProperty("sn码")
    private String sn;
    @ApiModelProperty("设备sn码")
    private String deviceSn;
    @ApiModelProperty("归属社区")
    private String hospital;
    @ApiModelProperty("sim卡号")
    private String sim;
    public String getSn() {
        return sn;
    }
    public void setSn(String sn) {
        this.sn = sn;
    }
    @ApiModelProperty("设备名称")
    private String name;
    @ApiModelProperty("设备类型名称")
    private String categoryName;//设备类型名称
    @ApiModelProperty("厂商名称")
    private String manufacturerName;
    public String getHospital() {
        return hospital;
@ -43,4 +41,36 @@ public class IotDeviceImportVO implements Serializable {
    public void setSim(String sim) {
        this.sim = sim;
    }
    public String getDeviceSn() {
        return deviceSn;
    }
    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCategoryName() {
        return categoryName;
    }
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
    public String getManufacturerName() {
        return manufacturerName;
    }
    public void setManufacturerName(String manufacturerName) {
        this.manufacturerName = manufacturerName;
    }
}

+ 12 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java

@ -11,6 +11,7 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -235,4 +236,15 @@ public class UserEndpoint extends EnvelopRestEndpoint {
        }
        return success(jsonObject.getString("msg"));
    }
    
    @PostMapping(value = BaseRequestMapping.User.updatePwd)
    @ApiOperation(value = "修账号密码")
    public Envelop updatePwd(@ApiParam(name = "id", value = "用户ID")
                                  @RequestParam(value = "id", required = true)String id,
                                  @ApiParam(name = "pw", value = "密码")
                                  @RequestParam(value = "pw", required = true)String pw,
                                  @ApiParam(name = "orgPw", value = "原密码")
                                  @RequestParam(value = "orgPw", required = true)String orgPw)throws Exception{
        return success(userService.updatePwd(id,pw,orgPw));
    }
}

+ 102 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -1,5 +1,6 @@
package com.yihu.jw.base.service.user;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -17,11 +18,15 @@ import com.yihu.jw.entity.base.org.BaseOrgUserDO;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -61,9 +66,15 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    @Autowired
    private BaseOrgSaasService baseOrgSaasService;
    
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Value("${configDefault.saasId}")
    private String defaultSaasId;
    
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    public UserDO registerWithIdcard(UserDO userDO) {
@ -214,9 +225,44 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                    }
            }
        }
    
    
        //密码过期
        userinfo.put("authPw",findDoctorPwlimitDate(id));
        return userinfo;
    }
    
    public com.alibaba.fastjson.JSONObject findDoctorPwlimitDate(String user){
        String key = "base:authPw:iser:" + user;
        String authPw = redisTemplate.opsForValue().get(key);
        com.alibaba.fastjson.JSONObject valueJson = null;
        if(org.apache.commons.lang3.StringUtils.isNotBlank(authPw)){
            
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("pwOverDue");
            String code[] = wlyyHospitalSysDictDO.getDictCode().split(",");
            Integer maxDateInt = Integer.parseInt(code[0]);
            Integer remainDateInt = Integer.parseInt(code[1]);
            
            valueJson = JSON.parseObject(authPw);
            Long updateTimeLong = valueJson.getLong("updateTime");
            Date updateTime = new Date();
            updateTime.setTime(updateTimeLong);
            Date maxDate = DateUtil.getPreDays(updateTime,maxDateInt);
            
            Long betweenDate = (maxDate.getTime() - new Date().getTime())/(60*60*24*1000);
            valueJson.put("betweenDate",betweenDate);
            if(betweenDate<remainDateInt){
                valueJson.put("remaind",true);
            }else {
                valueJson.put("remaind",false);
            }
        }else {
            valueJson = new com.alibaba.fastjson.JSONObject();
            valueJson.put("isChanged",false);
        }
        return valueJson;
    }
    /**
@ -427,6 +473,58 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        return result;
    }
    /**
     * 用户修改密码
     * @param userId
     * @return
     */
    public JSONObject updatePwd(String userId,String pwd,String oldpwd){
        JSONObject result = new JSONObject();
        UserDO user = userDao.findOne(userId);
        if(null == user){
            result.put("response", ConstantUtils.FAIL);
            result.put("msg","user not exist for id : " + userId);
            return result;
        }
    
        String orgPwMd5 = MD5.md5Hex(oldpwd + "{" + user.getSalt() + "}");
        if(!orgPwMd5.equals(user.getPassword())){
            result.put("response", ConstantUtils.FAIL);
            result.put("msg","旧密码不正确!");
            return result;
        }
        if(StringUtils.isEmpty(pwd)){
            result.put("response", ConstantUtils.FAIL);
            result.put("msg","新密码不能为空!");
            return result;
        }
        user.setSalt(randomString(5));
        user.setEnabled(true);
        user.setLocked(false);
        user.setLoginFailureCount(0);
        user.setPassword(MD5.md5Hex(pwd + "{" + user.getSalt() + "}"));
        userDao.save(user);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg", "修改成功");
    
        //设置用户密码过期时间
        saveUserPwlimitDate(userId);
        
        return result;
    }
    
    public boolean saveUserPwlimitDate(String user){
        String key = "base:authPw:user:" + user;
        com.alibaba.fastjson.JSONObject valueJson = new com.alibaba.fastjson.JSONObject();
        valueJson.put("updateTime",new Date().getTime());
        valueJson.put("isChanged",true);
        redisTemplate.opsForValue().set(key,valueJson.toJSONString());
        return true;
    }
    
    /**
     * 用户重置密码
     * @param userId
@ -444,26 +542,26 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        String idcard = user.getIdcard();
        String mobile = user.getMobile();
        String password = null;
        
        if(!StringUtils.isEmpty(password)&&idcard.length()>10){
            password = idcard.substring(idcard.length()-6,idcard.length());
        }else if(!StringUtils.isEmpty(mobile)&&mobile.length()>=11){
            password = mobile.substring(mobile.length()-6,mobile.length());
        }
        
        if(StringUtils.isEmpty(password)){
            result.put("response", ConstantUtils.FAIL);
            result.put("msg","idcard or moblie not exist : " + userId);
            return result;
        }
        
        user.setSalt(randomString(5));
        user.setEnabled(true);
        user.setLocked(false);
        user.setLoginFailureCount(0);
        user.setPassword(MD5.md5Hex(password + "{" + user.getSalt() + "}"));
        userDao.save(user);
        
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg", password);
        return result;

+ 39 - 22
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java

@ -23,7 +23,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -160,37 +162,39 @@ public class IotDeviceController extends EnvelopRestEndpoint {
    @GetMapping(value = IotRequestMapping.Device.api_queryPage)
    @ApiOperation(value = "分页查找设备", notes = "分页查找设备")
    public MixEnvelop<IotDeviceVO, IotDeviceVO> findProductPageByCompanyId(@ApiParam(name = "sn", value = "SN码或SIM卡号", defaultValue = "")
                                                           @RequestParam(value = "sn", required = false) String sn,
                                                              @ApiParam(name = "hospital", value = "社区医院", defaultValue = "")
                                                           @RequestParam(value = "hospital", required = false) String hospital,
                                                              @ApiParam(name = "orderId", value = "订单id", defaultValue = "")
                                                           @RequestParam(value = "orderId", required = false) String orderId,
                                                              @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                                           @RequestParam(value = "purcharseId", required = false) String purcharseId,
                                                              @ApiParam(name = "isBinding", value = "是否绑定(1已绑定,2未绑定)", defaultValue = "")
                                                           @RequestParam(value = "isBinding", required = false) Integer isBinding,
                                                                           @RequestParam(value = "sn", required = false) String sn,
                                                                           @ApiParam(name = "hospital", value = "社区医院", defaultValue = "")
                                                                           @RequestParam(value = "hospital", required = false) String hospital,
                                                                           @ApiParam(name = "hospitalName", value = "社区医院名称", defaultValue = "")
                                                                           @RequestParam(value = "hospitalName", required = false) String hospitalName,
                                                                           @ApiParam(name = "orderId", value = "订单id", defaultValue = "")
                                                                           @RequestParam(value = "orderId", required = false) String orderId,
                                                                           @ApiParam(name = "purcharseId", value = "采购id", defaultValue = "")
                                                                           @RequestParam(value = "purcharseId", required = false) String purcharseId,
                                                                           @ApiParam(name = "isBinding", value = "是否绑定(1已绑定,2未绑定)", defaultValue = "")
                                                                           @RequestParam(value = "isBinding", required = false) Integer isBinding,
                                                                           @ApiParam(name = "productId", value = "产品id")
                                                                               @RequestParam(value = "productId", required = false) String productId,
                                                                           @RequestParam(value = "productId", required = false) String productId,
                                                                           @ApiParam(name = "name", value = "设备名称")
                                                                               @RequestParam(value = "name", required = false) String name,
                                                                           @RequestParam(value = "name", required = false) String name,
                                                                           @ApiParam(name = "categoryCode", value = "设备类型标识")
                                                                               @RequestParam(value = "categoryCode", required = false) String categoryCode,
                                                                           @RequestParam(value = "categoryCode", required = false) String categoryCode,
                                                                           @ApiParam(name = "manufacturerId", value = "供应厂商id")
                                                                               @RequestParam(value = "manufacturerId", required = false) String manufacturerId,
                                                              @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                           @RequestParam(value = "page", required = false) Integer page,
                                                              @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                           @RequestParam(value = "size", required = false) Integer size){
                                                                           @RequestParam(value = "manufacturerId", required = false) String manufacturerId,
                                                                           @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                           @RequestParam(value = "page", required = false) Integer page,
                                                                           @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                           @RequestParam(value = "size", required = false) Integer size) {
        try {
            if(page == null|| page < 0){
            if (page == null || page < 0) {
                page = 1;
            }
            if(size == null){
            if (size == null) {
                size = 10;
            }
            if(isBinding==null){
                return iotDeviceService.queryPage(sn, hospital, orderId, purcharseId, productId, name, categoryCode, manufacturerId, page, size);
            }else {
            if (isBinding == null) {
                return iotDeviceService.queryPage(sn, hospital, hospitalName, orderId, purcharseId, productId, name, categoryCode, manufacturerId, page, size);
            } else {
                return iotDeviceService.queryPage(sn, hospital, orderId, purcharseId, isBinding, page, size);
            }
        } catch (Exception e) {
@ -275,4 +279,17 @@ public class IotDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Device.uploadDeviceInfo)
    @ApiOperation(value = "导入设备sn码相关信息", notes = "导入设备sn码相关信息")
    public MixEnvelop<IotDeviceImportVO, IotDeviceImportVO> uploadStream(@ApiParam(value = "文件", required = true)
                                                                                     @RequestParam(value = "file", required = true) MultipartFile file,
                                                                                     HttpServletRequest request) {
        try {
            return iotDeviceService.uploadStream(file, request);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
}

+ 4 - 34
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -16,10 +16,8 @@ import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
@ -159,12 +157,12 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
  @GetMapping(value = IotRequestMapping.Platform.findAllLog)
    @GetMapping(value = IotRequestMapping.Platform.findAllLog)
    @ApiOperation(value = "分页查询所有接口日志信息",notes = "分页查询所有接口日志信息")
    public MixEnvelop<IotInterfaceLogVO,IotInterfaceLogVO> findAllLog(@ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                      @RequestParam(value = "page", required = false) Integer page,
                                                                      @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                      @RequestParam(value = "size", required = false) Integer size){
                                                                       @RequestParam(value = "page", required = false) Integer page,
                                                                        @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                       @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
@ -183,34 +181,6 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    @GetMapping(value = IotRequestMapping.Platform.findInterfaceLog)
    @ApiOperation(value = "分页查询接口日志信息",notes = "分页查询接口日志信息")
    public MixEnvelop<IotInterfaceLogVO,IotInterfaceLogVO> findInterfaceLog(@ApiParam(name = "page", value = "第几页", defaultValue = "")
                                                                      @RequestParam(value = "page", required = false) Integer page,
                                                                            @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                                                      @RequestParam(value = "size", required = false) Integer size,
                                                                            @ApiParam(name = "interfaceName", value = "接口,名称", defaultValue = "")
                                                                       @RequestParam(value = "interfaceName", required = true) String interfaceName){
        try {
            if(page == null|| page < 0){
                page = 1;
            }
            if(size == null){
                size = 10;
            }
            return iotInterfaceLogService.findInterfaceLog(page,size,interfaceName);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Platform.dataConsumption)
    @ApiOperation(value = "接口数据消费分页查询",notes = "接口数据消费分页查询")

+ 34 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java

@ -1,8 +1,12 @@
package com.yihu.iot.service.device;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.iot.dao.device.*;
import com.yihu.iot.dao.product.IotProductDataTransmissionDao;
import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.iot.util.excel.reader.IotDeviceImportVOReader;
import com.yihu.jw.entity.iot.device.*;
import com.yihu.jw.entity.iot.product.IotProductDataTransmissionDO;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportRecordVO;
@ -13,6 +17,8 @@ import com.yihu.jw.restmodel.iot.product.IotProductDataTransmissionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.iot.util.excel.AExcelReader;
import com.yihu.iot.util.excel.reader.IotDeviceImportVOReader;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,7 +26,9 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -199,7 +207,7 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
     * @param size
     * @return
     */
    public MixEnvelop<IotDeviceVO, IotDeviceVO> queryPage(String sn, String hospital, String orderId, String purcharseId, String productId, String name, String categoryCode, String manufacturerId, Integer page, Integer size) throws Exception{
    public MixEnvelop<IotDeviceVO, IotDeviceVO> queryPage(String sn, String hospital, String hospitalName,String orderId, String purcharseId, String productId, String name, String categoryCode, String manufacturerId, Integer page, Integer size) throws Exception{
        String filters = "del=1;";
        String semicolon = "";
        if(StringUtils.isNotBlank(orderId)){
@ -234,6 +242,10 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
            filters += semicolon +"manufacturerId="+manufacturerId;
            semicolon = ";";
        }
        if(StringUtils.isNotBlank(hospitalName)){
            filters += semicolon + "hospitalName?"+hospitalName+"";
            semicolon = ";";
        }
        String sorts = "-updateTime";
        //得到list数据
        List<IotDeviceDO> list = search(null, filters, sorts, page, size);
@ -458,4 +470,25 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
            }
        }
    }
    public MixEnvelop<IotDeviceImportVO, IotDeviceImportVO> uploadStream(MultipartFile file, HttpServletRequest request) throws Exception {
        // 得到文件的完整名称  xxx.txt
        String fullName = file.getOriginalFilename();
        //得到文件类型
        String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
        if (!"xls".equals(fileType) || !"xlsx".equals(fileType)) {
            return MixEnvelop.getError("文件格式不正确");
        }
//        String fileName = fullName.substring(0, fullName.lastIndexOf("."));
        //解析excel封装对象
        AExcelReader excelReader = new IotDeviceImportVOReader();
        excelReader.read(file.getInputStream());
        List<IotDeviceImportVO> correctLs = excelReader.getCorrectLs();
        ObjectMapper objectMapper = new ObjectMapper();
        List<IotDeviceImportVO> importVOList = objectMapper.readValue(JSONObject.toJSONString(correctLs), new TypeReference<List<IotDeviceImportVO>>() {
        });
//        IotDeviceImportRecordVO vo = this.importDevice(null,fileName,null,importVOList);
        return MixEnvelop.getSuccess(IotRequestMapping.FileUpload.message_success_upload, importVOList);
    }
}

+ 70 - 0
svr/svr-iot/src/main/java/com/yihu/iot/util/excel/AExcelReader.java

@ -0,0 +1,70 @@
package com.yihu.iot.util.excel;
import jxl.Sheet;
import jxl.Workbook;
import java.io.File;
import java.io.InputStream;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * @author lincl
 * @version 1.0
 * @created 2016/6/18
 */
public abstract class AExcelReader {
    protected List errorLs = new ArrayList<>();
    protected List correctLs = new ArrayList<>();
    protected Map<String, Set> repeat = new HashMap<>();
    private static Pattern blankPattern = Pattern.compile("\\s*|\t|\r|\n");
    public abstract void read(Workbook rwb) throws Exception;
    public void read(File file) throws Exception {
        read(Workbook.getWorkbook(file));
    }
    public void read(InputStream is) throws Exception {
        read(Workbook.getWorkbook(is));
    }
    public static String replaceBlank(String str) {
        String dest = "";
        if (str!=null) {
            //去除字符串中的空格、回车、换行符、制表符
            Matcher m = blankPattern.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }
    protected String getCellCont(Sheet sheet, int row, int col){
        return sheet.getCell(col, row).getContents();
    }
    public List getErrorLs() {
        return errorLs;
    }
    public void setErrorLs(List errorLs) {
        this.errorLs = errorLs;
    }
    public List getCorrectLs() {
        return correctLs;
    }
    public void setCorrectLs(List correctLs) {
        this.correctLs = correctLs;
    }
    public Map<String, Set> getRepeat() {
        return repeat;
    }
    public void setRepeat(Map<String, Set> repeat) {
        this.repeat = repeat;
    }
}

+ 35 - 0
svr/svr-iot/src/main/java/com/yihu/iot/util/excel/reader/IotDeviceImportVOReader.java

@ -0,0 +1,35 @@
package com.yihu.iot.util.excel.reader;
import com.yihu.iot.util.excel.AExcelReader;
import com.yihu.jw.restmodel.iot.device.IotDeviceImportVO;
import jxl.Sheet;
import jxl.Workbook;
/**
 * @author yeshijie on 2018/1/23.
 */
public class IotDeviceImportVOReader extends AExcelReader {
    @Override
    public void read(Workbook rwb) throws Exception {
        try {
            Sheet sheet = rwb.getSheet(0) ;
            for (int i = 1; i < sheet.getRows(); i++) {
                IotDeviceImportVO device = new IotDeviceImportVO();
                device.setName(getCellCont(sheet, i, 0));
                device.setCategoryName(getCellCont(sheet, i, 1));
                device.setDeviceSn(getCellCont(sheet, i, 2));
                device.setManufacturerName(getCellCont(sheet, i, 3));
                device.setSim(getCellCont(sheet, i, 4).trim());
                correctLs.add(device);
            }
        } catch (Exception e) {
            throw new RuntimeException("模板不正确,请下载新的模板,并按照示例正确填写后上传!");
        } finally {
            if (rwb != null){
                rwb.close();
            }
        }
    }
}

+ 2 - 2
svr/svr-iot/src/main/resources/application.yml

@ -124,9 +124,9 @@ spring:
    password: ssgg@jkzl2019
  elasticsearch:
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 172.26.0.112:9300,172.26.0.112:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      uris: http://172.26.0.112:9200,http://172.26.0.112:9200
  wlyy:
    url: http://ehr.yihu.com/wlyy/
fast-dfs: