|
|
|
|
@ -22,6 +22,12 @@ import org.dromara.xzd.domain.dto.QuerCorrespondentDto;
|
|
|
|
|
import org.dromara.xzd.domain.vo.*;
|
|
|
|
|
import org.dromara.xzd.service.IXzdCorrespondentList;
|
|
|
|
|
import org.dromara.xzd.service.IXzdSolutionSelectionService;
|
|
|
|
|
import org.dromara.xzd.settlement.domain.XzdAlterationInventory;
|
|
|
|
|
import org.dromara.xzd.settlement.domain.XzdContractInventory;
|
|
|
|
|
import org.dromara.xzd.settlement.domain.XzdJsDeductionItems;
|
|
|
|
|
import org.dromara.xzd.settlement.service.impl.XzdAlterationInventoryServiceImpl;
|
|
|
|
|
import org.dromara.xzd.settlement.service.impl.XzdContractInventoryServiceImpl;
|
|
|
|
|
import org.dromara.xzd.settlement.service.impl.XzdJsDeductionItemsServiceImpl;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.dromara.xzd.domain.bo.XzdContractProgressSettlementBo;
|
|
|
|
|
@ -66,6 +72,12 @@ public class XzdContractProgressSettlementServiceImpl extends ServiceImpl<XzdCon
|
|
|
|
|
private XzdBusinessChangeServiceImpl xzdBusinessChangeService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private XzdSettlementRulesServiceImpl xzdSettlementRulesService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private XzdContractInventoryServiceImpl xzdContractInventoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private XzdAlterationInventoryServiceImpl xzdAlterationInventoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private XzdJsDeductionItemsServiceImpl xzdJsDeductionItemsService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询承包合同进度结算
|
|
|
|
|
@ -166,12 +178,61 @@ public class XzdContractProgressSettlementServiceImpl extends ServiceImpl<XzdCon
|
|
|
|
|
if (flag) {
|
|
|
|
|
bo.setId(add.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bo.getSealInfo() != null && !bo.getSealInfo().isEmpty()){
|
|
|
|
|
for (XzdBusinessChange xzdBusinessChange : bo.getSealInfo()) {
|
|
|
|
|
xzdBusinessChange.setContractChangeId(add.getId());
|
|
|
|
|
}
|
|
|
|
|
xzdBusinessChangeService.saveBatch(bo.getSealInfo());
|
|
|
|
|
}
|
|
|
|
|
xzdBusinessChangeService.saveBatch(bo.getSealInfo());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//合同内清单
|
|
|
|
|
if (bo.getHtnqd() != null && !bo.getHtnqd().isEmpty()){
|
|
|
|
|
for (XzdContractInventory inventory : bo.getHtnqd()) {
|
|
|
|
|
inventory.setType("合同内清单");
|
|
|
|
|
inventory.setCode(IdUtil.getSnowflakeNextIdStr());
|
|
|
|
|
inventory.setPrimaryMeterId(add.getId());
|
|
|
|
|
}
|
|
|
|
|
xzdContractInventoryService.saveBatch(bo.getHtnqd());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//变更增加清单
|
|
|
|
|
if (bo.getBgzjqd() != null && !bo.getBgzjqd().isEmpty()){
|
|
|
|
|
for (XzdAlterationInventory xzdAlterationInventory : bo.getBgzjqd()) {
|
|
|
|
|
xzdAlterationInventory.setPrimaryMeterId(add.getId());
|
|
|
|
|
}
|
|
|
|
|
xzdAlterationInventoryService.saveBatch(bo.getBgzjqd());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//合同外清单
|
|
|
|
|
if(bo.getHtwqd() != null && !bo.getHtwqd().isEmpty()){
|
|
|
|
|
for (XzdContractInventory xzdContractOutsideInventory : bo.getHtwqd()) {
|
|
|
|
|
xzdContractOutsideInventory.setPrimaryMeterId(add.getId());
|
|
|
|
|
xzdContractOutsideInventory.setType("合同外清单");
|
|
|
|
|
xzdContractOutsideInventory.setCode(IdUtil.getSnowflakeNextIdStr());
|
|
|
|
|
}
|
|
|
|
|
xzdContractInventoryService.saveBatch(bo.getHtwqd());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//奖励与扣款-扣款
|
|
|
|
|
if (bo.getKk() != null && !bo.getKk().isEmpty()){
|
|
|
|
|
for (XzdJsDeductionItems items : bo.getKk()) {
|
|
|
|
|
items.setMainDocId(add.getId());
|
|
|
|
|
items.setTableName("xzd_contract_progress_settlement");
|
|
|
|
|
items.setDetailType(1L);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//奖励与扣款-奖励
|
|
|
|
|
if (bo.getJl() != null && !bo.getJl().isEmpty()){
|
|
|
|
|
for (XzdJsDeductionItems items : bo.getJl()) {
|
|
|
|
|
items.setMainDocId(add.getId());
|
|
|
|
|
items.setTableName("xzd_contract_progress_settlement");
|
|
|
|
|
items.setDetailType(2L);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -208,23 +269,6 @@ public class XzdContractProgressSettlementServiceImpl extends ServiceImpl<XzdCon
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//印章信息
|
|
|
|
|
// if (bo.getSealInfo() != null && !bo.getSealInfo().isEmpty()) {
|
|
|
|
|
// for (XzdBusinessChange advanceInfo : old.getSealInfo()) {
|
|
|
|
|
// if (!bo.getSealInfo().contains(advanceInfo)) {
|
|
|
|
|
// if (advanceInfo.getId() != null){
|
|
|
|
|
// xzdBusinessChangeService.removeById(advanceInfo);
|
|
|
|
|
// }else {
|
|
|
|
|
// advanceInfo.setContractChangeId(update.getId());
|
|
|
|
|
// xzdBusinessChangeService.save(advanceInfo);
|
|
|
|
|
// }
|
|
|
|
|
// }else {
|
|
|
|
|
// xzdBusinessChangeService.updateById(advanceInfo);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }else if (old.getSealInfo() != null && !old.getSealInfo().isEmpty()){
|
|
|
|
|
// xzdBusinessChangeService.removeByIds(old.getSealInfo());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (bo.getSealInfo() != null && !bo.getSealInfo().isEmpty()){
|
|
|
|
|
if (old.getSealInfo() != null && !old.getSealInfo().isEmpty()){
|
|
|
|
|
xzdBusinessChangeService.removeByIds(old.getSealInfo());
|
|
|
|
|
@ -239,6 +283,79 @@ public class XzdContractProgressSettlementServiceImpl extends ServiceImpl<XzdCon
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//合同内清单
|
|
|
|
|
if (bo.getHtnqd() != null && !bo.getHtnqd().isEmpty()){
|
|
|
|
|
if (old.getHtnqd() != null && !old.getHtnqd().isEmpty()){
|
|
|
|
|
xzdContractInventoryService.removeByIds(old.getHtnqd());
|
|
|
|
|
}
|
|
|
|
|
for (XzdContractInventory businessChange : bo.getHtnqd()) {
|
|
|
|
|
businessChange.setPrimaryMeterId(update.getId());
|
|
|
|
|
businessChange.setType("合同内清单");
|
|
|
|
|
}
|
|
|
|
|
xzdContractInventoryService.saveBatch(bo.getHtnqd());
|
|
|
|
|
}else {
|
|
|
|
|
if (old.getHtnqd() != null && !old.getHtnqd().isEmpty()){
|
|
|
|
|
xzdContractInventoryService.removeByIds(old.getHtnqd());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//变更增加清单
|
|
|
|
|
if (bo.getBgzjqd() != null && !bo.getBgzjqd().isEmpty()){
|
|
|
|
|
if (old.getBgzjqd() != null && !old.getBgzjqd().isEmpty()){
|
|
|
|
|
xzdAlterationInventoryService.removeByIds(old.getBgzjqd());
|
|
|
|
|
}
|
|
|
|
|
for (XzdAlterationInventory businessChange : bo.getBgzjqd()) {
|
|
|
|
|
businessChange.setPrimaryMeterId(update.getId());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
if (old.getBgzjqd() != null && !old.getBgzjqd().isEmpty()){
|
|
|
|
|
xzdAlterationInventoryService.removeByIds(old.getBgzjqd());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//合同外清单
|
|
|
|
|
if(bo.getHtwqd() != null && !bo.getHtwqd().isEmpty()){
|
|
|
|
|
if (old.getHtwqd() != null && !old.getHtwqd().isEmpty()){
|
|
|
|
|
xzdContractInventoryService.removeByIds(old.getHtwqd());
|
|
|
|
|
}
|
|
|
|
|
for (XzdContractInventory xzdContractOutsideInventory : bo.getHtwqd()) {
|
|
|
|
|
xzdContractOutsideInventory.setPrimaryMeterId(update.getId());
|
|
|
|
|
xzdContractOutsideInventory.setType("合同外清单");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//奖励与扣款-扣款
|
|
|
|
|
if (bo.getKk() != null && !bo.getKk().isEmpty()){
|
|
|
|
|
if (old.getKk() != null && !old.getKk().isEmpty()){
|
|
|
|
|
xzdJsDeductionItemsService.removeByIds(old.getKk());
|
|
|
|
|
}
|
|
|
|
|
for (XzdJsDeductionItems items : bo.getKk()) {
|
|
|
|
|
items.setMainDocId(update.getId());
|
|
|
|
|
items.setTableName("xzd_contract_progress_settlement");
|
|
|
|
|
items.setDetailType(1L);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
if (old.getKk() != null && !old.getKk().isEmpty()){
|
|
|
|
|
xzdJsDeductionItemsService.removeByIds(old.getKk());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//奖励与扣款-奖励
|
|
|
|
|
if (bo.getJl() != null && !bo.getJl().isEmpty()){
|
|
|
|
|
if (old.getJl() != null && !old.getJl().isEmpty()){
|
|
|
|
|
xzdJsDeductionItemsService.removeByIds(old.getJl());
|
|
|
|
|
}
|
|
|
|
|
for (XzdJsDeductionItems items : bo.getJl()) {
|
|
|
|
|
items.setMainDocId(update.getId());
|
|
|
|
|
items.setDetailType(2L);
|
|
|
|
|
items.setTableName("xzd_contract_progress_settlement");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
if (old.getJl() != null && !old.getJl().isEmpty()){
|
|
|
|
|
xzdJsDeductionItemsService.removeByIds(old.getJl());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -275,6 +392,35 @@ public class XzdContractProgressSettlementServiceImpl extends ServiceImpl<XzdCon
|
|
|
|
|
lqw.eq(XzdBusinessChange::getContractChangeId, id);
|
|
|
|
|
xzdBusinessChangeService.remove(lqw);
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<XzdContractInventory> lqw1 = new LambdaQueryWrapper<>();
|
|
|
|
|
lqw1.eq(XzdContractInventory::getPrimaryMeterId, id);
|
|
|
|
|
lqw1.eq(XzdContractInventory::getType, "合同内清单");
|
|
|
|
|
xzdContractInventoryService.remove(lqw1);
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<XzdAlterationInventory> lqw2 = new LambdaQueryWrapper<>();
|
|
|
|
|
lqw2.eq(XzdAlterationInventory::getPrimaryMeterId, id);
|
|
|
|
|
xzdAlterationInventoryService.remove(lqw2);
|
|
|
|
|
|
|
|
|
|
//合同外清单
|
|
|
|
|
LambdaQueryWrapper<XzdContractInventory> lqw3 = new LambdaQueryWrapper<>();
|
|
|
|
|
lqw3.eq(XzdContractInventory::getPrimaryMeterId, id);
|
|
|
|
|
lqw3.eq(XzdContractInventory::getType, "合同外清单");
|
|
|
|
|
xzdContractInventoryService.remove(lqw3);
|
|
|
|
|
|
|
|
|
|
//奖励与扣款-扣款
|
|
|
|
|
LambdaQueryWrapper<XzdJsDeductionItems> lqw4 = new LambdaQueryWrapper<>();
|
|
|
|
|
lqw4.eq(XzdJsDeductionItems::getMainDocId, id);
|
|
|
|
|
lqw4.eq(XzdJsDeductionItems::getTableName, "xzd_contract_progress_settlement");
|
|
|
|
|
lqw4.eq(XzdJsDeductionItems::getDetailType, 1L);
|
|
|
|
|
xzdJsDeductionItemsService.remove(lqw4);
|
|
|
|
|
|
|
|
|
|
//奖励与扣款-奖励
|
|
|
|
|
LambdaQueryWrapper<XzdJsDeductionItems> lqw5 = new LambdaQueryWrapper<>();
|
|
|
|
|
lqw5.eq(XzdJsDeductionItems::getMainDocId, id);
|
|
|
|
|
lqw5.eq(XzdJsDeductionItems::getTableName, "xzd_contract_progress_settlement");
|
|
|
|
|
lqw5.eq(XzdJsDeductionItems::getDetailType, 2L);
|
|
|
|
|
xzdJsDeductionItemsService.remove(lqw5);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|
@ -347,6 +493,47 @@ public class XzdContractProgressSettlementServiceImpl extends ServiceImpl<XzdCon
|
|
|
|
|
if (xzdSettlementRulesVo != null){
|
|
|
|
|
vo.setPaymentTermsName(xzdSettlementRulesVo.getType());
|
|
|
|
|
}
|
|
|
|
|
//合同内清单
|
|
|
|
|
LambdaQueryWrapper<XzdContractInventory> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper1.eq(XzdContractInventory::getPrimaryMeterId, vo.getId());
|
|
|
|
|
queryWrapper1.eq(XzdContractInventory::getType, "合同内清单");
|
|
|
|
|
List<XzdContractInventory> list1 = xzdContractInventoryService.list(queryWrapper1);
|
|
|
|
|
if (list1 != null){
|
|
|
|
|
vo.setHtnqd(list1);
|
|
|
|
|
}
|
|
|
|
|
//变更清单
|
|
|
|
|
LambdaQueryWrapper<XzdAlterationInventory> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper2.eq(XzdAlterationInventory::getPrimaryMeterId, vo.getId());
|
|
|
|
|
List<XzdAlterationInventory> list2 = xzdAlterationInventoryService.list(queryWrapper2);
|
|
|
|
|
if (list2 != null){
|
|
|
|
|
vo.setBgzjqd(list2);
|
|
|
|
|
}
|
|
|
|
|
//合同外清单
|
|
|
|
|
LambdaQueryWrapper<XzdContractInventory> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper3.eq(XzdContractInventory::getPrimaryMeterId, vo.getId());
|
|
|
|
|
queryWrapper3.eq(XzdContractInventory::getType, "合同外清单");
|
|
|
|
|
List<XzdContractInventory> list3 = xzdContractInventoryService.list(queryWrapper3);
|
|
|
|
|
if (list3 != null){
|
|
|
|
|
vo.setHtwqd(list3);
|
|
|
|
|
}
|
|
|
|
|
//奖励与扣款-扣款
|
|
|
|
|
LambdaQueryWrapper<XzdJsDeductionItems> queryWrapper4 = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper4.eq(XzdJsDeductionItems::getTableName, "xzd_contract_progress_settlement");
|
|
|
|
|
queryWrapper4.eq(XzdJsDeductionItems::getDetailType, 1L);
|
|
|
|
|
queryWrapper4.eq(XzdJsDeductionItems::getMainDocId, vo.getId());
|
|
|
|
|
List<XzdJsDeductionItems> list4 = xzdJsDeductionItemsService.list(queryWrapper4);
|
|
|
|
|
if (list4 != null){
|
|
|
|
|
vo.setKk(list4);
|
|
|
|
|
}
|
|
|
|
|
//奖励与扣款-奖励
|
|
|
|
|
queryWrapper4.clear();
|
|
|
|
|
queryWrapper4.eq(XzdJsDeductionItems::getTableName, "xzd_contract_progress_settlement");
|
|
|
|
|
queryWrapper4.eq(XzdJsDeductionItems::getDetailType, 2L);
|
|
|
|
|
queryWrapper4.eq(XzdJsDeductionItems::getMainDocId, vo.getId());
|
|
|
|
|
List<XzdJsDeductionItems> list5 = xzdJsDeductionItemsService.list(queryWrapper4);
|
|
|
|
|
if (list5 != null){
|
|
|
|
|
vo.setJl(list5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|