10-15-承包合同竣工结算
This commit is contained in:
		| @ -7,6 +7,7 @@ import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
|  | ||||
| import java.io.Serial; | ||||
| @ -31,6 +32,11 @@ public class XzdContractAccount extends BaseEntity { | ||||
|     @TableId(value = "id") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 单据编号 | ||||
|      */ | ||||
|     private String documentCodeThis; | ||||
|  | ||||
|     /** | ||||
|      * 标题 | ||||
|      */ | ||||
| @ -66,12 +72,12 @@ public class XzdContractAccount extends BaseEntity { | ||||
|     /** | ||||
|      * 送审造价 | ||||
|      */ | ||||
|     private Long submittedCost; | ||||
|     private BigDecimal submittedCost; | ||||
|  | ||||
|     /** | ||||
|      * 审定总价 | ||||
|      */ | ||||
|     private Long totalPrice; | ||||
|     private BigDecimal totalPrice; | ||||
|  | ||||
|     /** | ||||
|      * 审定日期 | ||||
| @ -118,7 +124,7 @@ public class XzdContractAccount extends BaseEntity { | ||||
|     /** | ||||
|      * 本期应收金额 | ||||
|      */ | ||||
|     private Long amountReceivable; | ||||
|     private BigDecimal amountReceivable; | ||||
|  | ||||
|     /** | ||||
|      * 竣工日期 | ||||
| @ -135,12 +141,12 @@ public class XzdContractAccount extends BaseEntity { | ||||
|     /** | ||||
|      * 本期决算总额 | ||||
|      */ | ||||
|     private Long settlementAmount; | ||||
|     private BigDecimal settlementAmount; | ||||
|  | ||||
|     /** | ||||
|      * 质保金金额(客户) | ||||
|      */ | ||||
|     private Long warrantyAmount; | ||||
|     private BigDecimal warrantyAmount; | ||||
|  | ||||
|     /** | ||||
|      * 业主单位(客户) | ||||
| @ -157,5 +163,6 @@ public class XzdContractAccount extends BaseEntity { | ||||
|      */ | ||||
|     private Long review; | ||||
|  | ||||
|     private String fileId; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -11,6 +11,7 @@ import lombok.EqualsAndHashCode; | ||||
| import jakarta.validation.constraints.*; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
| @ -29,6 +30,11 @@ public class XzdContractAccountBo extends BaseEntity { | ||||
|      */ | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 单据编号 | ||||
|      */ | ||||
|     private String documentCodeThis; | ||||
|  | ||||
|     /** | ||||
|      * 标题 | ||||
|      */ | ||||
| @ -63,12 +69,12 @@ public class XzdContractAccountBo extends BaseEntity { | ||||
|     /** | ||||
|      * 送审造价 | ||||
|      */ | ||||
|     private Long submittedCost; | ||||
|     private BigDecimal submittedCost; | ||||
|  | ||||
|     /** | ||||
|      * 审定总价 | ||||
|      */ | ||||
|     private Long totalPrice; | ||||
|     private BigDecimal totalPrice; | ||||
|  | ||||
|     /** | ||||
|      * 审定日期 | ||||
| @ -100,7 +106,7 @@ public class XzdContractAccountBo extends BaseEntity { | ||||
|     /** | ||||
|      * 本期应收金额 | ||||
|      */ | ||||
|     private Long amountReceivable; | ||||
|     private BigDecimal amountReceivable; | ||||
|  | ||||
|     /** | ||||
|      * 竣工日期 | ||||
| @ -117,12 +123,12 @@ public class XzdContractAccountBo extends BaseEntity { | ||||
|     /** | ||||
|      * 本期决算总额 | ||||
|      */ | ||||
|     private Long settlementAmount; | ||||
|     private BigDecimal settlementAmount; | ||||
|  | ||||
|     /** | ||||
|      * 质保金金额(客户) | ||||
|      */ | ||||
|     private Long warrantyAmount; | ||||
|     private BigDecimal warrantyAmount; | ||||
|  | ||||
|     /** | ||||
|      * 业主单位(客户) | ||||
| @ -139,5 +145,6 @@ public class XzdContractAccountBo extends BaseEntity { | ||||
|      */ | ||||
|     private Long review; | ||||
|  | ||||
|     private String fileId; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| package org.dromara.xzd.domain.vo; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
|  | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| @ -35,6 +36,11 @@ public class XzdContractAccountVo implements Serializable { | ||||
|     @ExcelProperty(value = "id") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 单据编号 | ||||
|      */ | ||||
|     private String documentCodeThis; | ||||
|  | ||||
|     /** | ||||
|      * 标题 | ||||
|      */ | ||||
| @ -130,7 +136,7 @@ public class XzdContractAccountVo implements Serializable { | ||||
|      * 本期应收金额 | ||||
|      */ | ||||
|     @ExcelProperty(value = "本期应收金额") | ||||
|     private Long amountReceivable; | ||||
|     private BigDecimal amountReceivable; | ||||
|  | ||||
|     /** | ||||
|      * 竣工日期 | ||||
| @ -150,13 +156,13 @@ public class XzdContractAccountVo implements Serializable { | ||||
|      * 本期决算总额 | ||||
|      */ | ||||
|     @ExcelProperty(value = "本期决算总额") | ||||
|     private Long settlementAmount; | ||||
|     private BigDecimal settlementAmount; | ||||
|  | ||||
|     /** | ||||
|      * 质保金金额(客户) | ||||
|      */ | ||||
|     @ExcelProperty(value = "质保金金额(客户)") | ||||
|     private Long warrantyAmount; | ||||
|     private BigDecimal warrantyAmount; | ||||
|  | ||||
|     /** | ||||
|      * 业主单位(客户) | ||||
| @ -164,17 +170,33 @@ public class XzdContractAccountVo implements Serializable { | ||||
|     @ExcelProperty(value = "业主单位(客户)") | ||||
|     private Long owner; | ||||
|  | ||||
|     /** | ||||
|      * 业主单位名称 | ||||
|      */ | ||||
|     private String ownerName; | ||||
|  | ||||
|     /** | ||||
|      * 监理单位(客户) | ||||
|      */ | ||||
|     @ExcelProperty(value = "监理单位(客户)") | ||||
|     private Long supervision; | ||||
|  | ||||
|     /** | ||||
|      * 监理单位名称 | ||||
|      */ | ||||
|     private String supervisionName; | ||||
|  | ||||
|     /** | ||||
|      * 审核单位(客户) | ||||
|      */ | ||||
|     @ExcelProperty(value = "审核单位(客户)") | ||||
|     private Long review; | ||||
|  | ||||
|     /** | ||||
|      * 审核单位名称 | ||||
|      */ | ||||
|     private String reviewName; | ||||
|  | ||||
|     private String fileId; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -1,7 +1,9 @@ | ||||
| package org.dromara.xzd.service.impl; | ||||
|  | ||||
| import cn.hutool.core.util.IdUtil; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ParameterUtils; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -10,9 +12,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.system.service.impl.SysOssServiceImpl; | ||||
| import org.dromara.xzd.domain.XzdSettlementRules; | ||||
| import org.dromara.xzd.domain.dto.QuerCorrespondentDto; | ||||
| import org.dromara.xzd.domain.vo.XzdContractDetailsVo; | ||||
| import org.dromara.xzd.domain.vo.XzdSettlementRulesVo; | ||||
| import org.dromara.xzd.service.IXzdCorrespondentList; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.dromara.xzd.domain.bo.XzdContractAccountBo; | ||||
| @ -21,6 +26,7 @@ import org.dromara.xzd.domain.XzdContractAccount; | ||||
| import org.dromara.xzd.mapper.XzdContractAccountMapper; | ||||
| import org.dromara.xzd.service.IXzdContractAccountService; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Collection; | ||||
| @ -40,6 +46,10 @@ public class XzdContractAccountServiceImpl extends ServiceImpl<XzdContractAccoun | ||||
|     private XzdContractDetailsServiceImpl xzdContractDetailsService; | ||||
|     @Autowired | ||||
|     private XzdSettlementRulesServiceImpl xzdSettlementRulesService; | ||||
|     @Autowired | ||||
|     private IXzdCorrespondentList iXzdCorrespondentList; | ||||
|     @Autowired | ||||
|     private SysOssServiceImpl sysOssService; | ||||
|  | ||||
|     /** | ||||
|      * 查询承包合同竣工结算 | ||||
| @ -63,6 +73,7 @@ public class XzdContractAccountServiceImpl extends ServiceImpl<XzdContractAccoun | ||||
|     public TableDataInfo<XzdContractAccountVo> queryPageList(XzdContractAccountBo bo, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<XzdContractAccount> lqw = buildQueryWrapper(bo); | ||||
|         Page<XzdContractAccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         setValue(result.getRecords()); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
| @ -115,11 +126,12 @@ public class XzdContractAccountServiceImpl extends ServiceImpl<XzdContractAccoun | ||||
|     public Boolean insertByBo(XzdContractAccountBo bo) { | ||||
|         XzdContractAccount add = MapstructUtils.convert(bo, XzdContractAccount.class); | ||||
|         validEntityBeforeSave(add); | ||||
|         add.setDocumentCodeThis(IdUtil.getSnowflakeNextIdStr()); | ||||
|         boolean flag = baseMapper.insert(add) > 0; | ||||
|         if (flag) { | ||||
|             bo.setId(add.getId()); | ||||
|         if (!flag) { | ||||
|             return false; | ||||
|         } | ||||
|         return flag; | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @ -132,7 +144,27 @@ public class XzdContractAccountServiceImpl extends ServiceImpl<XzdContractAccoun | ||||
|     public Boolean updateByBo(XzdContractAccountBo bo) { | ||||
|         XzdContractAccount update = MapstructUtils.convert(bo, XzdContractAccount.class); | ||||
|         validEntityBeforeSave(update); | ||||
|         return baseMapper.updateById(update) > 0; | ||||
|         XzdContractAccountVo old = queryById(update.getId()); | ||||
|         boolean b = baseMapper.updateById(update) > 0; | ||||
|         //更新文件 | ||||
|         if (bo.getFileId() != null && !bo.getFileId().isEmpty()){ | ||||
|             if (old.getFileId() != null && !old.getFileId().isEmpty()) { | ||||
|                 List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList(); | ||||
|                 List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList(); | ||||
|                 for (Long l : oldFileId) { | ||||
|                     if (!nowFileId.contains(l)) { | ||||
|                         sysOssService.deleteWithValidByIds(List.of(l), false); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }else { | ||||
|             if (old.getFileId()!= null && !old.getFileId().isEmpty()){ | ||||
|                 List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList(); | ||||
|                 sysOssService.deleteWithValidByIds(deleteIds, false); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return b; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @ -183,6 +215,35 @@ public class XzdContractAccountServiceImpl extends ServiceImpl<XzdContractAccoun | ||||
|                     vo.setSettlementRules(settlementRulesVo); | ||||
|                 } | ||||
|             } | ||||
|             //业主单位 | ||||
|             if (vo.getOwner() != null){ | ||||
|                 R<QuerCorrespondentDto> byid2 = iXzdCorrespondentList.getCustomerByid(vo.getOwner()); | ||||
|                 if (byid2 != null) { | ||||
|                     if (byid2.getData().getXzdCustomerinformation() != null) { | ||||
|                         vo.setOwnerName(byid2.getData().getXzdCustomerinformation().getUnitName()); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             //监理单位 | ||||
|             if (vo.getSupervision() != null){ | ||||
|                 if (vo.getOwner() != null){ | ||||
|                     R<QuerCorrespondentDto> byid2 = iXzdCorrespondentList.getCustomerByid(vo.getSupervision()); | ||||
|                     if (byid2 != null) { | ||||
|                         if (byid2.getData().getXzdCustomerinformation() != null) { | ||||
|                             vo.setOwnerName(byid2.getData().getXzdCustomerinformation().getUnitName()); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             //审核单位 | ||||
|             if (vo.getReview() != null){ | ||||
|                 R<QuerCorrespondentDto> byid2 = iXzdCorrespondentList.getCustomerByid(vo.getReview()); | ||||
|                 if (byid2 != null) { | ||||
|                     if (byid2.getData().getXzdCustomerinformation() != null) { | ||||
|                         vo.setReviewName(byid2.getData().getXzdCustomerinformation().getUnitName()); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user