@ -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<LimitManagementDetailEntity> { | |||
@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; | |||
} |
@ -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<LimitManagementEntity> { | |||
@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<LimitManagementDetailEntity> info; | |||
} |
@ -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<PaymentDetailsEntity> { | |||
/** 应收单号 */ | |||
@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; | |||
} |
@ -0,0 +1,24 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.digiwin.athena.app.ptc.infra.repository.LimitManagementDetailRepository"> | |||
<update id="updateBatch"> | |||
<foreach collection="list" item="item" index="index" separator=";" open="" close=""> | |||
UPDATE cim_limit_management_detail | |||
<set> | |||
`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} | |||
</set> | |||
WHERE `id` = #{item.id} | |||
</foreach> | |||
</update> | |||
</mapper> |
@ -0,0 +1,9 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.digiwin.athena.app.ptc.infra.repository.LimitManagementRepository"> | |||
</mapper> |
@ -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<LimitManagementDetailEntity> { | |||
void updateBatch(@Param("list")List<LimitManagementDetailEntity> list); | |||
} |
@ -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<LimitManagementEntity> { | |||
} |
@ -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<PaymentDetailsEntity> { | |||
} |
@ -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<LimitManagementDetailEntity>{ | |||
} |
@ -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<LimitManagementEntity> { | |||
} |
@ -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<PaymentDetailsEntity> { | |||
} |
@ -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<LimitManagementDetailRepository, LimitManagementDetailEntity> implements LimitManagementDetailService { | |||
} |
@ -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<LimitManagementRepository, LimitManagementEntity> implements LimitManagementService { | |||
} |
@ -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<PaymentDetailsRepository, PaymentDetailsEntity> implements PaymentDetailsService { | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception; | |||
@EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE) | |||
DWEAIResult update(Map<String, String> headers, String messageBody) throws Exception; | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception; | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception; | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET,headers,messageBody); | |||
} | |||
@Override | |||
public DWEAIResult update(Map<String, String> headers, String messageBody) throws Exception { | |||
return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE,headers,messageBody); | |||
} | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET,headers,messageBody); | |||
} | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
return eaiServiceContext.execute(PaymentDetailsUtil.RECEIVABLES_GET,headers,messageBody); | |||
} | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
//直接捞两个表的数据 | |||
LambdaQueryWrapper<LimitManagementEntity> lmq = new LambdaQueryWrapper<>(); | |||
lmq.eq(LimitManagementEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); | |||
List<LimitManagementEntity> list = limitManagementService.list(lmq); | |||
return buildOK("query_result",list); | |||
} | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
//根据id查子表 | |||
EAIRequest eaiRequest = EAIRequest.build(messageBody); | |||
List<LimitManagementEntity> limitManagementEntities = eaiRequest.getObject("get_data", new TypeReference<List<LimitManagementEntity>>() {}); | |||
if (CollectionUtils.isEmpty(limitManagementEntities)){ | |||
throw new DWBusinessException("必填参数为空"); | |||
} | |||
LimitManagementEntity limitManagementEntity = limitManagementEntities.get(0); | |||
Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); | |||
if (Objects.nonNull(limitManagementEntity.getId())){ | |||
LambdaQueryWrapper<LimitManagementEntity> mfLmq = new LambdaQueryWrapper<>(); | |||
mfLmq.eq(LimitManagementEntity::getId,limitManagementEntity.getId()); | |||
LimitManagementEntity one = limitManagementService.getOne(mfLmq); | |||
LambdaQueryWrapper<LimitManagementDetailEntity> dfLmq = new LambdaQueryWrapper<>(); | |||
dfLmq.eq(LimitManagementDetailEntity::getTenantSid,tenantSid); | |||
dfLmq.eq(LimitManagementDetailEntity::getLimitManagementId,limitManagementEntity.getId()); | |||
List<LimitManagementDetailEntity> list = limitManagementDetailService.list(dfLmq); | |||
one.setInfo(list); | |||
return buildOK("query_result",one); | |||
} | |||
if (Objects.nonNull(limitManagementEntity.getQuotaRatio())){ | |||
//根据间距查询主表 | |||
LambdaQueryWrapper<LimitManagementEntity> 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<LimitManagementDetailEntity> dfLmq = new LambdaQueryWrapper<>(); | |||
dfLmq.eq(LimitManagementDetailEntity::getTenantSid,tenantSid); | |||
dfLmq.eq(LimitManagementDetailEntity::getLimitManagementId,one.getId()); | |||
List<LimitManagementDetailEntity> list = limitManagementDetailService.list(dfLmq); | |||
one.setInfo(list); | |||
return buildOK("query_result",one); | |||
} | |||
} | |||
return buildOK("query_result",new HashMap<>()); | |||
} | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
//修改子表 | |||
EAIRequest eaiRequest = EAIRequest.build(messageBody); | |||
List<LimitManagementEntity> managementDetailEntities = eaiRequest.getObject("get_data", new TypeReference<List<LimitManagementEntity>>() {}); | |||
if (CollectionUtils.isEmpty(managementDetailEntities)){ | |||
return buildOK("query_result",new HashMap<>()); | |||
} | |||
//获取单身数据 | |||
List<LimitManagementDetailEntity> info = managementDetailEntities.get(0).getInfo(); | |||
if (CollectionUtils.isNotEmpty(info)){ | |||
limitManagementDetailRepository.updateBatch(info); | |||
} | |||
return buildOK("query_result",managementDetailEntities); | |||
} | |||
} |
@ -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"; | |||
} |
@ -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"; | |||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||
LambdaQueryWrapper<PaymentDetailsEntity> lmq = new LambdaQueryWrapper<>(); | |||
lmq.eq(PaymentDetailsEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); | |||
List<PaymentDetailsEntity> list = paymentDetailsService.list(lmq); | |||
return buildOK("query_result",list); | |||
} | |||
} |