|
@@ -40,6 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
+import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -125,6 +126,13 @@ public class ChangeTokenFormServiceImpl extends BaseServiceImpl<ChangeTokenFormM
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public void add(ChangeTokenFormDTO dto) {
|
|
public void add(ChangeTokenFormDTO dto) {
|
|
|
|
+ //校验编号是否存在
|
|
|
|
+ ChangeTokenForm one = this.getOne(new LambdaQueryWrapper<ChangeTokenForm>()
|
|
|
|
+ .eq(ChangeTokenForm::getContractId,dto.getContractId())
|
|
|
|
+ .eq(ChangeTokenForm::getChangeNumber, dto.getChangeNumber()));
|
|
|
|
+ if (one != null){
|
|
|
|
+ throw new ServiceException("当前编号已经存在,请更改后保存");
|
|
|
|
+ }
|
|
//复制出基础数据
|
|
//复制出基础数据
|
|
Long id = SnowFlakeUtil.getId();
|
|
Long id = SnowFlakeUtil.getId();
|
|
dto.setId(id);
|
|
dto.setId(id);
|
|
@@ -315,6 +323,13 @@ public class ChangeTokenFormServiceImpl extends BaseServiceImpl<ChangeTokenFormM
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public void update2(ChangeTokenFormDTO dto) {
|
|
public void update2(ChangeTokenFormDTO dto) {
|
|
|
|
+ //校验编号是否存在,未排除当前
|
|
|
|
+// ChangeTokenForm one = this.getOne(new LambdaQueryWrapper<ChangeTokenForm>()
|
|
|
|
+// .eq(ChangeTokenForm::getContractId,dto.getContractId())
|
|
|
|
+// .eq(ChangeTokenForm::getChangeNumber, dto.getChangeNumber()));
|
|
|
|
+// if (one != null){
|
|
|
|
+// throw new ServiceException("当前编号已经存在,请更改后保存");
|
|
|
|
+// }
|
|
//获取当前变更令,判断上报状态
|
|
//获取当前变更令,判断上报状态
|
|
ChangeTokenForm tokenForm = this.getById(dto.getId());
|
|
ChangeTokenForm tokenForm = this.getById(dto.getId());
|
|
if (tokenForm.getApproveStatus() != 0){
|
|
if (tokenForm.getApproveStatus() != 0){
|
|
@@ -548,7 +563,7 @@ public class ChangeTokenFormServiceImpl extends BaseServiceImpl<ChangeTokenFormM
|
|
inventory.setContractId(form2.getContractId());
|
|
inventory.setContractId(form2.getContractId());
|
|
inventory.setChangeTokenId(vo2.getChangeTokenId());
|
|
inventory.setChangeTokenId(vo2.getChangeTokenId());
|
|
inventory.setContractFormId(vo2.getId());
|
|
inventory.setContractFormId(vo2.getId());
|
|
- inventory.setContractMeterId(vo2.getContractMeterId());
|
|
|
|
|
|
+// inventory.setContractMeterId(vo2.getContractMeterId());
|
|
//设置汇总清单的数量
|
|
//设置汇总清单的数量
|
|
inventory.setChangeBeforeTotal(form2.getChangeTotal());
|
|
inventory.setChangeBeforeTotal(form2.getChangeTotal());
|
|
inventory.setChangeTotal(total);
|
|
inventory.setChangeTotal(total);
|
|
@@ -647,7 +662,7 @@ public class ChangeTokenFormServiceImpl extends BaseServiceImpl<ChangeTokenFormM
|
|
this.update(new LambdaUpdateWrapper<ChangeTokenForm>()
|
|
this.update(new LambdaUpdateWrapper<ChangeTokenForm>()
|
|
.eq(ChangeTokenForm::getId,id)
|
|
.eq(ChangeTokenForm::getId,id)
|
|
.set(ChangeTokenForm::getCommandStatus,1)
|
|
.set(ChangeTokenForm::getCommandStatus,1)
|
|
- .set(ChangeTokenForm::getCommandDate, LocalDate.now()));
|
|
|
|
|
|
+ .set(ChangeTokenForm::getCommandDate, LocalDateTime.now()));
|
|
//异步重新计算节点金额,和修改施工图号,此方法放到最后,待所有操作成功后再执行
|
|
//异步重新计算节点金额,和修改施工图号,此方法放到最后,待所有操作成功后再执行
|
|
meterTreeContractService.asyncCalculateNodeMoney(allNode);
|
|
meterTreeContractService.asyncCalculateNodeMoney(allNode);
|
|
}
|
|
}
|