|
@@ -24,15 +24,11 @@ import org.apache.commons.lang.StringUtils;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
|
+import org.springblade.meter.dto.MaterialLinkFormDTO;
|
|
import org.springblade.meter.dto.MaterialListDTO;
|
|
import org.springblade.meter.dto.MaterialListDTO;
|
|
-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.entity.*;
|
|
import org.springblade.meter.mapper.ContractMaterialMapper;
|
|
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.meter.service.*;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.meter.vo.*;
|
|
import org.springblade.meter.vo.*;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -57,6 +53,10 @@ public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMateria
|
|
|
|
|
|
private final IContractMaterialPriceService priceService;
|
|
private final IContractMaterialPriceService priceService;
|
|
|
|
|
|
|
|
+ private final IContractInventoryFormService formService;
|
|
|
|
+
|
|
|
|
+ private final IInventoryFormMaterialService formMaterialService;
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -198,4 +198,47 @@ public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMateria
|
|
List<ContractMaterialVO4> vo3List = baseMapper.getALLMaterial3(dto);
|
|
List<ContractMaterialVO4> vo3List = baseMapper.getALLMaterial3(dto);
|
|
return vo3List;
|
|
return vo3List;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<FormTreeVO2> getAdjustFormTree(Long contractId, Long materialId) {
|
|
|
|
+ return formService.getAdjustFormTree(contractId,materialId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional
|
|
|
|
+ public void materialLinkForm(MaterialLinkFormDTO dto) {
|
|
|
|
+ //校验材料是否存在
|
|
|
|
+ ContractMaterial m = this.getById(dto.getMaterialId());
|
|
|
|
+ if (m == null){
|
|
|
|
+ throw new ServiceException("获取材料信息错误");
|
|
|
|
+ }
|
|
|
|
+ //先删除当前材料绑定的节点
|
|
|
|
+ formMaterialService.remove(new LambdaQueryWrapper<InventoryFormMaterial>()
|
|
|
|
+ .eq(InventoryFormMaterial::getContractId,dto.getContractId())
|
|
|
|
+ .eq(InventoryFormMaterial::getContractMaterialId,dto.getMaterialId()));
|
|
|
|
+ //再保存当前选择的节点
|
|
|
|
+ List<InventoryFormMaterial> addList = new ArrayList<>();
|
|
|
|
+ List<MaterialLinkFormDTO.form> forms = dto.getForms();
|
|
|
|
+ for (MaterialLinkFormDTO.form form : forms) {
|
|
|
|
+ InventoryFormMaterial material = new InventoryFormMaterial();
|
|
|
|
+ material.setProjectId(dto.getProjectId());
|
|
|
|
+ material.setContractId(dto.getContractId());
|
|
|
|
+ material.setContractMaterialId(dto.getMaterialId());
|
|
|
|
+ material.setContractFormId(form.getId());
|
|
|
|
+ material.setAdjustFactor(form.getAdjustFactor());
|
|
|
|
+ addList.add(material);
|
|
|
|
+ }
|
|
|
|
+ formMaterialService.saveBatch(addList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<GetLinkAllFormVO> getLinkAllForm(Long contractId, Long materialId) {
|
|
|
|
+ List<GetLinkAllFormVO> vos = baseMapper.getLinkAllForm(contractId,materialId);
|
|
|
|
+ return vos;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void removeLinkForm(Long id) {
|
|
|
|
+ formMaterialService.removeById(id);
|
|
|
|
+ }
|
|
}
|
|
}
|