platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/BusinessCustomerAddDTO.java
New file @@ -0,0 +1,23 @@ package com.by4cloud.platformx.business.dto; import lombok.Data; @Data public class BusinessCustomerAddDTO { private String companyName; private String creditCode; private String legalPerson; private String contactPhone; private String salesModel; private String exportServiceAttr; private String classId; private String erpCompanyCode; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContractAddDTO.java
@@ -31,6 +31,10 @@ @JsonProperty("partyA") private String partyA; @Schema(description = "关联方ID") @JsonProperty("partyCId") private Long partyCId; @Schema(description = "乙方id") private Long partyBId; @@ -266,6 +270,9 @@ @Schema(description = "是否关联交易") private String isRelated; @Schema(description = "合同条款及主要内容") private String summary; private List<ContractPaymentScheduleAddDTO> contractPaymentSchedule; private List<ContractSubjectMatterAddDTO> contractSubjectMatter; platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContractAssociationPartyCyDTO.java
New file @@ -0,0 +1,13 @@ package com.by4cloud.platformx.business.dto; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data public class ContractAssociationPartyCyDTO { private String id; @JsonProperty("partyCId") private String partyCId; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContractFinallyDTO.java
@@ -1,17 +1,40 @@ package com.by4cloud.platformx.business.dto; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @Data public class ContractFinallyDTO { private String id; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "签署日期") private Date signDate; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "到期日期") private Date expirationDate; @Schema(description = "合同签字盖章附件URL") private String lastAttachmentUrl; @Schema(description = "合同签字盖章名称") private String lastAttachmentName; private String linkPerson; private String linkPhone; private String singer; private String reviewerNo; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ContractQueryDTO.java
@@ -22,4 +22,6 @@ * 预收发票标识 */ private String advanceType; private String province; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenInvoiceInfoDTO.java
@@ -30,4 +30,8 @@ private String vehicleData; private String remarks; private String partyA; private String partyAOrgCode; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/GenMergeInvoiceDTO.java
@@ -31,4 +31,8 @@ private String vehicleData; private String remarks; private String partyA; private String partyAOrgCode; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/HomeQueryDTO.java
@@ -20,6 +20,8 @@ */ private String queryArea; private String queryProvince; /** * 1 内销 2 海外 3 外销 */ platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/ProductQueryDTO.java
@@ -2,6 +2,8 @@ import lombok.Data; import java.util.List; @Data public class ProductQueryDTO { @@ -11,4 +13,8 @@ private String parentId; private String productIds; private List<String> productId; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/PushCenterDTO.java
New file @@ -0,0 +1,25 @@ package com.by4cloud.platformx.business.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class PushCenterDTO { private String id; @Schema(description = "选商方式") private String selectionMethod; @Schema(description = "是否关联交易") private String isRelated; @Schema(description = "附件URL") private String attachmentUrl; @Schema(description = "附件名称") private String attachmentName; private String contractCreater; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/dto/SyncContractStatusDTO.java
@@ -5,6 +5,8 @@ @Data public class SyncContractStatusDTO { private String fd_bizId; private String contractNumber; private String status; @@ -13,6 +15,6 @@ private String returnPerson; private String returnDateTime; private String returnDate; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/entity/Contract.java
@@ -426,4 +426,32 @@ @Schema(description = "是否关联交易") @Column(name = "is_related",columnDefinition = "VARCHAR(50) comment '是否关联交易'") private String isRelated; @Schema(description = "起草人") @Column(columnDefinition = "VARCHAR(255) comment '起草人编号'") private String contractCreater; @Schema(description = "联系人") @Column(columnDefinition = "VARCHAR(255) comment '联系人姓名'") private String linkPerson; @Schema(description = "联系电话") @Column(columnDefinition = "VARCHAR(255) comment '联系电话'") private String linkPhone; @Schema(description = "签署人") @Column(columnDefinition = "VARCHAR(255) comment '签署人编号'") private String singer; @Schema(description = "登记人") @Column(columnDefinition = "VARCHAR(255) comment '登记人编号'") private String reviewerNo; @Schema(description = "关联方id") @Column(name = "party_c_id",columnDefinition = "bigint comment '关联方id'") private Long partyCId; @Schema(description = "合同条款及主要内容") @Column(columnDefinition = "text comment '合同条款及主要内容'") private String summary; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/BusinessCustomerSelectVo.java
@@ -10,4 +10,6 @@ private String companyName; private String registerName; private String creditCode; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ContractDetailVo.java
@@ -257,6 +257,12 @@ @Schema(description = "是否关联交易") private String isRelated; @Schema(description = "乙方id") private Long partyCId; @Schema(description = "条款主要内容") private String summary; private ContractInvoiceBipVo bipVo; private List<ContractPaymentSchedule> contractPaymentSchedule; platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ContractFinallyVo.java
New file @@ -0,0 +1,54 @@ package com.by4cloud.platformx.business.vo; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @Data public class ContractFinallyVo { private String id; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "签署日期") private Date signDate; @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") @Schema(description = "到期日期") private Date expirationDate; @Schema(description = "合同签字盖章附件URL") private String lastAttachmentUrl; @Schema(description = "合同签字盖章名称") private String lastAttachmentName; @Schema(description = "选商方式") private String selectionMethod; @Schema(description = "是否关联交易") private String isRelated; @Schema(description = "附件URL") private String attachmentUrl; @Schema(description = "附件名称") private String attachmentName; private String contractCreater; private String linkPerson; private String linkPhone; private String singer; private String reviewerNo; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ContractInvoiceObjVo.java
New file @@ -0,0 +1,26 @@ package com.by4cloud.platformx.business.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @Data public class ContractInvoiceObjVo { private Long id; @Schema(description = "合同名称") private String contractName; @Schema(description = "合同名称") private String contractNo; private String partyA; private String partyAOrgCode; private String invoiceType; List<BusinessCustomerSelectVo> linkPartyC; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ContractPageVo.java
@@ -30,6 +30,9 @@ @Schema(description = "乙方名称") private String partyB; @Schema(description = "乙方id") private Long partyCId; @Schema(description = "合同金额") private BigDecimal amount; platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/HomeZgsData.java
New file @@ -0,0 +1,30 @@ package com.by4cloud.platformx.business.vo; import lombok.Data; @Data public class HomeZgsData { private String provinceCode; private String provinceName; private String kpbr; private String kpby; private String kpbn; private String skbr; private String skby; private String skbn; private String htbr; private String htby; private String htbn; } platformx-business-finance-api/src/main/java/com/by4cloud/platformx/business/vo/ReceiveItemVo.java
@@ -22,4 +22,8 @@ private String hsdy; private String zy; private String fphm; private String kxlx; } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
@@ -7,6 +7,7 @@ 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.business.dto.BusinessCustomerAddDTO; import com.by4cloud.platformx.business.entity.Product; import com.by4cloud.platformx.business.vo.BusinessCustomerSelectVo; import com.by4cloud.platformx.common.core.util.R; @@ -54,6 +55,9 @@ @Value("${dept.smjzt}") private String smjzt; @Value("${dept.smjhw}") private String smjhw; /** * 分页查询 * @param page 分页对象 @@ -66,22 +70,24 @@ public R getBusinessCustomerPage(@ParameterObject Page page, @ParameterObject BusinessCustomer businessCustomer) { if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); wrapper.eq(businessCustomer.getIndustryId()!=null,BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); wrapper.eq(businessCustomer.getAreaId()!=null,BusinessCustomer::getAreaId,businessCustomer.getAreaId()); wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince()); wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); List<String> smjList = new ArrayList<>(); smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); wrapper.in(BusinessCustomer::getCompId, smjList); wrapper.orderByDesc(BusinessCustomer::getCreateTime); return R.ok(businessCustomerService.page(page, wrapper)); } LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); wrapper.eq(businessCustomer.getIndustryId()!=null,BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); wrapper.eq(businessCustomer.getAreaId()!=null,BusinessCustomer::getAreaId,businessCustomer.getAreaId()); wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince()); wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); wrapper.orderByDesc(BusinessCustomer::getCreateTime); return R.ok(businessCustomerService.pageByScope(page, wrapper)); @@ -98,13 +104,16 @@ public R getBusinessCustomerList(@ParameterObject BusinessCustomer businessCustomer) { if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); List<String> smjList = new ArrayList<>(); smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); wrapper.in(BusinessCustomer::getCompId, smjList); List<BusinessCustomer> businessCustomerList = businessCustomerService.list(wrapper); if (CollUtil.isNotEmpty(businessCustomerList)){ @@ -117,6 +126,8 @@ } LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery(); wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName()); wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince()); wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId()); List<BusinessCustomer> businessCustomerList = businessCustomerService.listByScope(wrapper); if (CollUtil.isNotEmpty(businessCustomerList)){ List<BusinessCustomerSelectVo> voList = BeanUtil.copyToList(businessCustomerList, BusinessCustomerSelectVo.class); @@ -153,6 +164,13 @@ return R.ok(businessCustomerService.save(businessCustomer)); } @Operation(summary = "新增客商信息-石工泵" , description = "新增客商信息-石工泵" ) @SysLog("新增客商信息-石工泵" ) @PostMapping("/saveCustomerSgb") public R saveCustomerSgb(@RequestBody BusinessCustomerAddDTO addDTO) { return businessCustomerService.saveCustomerSgb(addDTO); } /** * 修改客商信息 * @param businessCustomer 客商信息 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ContractController.java
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.business.dto.*; import com.by4cloud.platformx.business.entity.Contract; import com.by4cloud.platformx.business.entity.PaymentConfirm; import com.by4cloud.platformx.common.core.util.R; import com.by4cloud.platformx.common.data.mybatis.BaseModel; import com.by4cloud.platformx.common.log.annotation.SysLog; @@ -78,14 +79,14 @@ } /** * 通过id手动推送合同中心 * @param id id * 手动推送合同中心 * @param dto * @return R */ @Operation(summary = "通过id手动推送合同中心" , description = "通过id手动推送合同中心" ) @GetMapping("/pushCenter/{id}" ) public R pushCenter(@PathVariable("id" ) Long id) { return contractService.pushCenter(id); @Operation(summary = "手动推送合同中心" , description = "手动推送合同中心" ) @PostMapping("/pushCenter" ) public R pushCenter(@RequestBody PushCenterDTO dto) { return contractService.pushCenter(dto); } @@ -161,6 +162,17 @@ public R list(@ParameterObject Contract contract) { return R.ok(contractService.listByScope(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractStatus,2) .eq(ObjUtil.isNotNull(contract.getPartyAId()),Contract::getPartyAId,contract.getPartyAId()) .orderByDesc(Contract::getCreateTime))); } @GetMapping("/listAssoci") public R listAssoci(@ParameterObject Contract contract) { return R.ok(contractService.listByScope(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractStatus,2) .and(wrapper -> wrapper .eq(ObjUtil.isNotNull(contract.getPartyAId()),Contract::getPartyAId,contract.getPartyAId()) .or() .eq(ObjUtil.isNotNull(contract.getPartyAId()),Contract::getPartyCId,contract.getPartyAId()) ) .orderByDesc(Contract::getCreateTime))); } @@ -358,7 +370,7 @@ * @return R */ @Operation(summary = "删除合同-石工泵" , description = "删除合同-石工泵" ) @PostMapping("/delContractSgb/{dataId}") @GetMapping("/delContractSgb/{dataId}") @SysLog("删除合同-石工泵" ) public R delContractSgb(@PathVariable String dataId) { return contractService.delContractSgb(dataId); @@ -436,6 +448,26 @@ return contractService.finallyPdf(attDTO); } @PostMapping("/associationPartyC") public R associationPartyC(@RequestBody ContractAssociationPartyCyDTO associationPartyCyDTO) { return contractService.associationPartyC(associationPartyCyDTO); } @GetMapping("/getFinallyInfo/{id}") public R getFinallyInfo(@PathVariable("id") Long id) { return contractService.getFinallyInfo(id); } @Inner(value = false) @GetMapping("/erpPush/{id}") public R erpPush(@PathVariable("id") Long id) { return contractService.erpPush(id); } @GetMapping("/getInvoiceObj/{id}") public R getInvoiceObj(@PathVariable("id") Long id) { return contractService.getInvoiceObj(id); } /** * 新增合同-石工泵 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductController.java
@@ -22,6 +22,9 @@ import com.by4cloud.platformx.business.service.ProductService; import com.by4cloud.platformx.common.security.annotation.Inner; import com.by4cloud.platformx.common.security.util.SecurityUtils; import com.github.yulichang.query.MPJLambdaQueryWrapper; import com.github.yulichang.query.MPJQueryWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.access.prepost.PreAuthorize; import com.by4cloud.platformx.common.excel.annotation.ResponseExcel; @@ -53,15 +56,6 @@ private final ProductService productService; @Value("${dept.smj}") private String smj; @Value("${dept.smjsc}") private String smjsc; @Value("${dept.smjzt}") private String smjzt; /** * 分页查询 * @param page 分页对象 @@ -72,50 +66,33 @@ @GetMapping("/page" ) @PreAuthorize("@pms.hasPermission('business_product_view')" ) public R getProductPage(@ParameterObject Page page, @ParameterObject Product product) { if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { LambdaQueryWrapper<Product> wrapper = Wrappers.lambdaQuery(); wrapper.eq(product.getParentId()!=null,Product::getParentId,product.getParentId()); wrapper.like(StrUtil.isNotEmpty(product.getProductName()),Product::getProductName,product.getProductName()); wrapper.like(StrUtil.isNotEmpty(product.getMainCode()),Product::getMainCode,product.getMainCode()); wrapper.like(StrUtil.isNotEmpty(product.getErpCode()),Product::getErpCode,product.getErpCode()); List<String> smjList = new ArrayList<>(); smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); wrapper.in(Product::getCompId, smjList); wrapper.orderByDesc(Product::getCreateTime); Page<Product> page1 = productService.page(page, wrapper); List<Product> list = page1.getRecords(); for(Product product1 : list){ Product parent = productService.getById(product1.getParentId()); if(parent==null){ product1.setParentName("根级产品"); }else { product1.setParentName(parent.getProductName()); } } page1.setRecords(list); return R.ok(page1); } LambdaQueryWrapper<Product> wrapper = Wrappers.lambdaQuery(); wrapper.eq(product.getParentId()!=null,Product::getParentId,product.getParentId()); wrapper.like(StrUtil.isNotEmpty(product.getProductName()),Product::getProductName,product.getProductName()); wrapper.like(StrUtil.isNotEmpty(product.getMainCode()),Product::getMainCode,product.getMainCode()); wrapper.like(StrUtil.isNotEmpty(product.getErpCode()),Product::getErpCode,product.getErpCode()); wrapper.orderByDesc(Product::getCreateTime); Page<Product> page1 = productService.pageByScope(page, wrapper); List<Product> list = page1.getRecords(); for(Product product1 : list){ Product parent = productService.getById(product1.getParentId()); if(parent==null){ product1.setParentName("根级产品"); }else { product1.setParentName(parent.getProductName()); } } page1.setRecords(list); return R.ok(page1); // if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { // MPJLambdaWrapper<Product> wrapper =new MPJLambdaWrapper<Product>() // .selectAll(Product.class) // .selectAs("ifnull((select product_name from product t1 where t1.id = t.parent_id),'根级产品')",Product::getParentName) // .eq(product.getParentId()!=null,Product::getParentId,product.getParentId()) // .like(StrUtil.isNotEmpty(product.getProductName()),Product::getProductName,product.getProductName()) // .like(StrUtil.isNotEmpty(product.getMainCode()),Product::getMainCode,product.getMainCode()) // .like(StrUtil.isNotEmpty(product.getErpCode()),Product::getErpCode,product.getErpCode()); // List<String> smjList = new ArrayList<>(); // smjList.add(smj); //// smjList.add(smjsc); //// smjList.add(smjzt); // smjList.add(smjhw); // wrapper.in(Product::getCompId, smjList); // wrapper.orderByDesc(Product::getCreateTime); // return R.ok(productService.page(page, wrapper)); // } // MPJLambdaWrapper<Product> wrapper =new MPJLambdaWrapper<Product>() // .selectAll(Product.class) // .selectAs("ifnull((select product_name from product t1 where t1.id = parent_id),'根级产品')",Product::getParentName) // .eq(product.getParentId()!=null,Product::getParentId,product.getParentId()) // .like(StrUtil.isNotEmpty(product.getProductName()),Product::getProductName,product.getProductName()) // .like(StrUtil.isNotEmpty(product.getMainCode()),Product::getMainCode,product.getMainCode()) // .like(StrUtil.isNotEmpty(product.getErpCode()),Product::getErpCode,product.getErpCode()); //// .eq(Product::getCompId,SecurityUtils.getUser().getCompId()); // return R.ok(productService.pageByScope(page, wrapper)); return R.ok(productService.pageScope(page,product)); } /** platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/StatisticController.java
@@ -257,4 +257,13 @@ public R homeOverdueHis(@RequestBody HomeQueryDTO queryDTO) { return statisticService.homeOverdueHis(queryDTO); } /** * 子公司首页 * @return R */ @PostMapping("/homeZgsColum") public R homeZgsColum() { return statisticService.homeZgsColum(); } } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractInvoiceMapper.java
@@ -4,10 +4,7 @@ import com.by4cloud.platformx.business.dto.ContractInvoiceQueryDTO; import com.by4cloud.platformx.business.dto.ContractQueryDTO; import com.by4cloud.platformx.business.entity.ContractInvoice; import com.by4cloud.platformx.business.vo.ContractInvoicePageVo; import com.by4cloud.platformx.business.vo.HomeInvoiceVo; 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; @@ -22,4 +19,6 @@ Page<HomeInvoiceVo> pageInvoice(Page page,@Param("queryDTO") ContractInvoiceQueryDTO queryDTO, DataScope comp_id); Page<ContractInvoicePageVo> pageScope(Page page,@Param("queryDTO") ContractQueryDTO queryDTO, DataScope comp_id); HomeZgsData homeZgsData(@Param("compId") Long compId,@Param("province") String province); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ContractMapper.java
@@ -12,6 +12,7 @@ import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @@ -70,4 +71,16 @@ HomeZgsVo homeZgs(@Param("compId") Long compId); Page<FourAssociationPageVo> fourAssociation(Page page,@Param("queryDTO") ContractQueryDTO queryDTO, DataScope comp_id); @Select("SELECT\n" + "\tbc.province \n" + "FROM\n" + "\tcontract c\n" + "\tLEFT JOIN business_customer bc ON bc.id = c.party_a_id \n" + "WHERE\n" + "\tbc.province IS NOT NULL \n" + "and c.party_b_id = #{compId}" + "GROUP BY\n" + "\tbc.province;") List<String> homeZgsColum(@Param("compId") Long compId); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ProductMapper.java
@@ -1,5 +1,6 @@ package com.by4cloud.platformx.business.mapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.business.dto.ProductQueryDTO; import com.by4cloud.platformx.business.vo.ProductSelectVo; import com.by4cloud.platformx.common.data.datascope.DataScope; @@ -19,4 +20,8 @@ List<ProductSelectVo> getProductListByParentId(@Param("queryDTO") ProductQueryDTO queryDTO,@Param("erpCodes") List<String> erpCodes, DataScope comp_id); List<ProductSelectVo> getProductSMJListByParentId(@Param("queryDTO")ProductQueryDTO queryDTO,@Param("erpCodes") List<String> erpCodes); Page<Product> pageScope(Page page,@Param("queryDTO") Product product, DataScope comp_id); Page<Product> page(Page page,@Param("queryDTO") Product product, List<String> smjList); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/BusinessCustomerService.java
@@ -1,5 +1,6 @@ package com.by4cloud.platformx.business.service; import com.by4cloud.platformx.business.dto.BusinessCustomerAddDTO; import com.by4cloud.platformx.business.entity.BusinessCustomer; import com.by4cloud.platformx.business.vo.BusinessCustomerMainVo; import com.by4cloud.platformx.common.core.util.R; @@ -10,4 +11,6 @@ R syncMainBusCus(String compId); BusinessCustomerMainVo queryMainBC(String companyName); R saveCustomerSgb(BusinessCustomerAddDTO addDTO); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ContractService.java
@@ -68,7 +68,7 @@ R addSimple(ContractAddDTO addDTO); R pushCenter(Long id); R pushCenter(PushCenterDTO dto); R importContractMultiSheet(MultipartFile file); @@ -85,4 +85,12 @@ R addContractSgbHis(ContractAddDTO addDTO); R addContractHis(ContractAddDTO addDTO); R getFinallyInfo(Long id); R erpPush(Long id); R associationPartyC(ContractAssociationPartyCyDTO associationPartyCyDTO); R getInvoiceObj(Long id); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ProductService.java
@@ -1,6 +1,7 @@ package com.by4cloud.platformx.business.service; import cn.hutool.core.lang.tree.Tree; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.by4cloud.platformx.business.dto.ProductAddDTO; import com.by4cloud.platformx.business.dto.ProductQueryDTO; import com.by4cloud.platformx.business.dto.SyncProductDTO; @@ -27,4 +28,6 @@ R importProduct(List<ProductExcelVO> excelVOList, BindingResult bindingResult); R syncSMJByDate(SyncProductDTO dto); Page pageScope(Page page, Product product); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/StatisticService.java
@@ -54,4 +54,6 @@ R homeOverdue(HomeQueryDTO queryDTO); R homeOverdueHis(HomeQueryDTO queryDTO); R homeZgsColum(); } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BankStatementServiceImpl.java
@@ -289,8 +289,10 @@ item.put("expenseItemCode", bipVo.getItemList().get(0).getJjsx());//经济事项 item.put("remarks", bipVo.getItemList().get(0).getZy());//摘要 JSONObject freeChId = new JSONObject(); freeChId.put("GX08", bipVo.getItemList().get(0).getHsdy());//核算单元 freeChId.put("YSYF14", "1");//款项类型 1 预收款 2 应收款 freeChId.put("YSYF33", bipVo.getItemList().get(0).getFphm());//发票号码 freeChId.put("GX08", bipVo.getItemList().get(0).getHsdy());//核算单元 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());//产品物料分类 @@ -634,6 +636,7 @@ bipVo.setDjfx("1"); List<ReceiveItemVo> list = new ArrayList<>(); ReceiveItemVo itemVo = new ReceiveItemVo(); itemVo.setKxlx("1"); itemVo.setConfirmAmount(bankStatementItem.getConfirmAmount()); list.add(itemVo); bipVo.setItemList(list); platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/BusinessCustomerServiceImpl.java
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.business.dto.BusinessCustomerAddDTO; import com.by4cloud.platformx.business.entity.BusinessCustomer; import com.by4cloud.platformx.business.mapper.BipBanklViewMapper; import com.by4cloud.platformx.business.mapper.BipViewMapper; @@ -114,4 +115,55 @@ } return bc; } @Override public R saveCustomerSgb(BusinessCustomerAddDTO addDTO) { if (StrUtil.isBlank(addDTO.getCompanyName())||StrUtil.isBlank(addDTO.getCreditCode())){ return R.failed("客商名称或社会信用代码不能为空"); } BusinessCustomer bc = baseMapper.selectOne(Wrappers.<BusinessCustomer>lambdaQuery().eq(BusinessCustomer::getCompanyName,addDTO.getCompanyName()) .eq(BusinessCustomer::getCreditCode,addDTO.getCreditCode()).last("limit 1")); if (ObjUtil.isNotNull(bc)){ return R.failed("客商已存在"); } BusinessCustomer customer = new BusinessCustomer(); log.info("主数据查询{}信息",addDTO.getCompanyName()); CustInfoVo custInfo = bipViewMapper.selectBaseInfoByCustName(addDTO.getCompanyName()); if (ObjUtil.isNotNull(custInfo)){ if (!addDTO.getCreditCode().equals(custInfo.getCertificateId())){ return R.failed("主数据社会信用代码与新增的不一致"); } customer.setCompanyName(addDTO.getCompanyName()); customer.setCreditCode(custInfo.getCertificateId()); customer.setRegisterName(custInfo.getCustName()); customer.setLegalPerson(custInfo.getLegalPerson()); customer.setAddress(custInfo.getRegistrationAddress()); customer.setProvince(customer.getCreditCode().substring(2,4)); if (StrUtil.isNotEmpty(addDTO.getSalesModel())&& addDTO.getSalesModel().matches("[0-9]+")){ customer.setSalesModel(Long.valueOf(addDTO.getSalesModel())); } if (StrUtil.isNotEmpty(addDTO.getExportServiceAttr())&& addDTO.getExportServiceAttr().matches("[0-9]+")){ customer.setExportServiceAttr(Long.valueOf(addDTO.getExportServiceAttr())); } if (StrUtil.isNotEmpty(addDTO.getClassId())&& addDTO.getClassId().matches("[0-9]+")){ customer.setClassId(Long.valueOf(addDTO.getClassId())); } customer.setInvoiceType("01"); log.info("{}主数据查询名称、法人、地址、信用码信息成功",addDTO.getCompanyName()); List<CustBankVo> bankVoList = bipViewMapper.selectBankByCustName(addDTO.getCompanyName()); if (CollUtil.isNotEmpty(bankVoList)){ customer.setBankAccount(bankVoList.get(0).getBankAccount()); log.info("{}主数据查询银行卡号信息成功",addDTO.getCompanyName()); List<BankNameVo> bankNameVoList = bipBanklViewMapper.selectBankByCode(bankVoList.get(0).getBankName()); if (CollUtil.isNotEmpty(bankNameVoList)){ customer.setBankName(bankNameVoList.get(0).getBankNameName()); log.info("{}主数据查询银行名称信息成功",addDTO.getCompanyName()); } } customer.setRegisterName(custInfo.getCustName()); baseMapper.insert(customer); return R.ok(); } return R.failed("主数据客商信息不存在"); } } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java
@@ -93,6 +93,9 @@ @Value("${dept.smjsc}") private String smjsc; @Value("${dept.smjhw}") private String smjhw; @Value("${dept.tfgs}") private String tfgs; @@ -233,8 +236,10 @@ smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { ("" + SecurityUtils.getUser().getCompId()).equals(smjzt) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, subjectMatter.getMaterialCode()) .in(Product::getCompId, smjList).last("limit 1")); if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { @@ -285,8 +290,10 @@ smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)|| ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) .in(Product::getCompId, smjList).last("limit 1")); if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { @@ -346,8 +353,10 @@ smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { ("" + SecurityUtils.getUser().getCompId()).equals(smjzt) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) .in(Product::getCompId, smjList).last("limit 1")); if (ObjUtil.isNull(product) || StrUtil.isBlank(product.getTaxClass()) || StrUtil.isBlank(product.getTaxCode())) { @@ -407,8 +416,10 @@ smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { ("" + SecurityUtils.getUser().getCompId()).equals(smjzt) || ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) .in(Product::getCompId, smjList).last("limit 1")); } else { @@ -567,8 +578,8 @@ GenInvoiceInfoVo vo = new GenInvoiceInfoVo(); BusinessCustomer a = businessCustomerMapper.selectById(contract.getPartyAId()); vo.setContractId(contract.getId()); vo.setPartyA(a.getCompanyName()); vo.setPartyAOrgCode(a.getCreditCode()); vo.setPartyA(genInvoiceInfoDTO.getPartyA()); vo.setPartyAOrgCode(genInvoiceInfoDTO.getPartyAOrgCode()); vo.setPartyAOpenBank(a.getBankName()); vo.setPartyABankAccount(a.getBankAccount()); vo.setPartyB(b.getOrgName()); @@ -610,8 +621,10 @@ smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)|| ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) .in(Product::getCompId, smjList).last("limit 1")); } else { @@ -679,8 +692,10 @@ smjList.add(smj); smjList.add(smjsc); smjList.add(smjzt); smjList.add(smjhw); if (("" + SecurityUtils.getUser().getCompId()).equals(smj) || ("" + SecurityUtils.getUser().getCompId()).equals(smjsc) || ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)) { ("" + SecurityUtils.getUser().getCompId()).equals(smjzt)|| ("" + SecurityUtils.getUser().getCompId()).equals(smjhw)) { product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode, contractOutBound.getSubjectMatterCode()) .in(Product::getCompId, smjList).last("limit 1")); } else { @@ -807,8 +822,8 @@ BusinessCustomer a = businessCustomerMapper.selectById(contract.getPartyAId()); vo.setContractId(contract.getId()); vo.setAdvanceInvoice("111"); vo.setPartyA(a.getCompanyName()); vo.setPartyAOrgCode(a.getCreditCode()); vo.setPartyA(genInvoiceInfoDTO.getPartyA()); vo.setPartyAOrgCode(genInvoiceInfoDTO.getPartyAOrgCode()); vo.setPartyAOpenBank(a.getBankName()); vo.setPartyABankAccount(a.getBankAccount()); vo.setPartyB(b.getOrgName()); platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
@@ -5,7 +5,6 @@ import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; @@ -29,7 +28,6 @@ import com.by4cloud.platformx.business.entity.*; import com.by4cloud.platformx.business.mapper.*; import com.by4cloud.platformx.business.service.ContractPaymentScheduleProcessService; import com.by4cloud.platformx.business.service.ContractPaymentScheduleService; import com.by4cloud.platformx.business.service.ContractService; import com.by4cloud.platformx.business.utils.BatchInsertListener; import com.by4cloud.platformx.business.utils.ItemGeneratorUtil; @@ -49,6 +47,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.ClassPathResource; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.security.core.parameters.P; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -101,6 +100,12 @@ @Value("${erp.smj}") private String smjErp; @Value("${erp.smjsc}") private String smjscErp; @Value("${erp.smjzt}") private String smjztErp; @Value("${erp.sgb}") private String sgbErp; @@ -118,6 +123,9 @@ @Value("${dept.smjzt}") private String smjzt; @Value("${dept.smjhw}") private String smjhw; @Value("${dept.sgb}") private String sgb; @@ -196,7 +204,8 @@ } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { contract.setContractNo(generateSMJContractNo()); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -320,7 +329,8 @@ contract.setBillingAmout(new BigDecimal("0")); contract.setNickName(SecurityUtils.getUser().getNickname()); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { contract.setContractNo(generateSMJContractNo()); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -515,12 +525,13 @@ requestApply.put("fd_settlementType", "00"); requestApply.put("fd_applyType", "外销"); if (CollUtil.isNotEmpty(subjectMatterList)) { requestApply.put("fd_contractsubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(","))); requestApply.put("fd_contractSubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(","))); } requestApply.put("fd_docNumber", contract.getContractNo()); // requestApply.put("fd_templateId", "19e39bb6c1edadbdb162c434274a8a18"); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { requestApply.put("fd_templateId", tempSMJ); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -538,16 +549,18 @@ requestApply.put("fd_name", contract.getContractName()); requestApply.put("fd_signDate", DateUtil.formatDate(contract.getSignDate())); requestApply.put("fd_endDate", DateUtil.formatDate(contract.getExpirationDate())); requestApply.put("fd_contractCreater", contract.getNickName()); requestApply.put("fd_contractCreater", SecurityUtils.getUser().getNickname()); requestApply.put("fd_currency", "人民币"); requestApply.put("fd_ContractAmount", contract.getAmount()); requestApply.put("fd_finAmount", contract.getAmount().divide(new BigDecimal("113"), 2, RoundingMode.HALF_UP) .multiply(new BigDecimal("87"))); requestApply.put("fd_docStatus", "20"); requestApply.put("fd_docStatus", "10"); requestApply.put("fd_taxRates", 13); requestApply.put("fd_customerName", contract.getPartyA()); requestApply.put("fd_systemSource", "非煤销售系统"); requestApply.put("fd_type", "00"); requestApply.put("fd_baozhangren", comp.getBaozhangren()); requestApply.put("fd_summary",contract.getSummary()); JSONArray signList = new JSONArray(); JSONObject j = new JSONObject(); j.put("fd_standing","甲"); @@ -555,19 +568,48 @@ j.put("fd_signMain","2"); signList.add(j); JSONObject y = new JSONObject(); y.put("fd_standing","甲"); y.put("fd_standing","乙"); y.put("fd_Iden",comp.getOrgCode()); y.put("fd_signMain","1"); signList.add(y); requestApply.put("fd_signList", signList); JSONArray attList = new JSONArray(); JSONObject att = new JSONObject(); att.put("fd_attNum","1"); att.put("fd_attName",contract.getAttachmentName()); att.put("fd_attQuality","00"); att.put("fd_attcontent",NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl())); attList.add(att); requestApply.put("attList", att); if (StrUtil.isNotBlank(contract.getAttachmentUrl())) { JSONArray attList = new JSONArray(); JSONObject att = new JSONObject(); att.put("fd_attNum", "1"); att.put("fd_attName", contract.getAttachmentName()); att.put("fd_attType", contract.getAttachmentName().substring(contract.getAttachmentName().lastIndexOf('.')+1)); att.put("fd_attQuality", "00"); att.put("fd_attcontent", NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl())); attList.add(att); requestApply.put("attList", attList); } if (CollUtil.isNotEmpty(subjectMatterList)){ JSONArray materialList = new JSONArray(); subjectMatterList.stream().forEach(subjectMatter->{ JSONObject material = new JSONObject(); material.put("fd_materiaCode", subjectMatter.getMaterialCode()); material.put("fd_materiaName", subjectMatter.getMaterialInternalName()); material.put("fd_specification", StrUtil.isNotBlank(subjectMatter.getSpecification())?subjectMatter.getSpecification():""); material.put("fd_figureNumber", ""); material.put("fd_measureUnit", subjectMatter.getUnit()); material.put("fd_number", subjectMatter.getQuantity()); material.put("fd_price", subjectMatter.getUnitPrice()); Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode()).last("limit 1")); if (ObjUtil.isNotNull(product)){ material.put("fd_rate", product.getTaxRate().toString()); } material.put("fd_amount", subjectMatter.getUnitPrice().multiply(subjectMatter.getQuantity())); material.put("fd_requirements", ""); material.put("fd_standard", ""); material.put("fd_factory", ""); material.put("fd_Deadlines", ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate())?subjectMatter.getPlannedDeliveryDate():""); material.put("fd_delivery", ""); material.put("fd_des", ""); materialList.add(material); }); requestApply.put("materialList", materialList); } log.info("合同中心合同起草接口入参:{}", requestApply.toJSONString()); String respApply = HttpUtil.post("https://oa.res.jzeg.cn/ekp/api/km-agreement/kmAgreementWebService/addSupplyContractApply", requestApply.toJSONString()); log.info("合同中心合同起草接口回参:{}", respApply); @@ -632,7 +674,7 @@ requestApply.put("fd_MainContent", ""); requestApply.put("fd_settlementType", "00"); requestApply.put("fd_applyType", "外销"); requestApply.put("fd_contractsubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(","))); requestApply.put("fd_contractSubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(","))); requestApply.put("fd_docNumber", contract.getContractNo()); requestApply.put("fd_templateId", "19e39bb6c1edadbdb162c434274a8a18"); requestApply.put("fd_name", contract.getContractName()); @@ -664,7 +706,7 @@ request.put("fd_receivedNum", 1); request.put("fd_effedate", DateUtil.formatDate(contract.getSignDate())); request.put("fd_enddate", DateUtil.formatDate(contract.getExpirationDate())); request.put("fd_reviewerNo", contract.getNickName()); request.put("fd_reviewerNo", SecurityUtils.getUser().getNickname()); request.put("fd_docStatus", "20"); request.put("fd_templateId", "19e39bb6c1edadbdb162c434274a8a18"); request.put("fd_attName", contract.getAttachmentName()); @@ -722,33 +764,32 @@ }); request.put("details", subjectMatter); } JSONObject loginJson = new JSONObject(); loginJson.put("username", "admin"); loginJson.put("password", "admin123"); log.info("一煤机合同推送获取token入参:{}", loginJson.toJSONString()); String loginResp = HttpUtil.post(ymjErp + "/api/account/v1/login", loginJson.toJSONString()); log.info("一煤机合同推送获取token回参:{}", loginResp); JSONObject respJson = JSONObject.parseObject(loginResp); if (respJson.getInteger("code") == 0) { JSONObject dataJson = JSONObject.parseObject(respJson.getString("data")); log.info("一煤机合同推送erp入参:{}", request.toJSONString()); HttpResponse response = HttpRequest.post(ymjErp + "/api/contract-staging/v1/receive") .header("token", dataJson.getString("token")) // 添加认证头 .header("Content-Type", "application/json") // 设置内容类型 .body(request.toJSONString()) // 设置请求体 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("一煤机合同推送erp回参:{}", response.body()); //保存请求记录 saveErpRequestRecord("ymj", request.toJSONString(), response.body()); //更新合同erp推送标识 contract.setErpPushFlag("1"); baseMapper.updateById(contract); String token = ""; if (redisTemplate.hasKey("YMJ_ERP_TOKEN")) { token = (String) redisTemplate.opsForValue().get("YMJ_ERP_TOKEN"); } else { token = getYmjErpToken(); } if (StrUtil.isEmpty(token)){ log.error("一煤机登录获取token失败"); return; } log.info("一煤机合同推送erp入参:{}", request.toJSONString()); HttpResponse response = HttpRequest.post(ymjErp + "/api/contract-staging/v1/receive") .header("token", token) // 添加认证头 .header("Content-Type", "application/json") // 设置内容类型 .body(request.toJSONString()) // 设置请求体 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("一煤机合同推送erp回参:{}", response.body()); //保存请求记录 saveErpRequestRecord("ymj", request.toJSONString(), response.body()); //更新合同erp推送标识 contract.setErpPushFlag("1"); baseMapper.updateById(contract); } if ((StrUtil.equals(contract.getPartyBId() + "", smj) || StrUtil.equals(contract.getPartyBId() + "", smjsc) || StrUtil.equals(contract.getPartyBId() + "", smjzt)) && StrUtil.isNotEmpty(smjErp)) { if ((StrUtil.equals(contract.getPartyBId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) && StrUtil.isNotEmpty(smjErp)) { request.put("customerCode", customer.getErpCompanyCode()); request.put("currencyId", "RMB"); request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN)); @@ -756,6 +797,7 @@ request.put("moneySum", contract.getAmount()); request.put("signManner", "面签"); request.put("salesman", ""); request.put("tenantId", "tenant1"); if (CollUtil.isNotEmpty(subjectMatterList)) { JSONArray subjectMatter = new JSONArray(); subjectMatterList.stream().forEach(contractSubjectMatter -> { @@ -777,30 +819,139 @@ request.put("details", subjectMatter); } JSONObject loginJson = new JSONObject(); loginJson.put("username", "admin"); loginJson.put("password", "Zimafold@2026"); log.info("石煤机合同推送获取token入参:{}", loginJson.toJSONString()); String loginResp = HttpUtil.post(smjErp + "/api/account/v1/login", loginJson.toJSONString()); log.info("石煤机合同推送获取token回参:{}", loginResp); JSONObject respJson = JSONObject.parseObject(loginResp); if (respJson.getInteger("code") == 0) { JSONObject dataJson = JSONObject.parseObject(respJson.getString("data")); log.info("石煤机合同推送erp入参:{}", request.toJSONString()); HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails") .header("token", dataJson.getString("token")) // 添加认证头 .header("Content-Type", "application/json") // 设置内容类型 .body(request.toJSONString()) // 设置请求体 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("石煤机合同推送erp回参:{}", response.body()); //保存请求记录 saveErpRequestRecord("smj", request.toJSONString(), response.body()); //更新合同erp推送标识 contract.setErpPushFlag("1"); baseMapper.updateById(contract); } } String token = ""; if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) { token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN"); } else { token = getErpToken(); } if (StrUtil.isEmpty(token)){ log.error("石煤机登录获取token失败"); return; } log.info("石煤机合同推送erp入参:{}", request.toJSONString()); HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails?tenantId=tenant1") .header("token", token) // 添加认证头 .header("Content-Type", "application/json") // 设置内容类型 .body(request.toJSONString()) // 设置请求体 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("石煤机合同推送erp回参:{}", response.body()); //保存请求记录 saveErpRequestRecord("smj", request.toJSONString(), response.body()); //更新合同erp推送标识 contract.setErpPushFlag("1"); baseMapper.updateById(contract); } if (StrUtil.equals(contract.getPartyBId() + "", smjsc) && StrUtil.isNotEmpty(smjscErp)) { request.put("customerCode", customer.getErpCompanyCode()); request.put("currencyId", "RMB"); request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN)); request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN)); request.put("moneySum", contract.getAmount()); request.put("signManner", "面签"); request.put("salesman", ""); request.put("tenantId", "tenant2"); if (CollUtil.isNotEmpty(subjectMatterList)) { JSONArray subjectMatter = new JSONArray(); subjectMatterList.stream().forEach(contractSubjectMatter -> { JSONObject subjectMatterItem = new JSONObject(); subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode()); subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice()); subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity()); subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice())); Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId()) .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode())); if (ObjUtil.isNotNull(product)) { subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100"))); } subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ? DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) : DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN)); subjectMatter.add(subjectMatterItem); }); request.put("details", subjectMatter); } String token = ""; if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) { token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN"); } else { token = getErpToken(); } if (StrUtil.isEmpty(token)){ log.error("石煤机登录获取token失败"); return; } log.info("石煤机随车分公司合同推送erp入参:{}", request.toJSONString()); HttpResponse response = HttpRequest.post(smjErp + "/api/contract/v1/createWithDetails?tenantId=tenant2") .header("token", token) // 添加认证头 .header("Content-Type", "application/json") // 设置内容类型 .body(request.toJSONString()) // 设置请求体 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("石煤机随车分公司合同推送erp回参:{}", response.body()); //保存请求记录 saveErpRequestRecord("smj", request.toJSONString(), response.body()); //更新合同erp推送标识 contract.setErpPushFlag("1"); baseMapper.updateById(contract); } if (StrUtil.equals(contract.getPartyBId() + "", smjzt) && StrUtil.isNotEmpty(smjztErp)) { request.put("customerCode", customer.getErpCompanyCode()); request.put("currencyId", "RMB"); request.put("signDate", DateUtil.format(contract.getSignDate(), DatePattern.NORM_DATETIME_PATTERN)); request.put("dateDeliver", DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN)); request.put("moneySum", contract.getAmount()); request.put("signManner", "面签"); request.put("salesman", ""); request.put("tenantId", "tenant3"); if (CollUtil.isNotEmpty(subjectMatterList)) { JSONArray subjectMatter = new JSONArray(); subjectMatterList.stream().forEach(contractSubjectMatter -> { JSONObject subjectMatterItem = new JSONObject(); subjectMatterItem.put("itemNo", contractSubjectMatter.getMaterialCode()); subjectMatterItem.put("salePrice", contractSubjectMatter.getUnitPrice()); subjectMatterItem.put("qtyRequired", contractSubjectMatter.getQuantity()); subjectMatterItem.put("money", contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice())); Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId, contract.getCompId()) .eq(Product::getErpCode, contractSubjectMatter.getMaterialCode())); if (ObjUtil.isNotNull(product)) { subjectMatterItem.put("taxRate", new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100"))); } subjectMatterItem.put("dateDeliver", ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate()) ? DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(), DatePattern.NORM_DATETIME_PATTERN) : DateUtil.format(contract.getExpirationDate(), DatePattern.NORM_DATETIME_PATTERN)); subjectMatter.add(subjectMatterItem); }); request.put("details", subjectMatter); } String token = ""; if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) { token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN"); } else { token = getErpToken(); } if (StrUtil.isEmpty(token)){ log.error("石煤机登录获取token失败"); return; } log.info("石煤机钻探分公司合同推送erp入参:{}", request.toJSONString()); HttpResponse response = HttpRequest.post(smjztErp + "/api/contract/v1/createWithDetails?tenantId=tenant3") .header("token", token) // 添加认证头 .header("Content-Type", "application/json") // 设置内容类型 .body(request.toJSONString()) // 设置请求体 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("石煤机钻探分公司合同推送erp回参:{}", response.body()); //保存请求记录 saveErpRequestRecord("smj", request.toJSONString(), response.body()); //更新合同erp推送标识 contract.setErpPushFlag("1"); baseMapper.updateById(contract); } if (StrUtil.equals(contract.getPartyBId() + "", jxc) && StrUtil.isNotEmpty(jxcErp)) { log.info("机械厂合同推送erp入参:{}", request.toJSONString()); String result = HttpUtil.post(jxcErp, request.toJSONString()); @@ -822,6 +973,40 @@ } private String getErpToken() { JSONObject loginJson = new JSONObject(); loginJson.put("username", "admin"); loginJson.put("password", "Zimafold@2026"); log.info("石煤机产品获取token入参:{}", loginJson.toJSONString()); String loginResp = HttpUtil.post(smjErp + "/api/account/v1/login", loginJson.toJSONString()); log.info("石煤机产品获取token回参:{}", loginResp); JSONObject respJson = JSONObject.parseObject(loginResp); if (respJson.getInteger("code") == 0) { JSONObject dataJson = JSONObject.parseObject(respJson.getString("data")); redisTemplate.opsForValue().set("SMJ_ERP_TOKEN",dataJson.getString("token")); log.info("石煤机erp token为:{}",dataJson.getString("token")); return dataJson.getString("token"); } return ""; } private String getYmjErpToken(){ JSONObject loginJson = new JSONObject(); loginJson.put("username", "admin"); loginJson.put("password", "admin123"); log.info("一煤机合同推送获取token入参:{}", loginJson.toJSONString()); String loginResp = HttpUtil.post(ymjErp + "/api/account/v1/login", loginJson.toJSONString()); log.info("一煤机合同推送获取token回参:{}", loginResp); JSONObject respJson = JSONObject.parseObject(loginResp); if (respJson.getInteger("code") == 0) { JSONObject dataJson = JSONObject.parseObject(respJson.getString("data")); redisTemplate.opsForValue().set("YMJ_ERP_TOKEN",dataJson.getString("token")); log.info("一煤机erp token为:{}",dataJson.getString("token")); return dataJson.getString("token"); } return ""; } private void saveScheduleProcess(Contract contract,ContractPaymentSchedule schedule) { //新增合同履约记录 ContractPaymentScheduleProcess process = new ContractPaymentScheduleProcess(); @@ -830,7 +1015,12 @@ process.setScheduleId(schedule.getId()); process.setScheduleName(schedule.getStageName()); process.setProcessDate(contract.getSignDate()); contractPaymentScheduleProcessMapper.insert(process); ContractPaymentScheduleProcess lastProcess = contractPaymentScheduleProcessMapper.selectOne(Wrappers.<ContractPaymentScheduleProcess>lambdaQuery() .eq(ContractPaymentScheduleProcess::getContractId, schedule.getContractId()) .eq(ContractPaymentScheduleProcess::getScheduleId, schedule.getId()).last("limit 1")); if (ObjUtil.isNull(lastProcess)) { contractPaymentScheduleProcessMapper.insert(process); } } private void handleWaterHouseCycle(Contract contract, List<ContractSubjectMatter> subjectMatterList) { @@ -1076,7 +1266,8 @@ newContract.setContractStatus(0); newContract.setBillingAmout(new BigDecimal("0")); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { newContract.setContractNo(generateSMJContractNo()); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -1716,6 +1907,10 @@ @Override public R addContractSgb(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("请添加标的物"); } @@ -1773,7 +1968,24 @@ 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())); @@ -1838,7 +2050,7 @@ } //推送合同中心 pushCenter(contract.getId()); // pushCenter(contract.getId()); return R.ok(contract.getContractNo()); } @@ -2351,7 +2563,8 @@ contract.setNickName(SecurityUtils.getUser().getNickname()); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { contract.setContractNo(generateSMJContractNo()); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -2371,8 +2584,17 @@ } @Override public R pushCenter(Long id) { Contract contract = baseMapper.selectById(id); public R pushCenter(PushCenterDTO dto) { Contract contract = baseMapper.selectById(dto.getId()); contract.setSelectionMethod(dto.getSelectionMethod()); contract.setIsRelated(dto.getIsRelated()); contract.setContractCreater(dto.getContractCreater()); if(StrUtil.isNotBlank(dto.getAttachmentUrl())) { contract.setAttachmentName(dto.getAttachmentName()); contract.setAttachmentUrl(dto.getAttachmentUrl()); } baseMapper.updateById(contract); BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId()); if (ObjUtil.isNull(customer)){ @@ -2386,20 +2608,21 @@ SysDept comp = r.getData(); List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery() .eq(ContractSubjectMatter::getContractId, id)); .eq(ContractSubjectMatter::getContractId, dto.getId())); JSONObject requestApply = new JSONObject(); requestApply.put("fd_selectionmethod", "公开招标"); requestApply.put("fd_isrelated", "是"); requestApply.put("fd_selectionmethod", dto.getSelectionMethod()); requestApply.put("fd_isrelated", dto.getIsRelated()); requestApply.put("fd_bizId", contract.getId()); requestApply.put("fd_remark", contract.getRemark()); requestApply.put("fd_MainContent", ""); requestApply.put("fd_settlementType", "00"); requestApply.put("fd_applyType", "外销"); requestApply.put("fd_contractsubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(","))); requestApply.put("fd_contractSubject ", subjectMatterList.stream().map(item -> item.getMaterialName()).collect(Collectors.joining(","))); requestApply.put("fd_docNumber", contract.getContractNo()); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { requestApply.put("fd_templateId", tempSMJ); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -2417,7 +2640,7 @@ requestApply.put("fd_name", contract.getContractName()); requestApply.put("fd_signDate", DateUtil.formatDate(contract.getSignDate())); requestApply.put("fd_endDate", DateUtil.formatDate(contract.getExpirationDate())); requestApply.put("fd_contractCreater", contract.getNickName()); requestApply.put("fd_contractCreater", StrUtil.isNotEmpty(dto.getContractCreater())?dto.getContractCreater():SecurityUtils.getUser().getNickname()); requestApply.put("fd_currency", "人民币"); requestApply.put("fd_ContractAmount", contract.getAmount()); requestApply.put("fd_finAmount", contract.getAmount().divide(new BigDecimal("113"), 2, RoundingMode.HALF_UP) @@ -2427,6 +2650,8 @@ requestApply.put("fd_customerName", contract.getPartyA()); requestApply.put("fd_systemSource", "非煤销售系统"); requestApply.put("fd_type", "00"); requestApply.put("fd_baozhangren", comp.getBaozhangren()); requestApply.put("fd_summary",contract.getSummary()); JSONArray signList = new JSONArray(); JSONObject j = new JSONObject(); j.put("fd_standing","甲"); @@ -2434,29 +2659,58 @@ j.put("fd_signMain","2"); signList.add(j); JSONObject y = new JSONObject(); y.put("fd_standing","甲"); y.put("fd_standing","乙"); y.put("fd_Iden",comp.getOrgCode()); y.put("fd_signMain","1"); signList.add(y); requestApply.put("fd_signList", signList); JSONArray attList = new JSONArray(); JSONObject att = new JSONObject(); att.put("fd_attNum","1"); att.put("fd_attName",contract.getAttachmentName()); att.put("fd_attQuality","00"); att.put("fd_attcontent",NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl())); attList.add(att); requestApply.put("attList", att); log.info("合同中心合同起草接口入参:{}", requestApply.toJSONString()); if(StrUtil.isNotBlank(contract.getAttachmentUrl())){ JSONArray attList = new JSONArray(); JSONObject att = new JSONObject(); att.put("fd_attNum","1"); att.put("fd_attName",contract.getAttachmentName()); att.put("fd_attQuality","00"); att.put("fd_attcontent",NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl())); attList.add(att); requestApply.put("attList", att); } if (CollUtil.isNotEmpty(subjectMatterList)){ JSONArray materialList = new JSONArray(); subjectMatterList.stream().forEach(subjectMatter->{ JSONObject material = new JSONObject(); material.put("fd_materiaCode", subjectMatter.getMaterialCode()); material.put("fd_materiaName", subjectMatter.getMaterialInternalName()); material.put("fd_specification", StrUtil.isNotBlank(subjectMatter.getSpecification())?subjectMatter.getSpecification():""); material.put("fd_figureNumber", ""); material.put("fd_measureUnit", subjectMatter.getUnit()); material.put("fd_number", subjectMatter.getQuantity()); material.put("fd_price", subjectMatter.getUnitPrice()); Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getErpCode,subjectMatter.getMaterialCode()).last("limit 1")); if (ObjUtil.isNotNull(product)){ material.put("fd_rate", product.getTaxRate().toString()); } material.put("fd_amount", subjectMatter.getUnitPrice().multiply(subjectMatter.getQuantity())); material.put("fd_requirements", ""); material.put("fd_standard", ""); material.put("fd_factory", ""); material.put("fd_Deadlines", ObjUtil.isNotNull(subjectMatter.getPlannedDeliveryDate())?subjectMatter.getPlannedDeliveryDate():""); material.put("fd_delivery", ""); material.put("fd_des", ""); materialList.add(material); }); requestApply.put("materialList", materialList); } log.info("工业泵推送——合同中心合同起草接口入参:{}", requestApply.toJSONString()); String respApply = HttpUtil.post("https://oa.res.jzeg.cn/ekp/api/km-agreement/kmAgreementWebService/addSupplyContractApply", requestApply.toJSONString()); log.info("合同中心合同起草接口回参:{}", respApply); log.info("工业泵推送——合同中心合同起草接口回参:{}", respApply); JSONObject applyResp = JSONObject.parseObject(respApply); if (applyResp.getString("code").equals("00")) { contract.setCenterPushFlag("1"); baseMapper.updateById(contract); return R.ok(); } return R.failed("推送合同中心审核失败,原因为:{}",applyResp.getString("msg")); log.error("工业泵推送——推送合同中心审核失败,原因为:{}",applyResp.getString("msg")); return R.failed("工业泵推送——推送合同中心审核失败,原因为:{}",applyResp.getString("msg")); } @Override @@ -2755,8 +3009,9 @@ @Override public R syncContractStatus(SyncContractStatusDTO dto) { if (StrUtil.isBlank(dto.getContractNumber())){ return R.failed("合同编号不能为空"); log.info("合同审批结果同步,合同编号:{},审批结果:{}",dto.getContractNumber(),dto.getStatus()); if (StrUtil.isBlank(dto.getFd_bizId())){ return R.failed("数据ID不能为空"); } if (StrUtil.isBlank(dto.getStatus())){ return R.failed("审批状态不能为空"); @@ -2764,18 +3019,22 @@ if (StrUtil.isBlank(dto.getReturnPerson())){ return R.failed("审批人不能为空"); } if (StrUtil.isBlank(dto.getReturnDateTime())){ if (StrUtil.isBlank(dto.getReturnDate())){ return R.failed("审批时间不能为空"); } Contract contract = baseMapper.selectOne(Wrappers.<Contract>lambdaQuery().eq(Contract::getContractNo,dto.getContractNumber()).last("limit 1")); Contract contract = baseMapper.selectById(dto.getFd_bizId()); if(ObjUtil.isNull(contract)){ return R.failed("合同编号不异常"); return R.failed("数据ID异常"); } if (StrUtil.equals(dto.getStatus(),"1")){ takeEffect(contract.getId()); } if (!StrUtil.equals(dto.getStatus(),"1")){ if (StrUtil.equals(dto.getStatus(),"2")){ refuseApproval(contract.getId()); } if (StrUtil.equals(dto.getStatus(),"3")||StrUtil.equals(dto.getStatus(),"4")){ contract.setContractStatus(3); baseMapper.updateById(contract); } saveContractApproval(contract,dto); return R.ok(); @@ -2784,7 +3043,7 @@ private void saveContractApproval(Contract contract, SyncContractStatusDTO dto) { ContractApproval approval = BeanUtil.copyProperties(dto,ContractApproval.class); approval.setContractId(contract.getId()); approval.setReturnDateTime(DateUtil.parseDateTime(dto.getReturnDateTime())); approval.setReturnDateTime(DateUtil.parseDateTime(dto.getReturnDate())); approval.setCompId(contract.getCompId()); contractApprovalMapper.insert(approval); } @@ -2798,21 +3057,31 @@ if (!StrUtil.equals(contract.getContractStatus()+"","2")){ return R.failed("合同异常状态"); } contract.setSignDate(attDTO.getSignDate()); contract.setExpirationDate(attDTO.getExpirationDate()); contract.setSinger(attDTO.getSinger()); contract.setReviewerNo(attDTO.getReviewerNo()); contract.setLinkPerson(attDTO.getLinkPerson()); contract.setLinkPhone(attDTO.getLinkPhone()); Long betweenDay = DateUtil.betweenDay(attDTO.getExpirationDate(),attDTO.getSignDate(),true); contract.setDeliveryCycle(betweenDay.intValue()); baseMapper.updateById(contract); JSONObject request = new JSONObject(); request.put("fd_docNumber", contract.getContractNo()); request.put("fd_singer", contract.getNickName()); request.put("fd_singer", StrUtil.isNotEmpty(attDTO.getSinger())?attDTO.getSinger():SecurityUtils.getUser().getNickname()); request.put("fd_signTime", DateUtil.formatDate(contract.getSignDate())); request.put("fd_linkPerson", ""); request.put("fd_linkPhone", ""); request.put("fd_linkPerson", StrUtil.isNotEmpty(attDTO.getLinkPerson())?attDTO.getLinkPerson():""); request.put("fd_linkPhone", StrUtil.isNotEmpty(attDTO.getLinkPhone())?attDTO.getLinkPhone():""); request.put("fd_address", contract.getSignPlace()); request.put("fd_receivedTime", DateUtil.format(contract.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN)); request.put("fd_receivedNum", 1); request.put("fd_effedate", DateUtil.formatDate(contract.getSignDate())); request.put("fd_enddate", DateUtil.formatDate(contract.getExpirationDate())); request.put("fd_reviewerNo", contract.getNickName()); request.put("fd_reviewerNo", StrUtil.isNotEmpty(attDTO.getReviewerNo())?attDTO.getReviewerNo():SecurityUtils.getUser().getNickname()); request.put("fd_docStatus", "20"); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { request.put("fd_templateId", tempSMJ); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -3067,4 +3336,51 @@ } return R.ok(); } @Override public R getFinallyInfo(Long id) { Contract contract = baseMapper.selectById(id); return R.ok(BeanUtil.copyProperties(contract,ContractFinallyVo.class)); } @Override public R erpPush(Long id) { Contract contract = baseMapper.selectById(id); List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery() .eq(ContractSubjectMatter::getContractId, id)); pushSubCompany(contract,subjectMatterList); return R.ok(); } @Override public R associationPartyC(ContractAssociationPartyCyDTO associationPartyCyDTO) { Contract contract = baseMapper.selectById(associationPartyCyDTO.getId()); contract.setPartyCId(Long.valueOf(associationPartyCyDTO.getPartyCId())); baseMapper.updateById(contract); return R.ok(); } @Override public R getInvoiceObj(Long id) { Contract contract = baseMapper.selectById(id); ContractInvoiceObjVo objVo = BeanUtil.copyProperties(contract,ContractInvoiceObjVo.class); List<BusinessCustomerSelectVo> selectVoList = new ArrayList<>(); BusinessCustomer a = businessCustomerMapper.selectById(contract.getPartyAId()); if (ObjUtil.isNotNull(a)){ objVo.setPartyA(a.getCompanyName()); objVo.setPartyAOrgCode(a.getCreditCode()); objVo.setInvoiceType(StrUtil.isNotBlank(a.getInvoiceType())?a.getInvoiceType():"01"); BusinessCustomerSelectVo selectVo = BeanUtil.copyProperties(a,BusinessCustomerSelectVo.class); selectVoList.add(selectVo); } if (ObjUtil.isNotNull(contract.getPartyCId())){ BusinessCustomer c = businessCustomerMapper.selectById(contract.getPartyCId()); if (ObjUtil.isNotNull(c)){ BusinessCustomerSelectVo selectVo = BeanUtil.copyProperties(c,BusinessCustomerSelectVo.class); selectVoList.add(selectVo); } } objVo.setLinkPartyC(selectVoList); return R.ok(objVo); } } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
@@ -58,6 +58,9 @@ @Value("${dept.smjzt}") private String smjzt; @Value("${dept.smjhw}") private String smjhw; @Value("${dept.sgb}") private String sgb; @@ -111,7 +114,8 @@ addDTO.getSubjectMatterList().stream().forEach(outSubjectMatterAddDTO -> { OutBound outBound = BeanUtil.copyProperties(outSubjectMatterAddDTO, OutBound.class); if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { outBound.setBatchNumber(generateSMJContractCKNo()); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { @@ -465,8 +469,9 @@ return r; } Contract contract = r.getData(); String batchNumber = genBatchNumber(); //出库 handleOutBound(contract, addDTO); handleOutBound(batchNumber,contract, addDTO); //保存资金明细 BigDecimal outBoundAmount = savePaymentConfirm(contract, addDTO); @@ -474,7 +479,7 @@ contract.setOutBoundAmout(outBoundAmount); updateContractSchedule(contract); return R.ok(); return R.ok(batchNumber); } private void updateContractSchedule(Contract contract) { @@ -543,7 +548,7 @@ return outAmount; } private void handleOutBound(Contract contract, OutBoundAddDTO addDTO) { private void handleOutBound(String batchNumber,Contract contract, OutBoundAddDTO addDTO) { addDTO.getSubjectMatterList().stream().forEach(outSubjectMatterAddDTO -> { ContractSubjectMatter subjectMatter = contractSubjectMatterMapper.selectOne(Wrappers.<ContractSubjectMatter>lambdaQuery() .eq(ContractSubjectMatter::getContractId, contract.getId()) @@ -571,7 +576,6 @@ subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime()); contractSubjectMatterMapper.updateById(subjectMatter); //保存erp出库 String batchNumber = genBatchNumber(); Long outBoundId = saveErpOutBound(contract, addDTO, outSubjectMatterAddDTO, batchNumber); //保存合同出库记录 saveContractOutBound(contract, addDTO, subjectMatter, outBoundId); @@ -580,7 +584,8 @@ private String genBatchNumber() { if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { return generateSMJContractCKNo(); } if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/PaymentConfirmServiceImpl.java
@@ -321,7 +321,7 @@ }else { params.put("enddate", DateUtil.today()); } params.put("dc_flag","1");//1 借 2 贷 只查收款 params.put("dc_flag","2");//1 借 2 贷 只查收款 银行角度所以是 贷 //单据状态已审批 params.put("accentity_code", bipCode); String finalAccessToken = accessToken; platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java
@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.by4cloud.platformx.business.dto.ProductAddDTO; import com.by4cloud.platformx.business.dto.ProductQueryDTO; @@ -33,6 +34,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.validation.BindingResult; @@ -56,10 +58,42 @@ private final TaxCodeMapper taxCodeMapper; private final StringRedisTemplate redisTemplate; @Value("${erp.smj}") private String smjErp; @Override @Value("${erp.smjsc}") private String smjscErp; @Value("${erp.smjzt}") private String smjztErp; @Value("${dept.smj}") private String smj; @Value("${dept.smjsc}") private String smjsc; @Value("${dept.smjzt}") private String smjzt; @Value("${dept.smjhw}") private String smjhw; @Override public Page pageScope(Page page, Product product) { if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { List<String> smjList = new ArrayList<>(); smjList.add(smj); smjList.add(smjhw); return baseMapper.page(page,product,smjList); } return baseMapper.pageScope(page,product,DataScope.of("comp_id")); } @Override public List<Tree<Long>> treeList() { List<TreeNode<Long>> collect = baseMapper .selectListByScope(Wrappers.<Product>lambdaQuery() @@ -126,9 +160,12 @@ // .eq(StrUtil.isNotEmpty(queryDTO.getParentId()),Product::getParentId,queryDTO.getParentId()) // .in(StrUtil.isNotEmpty(queryDTO.getContractCategory())&&StrUtil.equals(queryDTO.getContractCategory(), "water_house"), // Product::getErpCode,erpCodes); if (StrUtil.isNotBlank(queryDTO.getProductIds())){ String[] arr = queryDTO.getProductIds().split(","); queryDTO.setProductId(Arrays.stream(arr).collect(Collectors.toList())); } if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"","2089995177814495234")|| StrUtil.equals(SecurityUtils.getUser().getCompId()+"","2089996921978040321")|| StrUtil.equals(SecurityUtils.getUser().getCompId()+"","2089997578009128962")){ StrUtil.equals(SecurityUtils.getUser().getCompId()+"","2101966257365045249")){ List<ProductSelectVo> selectVos = baseMapper.getProductSMJListByParentId(queryDTO, Arrays.asList(erpCodes)); if (selectVos.size()>2000){ return R.ok(selectVos.subList(0,1999)); @@ -147,6 +184,9 @@ if (CollUtil.isNotEmpty(addDTOS)){ for (ProductAddDTO addDTO:addDTOS ) { if (StrUtil.isBlank(addDTO.getErpCode())){ return R.failed("erp编码不能为空"); } List<Product> classPro = baseMapper.selectListByScope(Wrappers.<Product>lambdaQuery() .eq(StrUtil.isNotEmpty(addDTO.getErpTypeCode()),Product::getErpCode,addDTO.getErpTypeCode()) .eq(StrUtil.isNotEmpty(addDTO.getErpTypeName()),Product::getProductName,addDTO.getErpTypeName()) @@ -166,21 +206,26 @@ baseMapper.insert(product); classPro.add(product); } Product product = new Product(); product.setProductName(addDTO.getErpName()); product.setProductType(addDTO.getSpecification()); product.setParentId(classPro.get(0).getId()); product.setParentName(classPro.get(0).getProductName()); 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.getSphwjc()); product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); List<Product> productList = baseMapper.selectListByScope(Wrappers.<Product>lambdaQuery() .eq(StrUtil.isNotEmpty(addDTO.getErpCode()),Product::getErpCode,addDTO.getErpCode()) , DataScope.of("comp_id")); if (CollUtil.isEmpty(productList)){ Product product = new Product(); product.setProductName(addDTO.getErpName()); product.setProductType(addDTO.getSpecification()); product.setParentId(classPro.get(0).getId()); product.setParentName(classPro.get(0).getProductName()); 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.getSphwjc()); product.setTaxRate(Double.valueOf(taxCode.getSl().replace("%",""))); } baseMapper.insert(product); } baseMapper.insert(product); } } return R.ok(); return R.failed("数据为空"); } @Override @@ -265,19 +310,22 @@ }else { startDate = dto.getStartDate(); } JSONObject loginJson = new JSONObject(); loginJson.put("username", "admin"); loginJson.put("password", "Zimafold@2026"); log.info("石煤机产品获取token入参:{}", loginJson.toJSONString()); String loginResp = HttpUtil.post(smjErp + "/api/account/v1/login", loginJson.toJSONString()); log.info("石煤机产品获取token回参:{}", loginResp); JSONObject respJson = JSONObject.parseObject(loginResp); if (respJson.getInteger("code") == 0) { JSONObject dataJson = JSONObject.parseObject(respJson.getString("data")); HttpResponse response = HttpRequest.get(smjErp + "/api/item/v1/byDateCre?startDate=" + startDate) .header("token", dataJson.getString("token")) // 添加认证头 String token = ""; if (redisTemplate.hasKey("SMJ_ERP_TOKEN")) { token = (String) redisTemplate.opsForValue().get("SMJ_ERP_TOKEN"); } else { token = getErpToken(); } if (StrUtil.isEmpty(token)){ return R.failed("石煤机登录获取token失败"); } List<String> list = Arrays.asList("tenant1","tenant2","tenant3"); for (int i = 0; i < list.size(); i++) { String tan = list.get(i); HttpResponse response = HttpRequest.get(smjErp + "/api/item/v1/byDateCre?startDate=" + startDate+"&tenantId="+tan) .header("token", token) // 添加认证头 .execute(); // 执行请求.post(ymjErp,request.toJSONString()); log.info("石煤机产品获取回参:{}", response.body()); log.info("石煤机——"+tan+"产品获取回参:{}", response.body()); JSONObject proResult = JSONObject.parseObject(response.body()); JSONArray items = proResult.getJSONArray("data"); if (CollUtil.isNotEmpty(items)){ @@ -286,10 +334,13 @@ JSONObject product = (JSONObject) item; Product productClass = baseMapper.selectOne(Wrappers.<Product>lambdaQuery() .eq(Product::getProductName,product.getString("itemClassName")) .and(wrapper -> wrapper.eq(Product::getCompId,"2089995177814495234") .or().eq(Product::getCompId,"2089996921978040321") .or().eq(Product::getCompId,"2089997578009128962") ) // .and(wrapper -> wrapper.eq(Product::getCompId,"2089995177814495234") // .or().eq(Product::getCompId,"2089996921978040321") // .or().eq(Product::getCompId,"2089997578009128962") // ) .eq(StrUtil.equals(tan,"tenant1"),Product::getCompId,"2089995177814495234") .eq(StrUtil.equals(tan,"tenant2"),Product::getCompId,"2089996921978040321") .eq(StrUtil.equals(tan,"tenant3"),Product::getCompId,"2089997578009128962") .last("limit 1") ); if(ObjUtil.isNull(productClass)){ @@ -298,7 +349,15 @@ productClass.setProductName(product.getString("itemClassName")); productClass.setErpCode(product.getString("itemClassName")); productClass.setParentId(0L); productClass.setCompId(2089995177814495234L); if(StrUtil.equals(tan,"tenant1")){ productClass.setCompId(2089995177814495234L); } if(StrUtil.equals(tan,"tenant2")){ productClass.setCompId(2089996921978040321L); } if(StrUtil.equals(tan,"tenant3")){ productClass.setCompId(2089997578009128962L); } TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,product.getString("tfTaxClass")).last("limit 1")); if (ObjUtil.isNotNull(taxCode)){ productClass.setTaxClass(taxCode.getSphwjc()); @@ -309,10 +368,13 @@ } Product productNew = baseMapper.selectOne(Wrappers.<Product>lambdaQuery() .eq(Product::getErpCode,product.getString("itemNo")) .and(wrapper -> wrapper.eq(Product::getCompId,"2089995177814495234") .or().eq(Product::getCompId,"2089996921978040321") .or().eq(Product::getCompId,"2089997578009128962") ) // .and(wrapper -> wrapper.eq(Product::getCompId,"2089995177814495234") // .or().eq(Product::getCompId,"2089996921978040321") // .or().eq(Product::getCompId,"2089997578009128962") // ) .eq(StrUtil.equals(tan,"tenant1"),Product::getCompId,"2089995177814495234") .eq(StrUtil.equals(tan,"tenant2"),Product::getCompId,"2089996921978040321") .eq(StrUtil.equals(tan,"tenant3"),Product::getCompId,"2089997578009128962") .last("limit 1") ); if(ObjUtil.isNull(productNew)){ @@ -321,7 +383,15 @@ productNew.setProductName(product.getString("note")); productNew.setErpCode(product.getString("itemNo")); productNew.setProductType(product.getString("grade")); productNew.setCompId(2089995177814495234L); if(StrUtil.equals(tan,"tenant1")){ productNew.setCompId(2089995177814495234L); } if(StrUtil.equals(tan,"tenant2")){ productNew.setCompId(2089996921978040321L); } if(StrUtil.equals(tan,"tenant3")){ productNew.setCompId(2089997578009128962L); } productNew.setParentId(productClass.getId()); TaxCode taxCode = taxCodeMapper.selectOne(Wrappers.<TaxCode>lambdaQuery().eq(TaxCode::getBm,product.getString("tfTaxClass")).last("limit 1")); if (ObjUtil.isNotNull(taxCode)){ @@ -336,6 +406,24 @@ }); } } return R.ok(); } private String getErpToken() { JSONObject loginJson = new JSONObject(); loginJson.put("username", "admin"); loginJson.put("password", "Zimafold@2026"); log.info("石煤机产品获取token入参:{}", loginJson.toJSONString()); String loginResp = HttpUtil.post(smjErp + "/api/account/v1/login", loginJson.toJSONString()); log.info("石煤机产品获取token回参:{}", loginResp); JSONObject respJson = JSONObject.parseObject(loginResp); if (respJson.getInteger("code") == 0) { JSONObject dataJson = JSONObject.parseObject(respJson.getString("data")); redisTemplate.opsForValue().set("SMJ_ERP_TOEKN",dataJson.getString("token")); log.info("石煤机erp token为:{}",dataJson.getString("token")); return dataJson.getString("token"); } return ""; } } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/StatisticServiceImpl.java
@@ -1326,4 +1326,32 @@ } return R.ok(homeOverdueVos); } @Override public R homeZgsColum() { R<List<SysDictItem>> r = remoteDictService.getDictByType("province"); List<SysDictItem> items = r.getData(); if (CollUtil.isEmpty(items)){ return R.failed("客商省份字典分类获取异常"); } List<HomeZgsData> list = new ArrayList<>(); List<String> contractProvinces = contractMapper.homeZgsColum(SecurityUtils.getUser().getCompId()); if (CollUtil.isNotEmpty(contractProvinces)){ contractProvinces.stream().forEach(province->{ HomeZgsData homeZgsData = contractInvoiceMapper.homeZgsData(SecurityUtils.getUser().getCompId(),province); SysDictItem result = items.stream() .filter(item -> item != null && province.equals(item.getItemValue())) .findFirst() .orElse(null); homeZgsData.setProvinceCode(province); if (ObjUtil.isNotNull(result)){ homeZgsData.setProvinceName(result.getLabel()); } list.add(homeZgsData); }); return R.ok(list); } return R.ok(); } } platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/utils/SignHelper.java
@@ -48,9 +48,9 @@ public static void main(String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException { long timestamp = System.currentTimeMillis(); Map<String, Object> paramMap = new HashMap<>(); paramMap.put("appKey", "95578dbdeabc41049b75e8af3dd66d19"); paramMap.put("appKey", "a4b2285c6cd448bc9c297728a699893d"); paramMap.put("timestamp", timestamp); System.out.println(timestamp); System.out.println(sign(paramMap,"f3a098d7848f87042b39d2cc1645b6c0ffa065cd")); System.out.println(sign(paramMap,"9e80437dab1cb978ccc843c8287ad0c1045a0b49")); } } platformx-business-finance-biz/src/main/resources/mapper/ContractInvoiceMapper.xml
@@ -480,8 +480,8 @@ <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> AND t2.company_name LIKE CONCAT('%', #{queryDTO.partyA}, '%') </if> <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> AND t2.class_id = #{queryDTO.queryArea} <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> AND t2.province = #{queryDTO.queryProvince} </if> <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> AND t2.export_service_attr = #{queryDTO.queryServiceAttr} @@ -597,4 +597,136 @@ ORDER BY create_time ASC </select> <select id="homeZgsData" resultType="com.by4cloud.platformx.business.vo.HomeZgsData"> SELECT ( SELECT sum( ci.invoice_total_price_tax ) FROM contract_invoice ci, contract c, business_customer bc WHERE ci.del_flag = '0' AND bc.del_flag = '0' AND c.del_flag = '0' AND ci.contract_id = c.id AND bc.id = c.party_a_id AND c.party_b_id = #{compId} AND bc.province=#{province} AND ci.invoice_time >= CURDATE() AND ci.invoice_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) kpbr, ( SELECT sum( ci.invoice_total_price_tax ) FROM contract_invoice ci, contract c, business_customer bc WHERE ci.del_flag = '0' AND bc.del_flag = '0' AND c.del_flag = '0' AND ci.contract_id = c.id AND bc.id = c.party_a_id AND c.party_b_id = #{compId} AND bc.province=#{province} 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' )) kpby, ( SELECT sum( ci.invoice_total_price_tax ) FROM contract_invoice ci, contract c, business_customer bc WHERE ci.del_flag = '0' AND bc.del_flag = '0' AND c.del_flag = '0' AND ci.contract_id = c.id AND bc.id = c.party_a_id AND c.party_b_id = #{compId} AND bc.province=#{province} AND ci.invoice_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) AND ci.invoice_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-%m-01' )) kpbn, ( SELECT sum(ps.payment_amount) FROM payment_slip ps, business_customer bc WHERE ps.del_flag = '0' AND bc.del_flag = '0' AND bc.id = ps.bus_guest_id AND ps.comp_id = #{compId} AND bc.province=#{province} AND ps.payment_time >= CURDATE() AND ps.payment_time < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) skbr, ( SELECT sum(ps.payment_amount) FROM payment_slip ps, business_customer bc WHERE ps.del_flag = '0' AND bc.del_flag = '0' AND bc.id = ps.bus_guest_id AND ps.comp_id = #{compId} AND bc.province=#{province} 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' )) skby, ( SELECT sum(ps.payment_amount) FROM payment_slip ps, business_customer bc WHERE ps.del_flag = '0' AND bc.del_flag = '0' AND bc.id = ps.bus_guest_id AND ps.comp_id = #{compId} AND bc.province=#{province} AND ps.payment_time >= DATE_FORMAT( CURDATE(), '%Y-01-01' ) AND ps.payment_time < DATE_FORMAT( DATE_ADD( CURDATE(), INTERVAL 1 YEAR ), '%Y-%m-01' )) skbn, ( SELECT sum( c.amount ) FROM contract c LEFT JOIN business_customer bc ON bc.id = c.party_a_id WHERE c.del_flag = '0' AND c.party_b_id = #{compId} AND bc.province=#{province} AND c.sign_date >= CURDATE() AND c.sign_date < DATE_ADD( CURDATE(), INTERVAL 1 DAY )) htbr, ( SELECT sum( c.amount ) FROM contract c LEFT JOIN business_customer bc ON bc.id = c.party_a_id WHERE c.del_flag = '0' AND c.party_b_id = #{compId} AND bc.province=#{province} 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' )) htby, ( SELECT sum( c.amount ) FROM contract c LEFT JOIN business_customer bc ON bc.id = c.party_a_id WHERE c.del_flag = '0' AND c.party_b_id = #{compId} AND bc.province=#{province} 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> </mapper> platformx-business-finance-biz/src/main/resources/mapper/ContractMapper.xml
@@ -74,8 +74,8 @@ <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> and t.party_a LIKE CONCAT('%', #{queryDTO.partyA}, '%') </if> <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> AND t1.class_id = #{queryDTO.queryArea} <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> AND t1.province = #{queryDTO.queryProvince} </if> <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> AND t1.export_service_attr = #{queryDTO.queryServiceAttr} @@ -1095,6 +1095,7 @@ c.party_a, c.party_b_id, c.party_b, c.party_c_id, c.amount, c.contract_type, c.supply_attribute, @@ -1146,8 +1147,8 @@ <if test="queryDTO.queryCompId !=null and queryDTO.queryCompId !=''"> AND c.comp_id = #{queryDTO.queryCompId} </if> <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> AND bc.class_id = #{queryDTO.queryArea} <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} platformx-business-finance-biz/src/main/resources/mapper/PaymentSlipMapper.xml
@@ -499,8 +499,8 @@ <if test="queryDTO.partyA !=null and queryDTO.partyA !=''"> AND t.bus_guest_name LIKE CONCAT('%', #{queryDTO.partyA}, '%') </if> <if test="queryDTO.queryArea !=null and queryDTO.queryArea !=''"> AND t1.class_id = #{queryDTO.queryArea} <if test="queryDTO.queryProvince !=null and queryDTO.queryProvince !=''"> AND t1.province = #{queryDTO.queryProvince} </if> <if test="queryDTO.queryServiceAttr !=null and queryDTO.queryServiceAttr !=''"> AND t1.export_service_attr = #{queryDTO.queryServiceAttr} platformx-business-finance-biz/src/main/resources/mapper/ProductMapper.xml
@@ -67,11 +67,27 @@ del_flag = '0' <if test="queryDTO.productName !=null and queryDTO.productName !=''"> and ( t.product_name LIKE CONCAT('%', #{queryDTO.productName}, '%') or t.erp_code LIKE CONCAT('%', #{queryDTO.productName}, '%')) t.erp_code LIKE CONCAT('%', #{queryDTO.productName}, '%') <if test="queryDTO.productId != null and queryDTO.productId.size() > 0"> or t.id IN <foreach collection="queryDTO.productId" item="id" open="(" separator="," close=")"> #{id} </foreach> </if> ) </if> <if test="queryDTO.parentId !=null "> and t.parent_id = #{queryDTO.parentId} and (t.parent_id = #{queryDTO.parentId} <if test="queryDTO.productId != null and queryDTO.productId.size() > 0"> or t.id IN <foreach collection="queryDTO.productId" item="id" open="(" separator="," close=")"> #{id} </foreach> </if> ) </if> <choose> <when test="queryDTO.contractCategory !=null and queryDTO.contractCategory !='' and queryDTO.contractCategory=='water_house'"> and t.erp_code in @@ -112,11 +128,27 @@ del_flag = '0' <if test="queryDTO.productName !=null and queryDTO.productName !=''"> and ( t.product_name LIKE CONCAT('%', #{queryDTO.productName}, '%') or t.erp_code LIKE CONCAT('%', #{queryDTO.productName}, '%')) t.erp_code LIKE CONCAT('%', #{queryDTO.productName}, '%') <if test="queryDTO.productId != null and queryDTO.productId.size() > 0"> or t.id IN <foreach collection="queryDTO.productId" item="id" open="(" separator="," close=")"> #{id} </foreach> </if> ) </if> <if test="queryDTO.parentId !=null "> and t.parent_id = #{queryDTO.parentId} and (t.parent_id = #{queryDTO.parentId} <if test="queryDTO.productId != null and queryDTO.productId.size() > 0"> or t.id IN <foreach collection="queryDTO.productId" item="id" open="(" separator="," close=")"> #{id} </foreach> </if> ) </if> <choose> <when test="queryDTO.contractCategory !=null and queryDTO.contractCategory !='' and queryDTO.contractCategory=='water_house'"> and t.erp_code in @@ -133,4 +165,76 @@ </choose> and ( t.comp_id = 2089995177814495234 or t.comp_id = 2089996921978040321 or t.comp_id = 2089997578009128962) </select> <select id="pageScope" resultType="com.by4cloud.platformx.business.entity.Product"> SELECT t.id, t.product_name, t.main_code, t.erp_code, t.product_type, t.tax_rate, t.tax_class, t.tax_code, t.parent_id, t.create_by, t.update_by, t.create_time, t.update_time, t.del_flag, t.comp_id, ifnull((select product_name from product t1 where t1.id = t.parent_id),'根级产品') AS parentName FROM product t WHERE del_flag = '0' <if test="queryDTO.productName !=null and queryDTO.productName !=''"> AND t.product_name LIKE CONCAT('%', #{queryDTO.productName}, '%') </if> <if test="queryDTO.mainCode !=null and queryDTO.mainCode !=''"> AND t.main_code LIKE CONCAT('%', #{queryDTO.mainCode}, '%') </if> <if test="queryDTO.erpCode !=null and queryDTO.erpCode !=''"> AND t.erp_code LIKE CONCAT('%', #{queryDTO.erpCode}, '%') </if> order by t.create_time desc </select> <select id="page" resultType="com.by4cloud.platformx.business.entity.Product"> SELECT t.id, t.product_name, t.main_code, t.erp_code, t.product_type, t.tax_rate, t.tax_class, t.tax_code, t.parent_id, t.create_by, t.update_by, t.create_time, t.update_time, t.del_flag, t.comp_id, ifnull((select product_name from product t1 where t1.id = t.parent_id),'根级产品') AS parentName FROM product t WHERE del_flag = '0' <if test="queryDTO.productName !=null and queryDTO.productName !=''"> AND t.product_name LIKE CONCAT('%', #{queryDTO.productName}, '%') </if> <if test="queryDTO.mainCode !=null and queryDTO.mainCode !=''"> AND t.main_code LIKE CONCAT('%', #{queryDTO.mainCode}, '%') </if> <if test="queryDTO.erpCode !=null and queryDTO.erpCode !=''"> AND t.erp_code LIKE CONCAT('%', #{queryDTO.erpCode}, '%') </if> <if test="smjList != null and smjList.size() > 0"> AND t.comp_id IN <foreach collection="smjList" item="id" open="(" separator="," close=")"> #{id} </foreach> </if> order by t.create_time desc </select> </mapper>