From 8555949ed7a019b7cc6331139f396e744ebca6f3 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Sat, 23 Nov 2024 15:36:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E8=A3=85=E5=A4=87=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/controller/DevInfoController.java | 26 ++++---- .../bonus/material/device/domain/DevInfo.java | 37 +++++++++-- .../material/device/domain/vo/DevInfoVo.java | 21 +++--- .../material/device/mapper/DevInfoMapper.java | 4 +- .../service/impl/DevInfoServiceImpl.java | 13 ++++ .../mapper/material/device/DevInfoMapper.xml | 66 +++++++++++++------ .../material/device/SysFileInfoMapper.xml | 38 +++++++++++ 7 files changed, 153 insertions(+), 52 deletions(-) create mode 100644 bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/SysFileInfoMapper.xml diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java index 00f32bb..3162884 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java @@ -58,7 +58,7 @@ public class DevInfoController extends BaseController { * 查询商品列表--包含附件查询 */ //@RequiresPermissions("equip:info:list") - @ApiOperation(value = "查询商品列表") + @ApiOperation(value = "查询商品列表--附件列表") @PostMapping("/devList") public TableDataInfo devList(@RequestBody DevInfoVo devInfo) { startPage(); @@ -83,18 +83,6 @@ public class DevInfoController extends BaseController { return getDataTable(list); } - /** - * 导出设备信息列表 - */ - // @RequiresPermissions("equip:info:export") - @ApiOperation(value = "导出装备信息") - @PostMapping("/export") - public void export(HttpServletResponse response, DevInfoVo devInfo) { - List list = devInfoService.selectDevInfoList(devInfo); - ExcelUtil util = new ExcelUtil<>(DevInfoVo.class); - util.exportExcel(response, list, "设备信息数据"); - } - /** * 获取设备信息详细信息 */ @@ -165,6 +153,16 @@ public class DevInfoController extends BaseController { return success(devInfoService.sumType()); } - + /** + * 导出设备信息列表 + */ + // @RequiresPermissions("equip:info:export") + @ApiOperation(value = "导出装备信息") + @PostMapping("/export") + public void export(HttpServletResponse response, DevInfoVo devInfo) { + List list = devInfoService.selectDevInfoList(devInfo); + ExcelUtil util = new ExcelUtil<>(DevInfoVo.class); + util.exportExcel(response, list, "设备信息数据"); + } } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java index d4fb190..63e633b 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/DevInfo.java @@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; /** @@ -40,22 +41,27 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "整机装备重量") private String deviceWeight; - @ApiModelProperty(value = "联系人") - private String person; - - @ApiModelProperty(value = "联系电话") - private String personPhone; + @ApiModelProperty(value = "单位") + private String unitName; /** 类型id */ @Excel(name = "类型id") @ApiModelProperty(value = "类型id") private Long typeId; + @ApiModelProperty(value = "装备类别") + private String typeName; + /** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */ @Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") @ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") private String maStatus; + /** 设备状态(自有,待上架,上架,在租,下架)考虑数据字典 */ + @Excel(name = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") + @ApiModelProperty(value = "设备状态(自有,待上架,上架,在租,下架)考虑数据字典") + private String maStatusName; + /** 租赁范围 */ @Excel(name = "租赁范围") @ApiModelProperty(value = "租赁范围") @@ -148,6 +154,12 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "创建人") private Long creator; + @ApiModelProperty(value = "联系人") + private String person; + + @ApiModelProperty(value = "联系人电话") + private String personPhone; + /** 设备规格 */ @Excel(name = "设备规格") @ApiModelProperty(value = "设备规格") @@ -168,6 +180,18 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "是否删除") private String isActive; + @ApiModelProperty(value = "主展示图") + private List mainFileList = new ArrayList<>(); + + @ApiModelProperty(value = "详情页展示图") + private List detailsFileList = new ArrayList<>(); + + @ApiModelProperty(value = "检测证明、检验pdf") + private List examinationPdf = new ArrayList<>(); + + @ApiModelProperty(value = "合格证、保险pdf") + private List insurancePdf = new ArrayList<>(); + /**文件附件 后续废弃 用下面的*/ @ApiModelProperty(value = "文件附件") private List fileList; @@ -178,4 +202,7 @@ public class DevInfo extends BaseEntity { @ApiModelProperty(value = "城市") private String city; + + @ApiModelProperty(value = "公司Id") + private String companyId; } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/vo/DevInfoVo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/vo/DevInfoVo.java index 9cbba91..9ee0d89 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/vo/DevInfoVo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/vo/DevInfoVo.java @@ -1,11 +1,14 @@ package com.bonus.material.device.domain.vo; +import com.bonus.common.biz.domain.SysFileInfo; import com.bonus.material.device.domain.DevInfo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +import java.util.List; + /** * @author syruan */ @@ -15,21 +18,15 @@ import lombok.ToString; public class DevInfoVo extends DevInfo { private Integer pageNum; - private Integer pageSize; - private long parentId; private Long maId; - @ApiModelProperty(value = "装备类别") - private String typeName; + /* 装备组别 parent */ @ApiModelProperty(value = "装备组别") private String groupName; - @ApiModelProperty(value = "装备名称") - private String deviceName; - @ApiModelProperty(value = "收藏id") private int collectId; @@ -60,12 +57,10 @@ public class DevInfoVo extends DevInfo { @ApiModelProperty(value = "搜索数量") private Long searchNum; - @ApiModelProperty(value = "检验pdf") - private String examinationPdf; - - @ApiModelProperty(value = "保险pdf") - private String insurancePdf; + @ApiModelProperty(value = "附件集合--只做返回用") + private List fileList; + /**上下架id*/ @ApiModelProperty(value = "上下架id") private int upId; @@ -117,6 +112,8 @@ public class DevInfoVo extends DevInfo { @ApiModelProperty(value = "所属公司id") private String companyId; + + /* 装备组别 parent */ @ApiModelProperty(value = "装备组别Id") private String groupId; diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java index 6a890de..60461a2 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/DevInfoMapper.java @@ -34,7 +34,7 @@ public interface DevInfoMapper { * @param maId 设备信息主键 * @return 设备图片集 */ - List getFilesByMaId(Long maId); + List getFilesByMaId(Long maId); Long getCompanyUpNum(Long ownCo); @@ -87,8 +87,10 @@ public interface DevInfoMapper { */ int insertLon(InfoMotionDto infoMotionDto); + // TODO List getSysDic(); + // todo SysDic getSysDicById(Integer id); List getBaseAddress(); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index 26a00ea..53d396f 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -32,6 +32,17 @@ import java.util.stream.Collectors; */ @Service public class DevInfoServiceImpl implements DevInfoService { + // 装备主展示图片字典 + private final Integer MAIN_IMAGES_DICT_VALUE = 0; + + // 装备详情展示图片字典 + private final Integer DETAILS_IMAGES_DICT_VALUE = 1; + + // 检测证明PDF附件字典 + private final Integer EXAMINATION_PDF = 2; + + // 合格证PDF附件字典 + private final Integer INSURANCE_PDF = 3; @Resource private DevInfoMapper devInfoMapper; @@ -145,6 +156,7 @@ public class DevInfoServiceImpl implements DevInfoService { List addressList = devInfoMapper.getBaseAddress(); for (DevInfoVo devInfoVo : list) { for (BaseAddress address : addressList) { + if (devInfoVo.getCityId() == null || address.getCode() == null) { continue; } if (devInfoVo.getCityId().equals(Integer.valueOf(address.getCode()))) { devInfoVo.setCityStr(address.getName()); break; @@ -168,6 +180,7 @@ public class DevInfoServiceImpl implements DevInfoService { //保存用户信息 devInfo.setCreator(userId); devInfo.setCode(String.valueOf(UUID.randomUUID())); + devInfo.setMaStatus("3"); devInfoMapper.insertDevInfo(devInfo); //把文件保存到附件中 diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml index d89c27d..f69d88c 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/DevInfoMapper.xml @@ -2,7 +2,9 @@ + + @@ -28,6 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -42,7 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ma_id, code, type_id, ma_status, lease_scope, location, province_id, city_id, area_id, brand, model_name, production_date, working_hours, serial_number, month_lease_price, day_lease_price, pic_url, js_month_price, js_day_price, description, gps_code, own_co, create_time, - creator, update_time, update_by, specification, deposit, is_operator, is_active, update_time, update_by from ma_dev_info + creator, update_time, person, person_phone, update_by, specification, deposit, is_operator, is_active, update_time, update_by + from ma_dev_info @@ -227,16 +232,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d.is_active='1' and d.ma_id = #{maId} - + SELECT s.dic_id, s.file_name,s.file_url from ma_dev_info d left join sys_file_info s on d.ma_id = s.model_id - WHERE d.ma_id = #{maId} and d.is_active='1' and s.dic_id in (20,28,29) + WHERE d.ma_id = #{maId} and d.is_active='1' and s.dic_id in (0,1,2,3) @@ -245,6 +249,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into ma_dev_info ma_id, + device_name, + device_weight, + unit_name, code, type_id, ma_status, @@ -263,12 +270,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pic_url, js_month_price, js_day_price, - description, + `description`, gps_code, own_co, create_time, + person, + person_phone, + create_time, creator, - update_time, + update_time, update_by, specification, deposit, @@ -279,6 +289,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{maId}, + #{deviceName}, + #{deviceWeight}, + #{unitName}, #{code}, #{typeId}, #{maStatus}, @@ -300,9 +313,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{description}, #{gpsCode}, #{ownCo}, + #{person}, + #{personPhone}, now(), #{creator}, - #{update_time}, + now(), #{update_by}, #{specification}, #{deposit}, @@ -331,6 +346,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update ma_dev_info code = #{code}, + device_name = #{deviceName}, + device_weight = #{deviceWeight}, + unit_name = #{unitName}, type_id = #{typeId}, ma_status = #{maStatus}, lease_scope = #{leaseScope}, @@ -348,9 +366,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pic_url = #{picUrl}, js_month_price = #{jsMonthPrice}, js_day_price = #{jsDayPrice}, - description = #{description}, + `description` = #{description}, gps_code = #{gpsCode}, own_co = #{ownCo}, + person = #{person}, + person_phone = #{personPhone}, create_time = #{createTime}, creator = #{creator}, update_by = #{updateBy}, @@ -377,7 +397,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -399,33 +419,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/SysFileInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/SysFileInfoMapper.xml new file mode 100644 index 0000000..15f7ec6 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/SysFileInfoMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + insert into sys_file_info ( + model_id, + file_name, + file_url, + dic_id, + creator, + create_time + )values( + #{modelId}, + #{fileName}, + #{fileUrl}, + #{dicId}, + #{creator}, + sysdate() + ) + + + \ No newline at end of file