Browse Source

材料调差所有接口

qianxb 7 months ago
parent
commit
3d9be28cf5
13 changed files with 323 additions and 21 deletions
  1. 60 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/dto/ContractMaterialDTO2.java
  2. 3 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/AttachmentForm.java
  3. 8 1
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialAdjust.java
  4. 2 6
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialAdjustDetail.java
  5. 19 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/ContractMaterialAdjustVO.java
  6. 26 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MaterialAdjustDetailVO.java
  7. 43 3
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/ContractMaterialAdjustController.java
  8. 11 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialAdjustMapper.java
  9. 24 1
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialAdjustMapper.xml
  10. 14 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialAdjustService.java
  11. 1 1
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/IInventoryFormMaterialService.java
  12. 111 8
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialAdjustServiceImpl.java
  13. 1 1
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/InventoryFormMaterialServiceImpl.java

+ 60 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/dto/ContractMaterialDTO2.java

@@ -0,0 +1,60 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.meter.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.meter.entity.ContractMaterial;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.groups.Default;
+
+/**
+ * 合同材料表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Data
+public class ContractMaterialDTO2 {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty(value = "合同段id")
+	@NotNull(message = "请传入合同段id!")
+	private Long contractId;
+
+	@ApiModelProperty(value = "合同材料id")
+	@NotNull(message = "请传入合同材料id!")
+	private Long contractMaterialId;
+
+	@ApiModelProperty(value = "合同计量期id(调差期)")
+	@NotNull(message = "请传入调差期id!")
+	private Long contractPeriodId;
+
+	@ApiModelProperty(value = "调差时间")
+	private String adjustMonth;
+
+	@ApiModelProperty("当前页")
+	private Integer current;
+
+	@ApiModelProperty("每页的数量")
+	private Integer size;
+
+
+}

+ 3 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/AttachmentForm.java

@@ -19,6 +19,7 @@ package org.springblade.meter.entity;
 import com.baomidou.mybatisplus.annotation.TableName;
 
 import java.io.Serializable;
+import java.time.LocalDateTime;
 
 import io.swagger.annotations.ApiModelProperty;
 import org.springblade.core.mp.base.BaseEntity;
@@ -86,5 +87,7 @@ public class AttachmentForm extends BaseEntity {
     @ApiModelProperty(value = "文件大小名称")
     private String fileSizeName;
 
+    @ApiModelProperty(value = "文件上传时间")
+    private LocalDateTime fileUpTime;
 
 }

+ 8 - 1
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialAdjust.java

@@ -58,10 +58,14 @@ public class ContractMaterialAdjust extends BaseEntity {
     @NotNull(message = "请传入合同材料id!")
     private Long contractMaterialId;
 
-    @ApiModelProperty(value = "合同计量期id(调差期)")
+    @ApiModelProperty(value = "调差期id(合同计量期id)")
     @NotNull(message = "请传入调差期id!")
     private Long contractPeriodId;
 
+    @ApiModelProperty(value = "调差期期号(合同计量期期号)")
+    @NotNull(message = "请传入调差期期号!")
+    private String contractPeriodNumber;
+
     @ApiModelProperty(value = "调差月份")
     @NotNull(message = "请填写调差月份!")
     private String adjustMonth;
@@ -100,4 +104,7 @@ public class ContractMaterialAdjust extends BaseEntity {
     @ApiModelProperty(value = "调差计算式")
     private String adjustCalculation;
 
+    @ApiModelProperty(value = "审批状态:0未完成1已完成(此处根据计量期状态)")
+    private Integer approveStatus;
+
 }

+ 2 - 6
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialAdjustDetail.java

@@ -38,14 +38,10 @@ public class ContractMaterialAdjustDetail extends BaseEntity {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * 项目id
-     */
+
     @ApiModelProperty(value = "项目id")
     private Long projectId;
-    /**
-     * 合同段id
-     */
+
     @ApiModelProperty(value = "合同段id")
     private Long contractId;
 

+ 19 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/ContractMaterialAdjustVO.java

@@ -0,0 +1,19 @@
+package org.springblade.meter.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.meter.entity.ContractMaterialAdjust;
+
+/**
+ * @Param   分页VO
+ * @Author wangwl
+ * @Date 2024/4/25 9:36
+ **/
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ContractMaterialAdjustVO extends ContractMaterialAdjust {
+
+    @ApiModelProperty(value = "审批状态名称")
+    private String approveStatusName;
+}

+ 26 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MaterialAdjustDetailVO.java

@@ -0,0 +1,26 @@
+package org.springblade.meter.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialAdjust;
+import org.springblade.meter.entity.ContractMaterialAdjustDetail;
+
+import java.util.List;
+
+/**
+ * @Param   材料调差详情
+ * @Author wangwl
+ * @Date 2024/4/25 10:15
+ **/
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class MaterialAdjustDetailVO extends ContractMaterialAdjust {
+
+    @ApiModelProperty(value = "材料明细集合")
+    private List<ContractMaterialAdjustDetail> details;
+
+    @ApiModelProperty(value = "附件集合")
+    private List<AttachmentForm> files;
+}

+ 43 - 3
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/ContractMaterialAdjustController.java

@@ -28,13 +28,20 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.meter.dto.ContractMaterialAdjustAddDTO;
+import org.springblade.meter.dto.ContractMaterialDTO2;
 import org.springblade.meter.entity.AttachmentForm;
 import org.springblade.meter.entity.ContractMaterial;
+import org.springblade.meter.entity.ContractMaterialAdjustDetail;
 import org.springblade.meter.service.IAttachmentFormService;
 import org.springblade.meter.service.IContractMaterialAdjustService;
+import org.springblade.meter.vo.ContractMaterialAdjustVO;
+import org.springblade.meter.vo.MaterialAdjustDetailVO;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import javax.validation.groups.Default;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * 附件表 控制器
@@ -50,12 +57,45 @@ public class ContractMaterialAdjustController extends BladeController {
 
     private final IContractMaterialAdjustService adjustService;
 
-    @PostMapping("/add")
+    @PostMapping("/get-material-detail")
     @ApiOperationSupport(order = 1)
+    @ApiOperation(value = "新增时获取材料明细", notes = "传入调差期id,材料id")
+    public R<List<ContractMaterialAdjustDetail>> getMaterialDetail(@Valid @RequestBody ContractMaterialDTO2 dto) {
+        List<ContractMaterialAdjustDetail> list = adjustService.getMaterialDetail(dto);
+        return R.data(list);
+    }
+
+    @PostMapping("/add")
+    @ApiOperationSupport(order = 2)
     @ApiOperation(value = "新增", notes = "传入材料调差单")
-    public R submit(@Valid @RequestBody ContractMaterialAdjustAddDTO dto) {
+    public R add(@Valid @RequestBody ContractMaterialAdjustAddDTO dto) {
         adjustService.add(dto);
         return R.success("新增成功");
     }
-	
+
+    @PostMapping("/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "材料调差分页", notes = "传入合同id分页信息,搜索条件:调差期id,调差时间")
+    public R<IPage<ContractMaterialAdjustVO>> page(@RequestBody ContractMaterialDTO2 dto) {
+        IPage<ContractMaterialAdjustVO> list = adjustService.page2(dto);
+        return R.data(list);
+    }
+
+    @GetMapping("/detail")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "材料调差详情", notes = "传入材料调差表id")
+    public R<MaterialAdjustDetailVO> detail(Long id) {
+        MaterialAdjustDetailVO vo = adjustService.detail(id);
+        return R.data(vo);
+    }
+
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改", notes = "传入材料调差单")
+    public R update(@Valid @RequestBody ContractMaterialAdjustAddDTO dto) {
+        adjustService.update2(dto);
+        return R.success("修改成功");
+    }
+
+
 }

+ 11 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialAdjustMapper.java

@@ -17,10 +17,16 @@
 package org.springblade.meter.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
+import org.springblade.meter.dto.ContractMaterialDTO2;
 import org.springblade.meter.entity.AttachmentForm;
 import org.springblade.meter.entity.ContractMaterialAdjust;
+import org.springblade.meter.entity.ContractMaterialAdjustDetail;
+import org.springblade.meter.vo.ContractMaterialAdjustVO;
+import org.springblade.meter.vo.MaterialAdjustDetailVO;
 
+import java.util.List;
 import java.util.Set;
 
 /**
@@ -32,4 +38,9 @@ import java.util.Set;
 public interface ContractMaterialAdjustMapper extends BaseMapper<ContractMaterialAdjust> {
 
 
+    List<ContractMaterialAdjustDetail> getMaterialDetail(@Param("dto") ContractMaterialDTO2 dto,@Param("ids") List<Long> ids);
+
+    IPage<ContractMaterialAdjustVO> page2(IPage<ContractMaterialAdjustVO> iPage,@Param("dto") ContractMaterialDTO2 dto);
+
+    MaterialAdjustDetailVO detail(@Param("id") Long id);
 }

+ 24 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialAdjustMapper.xml

@@ -3,5 +3,28 @@
 <mapper namespace="org.springblade.meter.mapper.ContractMaterialAdjustMapper">
 
 
-
+    <select id="getMaterialDetail" resultType="org.springblade.meter.entity.ContractMaterialAdjustDetail">
+        select ifa.project_id,ifa.contract_id,ifa.middle_meter_id,ifa.contract_form_id,ifa.current_meter_total as meterTotal,
+                cif.form_number,cif.form_name,cif.unit,
+                (select meter_number from s_middle_meter_apply mma where mma.id = ifa.middle_meter_id) as meterNumber,
+                (select adjust_factor from s_inventory_form_material ifm where ifm.contract_material_id = #{dto.contractMaterialId}
+                                            and ifm.contract_form_id = ifa.contract_form_id) as adjustFactor
+        from s_inventory_form_apply ifa left join s_contract_inventory_form cif on ifa.contract_form_id = cif.id
+        where ifa.is_deleted = 0 and cif.is_deleted = 0 and ifa.contract_id = #{dto.contractId}
+          and ifa.contract_period_id = #{dto.contractPeriodId} and ifa.contract_form_id in
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+    <select id="page2" resultType="org.springblade.meter.vo.ContractMaterialAdjustVO">
+        select *,if(approve_status = 0,'未完成','已完成') as approveStatusName
+        from s_contract_material_adjust
+        where contract_id = #{dto.contractId} and is_deleted = 0 and contract_period_id = #{dto.contractPeriodId}
+        <if test="dto.adjustMonth != null and dto.adjustMonth != ''">
+            and adjust_month = #{dto.adjustMonth}
+        </if>
+    </select>
+    <select id="detail" resultType="org.springblade.meter.vo.MaterialAdjustDetailVO">
+        select * from s_contract_material_adjust where id = #{id}
+    </select>
 </mapper>

+ 14 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialAdjustService.java

@@ -16,11 +16,17 @@
  */
 package org.springblade.meter.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.meter.dto.ContractMaterialAdjustAddDTO;
+import org.springblade.meter.dto.ContractMaterialDTO2;
 import org.springblade.meter.entity.AttachmentForm;
 import org.springblade.meter.entity.ContractMaterialAdjust;
+import org.springblade.meter.entity.ContractMaterialAdjustDetail;
+import org.springblade.meter.vo.ContractMaterialAdjustVO;
+import org.springblade.meter.vo.MaterialAdjustDetailVO;
 
+import java.util.List;
 import java.util.Set;
 
 /**
@@ -33,4 +39,12 @@ public interface IContractMaterialAdjustService extends BaseService<ContractMate
 
 
     void add(ContractMaterialAdjustAddDTO dto);
+
+    List<ContractMaterialAdjustDetail> getMaterialDetail(ContractMaterialDTO2 dto);
+
+    IPage<ContractMaterialAdjustVO> page2(ContractMaterialDTO2 dto);
+
+    MaterialAdjustDetailVO detail(Long id);
+
+    void update2(ContractMaterialAdjustAddDTO dto);
 }

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/service/IInventoryFormMaterialService.java

@@ -23,7 +23,7 @@ import org.springblade.meter.entity.InventoryFormMaterial;
 import java.util.Set;
 
 /**
- * 附件表 服务类
+ *
  *
  * @author BladeX
  * @since 2023-11-29

+ 111 - 8
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialAdjustServiceImpl.java

@@ -16,20 +16,21 @@
  */
 package org.springblade.meter.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.AllArgsConstructor;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.meter.dto.ContractMaterialAdjustAddDTO;
-import org.springblade.meter.entity.AttachmentForm;
-import org.springblade.meter.entity.ContractMaterialAdjust;
-import org.springblade.meter.entity.ContractMaterialAdjustDetail;
-import org.springblade.meter.entity.ContractMaterialValidity;
+import org.springblade.meter.dto.ContractMaterialDTO2;
+import org.springblade.meter.entity.*;
 import org.springblade.meter.mapper.AttachmentFormMapper;
 import org.springblade.meter.mapper.ContractMaterialAdjustMapper;
-import org.springblade.meter.service.IAttachmentFormService;
-import org.springblade.meter.service.IContractMaterialAdjustDetailService;
-import org.springblade.meter.service.IContractMaterialAdjustService;
-import org.springblade.meter.service.IContractMaterialValidityService;
+import org.springblade.meter.service.*;
+import org.springblade.meter.vo.ContractMaterialAdjustVO;
+import org.springblade.meter.vo.MaterialAdjustDetailVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +40,7 @@ import java.math.RoundingMode;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * 附件表 服务实现类
@@ -56,6 +58,8 @@ public class ContractMaterialAdjustServiceImpl extends BaseServiceImpl<ContractM
 
     private final IAttachmentFormService attachmentFormService;
 
+    private final IInventoryFormMaterialService formMaterialService;
+
     @Override
     @Transactional
     public void add(ContractMaterialAdjustAddDTO dto) {
@@ -104,4 +108,103 @@ public class ContractMaterialAdjustServiceImpl extends BaseServiceImpl<ContractM
             attachmentFormService.saveBatch(files);
         }
     }
+
+    @Override
+    public List<ContractMaterialAdjustDetail> getMaterialDetail(ContractMaterialDTO2 dto) {
+        //1 获取所有材料关联的清单,如果没有则提示
+        List<InventoryFormMaterial> formMaterials = formMaterialService.list(new LambdaQueryWrapper<InventoryFormMaterial>()
+                .eq(InventoryFormMaterial::getContractMaterialId, dto.getContractMaterialId()));
+        if (formMaterials.size() == 0){
+            throw new ServiceException("当前材料并未关联清单");
+        }
+        List<Long> formIds = formMaterials.stream().map(l -> l.getContractFormId()).collect(Collectors.toList());
+        //2 获取当前计量期下,包含当前清单的所有计量单
+        List<ContractMaterialAdjustDetail> list = baseMapper.getMaterialDetail(dto,formIds);
+        for (ContractMaterialAdjustDetail detail : list) {
+            detail.setContractMaterialId(dto.getContractMaterialId());
+        }
+        return list;
+    }
+
+    @Override
+    public IPage<ContractMaterialAdjustVO> page2(ContractMaterialDTO2 dto) {
+        if (dto.getContractId() == null || dto.getContractPeriodId() == null){
+            throw new ServiceException("请传入合同id和调差期id");
+        }
+        IPage<ContractMaterialAdjustVO> iPage = new Page<>(dto.getCurrent(),dto.getSize());
+        return baseMapper.page2(iPage,dto);
+    }
+
+    @Override
+    public MaterialAdjustDetailVO detail(Long id) {
+        //获取材料调差单数据
+        MaterialAdjustDetailVO vo = baseMapper.detail(id);
+        //获取材料详情
+        List<ContractMaterialAdjustDetail> adjustDetailList = adjustDetailService.list(new LambdaQueryWrapper<ContractMaterialAdjustDetail>()
+                .eq(ContractMaterialAdjustDetail::getContractId, vo.getContractId())
+                .eq(ContractMaterialAdjustDetail::getMaterialAdjustId, id));
+        vo.setDetails(adjustDetailList);
+        //获取附件详情
+        List<AttachmentForm> files = attachmentFormService.list(new LambdaQueryWrapper<AttachmentForm>()
+                .eq(AttachmentForm::getContractId, vo.getContractId())
+                .eq(AttachmentForm::getMasterId, id));
+        vo.setFiles(files);
+        return vo;
+    }
+
+    @Override
+    @Transactional
+    public void update2(ContractMaterialAdjustAddDTO dto) {
+        //获取材料有效期
+        ContractMaterialValidity validity = validityService.getById(dto.getMaterialValidityId());
+        /*保存材料调差单*/
+        ContractMaterialAdjust adjust = new ContractMaterialAdjust();
+        BeanUtils.copyProperties(dto,adjust);
+        //计算调差金额,生成计算式
+        StringBuilder str = new StringBuilder("调差价格依据于:"+dto.getMaterialName()+
+                "("+validity.getStartDate().format(DateTimeFormatter.ofPattern("yyyyMMdd"))+"至"+
+                validity.getEndDate().format(DateTimeFormatter.ofPattern("yyyyMMdd"))+")\n");
+        BigDecimal adjustMoney;
+        BigDecimal price = dto.getMaterialPrice();
+        BigDecimal currentPrice = dto.getCurrentPrice();
+        if (price.compareTo(currentPrice) == 1){
+            //市场价低于基准价
+            adjustMoney = dto.getMaterialTotal().multiply(currentPrice.subtract((price.multiply(new BigDecimal(1).add(dto.getRangePriceRatio().abs().divide(new BigDecimal(100))))))).multiply(new BigDecimal(1.09)).setScale(2, RoundingMode.DOWN);
+            str.append("调差公式(标准):调增金额=调差数量×[市场价-基准价×(1-风险幅度差%)]×(1+合同增值税税率)\n");
+            str.append("调差公式(计算):"+adjustMoney+"="+dto.getMaterialTotal()+"*["+currentPrice+"-"+price+"*(1+"+dto.getRangePriceRatio().abs()+"%)]*(1+9.0/100)");
+        }else {
+            //市场价高于基准价
+            adjustMoney = dto.getMaterialTotal().multiply(currentPrice.subtract((price.multiply(new BigDecimal(1).add(dto.getRangePriceRatio().divide(new BigDecimal(100))))))).multiply(new BigDecimal(1.09)).setScale(2, RoundingMode.DOWN);
+            str.append("调差公式(标准):调增金额=调差数量×[市场价-基准价×(1+风险幅度差%)]×(1+合同增值税税率)\n");
+            str.append("调差公式(计算):"+adjustMoney+"="+dto.getMaterialTotal()+"*["+currentPrice+"-"+price+"*(1-"+dto.getRangePriceRatio()+"%)]*(1+9.0/100)");
+        }
+        adjust.setAdjustMoney(adjustMoney);
+        adjust.setAdjustCalculation(str.toString());
+        this.updateById(adjust);
+
+        /*保存材料明细*/
+        //先删除再清空id
+        adjustDetailService.remove(new LambdaQueryWrapper<ContractMaterialAdjustDetail>()
+                .eq(ContractMaterialAdjustDetail::getMaterialAdjustId,adjust.getId()));
+        List<ContractMaterialAdjustDetail> details = dto.getDetails();
+        if (details.size() != 0){
+            for (ContractMaterialAdjustDetail detail : details) {
+                detail.setId(null);
+                detail.setMaterialAdjustId(adjust.getId());
+            }
+            adjustDetailService.saveBatch(details);
+        }
+        /*保存附件信息*/
+        //先删除再清空id
+        attachmentFormService.remove(new LambdaQueryWrapper<AttachmentForm>()
+                .eq(AttachmentForm::getMasterId,adjust.getId()));
+        List<AttachmentForm> files = dto.getFiles();
+        if (files.size() != 0){
+            for (AttachmentForm file : files) {
+                file.setId(null);
+                file.setMasterId(adjust.getId());
+            }
+            attachmentFormService.saveBatch(files);
+        }
+    }
 }

+ 1 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/InventoryFormMaterialServiceImpl.java

@@ -28,7 +28,7 @@ import org.springframework.stereotype.Service;
 import java.util.Set;
 
 /**
- * 附件表 服务实现类
+ *
  *
  * @author BladeX
  * @since 2023-11-29