From 252136cfeb8e2a16da1b8fd2f2bf040256fe7d67 Mon Sep 17 00:00:00 2001 From: lizhenhua <1075222162@qq.com> Date: Sat, 12 Jul 2025 14:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E7=AE=A1=E7=90=86=20youhua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/mapper/BmFileInfoMapper.java | 3 + .../bonus/material/owner/domain/FileInfo.java | 13 +++++ .../material/owner/domain/Ownerdomin.java | 6 ++ .../material/owner/mapper/OwnerMapper.java | 2 + .../owner/service/impl/OwnerServiceImpl.java | 25 ++++++++- .../material/device/BmFileInfoMapper.xml | 36 ++++++++---- .../mapper/material/owner/OwnerMapper.xml | 56 ++++++++++++++----- 7 files changed, 113 insertions(+), 28 deletions(-) create mode 100644 bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/FileInfo.java diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java index c905c02..3a7ecc7 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/mapper/BmFileInfoMapper.java @@ -3,6 +3,7 @@ package com.bonus.material.device.mapper; import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.common.biz.domain.TypeInfo; import com.bonus.material.device.domain.MaDevQc; +import com.bonus.material.owner.domain.Ownerdomin; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -86,4 +87,6 @@ public interface BmFileInfoMapper { Integer deleteBmFileInfoByFileId(@Param("fileId") Integer fileId, @Param("fileType") Integer fileType); List getInfoByMaIdAndTaskId(MaDevQc qc); + + int insertRentInfo(Ownerdomin ownerdomin); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/FileInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/FileInfo.java new file mode 100644 index 0000000..634cde5 --- /dev/null +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/FileInfo.java @@ -0,0 +1,13 @@ +package com.bonus.material.owner.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class FileInfo { + @ApiModelProperty(value = "文件名称") + private String fileName; + + @ApiModelProperty(value = "文件 URL") + private String fileUrl; +} diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/Ownerdomin.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/Ownerdomin.java index 5a69029..efd5f77 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/Ownerdomin.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/domain/Ownerdomin.java @@ -2,11 +2,13 @@ package com.bonus.material.owner.domain; import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.common.core.annotation.Excel; +import com.bonus.material.device.domain.vo.DevInfoPropertyVo; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -58,5 +60,9 @@ public class Ownerdomin { private BigDecimal orderCount; + @ApiModelProperty(value = "文件列表") + private List mainFileList = new ArrayList<>(); + + } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/mapper/OwnerMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/mapper/OwnerMapper.java index ef54380..2f72fd9 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/mapper/OwnerMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/mapper/OwnerMapper.java @@ -18,4 +18,6 @@ public interface OwnerMapper { Integer del(Ownerdomin ownerdomin); List listGrouped(); + + void deleteFileInfo(Integer id); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/service/impl/OwnerServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/service/impl/OwnerServiceImpl.java index 38a5f09..f87dbe7 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/service/impl/OwnerServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/owner/service/impl/OwnerServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.material.owner.service.impl; +import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.utils.bean.BeanUtils; @@ -7,6 +8,8 @@ import com.bonus.common.core.utils.bean.BeanValidators; import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.device.domain.DevInfo; import com.bonus.material.device.domain.dto.DevInfoImpDto; +import com.bonus.material.device.mapper.BmFileInfoMapper; +import com.bonus.material.owner.domain.FileInfo; import com.bonus.material.owner.domain.Ownerdomin; import com.bonus.material.owner.mapper.OwnerMapper; import com.bonus.material.owner.service.OwnerService; @@ -26,6 +29,9 @@ public class OwnerServiceImpl implements OwnerService { @Resource private OwnerMapper ownerMapper; + @Resource + private BmFileInfoMapper bmFileInfoMapper; + @Resource protected Validator validator; @@ -41,12 +47,27 @@ public class OwnerServiceImpl implements OwnerService { public Integer add(Ownerdomin ownerdomin) { ownerdomin.setCreator(SecurityUtils.getLoginUser().getSysUser().getUserId()+""); ownerdomin.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); - return ownerMapper.add(ownerdomin); + Integer add = ownerMapper.add(ownerdomin); + //判断是否存在图片等 + if (ownerdomin.getMainFileList() != null && ownerdomin.getMainFileList().size() > 0) { + bmFileInfoMapper.insertRentInfo(ownerdomin); + } + return add; } @Override public Integer edit(Ownerdomin ownerdomin) { - return ownerMapper.edit(ownerdomin); + Integer edit = ownerMapper.edit(ownerdomin); + //删除对应保存到表里面的信息 + ownerMapper.deleteFileInfo(ownerdomin.getId()); + if (ownerdomin.getMainFileList() != null && ownerdomin.getMainFileList().size() > 0) { + BmFileInfo bmFileInfo = new BmFileInfo(); + bmFileInfo.setTaskId(Long.valueOf(ownerdomin.getId())); + bmFileInfo.setFileName(bmFileInfo.getFileName()); + bmFileInfo.setFileUrl(bmFileInfo.getFileUrl()); + bmFileInfoMapper.insertRentInfo(ownerdomin); + } + return edit; } @Override diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/BmFileInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/BmFileInfoMapper.xml index ab466c5..20d12b5 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/BmFileInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/BmFileInfoMapper.xml @@ -1,7 +1,7 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> @@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and file_type = #{fileType} - + @@ -67,11 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, task_type, task_id, model_id, name fileName, url fileUrl, file_type, create_by, create_time from bm_file_info - WHERE + WHERE model_id = #{maId} - and task_id = #{id} - and task_type = 17 - and file_type = 4 + and task_id = #{id} + and task_type = 17 + and file_type = 4 @@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" file_type, create_by, create_time - + #{taskType}, #{taskId}, @@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{fileType}, #{createBy}, now() - + @@ -114,6 +114,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + + INSERT INTO bm_rent_info(task_id,name,url,create_time) + VALUES + + ( + #{id}, + #{item.fileName}, + #{item.fileUrl}, + now() + ) + + update bm_file_info @@ -135,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from bm_file_info where id in + delete from bm_file_info where id in #{id} @@ -165,4 +177,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from bm_file_info where id = #{fileId} and task_type = 17 and file_type = #{fileType} - \ No newline at end of file + diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/owner/OwnerMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/owner/OwnerMapper.xml index 6ce3417..68f5bcb 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/owner/OwnerMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/owner/OwnerMapper.xml @@ -3,7 +3,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + + + + + + + + + + + + + insert into ma_own_manage( ma_type, ma_name, model_id, ma_model, ma_num, creator, remark,company_id,type) @@ -25,23 +41,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_active =1 where id = #{id} - - + SELECT + id, + name AS fileName, + url AS fileUrl + FROM + bm_rent_info + WHERE + task_id = #{id} + +