From 0e57b01326d5b8c6468761d29dd2c9469b3274ad Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Tue, 12 Sep 2023 11:28:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/dto/CsEquipmentDeliveryDTO.java | 8 ++-- .../param/CsEquipmentDeliveryAddParm.java | 12 +++--- .../param/CsEquipmentDeliveryAuditParm.java | 10 ++--- .../pojo/po/CsEquipmentDeliveryPO.java | 6 +-- .../pojo/vo/CsEquipmentDeliveryVO.java | 10 ++--- .../njcn/csdevice/utils/ExcelStyleUtil.java | 42 +++++++++++++++++++ .../mapping/CsEquipmentDeliveryMapper.xml | 1 - .../impl/CsDeviceUserPOServiceImpl.java | 2 + .../impl/CsEquipmentDeliveryServiceImpl.java | 12 ++++-- .../service/impl/CsFeedbackServiceImpl.java | 1 + 10 files changed, 74 insertions(+), 30 deletions(-) diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/dto/CsEquipmentDeliveryDTO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/dto/CsEquipmentDeliveryDTO.java index 04a08d7..0530242 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/dto/CsEquipmentDeliveryDTO.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/dto/CsEquipmentDeliveryDTO.java @@ -66,10 +66,10 @@ public class CsEquipmentDeliveryDTO { */ private String devAccessMethod; - /** - * 装置程序版本 - */ - private String programVersion; +// /** +// * 装置程序版本 +// */ +// private String programVersion; /** * 调试人员 diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAddParm.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAddParm.java index 519d714..fc5cec6 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAddParm.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAddParm.java @@ -57,12 +57,12 @@ public class CsEquipmentDeliveryAddParm{ @NotBlank(message="装置型号不能为空!") private String devModel; - /** - * 装置程序版本 - */ - @ApiModelProperty(value="装置程序版本") - @NotBlank(message="装置程序版本不能为空!") - private String programVersion; +// /** +// * 装置程序版本 +// */ +// @ApiModelProperty(value="装置程序版本") +// @NotBlank(message="装置程序版本不能为空!") +// private String programVersion; // /** // * 调试人员 diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAuditParm.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAuditParm.java index de03bbb..bf8c13c 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAuditParm.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/param/CsEquipmentDeliveryAuditParm.java @@ -60,11 +60,11 @@ public class CsEquipmentDeliveryAuditParm { @ApiModelProperty(value="装置接入方式") private String devAccessMethod; - /** - * 装置程序版本 - */ - @ApiModelProperty(value="装置程序版本") - private String programVersion; +// /** +// * 装置程序版本 +// */ +// @ApiModelProperty(value="装置程序版本") +// private String programVersion; // /** // * 调试人员 diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentDeliveryPO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentDeliveryPO.java index 3fda285..98bf69a 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentDeliveryPO.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentDeliveryPO.java @@ -64,11 +64,7 @@ public class CsEquipmentDeliveryPO extends BaseEntity { @TableField(value = "dev_access_method") private String devAccessMethod; - /** - * 装置程序版本 - */ - @TableField(value = "program_version") - private String programVersion; + /** * 合同号 diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java index 21aacca..3f4e4e2 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java @@ -56,11 +56,11 @@ public class CsEquipmentDeliveryVO extends BaseEntity { @ApiModelProperty(value="装置型号") private String devModel; - /** - * 装置程序版本 - */ - @ApiModelProperty(value="装置程序版本") - private String programVersion; +// /** +// * 装置程序版本 +// */ +// @ApiModelProperty(value="装置程序版本") +// private String programVersion; /** * 调试人员 diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/utils/ExcelStyleUtil.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/utils/ExcelStyleUtil.java index 8dd05e5..eaf05b9 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/utils/ExcelStyleUtil.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/utils/ExcelStyleUtil.java @@ -3,9 +3,15 @@ package com.njcn.csdevice.utils; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams; 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.ss.usermodel.*; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.net.URLEncoder; + /** * pqs * @@ -155,4 +161,40 @@ public class ExcelStyleUtil implements IExcelExportStyler { style.setVerticalAlignment(VerticalAlignment.CENTER); 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); + } + } } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentDeliveryMapper.xml b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentDeliveryMapper.xml index e77dfd8..71dc0d9 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentDeliveryMapper.xml +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentDeliveryMapper.xml @@ -11,7 +11,6 @@ - diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java index c319946..38f1eb2 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java @@ -42,6 +42,7 @@ import static java.util.Objects.isNull; @Service @RequiredArgsConstructor public class CsDeviceUserPOServiceImpl extends ServiceImpl implements CsDeviceUserPOService{ + private final CsDevModelRelationService csDevModelRelationService; private final ICsLedgerService iCsLedgerService; // private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient; @@ -275,6 +276,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl queryWrap = new QueryWrapper<>(); queryWrap.eq("device_id",eid); csTouristDataPOService.getBaseMapper().delete(queryWrap); + csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,eid).set(CsDevModelRelationPO::getStatus,0).update(); return true; } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java index fe540f3..df13796 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentDeliveryServiceImpl.java @@ -27,6 +27,7 @@ import com.njcn.csdevice.pojo.vo.DeviceManagerVO; import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO; import com.njcn.csdevice.service.*; import com.njcn.csdevice.util.QRCodeUtil; +import com.njcn.csdevice.utils.ExcelStyleUtil; import com.njcn.db.constant.DbConstant; import com.njcn.oss.constant.OssPath; import com.njcn.oss.utils.FileStorageUtil; @@ -99,7 +100,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl queryWrap = new QueryWrapper<>(); queryWrap.eq("device_id",id); csTouristDataPOService.getBaseMapper().delete(queryWrap); + + csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update(); return update; } @@ -144,7 +147,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl wrapper = new QueryWrapper(); wrapper.eq ("ndid", ndid); - wrapper.eq("run_status",1); +// wrapper.eq("run_status",1); CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper); return csEquipmentDeliveryPO; } @@ -319,6 +322,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl