feat:新增单位年度合同 开票 收款计划
新增统计页
| New file |
| | |
| | | package com.by4cloud.platformx.business.entity; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.by4cloud.platformx.common.data.mybatis.BaseModel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.persistence.Column; |
| | | import jakarta.persistence.Entity; |
| | | import lombok.Data; |
| | | import org.hibernate.annotations.Table; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 2026年10月9日 10:13:52 |
| | | * syt |
| | | */ |
| | | @Data |
| | | @Entity//加了才能自动生成表 |
| | | @Table(appliesTo="annual_plan",comment = "单位计划")//给表加注释 |
| | | @jakarta.persistence.Table(name = "annual_plan")//数据库创建的表明 |
| | | public class AnnualPlan extends BaseModel<AnnualPlan> { |
| | | |
| | | @Schema(description = "类型") |
| | | @Column(columnDefinition="char(1) comment '类型 1/合同 2/开票 3/收款'") |
| | | private String planType; |
| | | |
| | | @Schema(description = "年") |
| | | @Column(columnDefinition="varchar(12) comment '年'") |
| | | private String planYear; |
| | | |
| | | @Schema(description = "1月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '1月金额'") |
| | | private BigDecimal janAmount; |
| | | |
| | | @Schema(description = "2月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '2月金额'") |
| | | private BigDecimal febAmount; |
| | | |
| | | @Schema(description = "3月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '3月金额'") |
| | | private BigDecimal marAmount; |
| | | |
| | | @Schema(description = "4月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '4月金额'") |
| | | private BigDecimal aprAmount; |
| | | |
| | | @Schema(description = "5月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '5月金额'") |
| | | private BigDecimal mayAmount; |
| | | |
| | | @Schema(description = "6月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '6月金额'") |
| | | private BigDecimal junAmount; |
| | | |
| | | @Schema(description = "7月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '7月金额'") |
| | | private BigDecimal julAmount; |
| | | |
| | | @Schema(description = "8月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '8月金额'") |
| | | private BigDecimal augAmount; |
| | | |
| | | @Schema(description = "9月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '9月金额'") |
| | | private BigDecimal sepAmount; |
| | | |
| | | @Schema(description = "10月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '10月金额'") |
| | | private BigDecimal octAmount; |
| | | |
| | | @Schema(description = "11月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '11月金额'") |
| | | private BigDecimal novAmount; |
| | | |
| | | @Schema(description = "12月金额") |
| | | @Column(columnDefinition = "decimal(14,2) comment '12月金额'") |
| | | private BigDecimal decAmount; |
| | | |
| | | public BigDecimal getTotalAmount() { |
| | | // 使用 Optional 或三元运算符处理 null 值,防止 NullPointerException |
| | | BigDecimal b1 = janAmount == null ? BigDecimal.ZERO : janAmount; |
| | | BigDecimal b2 = febAmount == null ? BigDecimal.ZERO : febAmount; |
| | | BigDecimal b3 = marAmount == null ? BigDecimal.ZERO : marAmount; |
| | | BigDecimal b4 = aprAmount == null ? BigDecimal.ZERO : aprAmount; |
| | | BigDecimal b5 = mayAmount == null ? BigDecimal.ZERO : mayAmount; |
| | | BigDecimal b6 = junAmount == null ? BigDecimal.ZERO : junAmount; |
| | | BigDecimal b7 = julAmount == null ? BigDecimal.ZERO : julAmount; |
| | | BigDecimal b8 = augAmount == null ? BigDecimal.ZERO : augAmount; |
| | | BigDecimal b9 = sepAmount == null ? BigDecimal.ZERO : sepAmount; |
| | | BigDecimal b10 = octAmount == null ? BigDecimal.ZERO : octAmount; |
| | | BigDecimal b11 = novAmount == null ? BigDecimal.ZERO : novAmount; |
| | | BigDecimal b12 = decAmount == null ? BigDecimal.ZERO : decAmount; |
| | | |
| | | return b1.add(b2).add(b3).add(b4).add(b5).add(b6).add(b7).add(b8).add(b9).add(b10).add(b11).add(b12); |
| | | } |
| | | |
| | | public BigDecimal getMonthAmount(String month) { |
| | | // 使用 Optional 或三元运算符处理 null 值,防止 NullPointerException |
| | | if (StrUtil.equals("1",month)||StrUtil.equals("01",month)){ |
| | | return janAmount; |
| | | } |
| | | if (StrUtil.equals("2",month)||StrUtil.equals("02",month)){ |
| | | return febAmount; |
| | | } |
| | | if (StrUtil.equals("3",month)||StrUtil.equals("03",month)){ |
| | | return marAmount; |
| | | } |
| | | if (StrUtil.equals("4",month)||StrUtil.equals("04",month)){ |
| | | return aprAmount; |
| | | } |
| | | if (StrUtil.equals("5",month)||StrUtil.equals("05",month)){ |
| | | return mayAmount; |
| | | } |
| | | if (StrUtil.equals("6",month)||StrUtil.equals("06",month)){ |
| | | return junAmount; |
| | | } |
| | | if (StrUtil.equals("7",month)||StrUtil.equals("07",month)){ |
| | | return julAmount; |
| | | } |
| | | if (StrUtil.equals("8",month)||StrUtil.equals("08",month)){ |
| | | return augAmount; |
| | | } |
| | | if (StrUtil.equals("9",month)||StrUtil.equals("09",month)){ |
| | | return sepAmount; |
| | | } |
| | | if (StrUtil.equals("10",month)){ |
| | | return octAmount; |
| | | } |
| | | if (StrUtil.equals("11",month)){ |
| | | return novAmount; |
| | | } |
| | | if (StrUtil.equals("12",month)){ |
| | | return decAmount; |
| | | } |
| | | return new BigDecimal("0"); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.by4cloud.platformx.common.data.mybatis.BaseModel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.persistence.Column; |
| | | import jakarta.persistence.Entity; |
| | | import jakarta.persistence.Id; |
| | | import lombok.Data; |
| | | import org.hibernate.annotations.Table; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 2026年5月22日 08:41:53 |
| | | * syt |
| | | */ |
| | | @Data |
| | | @Entity//加了才能自动生成表 |
| | | @Table(appliesTo="payment_receive",comment = "每月应收")//给表加注释 |
| | | @jakarta.persistence.Table(name = "payment_receive")//数据库创建的表明 |
| | | public class PaymentReceive { |
| | | |
| | | @Id |
| | | @TableId( |
| | | value = "id", |
| | | type = IdType.ASSIGN_ID |
| | | ) |
| | | private Long id; |
| | | |
| | | @Schema(description = "单位ID") |
| | | @Column(columnDefinition="bigint comment '单位ID'") |
| | | private Long compId; |
| | | |
| | | @Schema(description = "应收金额") |
| | | @Column(columnDefinition="decimal(14,2) comment '应收金额 /元 两位小数'") |
| | | private BigDecimal receiveAmount; |
| | | |
| | | @Schema(description = "应收日期") |
| | | @Column(columnDefinition="date comment '应收日期'") |
| | | private Date receiveDate; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class AnnualPlanTotalVo { |
| | | |
| | | @Schema(description = "1月金额") |
| | | private BigDecimal janAmount; |
| | | |
| | | @Schema(description = "2月金额") |
| | | private BigDecimal febAmount; |
| | | |
| | | @Schema(description = "3月金额") |
| | | private BigDecimal marAmount; |
| | | |
| | | @Schema(description = "4月金额") |
| | | private BigDecimal aprAmount; |
| | | |
| | | @Schema(description = "5月金额") |
| | | private BigDecimal mayAmount; |
| | | |
| | | @Schema(description = "6月金额") |
| | | private BigDecimal junAmount; |
| | | |
| | | @Schema(description = "7月金额") |
| | | private BigDecimal julAmount; |
| | | |
| | | @Schema(description = "8月金额") |
| | | private BigDecimal augAmount; |
| | | |
| | | @Schema(description = "9月金额") |
| | | private BigDecimal sepAmount; |
| | | |
| | | @Schema(description = "10月金额") |
| | | private BigDecimal octAmount; |
| | | |
| | | @Schema(description = "11月金额") |
| | | private BigDecimal novAmount; |
| | | |
| | | @Schema(description = "12月金额") |
| | | private BigDecimal decAmount; |
| | | |
| | | |
| | | public BigDecimal getTotalAmount() { |
| | | // 使用 Optional 或三元运算符处理 null 值,防止 NullPointerException |
| | | BigDecimal b1 = janAmount == null ? BigDecimal.ZERO : janAmount; |
| | | BigDecimal b2 = febAmount == null ? BigDecimal.ZERO : febAmount; |
| | | BigDecimal b3 = marAmount == null ? BigDecimal.ZERO : marAmount; |
| | | BigDecimal b4 = aprAmount == null ? BigDecimal.ZERO : aprAmount; |
| | | BigDecimal b5 = mayAmount == null ? BigDecimal.ZERO : mayAmount; |
| | | BigDecimal b6 = junAmount == null ? BigDecimal.ZERO : junAmount; |
| | | BigDecimal b7 = julAmount == null ? BigDecimal.ZERO : julAmount; |
| | | BigDecimal b8 = augAmount == null ? BigDecimal.ZERO : augAmount; |
| | | BigDecimal b9 = sepAmount == null ? BigDecimal.ZERO : sepAmount; |
| | | BigDecimal b10 = octAmount == null ? BigDecimal.ZERO : octAmount; |
| | | BigDecimal b11 = novAmount == null ? BigDecimal.ZERO : novAmount; |
| | | BigDecimal b12 = decAmount == null ? BigDecimal.ZERO : decAmount; |
| | | |
| | | return b1.add(b2).add(b3).add(b4).add(b5).add(b6).add(b7).add(b8).add(b9).add(b10).add(b11).add(b12); |
| | | } |
| | | |
| | | public BigDecimal getMonthAmount(String month) { |
| | | // 使用 Optional 或三元运算符处理 null 值,防止 NullPointerException |
| | | if (StrUtil.equals("1",month)||StrUtil.equals("01",month)){ |
| | | return janAmount; |
| | | } |
| | | if (StrUtil.equals("2",month)||StrUtil.equals("02",month)){ |
| | | return febAmount; |
| | | } |
| | | if (StrUtil.equals("3",month)||StrUtil.equals("03",month)){ |
| | | return marAmount; |
| | | } |
| | | if (StrUtil.equals("4",month)||StrUtil.equals("04",month)){ |
| | | return aprAmount; |
| | | } |
| | | if (StrUtil.equals("5",month)||StrUtil.equals("05",month)){ |
| | | return mayAmount; |
| | | } |
| | | if (StrUtil.equals("6",month)||StrUtil.equals("06",month)){ |
| | | return junAmount; |
| | | } |
| | | if (StrUtil.equals("7",month)||StrUtil.equals("07",month)){ |
| | | return julAmount; |
| | | } |
| | | if (StrUtil.equals("8",month)||StrUtil.equals("08",month)){ |
| | | return augAmount; |
| | | } |
| | | if (StrUtil.equals("9",month)||StrUtil.equals("09",month)){ |
| | | return sepAmount; |
| | | } |
| | | if (StrUtil.equals("10",month)){ |
| | | return octAmount; |
| | | } |
| | | if (StrUtil.equals("11",month)){ |
| | | return novAmount; |
| | | } |
| | | if (StrUtil.equals("12",month)){ |
| | | return decAmount; |
| | | } |
| | | return new BigDecimal("0"); |
| | | } |
| | | } |
| | |
| | | @Schema(description = "条款主要内容") |
| | | private String summary; |
| | | |
| | | private BigDecimal billingAmout; |
| | | |
| | | private ContractInvoiceBipVo bipVo; |
| | | |
| | | private List<ContractPaymentSchedule> contractPaymentSchedule; |
| | |
| | | @ExcelProperty("供应属性*") |
| | | private String supplyAttribute; |
| | | |
| | | @ExcelProperty("客户编码(erpcode)*") |
| | | @ExcelProperty("客户名称*") |
| | | private String bcErpCode; |
| | | |
| | | @ExcelProperty("签署日期*") |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ContractExportExceVO { |
| | | |
| | | @ExcelProperty("合同名称") |
| | | private String contractName; |
| | | |
| | | @ExcelProperty("合同编号") |
| | | private String contractNo; |
| | | |
| | | @ExcelProperty("服务属性") |
| | | private String contractAttribute; |
| | | |
| | | @ExcelProperty("经济事项") |
| | | private String economicMatters; |
| | | |
| | | @ExcelProperty("供应属性") |
| | | private String supplyAttribute; |
| | | |
| | | @ExcelProperty("客户名称") |
| | | private String bcErpCode; |
| | | |
| | | @ExcelProperty("签署日期") |
| | | private String signDate; |
| | | |
| | | @ExcelProperty("到期日期") |
| | | private String expirationDate; |
| | | |
| | | @ExcelProperty("所属行业") |
| | | private String industryCode; |
| | | |
| | | @ExcelProperty("合同金额") |
| | | private String amount; |
| | | |
| | | @ExcelProperty("已收款金额") |
| | | private String paidAmount; |
| | | |
| | | @ExcelProperty("已开票金额") |
| | | private String billingAmout; |
| | | |
| | | } |
| | |
| | | private String pzzdr; |
| | | |
| | | private String sfzy; |
| | | private String sffz; |
| | | private String hsdy; |
| | | private String sfnbwl; |
| | | private String sfjyjs; |
| | |
| | | private String fphm; |
| | | |
| | | private String kxlx; |
| | | |
| | | private String zyys; |
| | | |
| | | private String bkfl; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ZbjtIndicatorTrendVo { |
| | | |
| | | private String yearMon; |
| | | |
| | | private BigDecimal je; |
| | | |
| | | private String wc; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ZbjtStatisticByContractAmountClassVo { |
| | | |
| | | private BigDecimal jz; |
| | | |
| | | private BigDecimal zm; |
| | | |
| | | private BigDecimal wb; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ZbjtStatisticByContractAmountProVo { |
| | | |
| | | private BigDecimal mj; |
| | | |
| | | private BigDecimal hwc; |
| | | |
| | | private BigDecimal scd; |
| | | |
| | | private BigDecimal zt; |
| | | |
| | | private BigDecimal gyb; |
| | | |
| | | private BigDecimal qt; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ZbjtStatisticByContractAmountSupplyVo { |
| | | |
| | | private BigDecimal bj; |
| | | |
| | | private BigDecimal zj; |
| | | |
| | | private BigDecimal dx; |
| | | |
| | | private BigDecimal qt; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ZbjtStatisticByContractAmountVo { |
| | | |
| | | private BigDecimal smj; |
| | | |
| | | private BigDecimal sgb; |
| | | |
| | | private BigDecimal tfgs; |
| | | |
| | | private BigDecimal jxc; |
| | | |
| | | private BigDecimal ymj; |
| | | |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ZbjtStatisticVo { |
| | | |
| | | private String br; |
| | | |
| | | private String bm; |
| | | |
| | | private String bmwc; |
| | | |
| | | private String bn; |
| | | |
| | | private String bnwc; |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.controller; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.business.entity.AnnualPlan; |
| | | import com.by4cloud.platformx.business.service.AnnualPlanService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | | import org.springdoc.core.annotations.ParameterObject; |
| | | import org.springframework.http.HttpHeaders; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 单位计划 |
| | | * |
| | | * @author platformx |
| | | * @date 2026-10-09 10:31:46 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/annualPlan" ) |
| | | @Tag(description = "annualPlan" , name = "单位计划管理" ) |
| | | @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) |
| | | public class AnnualPlanController { |
| | | |
| | | private final AnnualPlanService annualPlanService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param annualPlan 单位计划 |
| | | * @return |
| | | */ |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_annualPlan_view')" ) |
| | | public R getAnnualPlanPage(@ParameterObject Page page, @ParameterObject AnnualPlan annualPlan) { |
| | | LambdaQueryWrapper<AnnualPlan> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(StrUtil.isNotBlank(annualPlan.getPlanType()),AnnualPlan::getPlanType,annualPlan.getPlanType()); |
| | | wrapper.eq(StrUtil.isNotBlank(annualPlan.getPlanYear()),AnnualPlan::getPlanYear,annualPlan.getPlanYear()); |
| | | wrapper.orderByDesc(AnnualPlan::getCreateTime); |
| | | return R.ok(annualPlanService.pageByScope(page, wrapper)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过id查询单位计划 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "通过id查询" , description = "通过id查询" ) |
| | | @GetMapping("/{id}" ) |
| | | @PreAuthorize("@pms.hasPermission('business_annualPlan_view')" ) |
| | | public R getById(@PathVariable("id" ) Long id) { |
| | | return R.ok(annualPlanService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增单位计划 |
| | | * @param annualPlan 单位计划 |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "新增单位计划" , description = "新增单位计划" ) |
| | | @SysLog("新增单位计划" ) |
| | | @PostMapping |
| | | @PreAuthorize("@pms.hasPermission('business_annualPlan_add')" ) |
| | | public R save(@RequestBody AnnualPlan annualPlan) { |
| | | return annualPlanService.add(annualPlan); |
| | | } |
| | | |
| | | /** |
| | | * 修改单位计划 |
| | | * @param annualPlan 单位计划 |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "修改单位计划" , description = "修改单位计划" ) |
| | | @SysLog("修改单位计划" ) |
| | | @PutMapping |
| | | @PreAuthorize("@pms.hasPermission('business_annualPlan_edit')" ) |
| | | public R updateById(@RequestBody AnnualPlan annualPlan) { |
| | | return R.ok(annualPlanService.updateById(annualPlan)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除单位计划 |
| | | * @param ids id列表 |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "通过id删除单位计划" , description = "通过id删除单位计划" ) |
| | | @SysLog("通过id删除单位计划" ) |
| | | @DeleteMapping |
| | | @PreAuthorize("@pms.hasPermission('business_annualPlan_del')" ) |
| | | public R removeById(@RequestBody Long[] ids) { |
| | | return R.ok(annualPlanService.removeBatchByIds(CollUtil.toList(ids))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出excel 表格 |
| | | * @param annualPlan 查询条件 |
| | | * @param ids 导出指定ID |
| | | * @return excel 文件流 |
| | | */ |
| | | @ResponseExcel |
| | | @GetMapping("/export") |
| | | @PreAuthorize("@pms.hasPermission('business_annualPlan_export')" ) |
| | | public List<AnnualPlan> export(AnnualPlan annualPlan,Long[] ids) { |
| | | return annualPlanService.list(Wrappers.lambdaQuery(annualPlan).in(ArrayUtil.isNotEmpty(ids), AnnualPlan::getId, ids)); |
| | | } |
| | | } |
| | |
| | | import com.by4cloud.platformx.business.dto.BankStatementUpdateDTO; |
| | | import com.by4cloud.platformx.business.dto.BipQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.BankStatement; |
| | | import com.by4cloud.platformx.business.entity.BusinessCustomer; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | | import com.by4cloud.platformx.business.service.BankStatementService; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; |
| | | import io.swagger.v3.oas.annotations.security.SecurityRequirement; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | private final BankStatementService bankStatementService; |
| | | |
| | | @Value("${dept.smj}") |
| | | private String smj; |
| | | |
| | | @Value("${dept.smjhw}") |
| | | private String smjhw; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | |
| | | @GetMapping("/page" ) |
| | | @PreAuthorize("@pms.hasPermission('business_bankStatement_view')" ) |
| | | public R getBankStatementPage(@ParameterObject Page page, @ParameterObject BankStatement bankStatement) { |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { |
| | | LambdaQueryWrapper<BankStatement> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotBlank(bankStatement.getPayBankAccName()),BankStatement::getPayBankAccName,bankStatement.getPayBankAccName()); |
| | | wrapper.like(StrUtil.isNotBlank(bankStatement.getReceiveBankAccName()),BankStatement::getReceiveBankAccName,bankStatement.getReceiveBankAccName()); |
| | | wrapper.orderByDesc(BankStatement::getCreateTime); |
| | | List<String> smjList = new ArrayList<>(); |
| | | smjList.add(smj); |
| | | smjList.add(smjhw); |
| | | wrapper.in(BankStatement::getCompId, smjList); |
| | | return R.ok(bankStatementService.page(page, wrapper)); |
| | | } |
| | | LambdaQueryWrapper<BankStatement> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.like(StrUtil.isNotBlank(bankStatement.getPayBankAccName()),BankStatement::getPayBankAccName,bankStatement.getPayBankAccName()); |
| | | wrapper.like(StrUtil.isNotBlank(bankStatement.getReceiveBankAccName()),BankStatement::getReceiveBankAccName,bankStatement.getReceiveBankAccName()); |
| | |
| | | import com.by4cloud.platformx.business.dto.*; |
| | | import com.by4cloud.platformx.business.entity.Contract; |
| | | import com.by4cloud.platformx.business.entity.PaymentConfirm; |
| | | import com.by4cloud.platformx.business.vo.ContractExportExceVO; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.BaseModel; |
| | | import com.by4cloud.platformx.common.log.annotation.SysLog; |
| | |
| | | |
| | | /** |
| | | * 导出excel 表格 |
| | | * @param contract 查询条件 |
| | | * @param queryDTO 查询条件 |
| | | * @param ids 导出指定ID |
| | | * @return excel 文件流 |
| | | */ |
| | | @ResponseExcel |
| | | @GetMapping("/export") |
| | | @PreAuthorize("@pms.hasPermission('business_contract_export')" ) |
| | | public List<Contract> export(Contract contract,Long[] ids) { |
| | | return contractService.list(Wrappers.lambdaQuery(contract).in(ArrayUtil.isNotEmpty(ids), Contract::getId, ids)); |
| | | public List<ContractExportExceVO> export(ContracQueryDTO queryDTO, Long[] ids) { |
| | | return contractService.export(queryDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 新增合同-石工泵 |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "新增历史合同-石工泵" , description = "新增历史合同-石工泵" ) |
| | | @PostMapping("/addContractSgbHis") |
| | | @SysLog("新增历史合同-石工泵" ) |
| | | public R addContractSgbHis(@RequestBody ContractAddDTO addDTO) { |
| | | return contractService.addContractSgbHis(addDTO); |
| | | } |
| | | // @Operation(summary = "新增历史合同-石工泵" , description = "新增历史合同-石工泵" ) |
| | | // @PostMapping("/addContractSgbHis") |
| | | // @SysLog("新增历史合同-石工泵" ) |
| | | // public R addContractSgbHis(@RequestBody ContractAddDTO addDTO) { |
| | | // return contractService.addContractSgbHis(addDTO); |
| | | // } |
| | | |
| | | /** |
| | | * 新增合同-石工泵 |
| | | * 新增合同-石工泵(合同号新生成) |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "新增合同-石工泵" , description = "新增合同-石工泵" ) |
| | |
| | | @SysLog("新增合同-石工泵" ) |
| | | public R addContractSgb(@RequestBody ContractAddDTO addDTO) { |
| | | return contractService.addContractSgb(addDTO); |
| | | } |
| | | |
| | | /** |
| | | * 新增合同-石工泵(合同号复用) |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "新增合同-石工泵" , description = "新增合同-石工泵" ) |
| | | @PostMapping("/addContractNoSgb") |
| | | @SysLog("新增合同-石工泵(合同号复用)" ) |
| | | public R addContractNoSgb(@RequestBody ContractAddDTO addDTO) { |
| | | return contractService.addContractNoSgb(addDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增合同-石工泵 |
| | | * 新增合同(已推送合同中心) |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "新增历史合同" , description = "新增历史合同" ) |
| | | @Operation(summary = "新增历史合同(已推送合同中心)" , description = "新增历史合同(已推送合同中心)" ) |
| | | @PostMapping("/addContractHis") |
| | | @SysLog("新增历史合同" ) |
| | | public R addContractHis(@RequestBody ContractAddDTO addDTO) { |
| | | return contractService.addContractHis(addDTO); |
| | | } |
| | | |
| | | /** |
| | | * 新增合同(未推送合同中心) |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "新增历史合同(未推送合同中心)" , description = "新增历史合同(未推送合同中心)" ) |
| | | @PostMapping("/addContractHisNoCenter") |
| | | @SysLog("新增历史合同" ) |
| | | public R addContractHisNoCenter(@RequestBody ContractAddDTO addDTO) { |
| | | return contractService.addContractHisNoCenter(addDTO); |
| | | } |
| | | |
| | | /** |
| | | * 更新历史合同(未推送合同中心) |
| | | * @return R |
| | | */ |
| | | @Operation(summary = "更新历史合同(未推送合同中心)" , description = "更新历史合同(未推送合同中心)" ) |
| | | @PostMapping("/updContractHisNoCenter") |
| | | @SysLog("更新历史合同" ) |
| | | public R updContractHisNoCenter(@RequestBody ContractUpdateDTO updateDTO) { |
| | | return contractService.updContractHisNoCenter(updateDTO); |
| | | } |
| | | |
| | | |
| | | @Inner(value = false) |
| | | @GetMapping("/takeEffect/{id}") |
| | | public R takeEffect(@PathVariable("id") Long id) { |
| | | contractService.takeEffect(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | public R selectBipByKey(@PathVariable("dictKey" ) String dictKey) { |
| | | return contractInvoiceService.selectBipByKey(dictKey); |
| | | } |
| | | |
| | | /** |
| | | * 手动通过发票 |
| | | * @return |
| | | */ |
| | | @GetMapping("/takeEffect/{id}" ) |
| | | public R takeEffect(@PathVariable("id" ) Long id) { |
| | | contractInvoiceService.takeEffect(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | } |
| | | //拒绝后回退主表状态 |
| | | if (processInstanceParamDto.getTaskStatus()== TaskStatusEnum.JJ.getCode()){ |
| | | delayOutService.refuseApproval(Long.valueOf(processInstanceParamDto.getParamMap().get("delayOutService")+"")); |
| | | delayOutService.refuseApproval(Long.valueOf(processInstanceParamDto.getParamMap().get("contractId")+"")); |
| | | } |
| | | } |
| | | } |
| | |
| | | public R syncPaymentRecepitHandle(@ParameterObject SyncPaymentRecepitDTO dto){ |
| | | return paymentConfirmService.syncPaymentRecepit(dto); |
| | | } |
| | | |
| | | /** |
| | | * 生成应收数据 |
| | | */ |
| | | @Inner(value = false) |
| | | @GetMapping("genReceivePayment") |
| | | public R genReceivePayment(SyncPaymentRecepitDTO dto){ |
| | | return paymentSlipService.genReceivePayment(dto); |
| | | } |
| | | } |
| | |
| | | public R homeZgsColum() { |
| | | return statisticService.homeZgsColum(); |
| | | } |
| | | |
| | | /** |
| | | * 集团统计页 本日 本月 完成率 本年 完成率 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/zbjtStatistic") |
| | | public R zbjtStatistic() { |
| | | return statisticService.zbjtStatistic(); |
| | | } |
| | | |
| | | /** |
| | | * 集团统计页 本年累计合同额占比 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/zbjtStatisticContractAmount") |
| | | public R zbjtStatisticContractAmount() { |
| | | return statisticService.zbjtStatisticContractAmount(); |
| | | } |
| | | |
| | | /** |
| | | * 集团统计页 指标趋势 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/zbjtIndicatorTrend") |
| | | public R zbjtIndicatorTrend() { |
| | | return statisticService.zbjtIndicatorTrend(); |
| | | } |
| | | |
| | | /** |
| | | * 集团统计页 计划达成 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/zbjtPlanAchieced") |
| | | public R zbjtPlanAchieced() { |
| | | return statisticService.zbjtPlanAchieced(); |
| | | } |
| | | |
| | | /** |
| | | * 集团统计页 应收规模 |
| | | * @return R |
| | | */ |
| | | @PostMapping("/zbjtReceiveScale") |
| | | public R zbjtReceiveScale() { |
| | | return statisticService.zbjtReceiveScale(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.by4cloud.platformx.business.vo.AnnualPlanTotalVo; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import com.by4cloud.platformx.business.entity.AnnualPlan; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface AnnualPlanMapper extends PlatformxBaseMapper<AnnualPlan> { |
| | | |
| | | |
| | | AnnualPlanTotalVo selectPlanYear(@Param("curYear")String curYear,@Param("planType")String planType); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ContractInvoiceMapper extends PlatformxBaseMapper<ContractInvoice> { |
| | | HomeZbjtVo homeZbjt(); |
| | |
| | | Page<ContractInvoicePageVo> pageScope(Page page,@Param("queryDTO") ContractQueryDTO queryDTO, DataScope comp_id); |
| | | |
| | | HomeZgsData homeZgsData(@Param("compId") Long compId,@Param("province") String province); |
| | | |
| | | ZbjtStatisticVo zbjtStatisticByInvoice(); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtIndicatorTrend(@Param("startMon") String startMon,@Param("endMon") String endMon); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtPlanAchieced(@Param("compId")Long compId); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtPlanAchiecedSmj(); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author 28254 |
| | |
| | | "GROUP BY\n" + |
| | | "\tbc.province;") |
| | | List<String> homeZgsColum(@Param("compId") Long compId); |
| | | |
| | | ZbjtStatisticVo zbjtStatisticByContract(); |
| | | |
| | | ZbjtStatisticByContractAmountVo zbjtStatisticByContractAmount(); |
| | | |
| | | ZbjtStatisticByContractAmountProVo zbjtStatisticByContractAmountPro(); |
| | | |
| | | ZbjtStatisticByContractAmountClassVo zbjtStatisticByContractAmountClass(); |
| | | |
| | | ZbjtStatisticByContractAmountSupplyVo zbjtStatisticByContractAmountSupply(); |
| | | |
| | | ZbjtStatisticByContractAmountClassVo zbjtStatisticByContractAmountYS(); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtIndicatorTrend(@Param("startMon") String startMon,@Param("endMon") String endMon); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtPlanAchieced(@Param("compId")Long compId); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtPlanAchiecedSmj(); |
| | | |
| | | List<ContractExportExceVO> export(@Param("queryDTO")ContracQueryDTO queryDTO, DataScope comp_id); |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.mapper; |
| | | |
| | | import com.by4cloud.platformx.business.entity.PaymentReceive; |
| | | import com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface PaymentReceiveMapper extends PlatformxBaseMapper<PaymentReceive> { |
| | | |
| | | |
| | | BigDecimal genReceivePayment(@Param("compId") Long compId); |
| | | |
| | | BigDecimal genReceivePaymentSmj(); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtReceiveScale(@Param("compId") Long compId); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtReceiveScaleSMJ(); |
| | | } |
| | |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | |
| | | import com.by4cloud.platformx.business.vo.HomeOutBoundVo; |
| | | import com.by4cloud.platformx.business.vo.HomePaymentSlipVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZbjtVo; |
| | | import com.by4cloud.platformx.business.vo.HomeZgsVo; |
| | | import com.by4cloud.platformx.business.vo.*; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface PaymentSlipMapper extends PlatformxBaseMapper<PaymentSlip> { |
| | |
| | | HomeZgsVo homeZgs(@Param("compId") Long compId); |
| | | |
| | | Page<HomePaymentSlipVo> pageScope(Page page, @Param("queryDTO") PaymentSlipQueryDTO queryDTO, DataScope comp_id); |
| | | |
| | | ZbjtStatisticVo zbjtStatisticByPayment(); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtIndicatorTrend(@Param("startMon") String startMon,@Param("endMon") String endMon); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtPlanAchieced(@Param("compId")Long compId); |
| | | |
| | | List<ZbjtIndicatorTrendVo> zbjtPlanAchiecedSmj(); |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.service; |
| | | |
| | | import com.by4cloud.platformx.business.entity.AnnualPlan; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface AnnualPlanService extends IIService<AnnualPlan> { |
| | | |
| | | R add(AnnualPlan annualPlan); |
| | | } |
| | |
| | | import com.by4cloud.platformx.business.dto.*; |
| | | import com.by4cloud.platformx.business.entity.Contract; |
| | | import com.by4cloud.platformx.business.vo.ContractDetailVo; |
| | | import com.by4cloud.platformx.business.vo.ContractExportExceVO; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 28254 |
| | |
| | | R associationPartyC(ContractAssociationPartyCyDTO associationPartyCyDTO); |
| | | |
| | | R getInvoiceObj(Long id); |
| | | |
| | | List<ContractExportExceVO> export(ContracQueryDTO queryDTO); |
| | | |
| | | R addContractHisNoCenter(ContractAddDTO addDTO); |
| | | |
| | | R updContractHisNoCenter(ContractUpdateDTO updateDTO); |
| | | |
| | | R addContractNoSgb(ContractAddDTO addDTO); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.SyncPaymentRecepitDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.mybatis.IIService; |
| | | |
| | | public interface PaymentSlipService extends IIService<PaymentSlip> { |
| | | |
| | | Page pageScope(Page page, PaymentSlipQueryDTO queryDTO); |
| | | |
| | | R genReceivePayment(SyncPaymentRecepitDTO dto); |
| | | } |
| | |
| | | R homeOverdueHis(HomeQueryDTO queryDTO); |
| | | |
| | | R homeZgsColum(); |
| | | |
| | | R zbjtStatistic(); |
| | | |
| | | R zbjtStatisticContractAmount(); |
| | | |
| | | R zbjtIndicatorTrend(); |
| | | |
| | | R zbjtPlanAchieced(); |
| | | |
| | | R zbjtReceiveScale(); |
| | | } |
| New file |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.entity.AnnualPlan; |
| | | import com.by4cloud.platformx.business.mapper.AnnualPlanMapper; |
| | | import com.by4cloud.platformx.business.service.AnnualPlanService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.security.util.SecurityUtils; |
| | | import org.springframework.stereotype.Service; |
| | | /** |
| | | * 单位计划 |
| | | * |
| | | * @author platformx |
| | | * @date 2026-10-09 10:31:46 |
| | | */ |
| | | @Service |
| | | public class AnnualPlanServiceImpl extends ServiceImpl<AnnualPlanMapper, AnnualPlan> implements AnnualPlanService { |
| | | |
| | | @Override |
| | | public R add(AnnualPlan entity) { |
| | | AnnualPlan plan = baseMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery().eq(AnnualPlan::getPlanYear,entity.getPlanYear()) |
| | | .eq(AnnualPlan::getPlanType,entity.getPlanType()).eq(AnnualPlan::getCompId, SecurityUtils.getUser().getCompId()) |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNotNull(plan)){ |
| | | return R.failed(entity.getPlanYear()+"计划类型已存在"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | freeChId.put("JT04", bipVo.getItemList().get(0).getHsjylx());//核算交易类型 0101 集团外部 01020301 三级分子公司间 01020302 三级分公司与子子公司之间 |
| | | freeChId.put("JT06", bipVo.getItemList().get(0).getKxmx());//款项明细 |
| | | freeChId.put("JT12", bipVo.getItemList().get(0).getCpwlfl());//产品物料分类 |
| | | freeChId.put("JT32", bipVo.getItemList().get(0).getZyys());//作业要素 |
| | | freeChId.put("zzbkfl", bipVo.getItemList().get(0).getBkfl());//板块分类 |
| | | |
| | | item.put("freeChId", freeChId); |
| | | |
| | |
| | | data.put("bodyItem", bodyItem); |
| | | JSONObject datafreeChId = new JSONObject(); |
| | | datafreeChId.put("YSYF_SFZY", bipVo.getSfzy());//是否主营 |
| | | datafreeChId.put("fk_035", bipVo.getSffz());//是否入负债科目 |
| | | datafreeChId.put("fk_038", bipVo.getPzzdr());//凭证制单人 |
| | | datafreeChId.put("YSYF_08", bipVo.getSfnbwl());//是否内部往来 |
| | | datafreeChId.put("YSYF24", bipVo.getSfjyjs());//是否简易计税 |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | .forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getPriceAndTax(); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | |
| | |
| | | invoiceItemVoList.stream().filter(invoiceItem -> invoiceItem.getUnitPrice().compareTo(new BigDecimal("0")) > 0).forEach(invoiceItemVo -> { |
| | | // for (InvoiceItemVo invoiceItemVo:invoiceItemVoList) { |
| | | BigDecimal itemPrice = invoiceItemVo.getUnitPrice().multiply(invoiceItemVo.getQuantity()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("100").add(invoiceItemVo.getTaxRate()), 2, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate()); |
| | | BigDecimal itemPriceTax = itemPrice.divide(new BigDecimal("1").add(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))), 10, RoundingMode.HALF_UP).multiply(invoiceItemVo.getTaxRate().divide(new BigDecimal("100"))).setScale(2,RoundingMode.HALF_UP); |
| | | invoiceItemVo.setPriceTax(itemPriceTax); |
| | | invoiceItemVo.setPriceNoTax(itemPrice.subtract(itemPriceTax)); |
| | | invoiceItemVo.setPriceAndTax(itemPrice); |
| | |
| | | jsonObject.put("redInvoiceLabel", "01"); |
| | | jsonObject.put("invoiceSource", "2"); |
| | | jsonObject.put("originalInvoiceNo", blueInvoice.getInvoiceNo()); |
| | | jsonObject.put("autoIssueSwitch", "Y"); |
| | | GenInvoiceInfoVo vo = BeanUtil.copyProperties(JSONObject.parseObject(redInvoice.getInvoicePreview()), GenInvoiceInfoVo.class); |
| | | JSONArray invoiceDetailsList = new JSONArray(); |
| | | Integer lineNo = 1; |
| | |
| | | public void handleBeforeRemain(PaymentConfirm currentConfim, Contract contract) { |
| | | //客户付款完成合同 |
| | | List<Contract> customerCompleteContractList = contractMapper.selectList(Wrappers.<Contract>lambdaQuery().eq(Contract::getPartyAId, contract.getPartyAId()) |
| | | .eq(Contract::getPartyBId, SecurityUtils.getUser().getCompId()).eq(Contract::getContractStatus, 3)); |
| | | .eq(Contract::getPartyBId, contract.getCompId()).eq(Contract::getContractStatus, 3)); |
| | | if (CollUtil.isNotEmpty(customerCompleteContractList)) { |
| | | List<BigDecimal> outAmountList = new ArrayList<>(); |
| | | for (Contract completeContract : customerCompleteContractList) { |
| | |
| | | outConfirm.setTransationAmount(contractLastConfirm.getTotalAmount()); |
| | | outConfirm.setTotalAmount(new BigDecimal("0")); |
| | | if (contract.getContractNo().startsWith("ZB-")) { |
| | | outConfirm.setCompId(contract.getCompId()); |
| | | paymentConfirmMapper.insert(outConfirm); |
| | | } |
| | | outAmountList.add(contractLastConfirm.getTotalAmount()); |
| | |
| | | inConfirm.setReceivableAmount(inConfirm.getTotalAmount().multiply(new BigDecimal("-1"))); |
| | | } |
| | | if (contract.getContractNo().startsWith("ZB-")) { |
| | | inConfirm.setCompId(contract.getCompId()); |
| | | paymentConfirmMapper.insert(inConfirm); |
| | | } |
| | | contract.setPaidAmount(currentSum); |
| | |
| | | |
| | | } |
| | | if ((StrUtil.equals(contract.getPartyBId() + "", smj) || |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) && StrUtil.isNotEmpty(smjErp)) { |
| | | StrUtil.equals(contract.getPartyBId() + "", smjhw)) && StrUtil.isNotEmpty(smjErp)) { |
| | | request.put("customerCode", customer.getErpCompanyCode()); |
| | | request.put("currencyId", "RMB"); |
| | | request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN)); |
| | |
| | | return; |
| | | } |
| | | currentConfim.setTotalAmount(currentConfim.getTransationAmount().multiply(new BigDecimal("-1"))); |
| | | currentConfim.setCompId(contract.getCompId()); |
| | | paymentConfirmMapper.insert(currentConfim); |
| | | processService.handleBeforeRemain(currentConfim,contract); |
| | | } |
| | |
| | | } |
| | | Contract contract = BeanUtil.copyProperties(updateDTO, Contract.class); |
| | | contract.setId(contractOld.getId()); |
| | | contract.setContractNo(contractOld.getContractNo()); |
| | | if (ObjUtil.isNotNull(updateDTO.getDeliveryCycle())) { |
| | | contract.setExpirationDate(DateUtil.offsetDay(updateDTO.getSignDate(), updateDTO.getDeliveryCycle())); |
| | | } |
| | |
| | | if (applyResp.getString("code").equals("00")) { |
| | | contract.setCenterPushFlag("1"); |
| | | baseMapper.updateById(contract); |
| | | //应收 |
| | | takeEffect(contract.getId()); |
| | | return R.ok(); |
| | | } |
| | | log.error("工业泵推送——推送合同中心审核失败,原因为:{}",applyResp.getString("msg")); |
| | |
| | | continue; |
| | | } |
| | | BusinessCustomer bc = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery() |
| | | .eq(BusinessCustomer::getErpCompanyCode, contractExceVO.getBcErpCode())); |
| | | .eq(BusinessCustomer::getCompanyName, contractExceVO.getBcErpCode()) |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNull(bc)) { |
| | | Map<String, String> map = new HashMap<String, String>(); |
| | | map.put("lineNum", "第" + (i + 1) + "行"); |
| | | map.put("errors", "客户erp编码不存在"); |
| | | map.put("errors", "客户名称不存在"); |
| | | errList.add(map); |
| | | continue; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R syncContractStatus(SyncContractStatusDTO dto) { |
| | | log.info("合同审批结果同步,合同编号:{},审批结果:{}",dto.getContractNumber(),dto.getStatus()); |
| | | if (StrUtil.isBlank(dto.getFd_bizId())){ |
| | | return R.failed("数据ID不能为空"); |
| | | } |
| | | log.info("合同审批结果同步,合同数据ID:{},审批结果:{}",dto.getFd_bizId(),dto.getStatus()); |
| | | if (StrUtil.isBlank(dto.getStatus())){ |
| | | return R.failed("审批状态不能为空"); |
| | | } |
| | |
| | | return R.failed("审批时间不能为空"); |
| | | } |
| | | Contract contract = baseMapper.selectById(dto.getFd_bizId()); |
| | | |
| | | if(ObjUtil.isNull(contract)){ |
| | | return R.failed("数据ID异常"); |
| | | } |
| | | if (StrUtil.equals(dto.getStatus(),"1")){ |
| | | new Thread(() -> { |
| | | takeEffect(contract.getId()); |
| | | saveContractApproval(contract,dto); |
| | | }).start(); |
| | | } |
| | | if (StrUtil.equals(dto.getStatus(),"2")){ |
| | | new Thread(() -> { |
| | | refuseApproval(contract.getId()); |
| | | saveContractApproval(contract,dto); |
| | | }).start(); |
| | | } |
| | | if (StrUtil.equals(dto.getStatus(),"3")||StrUtil.equals(dto.getStatus(),"4")){ |
| | | new Thread(() -> { |
| | | contract.setContractStatus(3); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | saveContractApproval(contract,dto); |
| | | }).start(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public R addContractHis(ContractAddDTO addDTO) { |
| | | Contract contract1 = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo,addDTO.getContractNo()) |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNotNull(contract1)){ |
| | | return R.failed("合同编号已存在"); |
| | | } |
| | | Contract contract = BeanUtil.copyProperties(addDTO, Contract.class); |
| | | contract.setPartyBId(SecurityUtils.getUser().getCompId()); |
| | | contract.setPartyB(SecurityUtils.getUser().getCompName()); |
| | |
| | | objVo.setLinkPartyC(selectVoList); |
| | | return R.ok(objVo); |
| | | } |
| | | |
| | | @Override |
| | | public List<ContractExportExceVO> export(ContracQueryDTO queryDTO) { |
| | | return baseMapper.export(queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | |
| | | @Override |
| | | public R addContractHisNoCenter(ContractAddDTO addDTO) { |
| | | Contract contract1 = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo,addDTO.getContractNo()) |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNotNull(contract1)){ |
| | | return R.failed("合同编号已存在"); |
| | | } |
| | | Contract contract = BeanUtil.copyProperties(addDTO, Contract.class); |
| | | contract.setPartyBId(SecurityUtils.getUser().getCompId()); |
| | | contract.setPartyB(SecurityUtils.getUser().getCompName()); |
| | | if (StrUtil.isEmpty(addDTO.getPartyA())) { |
| | | BusinessCustomer bc = businessCustomerMapper.selectById(addDTO.getPartyAId()); |
| | | if (ObjUtil.isNotNull(bc)) { |
| | | contract.setPartyA(bc.getCompanyName()); |
| | | } |
| | | if (!StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb) && StrUtil.isEmpty(bc.getErpCompanyCode()) |
| | | && StrUtil.isEmpty(bc.getCreditCode())) { |
| | | return R.failed("请完善客户ERP编码或组织机构代码"); |
| | | } |
| | | } |
| | | |
| | | contract.setBillingStatus("1"); |
| | | contract.setErpPushFlag("1"); |
| | | contract.setCenterPushFlag("0"); |
| | | contract.setContractStatus(0); |
| | | contract.setNickName(SecurityUtils.getUser().getNickname()); |
| | | contract.setNextScheduleName("发货前"); |
| | | if (ObjUtil.isNotNull(addDTO.getDeliveryCycle())) { |
| | | contract.setExpirationDate(DateUtil.offsetDay(addDTO.getSignDate(), addDTO.getDeliveryCycle())); |
| | | } |
| | | |
| | | if (CollUtil.isEmpty(addDTO.getContractSubjectMatter())) { |
| | | return R.failed("标的物不能为空"); |
| | | } |
| | | |
| | | baseMapper.insert(contract); |
| | | |
| | | if (CollUtil.isNotEmpty(addDTO.getContractSubjectMatter())) { |
| | | addDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> { |
| | | ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class); |
| | | subjectMatter.setContractId(contract.getId()); |
| | | subjectMatter.setDeliveredQuantity(ObjUtil.isNull(contractSubjectMatterAddDTO.getDeliveredQuantity()) |
| | | ? new BigDecimal("0") : contractSubjectMatterAddDTO.getDeliveredQuantity()); |
| | | subjectMatter.setRemainingQuantity(subjectMatter.getQuantity().subtract(subjectMatter.getDeliveredQuantity())); |
| | | subjectMatter.setDeliveryStatus(subjectMatter.getRemainingQuantity().compareTo(subjectMatter.getQuantity()) == 0 ? 0 |
| | | : subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0")) > 0 ? 1 : 2); |
| | | subjectMatter.setLineNo(ItemGeneratorUtil.nextId()); |
| | | contractSubjectMatterMapper.insert(subjectMatter); |
| | | }); |
| | | List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery() |
| | | .eq(ContractSubjectMatter::getContractId,contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus,2)); |
| | | if (CollUtil.isEmpty(subjectMatterList)){ |
| | | contract.setNextScheduleName("货到签收"); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | } |
| | | BigDecimal remainAmount = ObjUtil.isNotNull(contract.getPaidAmount()) ? contract.getPaidAmount() : new BigDecimal("0"); |
| | | if (CollUtil.isNotEmpty(addDTO.getContractPaymentSchedule())) { |
| | | |
| | | for (int j = 0; j < addDTO.getContractPaymentSchedule().size(); j++) { |
| | | ContractPaymentSchedule schedule = new ContractPaymentSchedule(); |
| | | schedule.setStageName(addDTO.getContractPaymentSchedule().get(j).getStageName()); |
| | | schedule.setContractId(contract.getId()); |
| | | schedule.setPaymentRatio(addDTO.getContractPaymentSchedule().get(j).getPaymentRatio()); |
| | | schedule.setAgreedDays(addDTO.getContractPaymentSchedule().get(j).getAgreedDays()); |
| | | schedule.setPlannedAmount(contract.getAmount().multiply(schedule.getPaymentRatio()) |
| | | .divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP)); |
| | | schedule.setPaymentStatus(0); |
| | | schedule.setStageOrder(j + 1); |
| | | if (remainAmount.compareTo(new BigDecimal("0")) > 0 && schedule.getPlannedAmount().compareTo(new BigDecimal("0")) > 0) { |
| | | remainAmount = remainAmount.subtract(schedule.getPlannedAmount()); |
| | | if (remainAmount.compareTo(new BigDecimal("0")) >= 0) { |
| | | schedule.setPaymentStatus(2); |
| | | schedule.setActualAmount(schedule.getPlannedAmount()); |
| | | } |
| | | if (remainAmount.compareTo(new BigDecimal("0")) < 0) { |
| | | schedule.setPaymentStatus(1); |
| | | schedule.setActualAmount(schedule.getPlannedAmount().add(remainAmount)); |
| | | } |
| | | } |
| | | contractPaymentScheduleMapper.insert(schedule); |
| | | if (addDTO.getContractPaymentSchedule().get(j).getStageName().equals("货到签收")) { |
| | | contract.setArrivalScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | if (addDTO.getContractPaymentSchedule().get(j).getStageName().equals("调试完成或验收")) { |
| | | contract.setAcceptScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | if (addDTO.getContractPaymentSchedule().get(j).getStageName().equals("质保金")) { |
| | | contract.setWarrantyScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (contract.getPaidAmount().compareTo(contract.getAmount())==0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){ |
| | | contract.setContractStatus(3); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R updContractHisNoCenter(ContractUpdateDTO updateDTO) { |
| | | |
| | | Contract contract = BeanUtil.copyProperties(updateDTO, Contract.class); |
| | | contract.setPartyBId(SecurityUtils.getUser().getCompId()); |
| | | contract.setPartyB(SecurityUtils.getUser().getCompName()); |
| | | contract.setBillingStatus("1"); |
| | | contract.setErpPushFlag("1"); |
| | | contract.setCenterPushFlag("0"); |
| | | contract.setContractStatus(0); |
| | | contract.setNickName(SecurityUtils.getUser().getNickname()); |
| | | contract.setContractCategory("his_no_center"); |
| | | contract.setNextScheduleName("发货前"); |
| | | if (ObjUtil.isNotNull(updateDTO.getDeliveryCycle())) { |
| | | contract.setExpirationDate(DateUtil.offsetDay(updateDTO.getSignDate(), updateDTO.getDeliveryCycle())); |
| | | } |
| | | |
| | | if (CollUtil.isEmpty(updateDTO.getContractSubjectMatter())) { |
| | | return R.failed("标的物不能为空"); |
| | | } |
| | | |
| | | baseMapper.insert(contract); |
| | | |
| | | if (CollUtil.isNotEmpty(updateDTO.getContractSubjectMatter())) { |
| | | contractSubjectMatterMapper.delete(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId, contract.getId())); |
| | | |
| | | updateDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> { |
| | | ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class); |
| | | subjectMatter.setContractId(contract.getId()); |
| | | subjectMatter.setDeliveredQuantity(ObjUtil.isNull(contractSubjectMatterAddDTO.getDeliveredQuantity()) |
| | | ? new BigDecimal("0") : contractSubjectMatterAddDTO.getDeliveredQuantity()); |
| | | subjectMatter.setRemainingQuantity(subjectMatter.getQuantity().subtract(subjectMatter.getDeliveredQuantity())); |
| | | subjectMatter.setDeliveryStatus(subjectMatter.getRemainingQuantity().compareTo(subjectMatter.getQuantity()) == 0 ? 0 |
| | | : subjectMatter.getRemainingQuantity().compareTo(new BigDecimal("0")) > 0 ? 1 : 2); |
| | | subjectMatter.setLineNo(ItemGeneratorUtil.nextId()); |
| | | contractSubjectMatterMapper.insert(subjectMatter); |
| | | }); |
| | | List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery() |
| | | .eq(ContractSubjectMatter::getContractId,contract.getId()).ne(ContractSubjectMatter::getDeliveryStatus,2)); |
| | | if (CollUtil.isEmpty(subjectMatterList)){ |
| | | contract.setNextScheduleName("货到签收"); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | } |
| | | BigDecimal remainAmount = ObjUtil.isNotNull(contract.getPaidAmount()) ? contract.getPaidAmount() : new BigDecimal("0"); |
| | | if (CollUtil.isNotEmpty(updateDTO.getContractPaymentSchedule())) { |
| | | contractPaymentScheduleMapper.delete(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contract.getId())); |
| | | |
| | | for (int j = 0; j < updateDTO.getContractPaymentSchedule().size(); j++) { |
| | | ContractPaymentSchedule schedule = new ContractPaymentSchedule(); |
| | | schedule.setStageName(updateDTO.getContractPaymentSchedule().get(j).getStageName()); |
| | | schedule.setContractId(contract.getId()); |
| | | schedule.setPaymentRatio(updateDTO.getContractPaymentSchedule().get(j).getPaymentRatio()); |
| | | schedule.setAgreedDays(updateDTO.getContractPaymentSchedule().get(j).getAgreedDays()); |
| | | schedule.setPlannedAmount(contract.getAmount().multiply(schedule.getPaymentRatio()) |
| | | .divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP)); |
| | | schedule.setPaymentStatus(0); |
| | | schedule.setStageOrder(j + 1); |
| | | if (remainAmount.compareTo(new BigDecimal("0")) > 0 && schedule.getPlannedAmount().compareTo(new BigDecimal("0")) > 0) { |
| | | remainAmount = remainAmount.subtract(schedule.getPlannedAmount()); |
| | | if (remainAmount.compareTo(new BigDecimal("0")) >= 0) { |
| | | schedule.setPaymentStatus(2); |
| | | schedule.setActualAmount(schedule.getPlannedAmount()); |
| | | } |
| | | if (remainAmount.compareTo(new BigDecimal("0")) < 0) { |
| | | schedule.setPaymentStatus(1); |
| | | schedule.setActualAmount(schedule.getPlannedAmount().add(remainAmount)); |
| | | } |
| | | } |
| | | contractPaymentScheduleMapper.insert(schedule); |
| | | if (updateDTO.getContractPaymentSchedule().get(j).getStageName().equals("货到签收")) { |
| | | contract.setArrivalScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | if (updateDTO.getContractPaymentSchedule().get(j).getStageName().equals("调试完成或验收")) { |
| | | contract.setAcceptScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | if (updateDTO.getContractPaymentSchedule().get(j).getStageName().equals("质保金")) { |
| | | contract.setWarrantyScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (contract.getPaidAmount().compareTo(contract.getAmount())==0&&contract.getBillingAmout().compareTo(contract.getAmount())==0){ |
| | | contract.setContractStatus(3); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R addContractNoSgb(ContractAddDTO addDTO) { |
| | | Contract contractOld = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getDataId, addDTO.getDataId()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(contractOld)) { |
| | | return R.failed("合同数据ID:{}已存在,不能新增重复数据", addDTO.getDataId()); |
| | | } |
| | | if (CollUtil.isEmpty(addDTO.getContractSubjectMatter())) { |
| | | return R.failed("请添加标的物"); |
| | | } |
| | | if (CollUtil.isEmpty(addDTO.getContractPaymentSchedule())) { |
| | | return R.failed("请添加付款阶段或付款阶段缺少"); |
| | | } |
| | | if (!isValidPaymentStages(addDTO.getContractPaymentSchedule())) { |
| | | return R.failed("付款阶段信息异常"); |
| | | } |
| | | if (addDTO.getContractPaymentSchedule().stream().map(item -> item.getPaymentRatio()).reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | .compareTo(new BigDecimal("100.00")) != 0) { |
| | | return R.failed("付款阶段比例异常"); |
| | | } |
| | | Contract contract = BeanUtil.copyProperties(addDTO, Contract.class); |
| | | contract.setPartyBId(SecurityUtils.getUser().getCompId()); |
| | | contract.setPartyB(SecurityUtils.getUser().getCompName()); |
| | | contract.setContractStatus(2); |
| | | contract.setPaidAmount(new BigDecimal("0")); |
| | | contract.setBillingStatus("1"); |
| | | contract.setErpPushFlag("1"); |
| | | contract.setCenterPushFlag("0"); |
| | | contract.setBillingAmout(new BigDecimal("0")); |
| | | |
| | | BusinessCustomer bc = businessCustomerMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery().eq(BusinessCustomer::getErpCompanyCode, |
| | | addDTO.getPartyACode()).last("limit 1")); |
| | | if (ObjUtil.isNull(bc)) { |
| | | return R.failed("erp客户编码不存在"); |
| | | } |
| | | contract.setPartyAId(bc.getId()); |
| | | contract.setPartyA(bc.getCompanyName()); |
| | | if (ObjUtil.isNotNull(addDTO.getDeliveryCycle())) { |
| | | contract.setExpirationDate(DateUtil.offsetDay(addDTO.getSignDate(), addDTO.getDeliveryCycle())); |
| | | } |
| | | if (ObjUtil.isNotNull(contract.getSignDate()) && ObjUtil.isNotNull(contract.getExpirationDate())) { |
| | | Long bd = DateUtil.betweenDay(contract.getExpirationDate(), contract.getSignDate(), true); |
| | | contract.setDeliveryCycle(bd.intValue()); |
| | | } |
| | | contract.setContractNo(generateGYBContractNo()); |
| | | |
| | | if (!StrUtil.equals(addDTO.getContractCategory(), "water_house")) { |
| | | // 假设 list 是你的 List<ContractSubjectMatterAddDTO> |
| | | Optional<ContractSubjectMatterAddDTO> maxDateObj = addDTO.getContractSubjectMatter().stream() |
| | | .filter(item -> item.getPlannedDeliveryDate() != null) // 过滤掉日期为空的项,避免 NullPointerException |
| | | .max(Comparator.comparing(ContractSubjectMatterAddDTO::getPlannedDeliveryDate)); |
| | | |
| | | if (maxDateObj.isPresent()) { |
| | | contract.setExpirationDate(maxDateObj.get().getPlannedDeliveryDate()); |
| | | |
| | | } |
| | | } |
| | | baseMapper.insert(contract); |
| | | |
| | | if (CollUtil.isNotEmpty(addDTO.getContractSubjectMatter())) { |
| | | addDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> { |
| | | ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class); |
| | | subjectMatter.setContractId(contract.getId()); |
| | | if (StrUtil.isNotBlank(subjectMatter.getMaterialCode())){ |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode()) |
| | | .last("limit 1")); |
| | | if (ObjUtil.isNotNull(product)){ |
| | | subjectMatter.setMaterialInternalName(product.getId()+""); |
| | | } |
| | | if (ObjUtil.isNull(product)){ |
| | | product = new Product(); |
| | | product.setParentId(2101559148831944705L); |
| | | product.setProductName(subjectMatter.getMaterialInternalName()); |
| | | product.setErpCode(subjectMatter.getMaterialCode()); |
| | | product.setProductType(subjectMatter.getSpecification()); |
| | | product.setTaxCode("1090117040000000000"); |
| | | product.setTaxClass("泵"); |
| | | productMapper.insert(product); |
| | | subjectMatter.setMaterialInternalName(product.getId()+""); |
| | | } |
| | | } |
| | | subjectMatter.setDeliveredQuantity(new BigDecimal("0")); |
| | | subjectMatter.setDeliveryStatus(0); |
| | | subjectMatter.setTotalAmount(contractSubjectMatterAddDTO.getQuantity().multiply(contractSubjectMatterAddDTO.getUnitPrice())); |
| | | contractSubjectMatterMapper.insert(subjectMatter); |
| | | //水电类必须有初次表号 |
| | | if (StrUtil.isNotEmpty(contractSubjectMatterAddDTO.getMeterReadCode()) && |
| | | ObjUtil.isNotNull(contractSubjectMatterAddDTO.getMeterReadNum())) { |
| | | MeterReadRecord record = BeanUtil.copyProperties(contractSubjectMatterAddDTO, MeterReadRecord.class, "id"); |
| | | record.setContractId(contract.getId()); |
| | | record.setMatterId(subjectMatter.getId()); |
| | | record.setContractName(contract.getContractName()); |
| | | record.setBusGuestId(contract.getPartyAId()); |
| | | record.setBusGuestName(contract.getPartyA()); |
| | | record.setMeterReadTime(new Date()); |
| | | meterReadRecordMapper.insert(record); |
| | | } |
| | | if (StrUtil.isNotEmpty(addDTO.getContractCategory()) && StrUtil.equals(addDTO.getContractCategory(), "ymjcg") |
| | | && ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate()) && ObjUtil.isNotNull(contract.getExpirationDate()) |
| | | && DateUtil.compare(contract.getExpirationDate(), subjectMatter.getPlannedDeliveryDate()) > 0) { |
| | | contract.setExpirationDate(subjectMatter.getPlannedDeliveryDate()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | if (CollUtil.isNotEmpty(addDTO.getContractPaymentSchedule())) { |
| | | AtomicInteger index = new AtomicInteger(1); |
| | | addDTO.getContractPaymentSchedule().stream().forEach(contractPaymentScheduleAddDTO -> { |
| | | int currentIndex = index.getAndIncrement(); |
| | | ContractPaymentSchedule schedule = BeanUtil.copyProperties(contractPaymentScheduleAddDTO, ContractPaymentSchedule.class); |
| | | if (contractPaymentScheduleAddDTO.getStageName().equals("合同签订")) { |
| | | schedule.setEffectiveEndDate(DateUtil.offsetDay(contract.getSignDate(), contractPaymentScheduleAddDTO.getAgreedDays())); |
| | | } |
| | | if (ObjUtil.isNotNull(schedule.getEffectiveDate())) { |
| | | if (schedule.getEffectiveDate().before(DateUtil.date())) { |
| | | schedule.setFulfillmentStatus(1); |
| | | } else { |
| | | schedule.setFulfillmentStatus(0); |
| | | } |
| | | } |
| | | if (contractPaymentScheduleAddDTO.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) { |
| | | schedule.setPaymentStatus(0); |
| | | } else { |
| | | schedule.setPaymentStatus(3); |
| | | } |
| | | schedule.setContractId(contract.getId()); |
| | | schedule.setContractName(contract.getContractName()); |
| | | schedule.setPlannedAmount(contract.getAmount().multiply(schedule.getPaymentRatio().divide(new BigDecimal("100")))); |
| | | schedule.setStageOrder(currentIndex); |
| | | contractPaymentScheduleMapper.insert(schedule); |
| | | if (contractPaymentScheduleAddDTO.getStageName().equals("货到签收")) { |
| | | contract.setArrivalScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | if (contractPaymentScheduleAddDTO.getStageName().equals("调试完成或验收")) { |
| | | contract.setAcceptScheduleId(schedule.getId()); |
| | | baseMapper.updateById(contract); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | //推送合同中心 |
| | | return R.ok(contract.getContractNo()); |
| | | } |
| | | } |
| | |
| | | |
| | | Product one = productMapper.selectOne(Wrappers.<Product>lambdaQuery() |
| | | .eq(Product::getErpCode, item.getMaterialCode()) |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId())); |
| | | .eq(Product::getCompId, SecurityUtils.getUser().getCompId()) |
| | | .last("limit 1")); |
| | | |
| | | if (one == null) { |
| | | errorMsg.add(item.getMaterialCode()+"erp编码不存在"); |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.business.dto.PaymentSlipQueryDTO; |
| | | import com.by4cloud.platformx.business.dto.SyncPaymentRecepitDTO; |
| | | import com.by4cloud.platformx.business.entity.PaymentReceive; |
| | | import com.by4cloud.platformx.business.entity.PaymentSlip; |
| | | import com.by4cloud.platformx.business.mapper.PaymentReceiveMapper; |
| | | import com.by4cloud.platformx.business.mapper.PaymentSlipMapper; |
| | | import com.by4cloud.platformx.business.service.PaymentSlipService; |
| | | import com.by4cloud.platformx.common.core.util.R; |
| | | import com.by4cloud.platformx.common.data.datascope.DataScope; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | public class PaymentSlipServiceImpl extends ServiceImpl<PaymentSlipMapper, PaymentSlip> implements PaymentSlipService { |
| | | |
| | | private final PaymentReceiveMapper paymentReceiveMapper; |
| | | |
| | | @Override |
| | | public Page pageScope(Page page, PaymentSlipQueryDTO queryDTO) { |
| | | return baseMapper.pageScope(page,queryDTO, DataScope.of("comp_id")); |
| | | } |
| | | |
| | | @Override |
| | | public R genReceivePayment(SyncPaymentRecepitDTO dto) { |
| | | //装备 |
| | | BigDecimal reveiceZb = paymentReceiveMapper.genReceivePayment(null); |
| | | saveReceive(DateUtil.offsetDay(new Date(),-1),reveiceZb,null); |
| | | //石煤机 |
| | | BigDecimal reveiceSmj = paymentReceiveMapper.genReceivePaymentSmj(); |
| | | saveReceive(DateUtil.offsetDay(new Date(),-1),reveiceSmj,2089995177814495234L); |
| | | //石工泵 |
| | | BigDecimal reveiceSgb = paymentReceiveMapper.genReceivePayment(2056556196124250113L); |
| | | saveReceive(DateUtil.offsetDay(new Date(),-1),reveiceSgb,2056556196124250113L); |
| | | //通方公司 |
| | | BigDecimal reveiceTfgs = paymentReceiveMapper.genReceivePayment(2056556421857497090L); |
| | | saveReceive(DateUtil.offsetDay(new Date(),-1),reveiceTfgs,2056556421857497090L); |
| | | //机械厂 |
| | | BigDecimal reveiceJxc = paymentReceiveMapper.genReceivePayment(2056556317461270529L); |
| | | saveReceive(DateUtil.offsetDay(new Date(),-1),reveiceJxc,2056556317461270529L); |
| | | //一煤机 |
| | | BigDecimal reveiceYmj = paymentReceiveMapper.genReceivePayment(2056556535640576002L); |
| | | saveReceive(DateUtil.offsetDay(new Date(),-1),reveiceYmj,2056556535640576002L); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private void saveReceive(Date offsetDay, BigDecimal reveiceZb,Long compId) { |
| | | PaymentReceive receive = new PaymentReceive(); |
| | | receive.setReceiveDate(offsetDay); |
| | | receive.setCompId(compId); |
| | | receive.setReceiveAmount(reveiceZb); |
| | | paymentReceiveMapper.insert(receive); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | product.setErpCode(addDTO.getErpTypeCode()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,addDTO.getTaxCode()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | product.setTaxClass(taxCode.getMc()); |
| | | product.setTaxClass(taxCode.getSphwjc()); |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | |
| | | product.setErpCode(addDTO.getErpCode()); |
| | | TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,addDTO.getTaxCode()).last("limit 1")); |
| | | if (ObjUtil.isNotNull(taxCode)){ |
| | | product.setTaxClass(taxCode.getMc()); |
| | | product.setTaxClass(taxCode.getSphwjc()); |
| | | product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); |
| | | } |
| | | baseMapper.insert(product); |
| | |
| | | package com.by4cloud.platformx.business.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.by4cloud.platformx.admin.api.entity.SysDept; |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | | |
| | |
| | | private final ContractInvoiceMapper contractInvoiceMapper; |
| | | private final CurrentOverdueMapper currentOverdueMapper; |
| | | private final HistoryOverdueMapper historyOverdueMapper; |
| | | private final AnnualPlanMapper annualPlanMapper; |
| | | private final PaymentReceiveMapper paymentReceiveMapper; |
| | | private final RemoteDeptService remoteDeptService; |
| | | private final RemoteDictService remoteDictService; |
| | | |
| | |
| | | if (CollUtil.isNotEmpty(contractProvinces)){ |
| | | contractProvinces.stream().forEach(province->{ |
| | | HomeZgsData homeZgsData = contractInvoiceMapper.homeZgsData(SecurityUtils.getUser().getCompId(),province); |
| | | if (ObjUtil.isNotNull(homeZgsData)) { |
| | | SysDictItem result = items.stream() |
| | | .filter(item -> item != null && province.equals(item.getItemValue())) |
| | | .findFirst() |
| | |
| | | homeZgsData.setProvinceName(result.getLabel()); |
| | | } |
| | | list.add(homeZgsData); |
| | | } |
| | | }); |
| | | return R.ok(list); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R zbjtStatistic() { |
| | | List<ZbjtStatisticVo> statisticVoList = new ArrayList<>(); |
| | | String curYear = DateUtil.year(new Date())+""; |
| | | String curMonth = DateUtil.month(new Date())+""; |
| | | //合同 |
| | | ZbjtStatisticVo htVo = contractMapper.zbjtStatisticByContract(); |
| | | AnnualPlanTotalVo planListHt = annualPlanMapper.selectPlanYear(curYear,"1"); |
| | | if (ObjUtil.isNotNull(htVo)&&ObjUtil.isNotNull(planListHt)){ |
| | | BigDecimal monAmount = planListHt.getMonthAmount(curMonth); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | htVo.setBmwc(new BigDecimal(htVo.getBm()).multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | BigDecimal yearAmount = planListHt.getTotalAmount(); |
| | | if (ObjUtil.isNotNull(yearAmount)&&yearAmount.compareTo(new BigDecimal("0"))>0){ |
| | | htVo.setBnwc(new BigDecimal(htVo.getBn()).multiply(new BigDecimal("100")).divide(yearAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | } |
| | | statisticVoList.add(htVo); |
| | | //开票 |
| | | ZbjtStatisticVo kpVo = contractInvoiceMapper.zbjtStatisticByInvoice(); |
| | | AnnualPlanTotalVo planListFP = annualPlanMapper.selectPlanYear(curYear,"2"); |
| | | if (ObjUtil.isNotNull(kpVo)&&ObjUtil.isNotNull(planListFP)){ |
| | | BigDecimal monAmount = planListFP.getMonthAmount(curMonth); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | kpVo.setBmwc(new BigDecimal(kpVo.getBm()).multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | BigDecimal yearAmount = planListFP.getTotalAmount(); |
| | | if (ObjUtil.isNotNull(yearAmount)&&yearAmount.compareTo(new BigDecimal("0"))>0){ |
| | | kpVo.setBnwc(new BigDecimal(kpVo.getBn()).multiply(new BigDecimal("100")).divide(yearAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | } |
| | | statisticVoList.add(kpVo); |
| | | //回款 |
| | | ZbjtStatisticVo hkVo = paymentSlipMapper.zbjtStatisticByPayment(); |
| | | AnnualPlanTotalVo planListHK = annualPlanMapper.selectPlanYear(curYear,"2"); |
| | | if (ObjUtil.isNotNull(hkVo)&&ObjUtil.isNotNull(planListHK)){ |
| | | BigDecimal monAmount = planListHK.getMonthAmount(curMonth); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | hkVo.setBmwc(new BigDecimal(hkVo.getBm()).multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | BigDecimal yearAmount = planListHK.getTotalAmount(); |
| | | if (ObjUtil.isNotNull(yearAmount)&&yearAmount.compareTo(new BigDecimal("0"))>0){ |
| | | hkVo.setBnwc(new BigDecimal(hkVo.getBn()).multiply(new BigDecimal("100")).divide(yearAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | } |
| | | statisticVoList.add(hkVo); |
| | | return R.ok(statisticVoList); |
| | | } |
| | | |
| | | @Override |
| | | public R zbjtStatisticContractAmount() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | ZbjtStatisticByContractAmountVo hte = contractMapper.zbjtStatisticByContractAmount(); |
| | | jsonObject.put("hte",hte); |
| | | ZbjtStatisticByContractAmountProVo htp = contractMapper.zbjtStatisticByContractAmountPro(); |
| | | jsonObject.put("cpbk",htp); |
| | | ZbjtStatisticByContractAmountClassVo sc = contractMapper.zbjtStatisticByContractAmountClass(); |
| | | jsonObject.put("sczb",sc); |
| | | ZbjtStatisticByContractAmountSupplyVo yw = contractMapper.zbjtStatisticByContractAmountSupply(); |
| | | jsonObject.put("ywzb",yw); |
| | | ZbjtStatisticByContractAmountClassVo ys = contractMapper.zbjtStatisticByContractAmountYS(); |
| | | jsonObject.put("yszb",ys); |
| | | return R.ok(jsonObject); |
| | | } |
| | | |
| | | @Override |
| | | public R zbjtIndicatorTrend() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | Integer curYear = DateUtil.year(new Date()); |
| | | String startMon = (curYear-3)+"-01-01"; |
| | | String endMon = curYear+"-12-01"; |
| | | List<ZbjtIndicatorTrendVo> trendList = contractMapper.zbjtIndicatorTrend(startMon,endMon); |
| | | JSONObject zbqs_ht = new JSONObject(); |
| | | zbqs_ht.put((curYear-3)+"",trendList.stream().filter(item->item.getYearMon().startsWith((curYear-3)+"")).collect(Collectors.toList())); |
| | | zbqs_ht.put((curYear-2)+"",trendList.stream().filter(item->item.getYearMon().startsWith((curYear-2)+"")).collect(Collectors.toList())); |
| | | zbqs_ht.put((curYear-1)+"",trendList.stream().filter(item->item.getYearMon().startsWith((curYear-1)+"")).collect(Collectors.toList())); |
| | | zbqs_ht.put(curYear+"",trendList.stream().filter(item->item.getYearMon().startsWith(curYear+"")).collect(Collectors.toList())); |
| | | jsonObject.put("zbqs-ht",zbqs_ht); |
| | | List<ZbjtIndicatorTrendVo> trendInvoiceList = contractInvoiceMapper.zbjtIndicatorTrend(startMon,endMon); |
| | | JSONObject zbqs_sr = new JSONObject(); |
| | | zbqs_sr.put((curYear-3)+"",trendInvoiceList.stream().filter(item->item.getYearMon().startsWith((curYear-3)+"")).collect(Collectors.toList())); |
| | | zbqs_sr.put((curYear-2)+"",trendInvoiceList.stream().filter(item->item.getYearMon().startsWith((curYear-2)+"")).collect(Collectors.toList())); |
| | | zbqs_sr.put((curYear-1)+"",trendInvoiceList.stream().filter(item->item.getYearMon().startsWith((curYear-1)+"")).collect(Collectors.toList())); |
| | | zbqs_sr.put(curYear+"",trendInvoiceList.stream().filter(item->item.getYearMon().startsWith(curYear+"")).collect(Collectors.toList())); |
| | | jsonObject.put("zbqs-sr",zbqs_sr); |
| | | List<ZbjtIndicatorTrendVo> trendSlipList = paymentSlipMapper.zbjtIndicatorTrend(startMon,endMon); |
| | | JSONObject zbqs_hs = new JSONObject(); |
| | | zbqs_hs.put((curYear-3)+"",trendSlipList.stream().filter(item->item.getYearMon().startsWith((curYear-3)+"")).collect(Collectors.toList())); |
| | | zbqs_hs.put((curYear-2)+"",trendSlipList.stream().filter(item->item.getYearMon().startsWith((curYear-2)+"")).collect(Collectors.toList())); |
| | | zbqs_hs.put((curYear-1)+"",trendSlipList.stream().filter(item->item.getYearMon().startsWith((curYear-1)+"")).collect(Collectors.toList())); |
| | | zbqs_hs.put(curYear+"",trendSlipList.stream().filter(item->item.getYearMon().startsWith(curYear+"")).collect(Collectors.toList())); |
| | | jsonObject.put("zbqs-hk",zbqs_hs); |
| | | return R.ok(jsonObject); |
| | | } |
| | | |
| | | @Override |
| | | public R zbjtPlanAchieced() { |
| | | String curYear = DateUtil.year(new Date())+""; |
| | | JSONObject jsonObject = new JSONObject(); |
| | | JSONObject ht = new JSONObject(); |
| | | AnnualPlanTotalVo planListHt = annualPlanMapper.selectPlanYear(curYear,"1"); |
| | | List<ZbjtIndicatorTrendVo> trendVoList = contractMapper.zbjtPlanAchieced(null); |
| | | if (ObjUtil.isNotNull(planListHt)&&CollUtil.isNotEmpty(trendVoList)){ |
| | | trendVoList.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHt.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | ht.put("zb",trendVoList); |
| | | List<Long> compIds = new ArrayList<>(); |
| | | compIds.add(2089995177814495234L); |
| | | compIds.add(2089996921978040321L); |
| | | compIds.add(2089997578009128962L); |
| | | compIds.add(2101966257365045249L); |
| | | |
| | | AnnualPlan planListHtSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .in(AnnualPlan::getCompId,compIds).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> smjtrendVoList = contractMapper.zbjtPlanAchiecedSmj(); |
| | | if (ObjUtil.isNotNull(planListHtSMJ)&&CollUtil.isNotEmpty(smjtrendVoList)){ |
| | | smjtrendVoList.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHtSMJ.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | ht.put("smj",smjtrendVoList); |
| | | AnnualPlan planListHtSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556196124250113L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> sgbtrendVoList = contractMapper.zbjtPlanAchieced(2056556196124250113L); |
| | | if (ObjUtil.isNotNull(planListHtSGB)&&CollUtil.isNotEmpty(sgbtrendVoList)){ |
| | | sgbtrendVoList.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHtSGB.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | ht.put("sgb",sgbtrendVoList); |
| | | AnnualPlan planListHTfgs = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556421857497090L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> tfgstrendVoList = contractMapper.zbjtPlanAchieced(2056556421857497090L); |
| | | if (ObjUtil.isNotNull(planListHTfgs)&&CollUtil.isNotEmpty(tfgstrendVoList)){ |
| | | tfgstrendVoList.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHTfgs.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | ht.put("tfgs",tfgstrendVoList); |
| | | AnnualPlan planListHjxc = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556317461270529L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> jxctrendVoList = contractMapper.zbjtPlanAchieced(2056556317461270529L); |
| | | if (ObjUtil.isNotNull(planListHjxc)&&CollUtil.isNotEmpty(jxctrendVoList)){ |
| | | jxctrendVoList.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHjxc.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ht.put("jxc",jxctrendVoList); |
| | | AnnualPlan planListHYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556535640576002L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> ymjtrendVoList = contractMapper.zbjtPlanAchieced(2056556535640576002L); |
| | | if (ObjUtil.isNotNull(planListHYMJ)&&CollUtil.isNotEmpty(ymjtrendVoList)){ |
| | | ymjtrendVoList.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHYMJ.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ht.put("ymj",ymjtrendVoList); |
| | | jsonObject.put("ht",ht); |
| | | JSONObject sr = new JSONObject(); |
| | | AnnualPlanTotalVo planLisSR = annualPlanMapper.selectPlanYear(curYear,"1"); |
| | | List<ZbjtIndicatorTrendVo> trendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(null); |
| | | if (ObjUtil.isNotNull(planLisSR)&&CollUtil.isNotEmpty(trendVoList1)){ |
| | | trendVoList1.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planLisSR.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | sr.put("zb",trendVoList1); |
| | | |
| | | AnnualPlan planListSRSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"2") |
| | | .in(AnnualPlan::getCompId,compIds).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> smjtrendVoList1 = contractInvoiceMapper.zbjtPlanAchiecedSmj(); |
| | | if (ObjUtil.isNotNull(planListSRSMJ)&&CollUtil.isNotEmpty(smjtrendVoList1)){ |
| | | smjtrendVoList1.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListSRSMJ.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | sr.put("smj",smjtrendVoList1); |
| | | //石工泵收入 |
| | | AnnualPlan planListSRSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556196124250113L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> sgbtrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556196124250113L); |
| | | if (ObjUtil.isNotNull(planListSRSGB)&&CollUtil.isNotEmpty(sgbtrendVoList1)){ |
| | | sgbtrendVoList1.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListSRSGB.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | sr.put("sgb",sgbtrendVoList1); |
| | | //通方公司收入 |
| | | AnnualPlan planListSRTFGS = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556421857497090L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> tfgstrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556421857497090L); |
| | | |
| | | if (ObjUtil.isNotNull(planListSRTFGS)&&CollUtil.isNotEmpty(tfgstrendVoList1)){ |
| | | tfgstrendVoList1.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListSRTFGS.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | sr.put("tfgs",tfgstrendVoList1); |
| | | //机械厂收入 |
| | | AnnualPlan planListSRJXC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556317461270529L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> jxctrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556317461270529L); |
| | | |
| | | |
| | | if (ObjUtil.isNotNull(planListSRJXC)&&CollUtil.isNotEmpty(jxctrendVoList1)){ |
| | | jxctrendVoList1.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListSRJXC.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | sr.put("jxc",jxctrendVoList1); |
| | | //一煤机收入 |
| | | AnnualPlan planListSRYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556317461270529L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> ymjtrendVoList1 = contractInvoiceMapper.zbjtPlanAchieced(2056556535640576002L); |
| | | |
| | | |
| | | if (ObjUtil.isNotNull(planListSRYMJ)&&CollUtil.isNotEmpty(ymjtrendVoList1)){ |
| | | ymjtrendVoList1.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListSRYMJ.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | sr.put("ymj",ymjtrendVoList1); |
| | | jsonObject.put("sr",sr); |
| | | |
| | | JSONObject hk = new JSONObject(); |
| | | //回款 |
| | | AnnualPlanTotalVo planLisHK = annualPlanMapper.selectPlanYear(curYear,"1"); |
| | | List<ZbjtIndicatorTrendVo> trendVoList2 = paymentSlipMapper.zbjtPlanAchieced(null); |
| | | if (ObjUtil.isNotNull(planLisHK)&&CollUtil.isNotEmpty(trendVoList2)){ |
| | | trendVoList2.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planLisHK.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | hk.put("zb",trendVoList2); |
| | | //石煤机回款 |
| | | AnnualPlan planListHKSMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"2") |
| | | .in(AnnualPlan::getCompId,compIds).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> smjtrendVoList2 = paymentSlipMapper.zbjtPlanAchiecedSmj(); |
| | | if (ObjUtil.isNotNull(planListHKSMJ)&&CollUtil.isNotEmpty(smjtrendVoList2)){ |
| | | smjtrendVoList2.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHKSMJ.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | hk.put("smj",smjtrendVoList2); |
| | | //石工泵回款 |
| | | AnnualPlan planListHKSGB = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556196124250113L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> sgbtrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556196124250113L); |
| | | |
| | | |
| | | if (ObjUtil.isNotNull(planListHKSGB)&&CollUtil.isNotEmpty(sgbtrendVoList2)){ |
| | | sgbtrendVoList2.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHKSGB.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | hk.put("sgb",sgbtrendVoList2); |
| | | //tfgs回款 |
| | | AnnualPlan planListHKTFGS = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556421857497090L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> tfgstrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556421857497090L); |
| | | |
| | | if (ObjUtil.isNotNull(planListHKTFGS)&&CollUtil.isNotEmpty(tfgstrendVoList2)){ |
| | | tfgstrendVoList2.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHKTFGS.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | hk.put("tfgs",tfgstrendVoList2); |
| | | //机械厂回款 |
| | | AnnualPlan planListHKJXC = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556317461270529L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> jxctrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556317461270529L); |
| | | |
| | | if (ObjUtil.isNotNull(planListHKJXC)&&CollUtil.isNotEmpty(jxctrendVoList2)){ |
| | | jxctrendVoList2.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHKJXC.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | hk.put("jxc",jxctrendVoList2); |
| | | //一煤机回款 |
| | | AnnualPlan planListHKYMJ = annualPlanMapper.selectOne(Wrappers.<AnnualPlan>lambdaQuery() |
| | | .eq(AnnualPlan::getPlanYear,curYear).eq(AnnualPlan::getPlanType,"1") |
| | | .eq(AnnualPlan::getCompId,2056556535640576002L).last("limit 1")); |
| | | List<ZbjtIndicatorTrendVo> ymjtrendVoList2 = paymentSlipMapper.zbjtPlanAchieced(2056556535640576002L); |
| | | |
| | | if (ObjUtil.isNotNull(planListHKYMJ)&&CollUtil.isNotEmpty(ymjtrendVoList2)){ |
| | | ymjtrendVoList2.stream().forEach(trendVo->{ |
| | | BigDecimal monAmount = planListHKYMJ.getMonthAmount(trendVo.getYearMon()); |
| | | if (ObjUtil.isNotNull(monAmount)&&monAmount.compareTo(new BigDecimal("0"))>0){ |
| | | trendVo.setWc(trendVo.getJe().multiply(new BigDecimal("100")).divide(monAmount,2,RoundingMode.HALF_UP)+"%"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | hk.put("ymj",ymjtrendVoList2); |
| | | jsonObject.put("hk",hk); |
| | | return R.ok(jsonObject); |
| | | } |
| | | |
| | | @Override |
| | | public R zbjtReceiveScale() { |
| | | |
| | | JSONObject hk = new JSONObject(); |
| | | //回款 |
| | | List<ZbjtIndicatorTrendVo> trendVoList = paymentReceiveMapper.zbjtReceiveScale(null); |
| | | hk.put("zb",trendVoList); |
| | | //石煤机回款 |
| | | |
| | | List<Long> compIds = new ArrayList<>(); |
| | | compIds.add(2089995177814495234L); |
| | | compIds.add(2089996921978040321L); |
| | | compIds.add(2089997578009128962L); |
| | | compIds.add(2101966257365045249L); |
| | | |
| | | List<ZbjtIndicatorTrendVo> trendVoListSMJ = paymentReceiveMapper.zbjtReceiveScaleSMJ(); |
| | | hk.put("smj",trendVoListSMJ); |
| | | //石工泵回款 |
| | | List<ZbjtIndicatorTrendVo> trendVoListSGB = paymentReceiveMapper.zbjtReceiveScale(2056556196124250113L); |
| | | |
| | | hk.put("sgb",trendVoListSGB); |
| | | //tfgs |
| | | List<ZbjtIndicatorTrendVo> trendVoListTFGS = paymentReceiveMapper.zbjtReceiveScale(2056556421857497090L); |
| | | hk.put("tfgs",trendVoListTFGS); |
| | | //机械厂回款 |
| | | List<ZbjtIndicatorTrendVo> trendVoListJXC = paymentReceiveMapper.zbjtReceiveScale(2056556317461270529L); |
| | | hk.put("jxc",trendVoListJXC); |
| | | //一煤机回款 |
| | | List<ZbjtIndicatorTrendVo> trendVoListYMJ = paymentReceiveMapper.zbjtReceiveScale(2056556535640576002L); |
| | | hk.put("ymj",trendVoListYMJ); |
| | | return R.ok(hk); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.by4cloud.platformx.business.mapper.AnnualPlanMapper"> |
| | | |
| | | <resultMap id="annualPlanMap" type="com.by4cloud.platformx.business.entity.AnnualPlan"> |
| | | <id property="id" column="id"/> |
| | | <result property="compId" column="comp_id"/> |
| | | <result property="planType" column="plan_type"/> |
| | | <result property="aprAmount" column="apr_amount"/> |
| | | <result property="augAmount" column="aug_amount"/> |
| | | <result property="decAmount" column="dec_amount"/> |
| | | <result property="febAmount" column="feb_amount"/> |
| | | <result property="janAmount" column="jan_amount"/> |
| | | <result property="julAmount" column="jul_amount"/> |
| | | <result property="junAmount" column="jun_amount"/> |
| | | <result property="marAmount" column="mar_amount"/> |
| | | <result property="mayAmount" column="may_amount"/> |
| | | <result property="novAmount" column="nov_amount"/> |
| | | <result property="octAmount" column="oct_amount"/> |
| | | <result property="planYear" column="plan_year"/> |
| | | <result property="sepAmount" column="sep_amount"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | </resultMap> |
| | | <select id="selectPlanYear" resultType="com.by4cloud.platformx.business.vo.AnnualPlanTotalVo"> |
| | | SELECT |
| | | plan_year, |
| | | IFNULL(sum(jan_amount),0) jan_amount, |
| | | IFNULL(sum(feb_amount),0) feb_amount, |
| | | IFNULL(sum(mar_amount),0) mar_amount, |
| | | IFNULL(sum(apr_amount),0) apr_amount, |
| | | IFNULL(sum(may_amount),0) may_amount, |
| | | IFNULL(sum(jun_amount),0) jun_amount, |
| | | IFNULL(sum(jul_amount),0) jul_amount, |
| | | IFNULL(sum(aug_amount),0) aug_amount, |
| | | IFNULL(sum(sep_amount),0) sep_amount, |
| | | IFNULL(sum(oct_amount),0) oct_amount, |
| | | IFNULL(sum(nov_amount),0) nov_amount, |
| | | IFNULL(sum(dec_amount),0) dec_amount |
| | | FROM |
| | | annual_plan |
| | | WHERE |
| | | del_flag = '0' |
| | | and plan_type = #{planType} |
| | | AND plan_year = #{curYear} |
| | | GROUP BY |
| | | plan_year |
| | | </select> |
| | | </mapper> |
| | |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-%m-01' )) htbn |
| | | </select> |
| | | <select id="zbjtStatisticByInvoice" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( ci.invoice_total_price_tax ) ,0) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | AND ci.invoice_time >= CURDATE() |
| | | AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | ) AS br, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( ci.invoice_total_price_tax ) ,0) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' ) |
| | | ) AS bm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( ci.invoice_total_price_tax ) ,0) |
| | | FROM |
| | | contract_invoice ci |
| | | WHERE |
| | | ci.del_flag = '0' |
| | | |
| | | AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS bn |
| | | </select> |
| | | <select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE( #{startMon} ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_ADD( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start < DATE(#{endMon} ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%Y-%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.invoice_total_price_tax ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract_invoice c ON DATE_FORMAT( c.invoice_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start; |
| | | </select> |
| | | <select id="zbjtPlanAchieced" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ci.invoice_total_price_tax ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract_invoice ci ON DATE_FORMAT( ci.invoice_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND ci.del_flag = '0' |
| | | <if test="compId !=null"> |
| | | AND ci.comp_id = #{compId} |
| | | </if> |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="zbjtPlanAchiecedSmj" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ci.invoice_total_price_tax ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract_invoice ci ON DATE_FORMAT( ci.invoice_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND ci.del_flag = '0' |
| | | AND (ci.comp_id = 2089995177814495234 or ci.comp_id = 2089996921978040321 or ci.comp_id = 2089997578009128962 or ci.comp_id = 2101966257365045249) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | </mapper> |
| | |
| | | AND amount IS NOT NULL |
| | | AND sign_date IS NOT NULL |
| | | AND YEAR(sign_date) = #{queryDTO.year} |
| | | AND party_b_id IN (2089995177814495234,2089996921978040321,2089997578009128962) |
| | | AND party_b_id IN (2089995177814495234,2089996921978040321,2089997578009128962,2101966257365045249) |
| | | |
| | | GROUP BY party_b_id, party_b |
| | | |
| | |
| | | AND amount IS NOT NULL |
| | | AND sign_date IS NOT NULL |
| | | AND YEAR(sign_date) = #{queryDTO.year} |
| | | AND party_b_id IN |
| | | <foreach collection="compIds" item="id" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | ) AS pivot_table |
| | | GROUP BY party_b_name |
| | | ORDER BY |
| | |
| | | c.create_time |
| | | |
| | | </select> |
| | | <select id="zbjtStatisticByContract" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | ) AS br, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' ) |
| | | ) AS bm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ),0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS bn |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmount" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS smj, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS sgb, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556421857497090 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS tfgs, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556317461270529 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS jxc, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556535640576002 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS ymj |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountPro" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountProVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089995177814495234 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS mj, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2101966257365045249 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS hwc, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089997578009128962 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS zt, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2089996921978040321 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS scd, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND comp_id = 2056556196124250113 |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS gyb, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND (comp_id = 2056556421857497090 or comp_id = 2056556317461270529 or comp_id = 2056556535640576002 ) |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS qt |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountClass" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountClassVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '1' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS jz, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '2' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS zm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '3' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS wb |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountSupply" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountSupplyVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='0' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS cp, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='1' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS bj, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='2' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS dx, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.amount ) ,0) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.supply_attribute='3' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS qt |
| | | </select> |
| | | <select id="zbjtStatisticByContractAmountYS" |
| | | resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticByContractAmountClassVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.billing_amout - paid_amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '1' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS jz, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.billing_amout - paid_amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '2' |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS zm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( c.billing_amout - paid_amount ) ,0) |
| | | FROM |
| | | contract c, business_customer bc |
| | | WHERE |
| | | bc.id = c.party_a_id |
| | | and c.del_flag = '0' |
| | | and bc.del_flag = '0' |
| | | and bc.class_id = '3' |
| | | and c.billing_amout >= c.paid_amount |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS wb |
| | | </select> |
| | | <select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE( #{startMon} ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_ADD( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start < DATE( #{endMon} ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%Y-%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract c ON DATE_FORMAT( c.sign_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start; |
| | | </select> |
| | | <select id="zbjtPlanAchieced" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%Y-%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract c ON DATE_FORMAT( c.sign_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND c.del_flag = '0' |
| | | <if test="compId !=null"> |
| | | AND c.comp_id = #{compId} |
| | | </if> |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="zbjtPlanAchiecedSmj" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( c.amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN contract c ON DATE_FORMAT( c.sign_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND c.del_flag = '0' |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="export" resultType="com.by4cloud.platformx.business.vo.ContractExportExceVO"> |
| | | SELECT |
| | | c.id, |
| | | c.contract_no, |
| | | c.contract_name, |
| | | c.party_a_id, |
| | | c.party_a, |
| | | c.party_b_id, |
| | | c.party_b, |
| | | c.party_c_id, |
| | | c.amount, |
| | | c.contract_type, |
| | | c.supply_attribute, |
| | | c.contract_status, |
| | | c.contract_attribute, |
| | | c.sign_date, |
| | | c.sign_place, |
| | | c.effective_date, |
| | | c.delivery_cycle, |
| | | c.expiration_date, |
| | | c.attachment_url, |
| | | c.remark, |
| | | c.parent_id, |
| | | c.approve_time, |
| | | c.arrival_schedule_id, |
| | | c.accept_schedule_id, |
| | | c.billing_status, |
| | | c.billing_amout, |
| | | c.template_id, |
| | | c.sales_model, |
| | | c.paid_amount, |
| | | c.contract_category, |
| | | c.economic_matters, |
| | | c.exec_frequency, |
| | | c.next_schedule_name, |
| | | c.warranty_schedule_id, |
| | | c.comp_id, |
| | | c.center_push_flag, |
| | | c.last_attachment_url |
| | | FROM |
| | | contract c, |
| | | business_customer bc |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND bc.del_flag = '0' |
| | | AND bc.id = c.party_a_id |
| | | <if test="queryDTO.contractName !=null and queryDTO.contractName !=''"> |
| | | AND contract_name LIKE CONCAT('%', #{queryDTO.contractName}, '%') |
| | | </if> |
| | | <if test="queryDTO.contractNo !=null and queryDTO.contractNo !=''"> |
| | | AND contract_no LIKE CONCAT('%', #{queryDTO.contractNo}, '%') |
| | | </if> |
| | | <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> |
| | | AND party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%') |
| | | </if> |
| | | <if test="queryDTO.contractStatus !=null and queryDTO.contractStatus !=''"> |
| | | AND contract_status = #{queryDTO.contractStatus} |
| | | </if> |
| | | <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> |
| | | AND c.comp_id = #{queryDTO.queryCompId} |
| | | </if> |
| | | <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> |
| | | AND bc.province = #{queryDTO.queryProvince} |
| | | </if> |
| | | <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> |
| | | AND bc.export_service_attr = #{queryDTO.queryServiceAttr} |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='1'.toString()"> |
| | | AND c.sign_date >= CURDATE() |
| | | AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='2'.toString()"> |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.queryType !=null and queryDTO.queryType !='' and queryDTO.queryType =='3'.toString()"> |
| | | AND c.sign_date >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND c.sign_date < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | </if> |
| | | <if test="queryDTO.startTime !=null and queryDTO.endTime !=null"> |
| | | AND c.sign_date >= #{queryDTO.startTime} |
| | | AND c.sign_date <= #{queryDTO.endTime} |
| | | </if> |
| | | ORDER BY |
| | | c.create_time DESC |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.by4cloud.platformx.business.mapper.PaymentReceiveMapper"> |
| | | |
| | | <resultMap id="paymentReceiveMap" type="com.by4cloud.platformx.business.entity.PaymentReceive"> |
| | | <id property="id" column="id"/> |
| | | <result property="compId" column="comp_id"/> |
| | | <result property="receiveAmount" column="receive_amount"/> |
| | | <result property="receiveDate" column="receive_date"/> |
| | | </resultMap> |
| | | <select id="genReceivePayment" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | sum(c.billing_amout - c.paid_amount) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.billing_amout >= paid_amount |
| | | <if test="compId!=null"> |
| | | AND c.comp_id = #{compId} |
| | | </if> |
| | | </select> |
| | | <select id="genReceivePaymentSmj" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | sum(c.billing_amout - c.paid_amount) |
| | | FROM |
| | | contract c |
| | | WHERE |
| | | c.del_flag = '0' |
| | | AND c.billing_amout >= paid_amount |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | </select> |
| | | <select id="zbjtReceiveScale" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ps.receive_amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN payment_receive ps ON DATE_FORMAT( ps.receive_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | <if test="compId !=null"> |
| | | AND ps.comp_id = #{compId} |
| | | </if> |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="zbjtReceiveScaleSMJ" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ps.receive_amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN payment_receive ps ON DATE_FORMAT( ps.receive_date, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND (comp_id = 2089995177814495234 or comp_id = 2089996921978040321 or comp_id = 2089997578009128962 or comp_id = 2101966257365045249) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | </mapper> |
| | |
| | | <result property="compId" column="comp_id"/> |
| | | <result property="busGuestId" column="bus_guest_id"/> |
| | | <result property="busGuestName" column="bus_guest_name"/> |
| | | <result property="businessType" column="business_type"/> |
| | | <result property="gatheringAccount" column="gathering_account"/> |
| | | <result property="payType" column="pay_type"/> |
| | | <result property="paymentAccount" column="payment_account"/> |
| | | <result property="paymentAmount" column="payment_amount"/> |
| | | <result property="paymentNumber" column="payment_number"/> |
| | | <result property="paymentTime" column="payment_time"/> |
| | |
| | | ORDER BY |
| | | t.create_time DESC |
| | | </select> |
| | | <select id="zbjtStatisticByPayment" resultType="com.by4cloud.platformx.business.vo.ZbjtStatisticVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( ps.payment_amount ),0) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND ps.payment_time >= CURDATE() |
| | | AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY ) |
| | | ) AS br, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( ps.payment_amount ) ,0) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-%m-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 MONTH ), '%Y-%m-01' ) |
| | | ) AS bm, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum( ps.payment_amount ) ,0) |
| | | FROM |
| | | payment_slip ps |
| | | WHERE |
| | | ps.del_flag = '0' |
| | | AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) |
| | | AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-01-01' ) |
| | | ) AS bn |
| | | </select> |
| | | <select id="zbjtIndicatorTrend" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE(#{startMon}) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_ADD( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start < DATE(#{endMon}) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%Y-%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ps.payment_amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN payment_slip ps ON DATE_FORMAT(ps.payment_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start; |
| | | </select> |
| | | <select id="zbjtPlanAchieced" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ps.payment_amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN payment_slip ps ON DATE_FORMAT( ps.payment_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND ps.del_flag = '0' |
| | | <if test="compId !=null"> |
| | | AND ps.comp_id = #{compId} |
| | | </if> |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | <select id="zbjtPlanAchiecedSmj" resultType="com.by4cloud.platformx.business.vo.ZbjtIndicatorTrendVo"> |
| | | WITH RECURSIVE month_series AS ( |
| | | SELECT |
| | | DATE_FORMAT( CURDATE(), '%Y-%m-01' ) AS month_start UNION ALL |
| | | SELECT |
| | | DATE_SUB( month_start, INTERVAL 1 MONTH ) |
| | | FROM |
| | | month_series |
| | | WHERE |
| | | month_start > DATE_SUB( DATE_FORMAT( CURDATE(), '%Y-%m-01' ), INTERVAL 11 MONTH ) |
| | | ) SELECT |
| | | DATE_FORMAT( ms.month_start, '%m' ) AS `yearMon`, |
| | | COALESCE ( SUM( ps.payment_amount ), 0 ) AS `je` |
| | | FROM |
| | | month_series ms |
| | | LEFT JOIN payment_slip ps ON DATE_FORMAT( ps.payment_time, '%Y-%m' ) = DATE_FORMAT( ms.month_start, '%Y-%m' ) |
| | | AND ps.del_flag = '0' |
| | | AND (ps.comp_id = 2089995177814495234 or ps.comp_id = 2089996921978040321 or ps.comp_id = 2089997578009128962 or ps.comp_id = 2101966257365045249) |
| | | GROUP BY |
| | | ms.month_start |
| | | ORDER BY |
| | | ms.month_start ASC; |
| | | </select> |
| | | </mapper> |
| | |
| | | </foreach> |
| | | </otherwise> |
| | | </choose> |
| | | and ( t.comp_id = 2089995177814495234 or t.comp_id = 2089996921978040321 or t.comp_id = 2089997578009128962) |
| | | and ( t.comp_id = 2089995177814495234 or t.comp_id = 2101966257365045249) |
| | | </select> |
| | | <select id="pageScope" resultType="com.by4cloud.platformx.business.entity.Product"> |
| | | SELECT |