Parcourir la source

合同材料所需全部实体类和修改删除校验

qianxb il y a 10 mois
Parent
commit
7a10a464dc
19 fichiers modifiés avec 618 ajouts et 6 suppressions
  1. 85 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialAdjust.java
  2. 61 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialPrice.java
  3. 65 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialValidity.java
  4. 4 1
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/ContractMaterialVO2.java
  5. 2 1
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/ContractMaterialController.java
  6. 35 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialAdjustMapper.java
  7. 7 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialAdjustMapper.xml
  8. 35 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialPriceMapper.java
  9. 7 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialPriceMapper.xml
  10. 35 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialValidityMapper.java
  11. 8 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialValidityMapper.xml
  12. 34 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialAdjustService.java
  13. 34 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialPriceService.java
  14. 2 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialService.java
  15. 34 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialValidityService.java
  16. 40 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialAdjustServiceImpl.java
  17. 41 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialPriceServiceImpl.java
  18. 49 4
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialServiceImpl.java
  19. 40 0
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialValidityServiceImpl.java

+ 85 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialAdjust.java

@@ -0,0 +1,85 @@
+/*
+ *      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.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * 合同材料表实体类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Data
+@TableName("s_contract_material_adjust")
+@EqualsAndHashCode(callSuper = true)
+public class ContractMaterialAdjust extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 项目id
+     */
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+    /**
+     * 合同段id
+     */
+    @ApiModelProperty(value = "合同段id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "合同材料id")
+    private Long contractMaterialId;
+
+    @ApiModelProperty(value = "合同计量期id(调差期)")
+    private Long contractPeriodId;
+
+    @ApiModelProperty(value = "调差月份")
+    private LocalDate adjustMonth;
+
+    @ApiModelProperty(value = "材料名称")
+    private String materialName;
+
+    @ApiModelProperty(value = "材料基准价格")
+    private BigDecimal materialPrice;
+
+    @ApiModelProperty(value = "实时价格id")
+    private Long currentPriceId;
+
+    @ApiModelProperty(value = "实时价格")
+    private BigDecimal currentPrice;
+
+    @ApiModelProperty(value = "价差幅度,百分比")
+    private BigDecimal rangePriceRatio;
+
+    @ApiModelProperty(value = "材料数量")
+    private BigDecimal materialTotal;
+
+    @ApiModelProperty(value = "调差金额")
+    private BigDecimal adjustMoney;
+
+    @ApiModelProperty(value = "调差计算式")
+    private String adjustCalculation;
+
+}

+ 61 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialPrice.java

@@ -0,0 +1,61 @@
+/*
+ *      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.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * 合同材料表实体类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Data
+@TableName("s_contract_material_price")
+@EqualsAndHashCode(callSuper = true)
+public class ContractMaterialPrice extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 项目id
+     */
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+    /**
+     * 合同段id
+     */
+    @ApiModelProperty(value = "合同段id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "材料价格有效期id")
+    private Long materialValidityId;
+
+    @ApiModelProperty(value = "合同材料id")
+    private Long contractMaterialId;
+
+    @ApiModelProperty(value = "实时单价")
+    private BigDecimal currentPrice;
+
+}

+ 65 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/ContractMaterialValidity.java

@@ -0,0 +1,65 @@
+/*
+ *      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.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * 合同材料表实体类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Data
+@TableName("s_contract_material_validity")
+@EqualsAndHashCode(callSuper = true)
+public class ContractMaterialValidity extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 项目id
+     */
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+    /**
+     * 合同段id
+     */
+    @ApiModelProperty(value = "合同段id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "父id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "开始日期")
+    private LocalDate startDate;
+
+    @ApiModelProperty(value = "结束日期")
+    private LocalDate endDate;
+
+    @ApiModelProperty(value = "节点名称")
+    private String nodeName;
+
+
+}

+ 4 - 1
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/ContractMaterialVO2.java

@@ -24,7 +24,7 @@ import org.springblade.meter.entity.ContractMaterial;
 import java.math.BigDecimal;
 
 /**
- * 合同材料表视图实体类
+ * 合同材料分页
  *
  * @author BladeX
  * @since 2023-11-29
@@ -43,4 +43,7 @@ public class ContractMaterialVO2 extends ContractMaterial {
 	@ApiModelProperty(value = "是否可以同步,0否1是")
 	private Integer isSync;
 
+	@ApiModelProperty(value = "是否可以修改和删除,0否1是")
+	private Integer isUpdateOrDelete;
+
 }

+ 2 - 1
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/ContractMaterialController.java

@@ -113,7 +113,8 @@ public class ContractMaterialController extends BladeController {
 	@ApiOperationSupport(order = 9)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(contractMaterialService.deleteLogic(Func.toLongList(ids)));
+		contractMaterialService.delete(ids);
+		return R.success("删除成功");
 	}
 
 	/**

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

@@ -0,0 +1,35 @@
+/*
+ *      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.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialAdjust;
+
+import java.util.Set;
+
+/**
+ * 附件表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface ContractMaterialAdjustMapper extends BaseMapper<ContractMaterialAdjust> {
+
+
+}

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

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.meter.mapper.ContractMaterialAdjustMapper">
+
+
+
+</mapper>

+ 35 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialPriceMapper.java

@@ -0,0 +1,35 @@
+/*
+ *      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.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialPrice;
+
+import java.util.Set;
+
+/**
+ * 附件表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface ContractMaterialPriceMapper extends BaseMapper<ContractMaterialPrice> {
+
+
+}

+ 7 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialPriceMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.meter.mapper.ContractMaterialPriceMapper">
+
+
+
+</mapper>

+ 35 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialValidityMapper.java

@@ -0,0 +1,35 @@
+/*
+ *      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.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialValidity;
+
+import java.util.Set;
+
+/**
+ * 附件表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface ContractMaterialValidityMapper extends BaseMapper<ContractMaterialValidity> {
+
+
+}

+ 8 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/ContractMaterialValidityMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.meter.mapper.ContractMaterialValidityMapper">
+
+
+
+
+</mapper>

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

@@ -0,0 +1,34 @@
+/*
+ *      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.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialAdjust;
+
+import java.util.Set;
+
+/**
+ * 附件表 服务类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface IContractMaterialAdjustService extends BaseService<ContractMaterialAdjust> {
+
+
+}

+ 34 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialPriceService.java

@@ -0,0 +1,34 @@
+/*
+ *      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.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialPrice;
+
+import java.util.Set;
+
+/**
+ * 附件表 服务类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface IContractMaterialPriceService extends BaseService<ContractMaterialPrice> {
+
+
+}

+ 2 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialService.java

@@ -44,4 +44,6 @@ public interface IContractMaterialService extends BaseService<ContractMaterial>
     void  syncMaterial(Long id,Long selectId);
 
     List<SyncMaterialVO> getSyncData(ContractMaterial material);
+
+    void delete(String ids);
 }

+ 34 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/IContractMaterialValidityService.java

@@ -0,0 +1,34 @@
+/*
+ *      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.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialValidity;
+
+import java.util.Set;
+
+/**
+ * 附件表 服务类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+public interface IContractMaterialValidityService extends BaseService<ContractMaterialValidity> {
+
+
+}

+ 40 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialAdjustServiceImpl.java

@@ -0,0 +1,40 @@
+/*
+ *      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.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialAdjust;
+import org.springblade.meter.mapper.AttachmentFormMapper;
+import org.springblade.meter.mapper.ContractMaterialAdjustMapper;
+import org.springblade.meter.service.IAttachmentFormService;
+import org.springblade.meter.service.IContractMaterialAdjustService;
+import org.springframework.stereotype.Service;
+
+import java.util.Set;
+
+/**
+ * 附件表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Service
+public class ContractMaterialAdjustServiceImpl extends BaseServiceImpl<ContractMaterialAdjustMapper, ContractMaterialAdjust> implements IContractMaterialAdjustService {
+
+
+}

+ 41 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialPriceServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialPrice;
+import org.springblade.meter.mapper.AttachmentFormMapper;
+import org.springblade.meter.mapper.ContractMaterialPriceMapper;
+import org.springblade.meter.service.IAttachmentFormService;
+import org.springblade.meter.service.IContractMaterialPriceService;
+import org.springframework.stereotype.Service;
+
+import java.util.Set;
+
+/**
+ * 附件表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Service
+public class ContractMaterialPriceServiceImpl extends BaseServiceImpl<ContractMaterialPriceMapper, ContractMaterialPrice> implements IContractMaterialPriceService {
+
+
+
+}

+ 49 - 4
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialServiceImpl.java

@@ -19,12 +19,18 @@ 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.apache.commons.lang.StringUtils;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.meter.entity.ContractInventoryForm;
 import org.springblade.meter.entity.ContractMaterial;
+import org.springblade.meter.entity.ContractMaterialAdjust;
+import org.springblade.meter.entity.ContractMaterialPrice;
 import org.springblade.meter.mapper.ContractMaterialMapper;
+import org.springblade.meter.service.IContractMaterialAdjustService;
+import org.springblade.meter.service.IContractMaterialPriceService;
 import org.springblade.meter.service.IContractMaterialService;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.meter.vo.ContractMaterialTreeVO;
@@ -32,6 +38,7 @@ import org.springblade.meter.vo.ContractMaterialVO;
 import org.springblade.meter.vo.ContractMaterialVO2;
 import org.springblade.meter.vo.SyncMaterialVO;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -45,8 +52,14 @@ import java.util.function.Consumer;
  * @since 2023-11-29
  */
 @Service
+@AllArgsConstructor
 public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMaterialMapper, ContractMaterial> implements IContractMaterialService {
 
+    private final IContractMaterialAdjustService adjustService;
+
+    private final IContractMaterialPriceService priceService;
+
+
 
     /**
      * 材料树 合同材料表
@@ -90,6 +103,13 @@ public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMateria
         wrapper2.eq(ContractMaterial::getContractId,contractMaterial.getContractId());
         wrapper2.eq(ContractMaterial::getMaterialName,contractMaterial.getMaterialName());
         if (contractMaterial.getId() != null){
+            //如果存在id,还要校验是否已经被调差
+            List<ContractMaterialAdjust> list = adjustService.list(new LambdaQueryWrapper<ContractMaterialAdjust>()
+                    .eq(ContractMaterialAdjust::getContractId, contractMaterial.getContractId())
+                    .eq(ContractMaterialAdjust::getContractMaterialId, contractMaterial.getId()));
+            if (list.size() > 0){
+                throw new ServiceException("当前材料已经被调差,不能被修改");
+            }
             wrapper1.ne(ContractMaterial::getId,contractMaterial.getId());
             wrapper2.ne(ContractMaterial::getId,contractMaterial.getId());
         }
@@ -109,10 +129,13 @@ public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMateria
         IPage<ContractMaterialVO2> iPage = new Page<>(query.getCurrent(),query.getSize());
         iPage = baseMapper.page2(iPage,material);
         iPage.getRecords().stream().forEach(l->{
-            if (l.getAdjustTotal() == 0 && l.getOtherTotal() > 0){
-                l.setIsSync(1);
-            }else {
-                l.setIsSync(0);
+            l.setIsSync(0);
+            l.setIsUpdateOrDelete(0);
+            if (l.getAdjustTotal() == 0){
+                l.setIsUpdateOrDelete(1);
+                if (l.getOtherTotal() > 0){
+                    l.setIsSync(1);
+                }
             }
         });
         return iPage;
@@ -143,4 +166,26 @@ public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMateria
     public List<SyncMaterialVO> getSyncData(ContractMaterial material) {
         return baseMapper.getSyncData(material);
     }
+
+    @Override
+    @Transactional
+    public void delete(String ids) {
+        if (StringUtils.isBlank(ids)){
+            throw new ServiceException("请先选择要删除的数据");
+        }
+        List<Long> list = Func.toLongList(ids);
+        //如果存在id,还要校验是否已经被调差
+        List<ContractMaterialAdjust> adjusts = adjustService.list(new LambdaQueryWrapper<ContractMaterialAdjust>()
+                .in(ContractMaterialAdjust::getContractMaterialId, list));
+        if (adjusts.size() > 0){
+            throw new ServiceException("材料已经被调差,不能被修改");
+        }
+        //删除实时价格
+        priceService.remove(new LambdaQueryWrapper<ContractMaterialPrice>()
+                .in(ContractMaterialPrice::getContractMaterialId,list));
+        //删除调差系数
+
+        //删除材料信息
+        this.removeBatchByIds(list);
+    }
 }

+ 40 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialValidityServiceImpl.java

@@ -0,0 +1,40 @@
+/*
+ *      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.service.impl;
+
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.meter.entity.AttachmentForm;
+import org.springblade.meter.entity.ContractMaterialValidity;
+import org.springblade.meter.mapper.AttachmentFormMapper;
+import org.springblade.meter.mapper.ContractMaterialValidityMapper;
+import org.springblade.meter.service.IAttachmentFormService;
+import org.springblade.meter.service.IContractMaterialValidityService;
+import org.springframework.stereotype.Service;
+
+import java.util.Set;
+
+/**
+ * 附件表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-11-29
+ */
+@Service
+public class ContractMaterialValidityServiceImpl extends BaseServiceImpl<ContractMaterialValidityMapper, ContractMaterialValidity> implements IContractMaterialValidityService {
+
+
+}