|
@@ -26,11 +26,9 @@ import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.manager.entity.WbsTree;
|
|
import org.springblade.manager.entity.WbsTree;
|
|
-import org.springblade.meter.entity.ContractInventoryForm;
|
|
|
|
-import org.springblade.meter.entity.InventoryFormApply;
|
|
|
|
-import org.springblade.meter.entity.InventoryFormMeter;
|
|
|
|
-import org.springblade.meter.entity.MeterTreeContract;
|
|
|
|
|
|
+import org.springblade.meter.entity.*;
|
|
import org.springblade.meter.mapper.InventoryFormMeterMapper;
|
|
import org.springblade.meter.mapper.InventoryFormMeterMapper;
|
|
|
|
+import org.springblade.meter.service.IChangeTokenInventoryService;
|
|
import org.springblade.meter.service.IInventoryFormApplyService;
|
|
import org.springblade.meter.service.IInventoryFormApplyService;
|
|
import org.springblade.meter.service.IInventoryFormMeterService;
|
|
import org.springblade.meter.service.IInventoryFormMeterService;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
@@ -55,6 +53,8 @@ public class InventoryFormMeterServiceImpl extends BaseServiceImpl<InventoryForm
|
|
|
|
|
|
private final IInventoryFormApplyService inventoryFormApplyService;
|
|
private final IInventoryFormApplyService inventoryFormApplyService;
|
|
|
|
|
|
|
|
+ private final IChangeTokenInventoryService tokenInventoryService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<Long> getNodeAllForm(Long nodeId) {
|
|
public List<Long> getNodeAllForm(Long nodeId) {
|
|
return baseMapper.getNodeAllForm(nodeId);
|
|
return baseMapper.getNodeAllForm(nodeId);
|
|
@@ -95,6 +95,10 @@ public class InventoryFormMeterServiceImpl extends BaseServiceImpl<InventoryForm
|
|
if (vo.getBuildPictureTotal() == null){
|
|
if (vo.getBuildPictureTotal() == null){
|
|
throw new ServiceException("请填写施工图数量");
|
|
throw new ServiceException("请填写施工图数量");
|
|
}
|
|
}
|
|
|
|
+ //校验当前节点下当前清单,是否在变更令中变更,或计量中计量
|
|
|
|
+ if (vo.getCiteStatus() == 0 && formIsChange(meterId,vo.getContractFormId())){
|
|
|
|
+ throw new ServiceException("清单["+vo.getFormName()+"]已经变更或计量,请刷新页面");
|
|
|
|
+ }
|
|
//统计
|
|
//统计
|
|
vo.setBuildPictureMoney(vo.getCurrentPrice().multiply(vo.getBuildPictureTotal()));
|
|
vo.setBuildPictureMoney(vo.getCurrentPrice().multiply(vo.getBuildPictureTotal()));
|
|
vo.setChangeBuildPictureMoney(vo.getCurrentPrice().multiply(vo.getChangeBuildPictureTotal()));
|
|
vo.setChangeBuildPictureMoney(vo.getCurrentPrice().multiply(vo.getChangeBuildPictureTotal()));
|
|
@@ -132,6 +136,7 @@ public class InventoryFormMeterServiceImpl extends BaseServiceImpl<InventoryForm
|
|
//判断当前清单是否被计量
|
|
//判断当前清单是否被计量
|
|
List<InventoryFormApply> list = inventoryFormApplyService.list(new LambdaQueryWrapper<InventoryFormApply>()
|
|
List<InventoryFormApply> list = inventoryFormApplyService.list(new LambdaQueryWrapper<InventoryFormApply>()
|
|
.eq(InventoryFormApply::getContractId, meter.getContractId())
|
|
.eq(InventoryFormApply::getContractId, meter.getContractId())
|
|
|
|
+ .eq(InventoryFormApply::getContractMeterId,Long.parseLong(meterId))
|
|
.eq(InventoryFormApply::getContractFormId, meter.getContractFormId()));
|
|
.eq(InventoryFormApply::getContractFormId, meter.getContractFormId()));
|
|
if (list.size() > 0){
|
|
if (list.size() > 0){
|
|
throw new ServiceException("当前清单已经计量,不能删除");
|
|
throw new ServiceException("当前清单已经计量,不能删除");
|
|
@@ -140,4 +145,23 @@ public class InventoryFormMeterServiceImpl extends BaseServiceImpl<InventoryForm
|
|
this.removeById(formIds);
|
|
this.removeById(formIds);
|
|
return R.success("成功");
|
|
return R.success("成功");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断当前节点下当前清单是否已经分解或变更过,变更过返回true
|
|
|
|
+ */
|
|
|
|
+ private Boolean formIsChange(Long meterId,Long formId) {
|
|
|
|
+ long count = inventoryFormApplyService.count(new LambdaQueryWrapper<InventoryFormApply>()
|
|
|
|
+ .eq(InventoryFormApply::getContractFormId, formId)
|
|
|
|
+ .eq(InventoryFormApply::getContractMeterId, meterId));
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ long count1 = tokenInventoryService.count(new LambdaQueryWrapper<ChangeTokenInventory>()
|
|
|
|
+ .eq(ChangeTokenInventory::getContractFormId, formId)
|
|
|
|
+ .eq(ChangeTokenInventory::getContractMeterId, meterId));
|
|
|
|
+ if (count1 > 0) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|