修改设备
This commit is contained in:
@@ -66,10 +66,10 @@ public class CsEquipmentDeliveryDTO {
|
|||||||
*/
|
*/
|
||||||
private String devAccessMethod;
|
private String devAccessMethod;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 装置程序版本
|
// * 装置程序版本
|
||||||
*/
|
// */
|
||||||
private String programVersion;
|
// private String programVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调试人员
|
* 调试人员
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ public class CsEquipmentDeliveryAddParm{
|
|||||||
@NotBlank(message="装置型号不能为空!")
|
@NotBlank(message="装置型号不能为空!")
|
||||||
private String devModel;
|
private String devModel;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 装置程序版本
|
// * 装置程序版本
|
||||||
*/
|
// */
|
||||||
@ApiModelProperty(value="装置程序版本")
|
// @ApiModelProperty(value="装置程序版本")
|
||||||
@NotBlank(message="装置程序版本不能为空!")
|
// @NotBlank(message="装置程序版本不能为空!")
|
||||||
private String programVersion;
|
// private String programVersion;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 调试人员
|
// * 调试人员
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ public class CsEquipmentDeliveryAuditParm {
|
|||||||
@ApiModelProperty(value="装置接入方式")
|
@ApiModelProperty(value="装置接入方式")
|
||||||
private String devAccessMethod;
|
private String devAccessMethod;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 装置程序版本
|
// * 装置程序版本
|
||||||
*/
|
// */
|
||||||
@ApiModelProperty(value="装置程序版本")
|
// @ApiModelProperty(value="装置程序版本")
|
||||||
private String programVersion;
|
// private String programVersion;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 调试人员
|
// * 调试人员
|
||||||
|
|||||||
@@ -64,11 +64,7 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
|
|||||||
@TableField(value = "dev_access_method")
|
@TableField(value = "dev_access_method")
|
||||||
private String devAccessMethod;
|
private String devAccessMethod;
|
||||||
|
|
||||||
/**
|
|
||||||
* 装置程序版本
|
|
||||||
*/
|
|
||||||
@TableField(value = "program_version")
|
|
||||||
private String programVersion;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同号
|
* 合同号
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
|
|||||||
@ApiModelProperty(value="装置型号")
|
@ApiModelProperty(value="装置型号")
|
||||||
private String devModel;
|
private String devModel;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 装置程序版本
|
// * 装置程序版本
|
||||||
*/
|
// */
|
||||||
@ApiModelProperty(value="装置程序版本")
|
// @ApiModelProperty(value="装置程序版本")
|
||||||
private String programVersion;
|
// private String programVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调试人员
|
* 调试人员
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ package com.njcn.csdevice.utils;
|
|||||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||||
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
|
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
|
||||||
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
|
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import org.apache.poi.hssf.util.HSSFColor;
|
import org.apache.poi.hssf.util.HSSFColor;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
*
|
*
|
||||||
@@ -155,4 +161,40 @@ public class ExcelStyleUtil implements IExcelExportStyler {
|
|||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void exportFileByWorkbook(Workbook workbook, String fileName, HttpServletResponse response) {
|
||||||
|
response.reset();
|
||||||
|
|
||||||
|
try {
|
||||||
|
ServletOutputStream outputStream = response.getOutputStream();
|
||||||
|
Throwable var4 = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
fileName = URLEncoder.encode(fileName, "UTF-8");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
||||||
|
workbook.write(outputStream);
|
||||||
|
} catch (Throwable var14) {
|
||||||
|
var4 = var14;
|
||||||
|
throw var14;
|
||||||
|
} finally {
|
||||||
|
if (outputStream != null) {
|
||||||
|
if (var4 != null) {
|
||||||
|
try {
|
||||||
|
outputStream.close();
|
||||||
|
} catch (Throwable var13) {
|
||||||
|
var4.addSuppressed(var13);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
outputStream.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception var16) {
|
||||||
|
var16.printStackTrace();
|
||||||
|
throw new BusinessException(CommonResponseEnum.EXPORT_FILE_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
<result column="dev_use" jdbcType="VARCHAR" property="devUse"/>
|
<result column="dev_use" jdbcType="VARCHAR" property="devUse"/>
|
||||||
<result column="dev_type" jdbcType="VARCHAR" property="devType"/>
|
<result column="dev_type" jdbcType="VARCHAR" property="devType"/>
|
||||||
<result column="dev_model" jdbcType="VARCHAR" property="devModel"/>
|
<result column="dev_model" jdbcType="VARCHAR" property="devModel"/>
|
||||||
<result column="program_version" jdbcType="VARCHAR" property="programVersion"/>
|
|
||||||
<result column="debug_person" jdbcType="VARCHAR" property="debugPerson"/>
|
<result column="debug_person" jdbcType="VARCHAR" property="debugPerson"/>
|
||||||
<result column="producte_time" jdbcType="TIMESTAMP" property="producteTime"/>
|
<result column="producte_time" jdbcType="TIMESTAMP" property="producteTime"/>
|
||||||
<result column="check_time" jdbcType="TIMESTAMP" property="checkTime"/>
|
<result column="check_time" jdbcType="TIMESTAMP" property="checkTime"/>
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import static java.util.Objects.isNull;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
||||||
|
private final CsDevModelRelationService csDevModelRelationService;
|
||||||
|
|
||||||
private final ICsLedgerService iCsLedgerService;
|
private final ICsLedgerService iCsLedgerService;
|
||||||
// private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
// private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
||||||
@@ -275,6 +276,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
|
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
|
||||||
queryWrap.eq("device_id",eid);
|
queryWrap.eq("device_id",eid);
|
||||||
csTouristDataPOService.getBaseMapper().delete(queryWrap);
|
csTouristDataPOService.getBaseMapper().delete(queryWrap);
|
||||||
|
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,eid).set(CsDevModelRelationPO::getStatus,0).update();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.njcn.csdevice.pojo.vo.DeviceManagerVO;
|
|||||||
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
||||||
import com.njcn.csdevice.service.*;
|
import com.njcn.csdevice.service.*;
|
||||||
import com.njcn.csdevice.util.QRCodeUtil;
|
import com.njcn.csdevice.util.QRCodeUtil;
|
||||||
|
import com.njcn.csdevice.utils.ExcelStyleUtil;
|
||||||
import com.njcn.db.constant.DbConstant;
|
import com.njcn.db.constant.DbConstant;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.oss.utils.FileStorageUtil;
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
@@ -99,7 +100,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPo);
|
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPo);
|
||||||
csEquipmentDeliveryPo.setStatus ("1");
|
csEquipmentDeliveryPo.setStatus ("1");
|
||||||
csEquipmentDeliveryPo.setRunStatus(1);
|
csEquipmentDeliveryPo.setRunStatus(1);
|
||||||
csEquipmentDeliveryPo.setProcess(1);
|
csEquipmentDeliveryPo.setProcess("1");
|
||||||
|
|
||||||
//生成二维码文件
|
//生成二维码文件
|
||||||
String qr = this.createQr(csEquipmentDeliveryAddParm.getNdid());
|
String qr = this.createQr(csEquipmentDeliveryAddParm.getNdid());
|
||||||
@@ -128,6 +129,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
|
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
|
||||||
queryWrap.eq("device_id",id);
|
queryWrap.eq("device_id",id);
|
||||||
csTouristDataPOService.getBaseMapper().delete(queryWrap);
|
csTouristDataPOService.getBaseMapper().delete(queryWrap);
|
||||||
|
|
||||||
|
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +147,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
public CsEquipmentDeliveryPO queryEquipmentPOByndid(String ndid) {
|
public CsEquipmentDeliveryPO queryEquipmentPOByndid(String ndid) {
|
||||||
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
|
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
|
||||||
wrapper.eq ("ndid", ndid);
|
wrapper.eq ("ndid", ndid);
|
||||||
wrapper.eq("run_status",1);
|
// wrapper.eq("run_status",1);
|
||||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
|
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
|
||||||
return csEquipmentDeliveryPO;
|
return csEquipmentDeliveryPO;
|
||||||
}
|
}
|
||||||
@@ -319,6 +322,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void importEquipment(MultipartFile file, HttpServletResponse response) {
|
public void importEquipment(MultipartFile file, HttpServletResponse response) {
|
||||||
ImportParams params = new ImportParams ( );
|
ImportParams params = new ImportParams ( );
|
||||||
params.setHeadRows(1);
|
params.setHeadRows(1);
|
||||||
@@ -388,7 +392,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
csEquipmentDeliveryPO.setMac(path);
|
csEquipmentDeliveryPO.setMac(path);
|
||||||
csEquipmentDeliveryPO.setRunStatus(1);
|
csEquipmentDeliveryPO.setRunStatus(1);
|
||||||
csEquipmentDeliveryPO.setStatus("1");
|
csEquipmentDeliveryPO.setStatus("1");
|
||||||
csEquipmentDeliveryPO.setProcess(1);
|
csEquipmentDeliveryPO.setProcess("1");
|
||||||
return csEquipmentDeliveryPO;
|
return csEquipmentDeliveryPO;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
this.saveOrUpdateBatch (collect, 500);
|
this.saveOrUpdateBatch (collect, 500);
|
||||||
@@ -396,7 +400,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
if (!CollectionUtils.isEmpty (falseCollect)) {
|
if (!CollectionUtils.isEmpty (falseCollect)) {
|
||||||
ExportParams exportExcel = new ExportParams ("批量导入模板(请严格按照模板标准填入数据)", "非法设备信息");
|
ExportParams exportExcel = new ExportParams ("批量导入模板(请严格按照模板标准填入数据)", "非法设备信息");
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel (exportExcel, DeviceExcelTemplete.IllegalityDeviceExcelTemplete.class, falseCollect);
|
Workbook workbook = ExcelExportUtil.exportExcel (exportExcel, DeviceExcelTemplete.IllegalityDeviceExcelTemplete.class, falseCollect);
|
||||||
PoiUtil.exportFileByWorkbook (workbook, "非法设备信息.xlsx", response);
|
ExcelStyleUtil.exportFileByWorkbook (workbook, "非法设备信息.xlsx", response);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public class CsFeedbackServiceImpl extends ServiceImpl<CsFeedbackMapper, CsFeedb
|
|||||||
return csFeedbackVO;
|
return csFeedbackVO;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
returnpage.setRecords (collect);
|
returnpage.setRecords (collect);
|
||||||
|
returnpage.setTotal(csFeedbackPOPage.getTotal());
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user