diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java new file mode 100644 index 0000000..50a978f --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java @@ -0,0 +1,59 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + * @description 额度管理基础资料 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_limit_management_detail", autoResultMap = true) +public class LimitManagementDetailEntity extends BaseMgrEntity { + + + @SerializedName(value = "limit_management_id") + private Long LimitManagementId; + + @SerializedName(value = "user_id") + private String user_id; + + @SerializedName(value = "min_percentage") + private BigDecimal minPercentage; + + + @SerializedName(value = "max_percentage") + private BigDecimal maxPercentage; + + + @SerializedName(value = "overdue_date_range") + private String overdueDateRange; + + + @SerializedName(value = "processed_by") + private String processedBy; + + + @SerializedName(value = "handling_method") + private String handlingMethod; + + + @SerializedName(value = "processed_by_type") + private String processedByType; + + @SerializedName(value = "class_interval_name") + @TableField(exist = false) + private String classIntervalName; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java new file mode 100644 index 0000000..7dacb6b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java @@ -0,0 +1,49 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_limit_management", autoResultMap = true) +public class LimitManagementEntity extends BaseMgrEntity { + + + @SerializedName(value = "class_interval_name") + private String classIntervalName; + + + @SerializedName(value = "class_interval_no") + private String classIntervalNo; + + @SerializedName(value = "min_percentage") + private BigDecimal minPercentage; + + + @SerializedName(value = "max_percentage") + private BigDecimal maxPercentage; + + + @TableField(exist = false) + @SerializedName(value = "quota_ratio") + private BigDecimal quotaRatio; + + @TableField(exist = false) + @SerializedName(value = "info") + private List info; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java new file mode 100644 index 0000000..5cd5e41 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java @@ -0,0 +1,112 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_payment_details", autoResultMap = true) +public class PaymentDetailsEntity extends BaseMgrEntity { + + + /** 应收单号 */ + @SerializedName(value = "receivable_no") + private String receivableNo; + + /** 应收序号 */ + @SerializedName(value = "receivable_non") + private String receivableNon; + + /** 客户编号 */ + @SerializedName(value = "customer_no") + private String customerNo; + + /** 客户名称 */ + @SerializedName(value = "customer_name") + private String customerName; + + /** 状态 */ + @SerializedName(value = "status") + private String status; + + /** 销售单号 */ + @SerializedName(value = "sales_order") + private String salesOrder; + + /** 销售单序号 */ + @SerializedName(value = "sales_order_number") + private String salesOrderNumber; + + /** 合同编号 */ + @SerializedName(value = "contract_no") + private String contractNo; + + /** 品号 */ + @SerializedName(value = "sku_code") + private String skuCode; + + /** 品名 */ + @SerializedName(value = "sku_name") + private String skuName; + + /** 规格 */ + @SerializedName(value = "sku_spec") + private String skuSpec; + + /** 联系人 */ + @SerializedName(value = "contacts") + private String contacts; + + /** 联系方式 */ + @SerializedName(value = "contact_information") + private String contactInformation; + + /** 业务助理 */ + @SerializedName(value = "salesman_assistant") + private String salesmanAssistant; + + /** 业务员 */ + @SerializedName(value = "salesman") + private String salesman; + + /** 业务主管 */ + @SerializedName(value = "salesman_boss") + private String salesmanBoss; + + /** 生产主管 */ + @SerializedName(value = "produce_boss") + private String produceBoss; + + /** 工单单号 */ + @SerializedName(value = "work_no") + private String workNo; + + /** 含税金额 */ + @SerializedName(value = "amount_tax") + private BigDecimal amountTax; + + /** 含税单价 */ + @SerializedName(value = "price_tax") + private BigDecimal priceTax; + + /** 数量 */ + @SerializedName(value = "quantity") + private BigDecimal quantity; + + /** 逾期天数 */ + @SerializedName(value = "overdue_days") + private Long overdueDays; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml new file mode 100644 index 0000000..6a58c52 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml @@ -0,0 +1,24 @@ + + + + + + + UPDATE cim_limit_management_detail + + `overdue_date_range` = #{item.overdueDateRange}, + `processed_by` = #{item.processedBy}, + `handling_method` = #{item.handlingMethod}, + `processed_by_type` = #{item.processedByType}, + `modified_date` = now(), + `modified_by` = #{item.modifiedBy} + + + WHERE `id` = #{item.id} + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml new file mode 100644 index 0000000..ba6d765 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java new file mode 100644 index 0000000..0de2334 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java @@ -0,0 +1,17 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementDetailRepository extends BaseRepository { + + void updateBatch(@Param("list")List list); + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java new file mode 100644 index 0000000..599ce52 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java new file mode 100644 index 0000000..d77c524 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface PaymentDetailsRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java new file mode 100644 index 0000000..99907ea --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementDetailService extends IBaseService{ +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java new file mode 100644 index 0000000..e2388a0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java new file mode 100644 index 0000000..25e19fe --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface PaymentDetailsService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java new file mode 100644 index 0000000..18f214a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitManagementDetailRepository; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementDetailService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +public class LimitManagementDetailServiceImpl extends AbsBaseService implements LimitManagementDetailService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java new file mode 100644 index 0000000..f24f0fa --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitManagementRepository; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +public class LimitManagementServiceImpl extends AbsBaseService implements LimitManagementService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java new file mode 100644 index 0000000..95b50ae --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.app.ptc.infra.repository.PaymentDetailsRepository; +import com.digiwin.athena.app.ptc.infra.service.PaymentDetailsService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +public class PaymentDetailsServiceImpl extends AbsBaseService implements PaymentDetailsService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java new file mode 100644 index 0000000..365d332 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java @@ -0,0 +1,21 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementDetailEAIService extends DWService { + + @EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + @EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java new file mode 100644 index 0000000..74a9ce0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java @@ -0,0 +1,19 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementEAIService extends DWService { + + @EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java new file mode 100644 index 0000000..9e154dd --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java @@ -0,0 +1,18 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.ptc.service.paymentdetails.PaymentDetailsUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface PaymentDetailsEAIService extends DWService { + + @EAIService(id = PaymentDetailsUtil.RECEIVABLES_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java new file mode 100644 index 0000000..b2f87d3 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java @@ -0,0 +1,29 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.LimitManagementDetailEAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class LimitManagementDetailEAIServiceImpl implements LimitManagementDetailEAIService{ + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET,headers,messageBody); + } + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java new file mode 100644 index 0000000..46cdb80 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java @@ -0,0 +1,25 @@ +package com.digiwin.athena.app.ptc.provider.impl; + + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.LimitManagementEAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class LimitManagementEAIServiceImpl implements LimitManagementEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java new file mode 100644 index 0000000..845dbd9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java @@ -0,0 +1,23 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.PaymentDetailsEAIService; +import com.digiwin.athena.app.ptc.service.paymentdetails.PaymentDetailsUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class PaymentDetailsEAIServiceImpl implements PaymentDetailsEAIService { + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PaymentDetailsUtil.RECEIVABLES_GET,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java new file mode 100644 index 0000000..cc4dbce --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java @@ -0,0 +1,48 @@ +package com.digiwin.athena.app.ptc.service.management; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementDetailService; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class LimitManagementGetEAIService extends AbsEAIService { + + + @Resource + private LimitManagementService limitManagementService; + + @Resource + private LimitManagementDetailService limitManagementDetailService; + + + + @Override + public String getServiceName() { + return LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //直接捞两个表的数据 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(LimitManagementEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List list = limitManagementService.list(lmq); + return buildOK("query_result",list); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java new file mode 100644 index 0000000..eae3cd6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java @@ -0,0 +1,94 @@ +package com.digiwin.athena.app.ptc.service.managementdetail; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.alibaba.nacos.common.utils.Objects; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementDetailService; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class LimitManagementDetailGetEAIService extends AbsEAIService { + + + @Resource + private LimitManagementDetailService limitManagementDetailService; + + @Resource + private LimitManagementService limitManagementService; + + @Override + public String getServiceName() { + return LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + //根据id查子表 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List limitManagementEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + if (CollectionUtils.isEmpty(limitManagementEntities)){ + throw new DWBusinessException("必填参数为空"); + } + + LimitManagementEntity limitManagementEntity = limitManagementEntities.get(0); + + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + if (Objects.nonNull(limitManagementEntity.getId())){ + + LambdaQueryWrapper mfLmq = new LambdaQueryWrapper<>(); + mfLmq.eq(LimitManagementEntity::getId,limitManagementEntity.getId()); + LimitManagementEntity one = limitManagementService.getOne(mfLmq); + + LambdaQueryWrapper dfLmq = new LambdaQueryWrapper<>(); + dfLmq.eq(LimitManagementDetailEntity::getTenantSid,tenantSid); + dfLmq.eq(LimitManagementDetailEntity::getLimitManagementId,limitManagementEntity.getId()); + List list = limitManagementDetailService.list(dfLmq); + one.setInfo(list); + return buildOK("query_result",one); + } + + if (Objects.nonNull(limitManagementEntity.getQuotaRatio())){ + //根据间距查询主表 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(LimitManagementEntity::getTenantSid,tenantSid); + lmq.le(LimitManagementEntity::getMinPercentage,limitManagementEntity.getQuotaRatio()); + lmq.ge(LimitManagementEntity::getMaxPercentage,limitManagementEntity.getQuotaRatio()); + LimitManagementEntity one = limitManagementService.getOne(lmq); + + //根据id查询子表 + if (Objects.nonNull(one)){ + LambdaQueryWrapper dfLmq = new LambdaQueryWrapper<>(); + dfLmq.eq(LimitManagementDetailEntity::getTenantSid,tenantSid); + dfLmq.eq(LimitManagementDetailEntity::getLimitManagementId,one.getId()); + List list = limitManagementDetailService.list(dfLmq); + one.setInfo(list); + return buildOK("query_result",one); + } + } + return buildOK("query_result",new HashMap<>()); + } + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java new file mode 100644 index 0000000..940bb38 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java @@ -0,0 +1,55 @@ +package com.digiwin.athena.app.ptc.service.managementdetail; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitManagementDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class LimitManagementDetailUpdateEAIService extends AbsEAIService { + + + @Resource + private LimitManagementDetailRepository limitManagementDetailRepository; + + @Override + public String getServiceName() { + return LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //修改子表 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List managementDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + if (CollectionUtils.isEmpty(managementDetailEntities)){ + return buildOK("query_result",new HashMap<>()); + } + + //获取单身数据 + List info = managementDetailEntities.get(0).getInfo(); + + if (CollectionUtils.isNotEmpty(info)){ + limitManagementDetailRepository.updateBatch(info); + } + return buildOK("query_result",managementDetailEntities); + } + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java new file mode 100644 index 0000000..25d5f8b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java @@ -0,0 +1,14 @@ +package com.digiwin.athena.app.ptc.service.managementdetail; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class LimitManagementDetailUtil { + + public static final String LIMIT_MANAGEMENT_DETAIL_UPDATE ="demo.ptc.athenapot.limit.management.detail.update"; + + public static final String LIMIT_MANAGEMENT_DETAIL_GET ="demo.ptc.athenapot.limit.management.detail.get"; + + public static final String LIMIT_MANAGEMENT_GET ="demo.ptc.athenapot.limit.management.get"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java new file mode 100644 index 0000000..338b550 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java @@ -0,0 +1,10 @@ +package com.digiwin.athena.app.ptc.service.paymentdetails; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class PaymentDetailsUtil { + + public static final String RECEIVABLES_GET = "demo.ptc.athenapot.receivables.get"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java new file mode 100644 index 0000000..531cabe --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java @@ -0,0 +1,40 @@ +package com.digiwin.athena.app.ptc.service.paymentdetails; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.app.ptc.infra.service.PaymentDetailsService; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class ReceivablesGetEAIService extends AbsEAIService { + + @Resource + private PaymentDetailsService paymentDetailsService; + + @Override + public String getServiceName() { + return PaymentDetailsUtil.RECEIVABLES_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(PaymentDetailsEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List list = paymentDetailsService.list(lmq); + return buildOK("query_result",list); + } +} diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index fb8dff5..2adde67 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -29,3 +29,76 @@ alter table cim_chat_file Add column question_no varchar(32) null default '' COM alter table cim_chat_file Add column user_id varchar(32) null default '' COMMENT '用户id'; ALTER TABLE `cim_chat_file` MODIFY COLUMN `is_join` tinyint(255); + +CREATE TABLE `cim_limit_management_detail` ( + `id` bigint(20) NOT NULL, + `limit_management_id` bigint(20) NOT NULL, + `min_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最小', + `max_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最大', + `overdue_date_range` varchar(100) DEFAULT '' COMMENT '逾期日期区间', + `processed_by` varchar(50) DEFAULT '' COMMENT '处理人', + `handling_method` varchar(1) DEFAULT '' COMMENT '处理方式', + `processed_by_type` varchar(1) DEFAULT '' COMMENT '处理人类型', + `user_id` varchar(50) DEFAULT '' COMMENT '用户id', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL, + `create_by` varchar(50) DEFAULT NULL, + `create_date` datetime DEFAULT NULL, + `modified_by` varchar(50) DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + `deleted` tinyint(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `cim_payment_details` ( + `id` bigint(20) NOT NULL, + `receivable_no` varchar(100) DEFAULT '' COMMENT '应收单号', + `receivable_non` varchar(100) DEFAULT '' COMMENT '应收序号', + `customer_no` varchar(100) DEFAULT '' COMMENT '客户编号', + `customer_name` varchar(100) DEFAULT '' COMMENT '客户名称', + `status` varchar(100) DEFAULT '' COMMENT '状态', + `sales_order` varchar(100) DEFAULT '' COMMENT '销售单号', + `sales_order_number` varchar(100) DEFAULT '' COMMENT '销售单序号', + `contract_no` varchar(100) DEFAULT '' COMMENT '合同编号', + `sku_code` varchar(100) DEFAULT '' COMMENT '品号', + `sku_name` varchar(100) DEFAULT '' COMMENT '品名', + `sku_spec` varchar(100) DEFAULT '' COMMENT '规格', + `contacts` varchar(100) DEFAULT '' COMMENT '联系人', + `contact_information` varchar(100) DEFAULT '' COMMENT '联系方式', + `salesman_assistant` varchar(100) DEFAULT '' COMMENT '业务助理', + `salesman` varchar(100) DEFAULT '' COMMENT '业务员', + `salesman_boss` varchar(100) DEFAULT '' COMMENT '业务主管', + `produce_boss` varchar(100) DEFAULT '' COMMENT '生产主管', + `work_no` varchar(100) DEFAULT '' COMMENT '工单单号', + `amount_tax` decimal(15,3) DEFAULT NULL COMMENT '含税金额', + `price_tax` decimal(15,3) DEFAULT NULL COMMENT '含税单价', + `quantity` decimal(15,3) DEFAULT NULL COMMENT '数量', + `overdue_days` int(11) DEFAULT NULL COMMENT '逾期天数', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL, + `create_by` varchar(50) DEFAULT NULL, + `create_date` datetime DEFAULT NULL, + `modified_by` varchar(50) DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + `deleted` tinyint(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `cim_limit_management` ( + `id` bigint(20) NOT NULL, + `min_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最小', + `max_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最大', + `class_interval_name` varchar(100) DEFAULT '' COMMENT '级距名称', + `class_interval_no` varchar(100) DEFAULT '' COMMENT '序号', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL, + `create_by` varchar(50) DEFAULT NULL, + `create_date` datetime DEFAULT NULL, + `modified_by` varchar(50) DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + `deleted` tinyint(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;