|
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import io.swagger.models.auth.In;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springblade.business.entity.InformationQuery;
|
|
import org.springblade.business.entity.InformationQuery;
|
|
@@ -356,14 +357,16 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
throw new ServiceException("修改失败,不能删除所有计量清单");
|
|
throw new ServiceException("修改失败,不能删除所有计量清单");
|
|
}
|
|
}
|
|
//删除附件
|
|
//删除附件
|
|
|
|
+ int total = baseMapper.getWbsLinkFileTotal(dto.getContractId(),dto.getId());
|
|
attachmentFormService.deleteByMasterId(dto.getId());
|
|
attachmentFormService.deleteByMasterId(dto.getId());
|
|
//先保存附件,因为要判断是否关联
|
|
//先保存附件,因为要判断是否关联
|
|
Integer isLinkData = 0;
|
|
Integer isLinkData = 0;
|
|
|
|
+ Integer linkTotal = 0;
|
|
List<AttachmentForm> fileList = dto.getFileList();
|
|
List<AttachmentForm> fileList = dto.getFileList();
|
|
if (fileList != null && fileList.size() != 0) {
|
|
if (fileList != null && fileList.size() != 0) {
|
|
for (AttachmentForm file : fileList) {
|
|
for (AttachmentForm file : fileList) {
|
|
- if (isLinkData == 0 && file.getSelectId() != null){
|
|
|
|
- isLinkData = 1;
|
|
|
|
|
|
+ if (file.getSelectId() != null){
|
|
|
|
+ linkTotal++;
|
|
}
|
|
}
|
|
file.setProjectId(dto.getProjectId());
|
|
file.setProjectId(dto.getProjectId());
|
|
file.setContractId(dto.getContractId());
|
|
file.setContractId(dto.getContractId());
|
|
@@ -371,10 +374,21 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
}
|
|
}
|
|
attachmentFormService.saveBatch(fileList);
|
|
attachmentFormService.saveBatch(fileList);
|
|
}
|
|
}
|
|
|
|
+ if (linkTotal > 0){
|
|
|
|
+ isLinkData = 1;
|
|
|
|
+ }
|
|
|
|
+ //获取计量单信息,判断是否为自动生成
|
|
|
|
+ MiddleMeterApply meterApply = this.getById(dto.getId());
|
|
|
|
+ //为自动生成,则获取附件的selectId逗号拼接,判断是否全部存在于当前附件
|
|
|
|
+ if (meterApply.getIsAutoBuild() == 1){
|
|
|
|
+ if (linkTotal != total){
|
|
|
|
+ throw new ServiceException("修改失败:不允许删除关联WBS节点的附件");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//校验当前计量期是否已经上报
|
|
//校验当前计量期是否已经上报
|
|
ContractMeterPeriod period = contractMeterPeriodService.getById(dto.getContractPeriodId());
|
|
ContractMeterPeriod period = contractMeterPeriodService.getById(dto.getContractPeriodId());
|
|
if (period.getApproveStatus() != 0){
|
|
if (period.getApproveStatus() != 0){
|
|
- throw new ServiceException("修改失败,当前计量期已经上报或审批");
|
|
|
|
|
|
+ throw new ServiceException("修改失败:当前计量期已经上报或审批");
|
|
}
|
|
}
|
|
//保存中间计量申请,设置计量金额为0,如果存在计量清单,则统计计量清单总金额
|
|
//保存中间计量申请,设置计量金额为0,如果存在计量清单,则统计计量清单总金额
|
|
MiddleMeterApply apply = new MiddleMeterApply();
|
|
MiddleMeterApply apply = new MiddleMeterApply();
|
|
@@ -1247,6 +1261,7 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
apply.setMeterMoney(total);
|
|
apply.setMeterMoney(total);
|
|
apply.setCalculateFormula(vo2.getCalculateFormula());
|
|
apply.setCalculateFormula(vo2.getCalculateFormula());
|
|
apply.setIsLinkData(1);
|
|
apply.setIsLinkData(1);
|
|
|
|
+ apply.setIsAutoBuild(1);
|
|
//添加到计量单集合
|
|
//添加到计量单集合
|
|
middleMeterApplyAdd.add(apply);
|
|
middleMeterApplyAdd.add(apply);
|
|
count++;
|
|
count++;
|