diff --git a/.drone.yml b/.drone.yml index 1bd3647..dbcc3b0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,7 +25,7 @@ steps: branch: # - develop # - master - - release/S2 + - release/S3 event: - push ### 应用版本控制:检查版本文件,若不存在则自动创建,并自动递增版本号 @@ -38,14 +38,14 @@ steps: - sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories - apk add tree --no-cache - tree ./$backendName - - make branch=release/S2 vc + - make branch=release/S3 vc # - make branch=master vc when: status: [ success ] branch: # - develop # - master - - release/S2 + - release/S3 event: - push ### 打包镜像并推送到镜像仓库 @@ -76,27 +76,27 @@ steps: branch: # - develop # - master - - release/S2 + - release/S3 ### 应用版本控制:提交版本文件的修改记录,并为代码分支创建版本号标签 - name: Upload Version image: registry.digiwincloud.com.cn/base/base_vc commands: # - make branch=develop to_git # - make branch=master to_git - - make branch=release/S2 to_git + - make branch=release/S3 to_git when: status: [ success ] branch: # - develop # - master - - release/S2 + - release/S3 event: - push trigger: branch: # - develop # - master - - release/S2 + - release/S3 event: - push volumes: diff --git a/README.md b/README.md index 7455420..6dfd050 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # demo-athenaopt -测试 release/S2 打包 \ No newline at end of file +测试 release/S3 打包 \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/ResponseUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/ResponseUtil.java new file mode 100644 index 0000000..a1fdfb1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/ResponseUtil.java @@ -0,0 +1,97 @@ +package com.digiwin.athena.app.infra.common.utils; + +import com.digiwin.athena.app.infra.constant.ParameterConstant; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @description 响应结果转换 + * @throws + * @time 2023/8/30 13:21 + */ +public class ResponseUtil { + /** + * 把对象中的 String 类型的null字段,转换为空字符串 + * + * @param 待转化对象类型 + * @param cls 待转化对象 + * @return 转化好的对象 + */ + public static T noNullStringAttr(T cls) { + Field[] fields = cls.getClass().getDeclaredFields(); + if (fields == null || fields.length == 0) { + return cls; + } + for (Field field : fields) { + if (ParameterConstant.STRING.equals(field.getType().getSimpleName())) { + field.setAccessible(true); + try { + Object value = field.get(cls); + if (value == null) { + field.set(cls, ""); + } + } catch (IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + } + } + return cls; + } + + /** + * 把集合中的所有对象中的String类型的null字段,转换为空字符串 + * 注意:只能转换String类型的字段 + * + * @param sourceList 待转化的集合 + * @return 转化好的集合 + */ + public static List listNullToString(List sourceList) { + ArrayList resultList = new ArrayList<>(); + for (T cls : sourceList) { + Field[] fields = cls.getClass().getDeclaredFields(); + if (fields == null || fields.length == 0) { + resultList.add(cls); + } + for (Field field : fields) { + if (ParameterConstant.STRING.equals(field.getType().getSimpleName())) { + field.setAccessible(true); + try { + Object value = field.get(cls); + if (value == null) { + field.set(cls, ""); + } + } catch (IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + } + } + resultList.add(cls); + } + return resultList; + } + + /** + * 注意:只能转换String类型的字段 + * + * @param sourceList 待转化的集合 + * @return 转化好的集合 + */ + public static List> listMapToLowerCase(List> sourceList) { + List> response = new ArrayList<>(); + for (Map map : sourceList) { + Map newMap = new HashMap<>(); + for (Map.Entry entry : map.entrySet()) { + String key = entry.getKey().toLowerCase(); + Object value = entry.getValue(); + newMap.put(key, value); + } + response.add(newMap); + } + return response; + } + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java index c2855f0..fdd4d68 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java @@ -12,4 +12,6 @@ public class ParameterConstant { public static final String STATUS = "status"; public static final String SET_NUMBER = "1"; + + public static final String STRING = "String"; } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/PurchaseOrderDetailDTO.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/PurchaseOrderDetailDTO.java new file mode 100644 index 0000000..3cb3a72 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/PurchaseOrderDetailDTO.java @@ -0,0 +1,146 @@ +package com.digiwin.athena.app.infra.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author lz + * @version 1.0 + * @title CaPurchaseOrderDetailDTO + * @description + * @create 2023/8/30 11:14 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class PurchaseOrderDetailDTO { + + /** + * 请购单号 + */ + @JsonProperty(value = "purchase_order_no") + private String purchaseOrderNo; + + /** + * 请购单序号 + */ + @JsonProperty(value = "purchase_order_seq") + private String purchaseOrderSeq; + + /** + * 品号 + */ + @JsonProperty(value = "item_no") + private String itemNo; + + /** + * 品名 + */ + @JsonProperty(value = "item_name") + private String itemName; + + /** + * 规格 + */ + @JsonProperty(value = "item_spec") + private String itemSpec; + + /** + * 供应商名称 + */ + @JsonProperty(value = "supplier_name") + private String supplierName; + + /** + * 供应商编号 + */ + @JsonProperty(value = "supplier_no") + private String supplierNo; + + /** + * 请购数量 + */ + @JsonProperty(value = "requisition_num") + private Integer requisitionNum; + + /** + * 采购数量 + */ + @JsonProperty(value = "purchase_num") + private Integer purchaseNum; + + /** + * 采购单价 + */ + @JsonProperty(value = "purchase_price") + private BigDecimal purchasePrice; + + /** + * 金额 + */ + @JsonProperty(value = "amount") + private BigDecimal amount; + + /** + * 采购剩余数量 + */ + @JsonProperty(value = "purchase_residue_num") + private Integer purchaseResidueNum; + + /** + * 采购执行人 + */ + @JsonProperty(value = "procurement_executor_code") + private String procurementExecutorCode; + + /** + * 采购需求日期 + */ + @JsonProperty(value = "purchase_date") + private Date purchaseDate; + + /** + * 预计到货日 + */ + @JsonProperty(value = "expected_date") + private Date expectedDate; + + /** + * 异常处理方式 + */ + @JsonProperty(value = "abnormal_handle_plan") + private String abnormalHandlePlan; + + /** + * 任务卡状态 + */ + @JsonProperty(value = "tab_status") + private String tabStatus; + + /** + * 交期回复任务卡状态 + */ + @JsonProperty(value = "reply_tab_status") + private String replyTabStatus; + + /** + * 异常排除任务卡状态 + */ + @JsonProperty(value = "abnormal_tab_status") + private String abnormalTabStatus; + + /** + * 任务卡类型:1是采购任务,2是交期回复任务,3是异常排除任务 + */ + @JsonProperty(value = "task_type") + private String taskType; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/FontSupplierEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/FontSupplierEntity.java new file mode 100644 index 0000000..82babdb --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/FontSupplierEntity.java @@ -0,0 +1,46 @@ +package com.digiwin.athena.app.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; + +/** + * 人资报道对象 cim_item_supplier + * + * @author bk + * @date 2023-04-28 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_item_supplier", autoResultMap = true) +public class FontSupplierEntity extends BaseMgrEntity { + private static final long serialVersionUID = 1L; + + + /** 品号 */ + @SerializedName("item_no") + private String itemNo; + + /** 品名 */ + @SerializedName("item_name") + private String itemName; + + /** 供应商编号 */ + @SerializedName("supplier_no") + private String supplierNo; + + /** 供应商名称 */ + @SerializedName("supplier_name") + private String supplierName; + + /** 单价 */ + @SerializedName("price") + private String price; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemExecutorEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemExecutorEntity.java new file mode 100644 index 0000000..217c636 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemExecutorEntity.java @@ -0,0 +1,56 @@ +package com.digiwin.athena.app.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:03 + * @Version 1.0 + * @Description + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@JsonIgnoreProperties(ignoreUnknown = true) +@TableName(value = "cim_item_execute", autoResultMap = true) +public class ItemExecutorEntity extends BaseMgrEntity { + + /** + * 品号 + */ + @SerializedName(value = "item_no") + @JsonProperty(value = "item_no") + private String itemNo; + + /** + * 品名 + */ + @SerializedName(value = "item_name") + @JsonProperty(value = "item_name") + private String itemName; + + /** + * 执行人编号 + */ + @SerializedName(value = "procurement_executor_code") + @JsonProperty(value = "procurement_executor_code") + private String procurementExecutorCode; + + /** + * 执行人名称 + */ + @SerializedName(value = "procurement_executor_name") + @JsonProperty(value = "procurement_executor_name") + private String procurementExecutorName; + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemSupplierEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemSupplierEntity.java new file mode 100644 index 0000000..ef65a4c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemSupplierEntity.java @@ -0,0 +1,45 @@ +package com.digiwin.athena.app.infra.entity; + +import java.math.BigDecimal; + +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; +/** + * 品号供应商对象 cim_item_supplier + * + * @author zhenggl + * @date 2023-08-31 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_item_supplier", autoResultMap = true) +public class ItemSupplierEntity extends BaseMgrEntity { + + + /** 品号 */ + @SerializedName(value = "item_no") + private String itemNo; + + /** 品名 */ + @SerializedName(value = "item_name") + private String itemName; + + /** 供应商编号 */ + @SerializedName(value = "supplier_no") + private String supplierNo; + + /** 供应商名称 */ + @SerializedName(value = "supplier_name") + private String supplierName; + + /** 单价 */ + @SerializedName(value = "price") + private BigDecimal price; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java new file mode 100644 index 0000000..88b464d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java @@ -0,0 +1,163 @@ +package com.digiwin.athena.app.infra.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.fasterxml.jackson.annotation.JsonProperty; +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.Date; + +/** + * @author lz + * @description 请购采购单表 + * @throws + * @time 2023/8/29 16:21 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_purchase_order_detail", autoResultMap = true) +public class PurchaseOrderDetailEntity extends BaseMgrEntity { + + + /** + * 请购单号 + */ + @SerializedName(value = "purchase_order_no") + @JsonProperty(value = "purchase_order_no") + private String purchaseOrderNo; + + /** + * 请购单序号 + */ + @SerializedName(value = "purchase_order_seq") + @JsonProperty(value = "purchase_order_seq") + private String purchaseOrderSeq; + + /** + * 品号 + */ + @SerializedName(value = "item_no") + @JsonProperty(value = "item_no") + private String itemNo; + + /** + * 品名 + */ + @SerializedName(value = "item_name") + @JsonProperty(value = "item_name") + private String itemName; + + /** + * 供应商名称 + */ + @SerializedName(value = "supplier_name") + @JsonProperty(value = "supplier_name") + private String supplierName; + + /** + * 供应商编号 + */ + @SerializedName(value = "supplier_no") + @JsonProperty(value = "supplier_no") + private String supplierNo; + + /** + * 请购数量 + */ + @SerializedName(value = "requisition_num") + @JsonProperty(value = "requisition_num") + private Integer requisitionNum; + + /** + * 采购数量 + */ + @SerializedName(value = "purchase_num") + @JsonProperty(value = "purchase_num") + private Integer purchaseNum; + + /** + * 采购单价 + */ + @SerializedName(value = "purchase_price") + @JsonProperty(value = "purchase_price") + private BigDecimal purchasePrice; + + /** + * 金额 + */ + @SerializedName(value = "amount") + @JsonProperty(value = "amount") + private BigDecimal amount; + + /** + * 采购剩余数量 + */ + @SerializedName(value = "purchase_residue_num") + @JsonProperty(value = "purchase_residue_num") + private Integer purchaseResidueNum; + + /** + * 采购执行人 + */ + @SerializedName(value = "procurement_executor_code") + @JsonProperty(value = "procurement_executor_code") + private String procurementExecutorCode; + + /** + * 采购需求日期 + */ + @SerializedName(value = "purchase_date") + @JsonProperty(value = "purchase_date") + private Date purchaseDate; + + /** + * 预计到货日 + */ + @SerializedName(value = "expected_date") + @JsonProperty(value = "expected_date") + private Date expectedDate; + + /** + * 异常处理方式 + */ + @SerializedName(value = "abnormal_handle_plan") + @JsonProperty(value = "abnormal_handle_plan") + private String abnormalHandlePlan; + + /** + * 任务卡状态 + */ + @SerializedName(value = "tab_status") + @JsonProperty(value = "tab_status") + private String tabStatus; + + /** + * 交期回复任务卡状态 + */ + @SerializedName(value = "reply_tab_status") + @JsonProperty(value = "reply_tab_status") + private String replyTabStatus; + + /** + * 异常排除任务卡状态 + */ + @SerializedName(value = "abnormal_tab_status") + @JsonProperty(value = "abnormal_tab_status") + private String abnormalTabStatus; + + /** + * 任务卡类型:1是采购任务,2是交期回复任务,3是异常排除任务 + */ + @SerializedName(value = "task_type") + @JsonProperty(value = "task_type") + private String taskType; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SupplierContactEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SupplierContactEntity.java new file mode 100644 index 0000000..0f7de1b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SupplierContactEntity.java @@ -0,0 +1,44 @@ +package com.digiwin.athena.app.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.Data; +import lombok.NoArgsConstructor; + +/** + * @author CR-7 + * create: 2023-09-01 16:12 + * Description: + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "cim_supplier_contact", autoResultMap = true) +public class SupplierContactEntity extends BaseMgrEntity { + + /** + * 供应商编号 + */ + @SerializedName(value = "supplier_no") + private String supplierNo; + + /** + * 供应商名称 + */ + @SerializedName(value = "supplier_name") + private String supplierName; + + /** + * 联系人名称 + */ + @SerializedName(value = "contact_name") + private String contactName; + + /** + * 联系人邮箱 + */ + @SerializedName(value = "contact_email") + private String contactEmail; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/ItemExecutorMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/ItemExecutorMapper.xml new file mode 100644 index 0000000..4d9f0ef --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/ItemExecutorMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + UPDATE cim_item_execute + + `item_name` = #{item.itemName}, + `procurement_executor_name` = #{item.procurementExecutorName} + + WHERE `tenantsid`=#{tenantSid} AND + `item_no`= #{item.itemNo} AND `procurement_executor_code` = #{item.procurementExecutorCode} + + + + + \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml new file mode 100644 index 0000000..3efba72 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + UPDATE cim_purchase_order_detail + + abnormal_handle_plan = #{item.abnormal_handle_plan} + + ,purchase_date = #{item.purchaseDate} + + + ,expected_date = #{item.expectedDate} + + + where id = #{item.id} + + + + + + + + UPDATE cim_purchase_order_detail + + + item_no = #{item.itemNo}, + + + item_name = #{item.itemName}, + + + supplier_name = #{item.supplierName}, + + + supplier_no = #{item.supplierNo}, + + + requisition_num = #{item.requisitionNum}, + + + purchase_num = #{item.purchaseNum}, + + + purchase_price = #{item.purchasePrice}, + + + amount = #{item.amount}, + + + purchase_residue_num = #{item.purchaseResidueNum}, + + + procurement_executor_code = #{item.procurementExecutorCode}, + + + purchase_date = #{item.purchaseDate}, + + + expected_date = #{item.expectedDate}, + + + abnormal_handle_plan = #{item.abnormalHandlePlan}, + + + tab_status = #{item.tabStatus}, + + + abnormal_tab_status = #{item.abnormalTabStatus}, + + + reply_tab_status = #{item.replyTabStatus}, + + + task_type = #{item.taskType}, + + modified_by = #{item.modifiedBy}, + modified_date = #{item.modifiedDate} + + WHERE tenantsid = #{item.tenantSid} AND purchase_order_no = #{item.purchaseOrderNo} + AND purchase_order_seq = #{item.purchaseOrderSeq} + + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/FontSupplierRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/FontSupplierRepository.java new file mode 100644 index 0000000..2570407 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/FontSupplierRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: bk + * @date: 2023/9/1 + */ +public interface FontSupplierRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/ItemExecutorRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/ItemExecutorRepository.java new file mode 100644 index 0000000..6096f59 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/ItemExecutorRepository.java @@ -0,0 +1,24 @@ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:21 + * @Version 1.0 + * @Description + */ +public interface ItemExecutorRepository extends BaseRepository { + + /** + * 批量更新 + * + * @param itemExecutorInfo + * @param tenantSid + */ + void updateBatch(@Param("list") List itemExecutorInfo, @Param("tenantSid") long tenantSid); +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java new file mode 100644 index 0000000..a6bebcf --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java @@ -0,0 +1,26 @@ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author lz + * @description + * @throws + * @time 2023/8/29 16:35 + */ +public interface PurchaseOrderDetailRepository extends BaseRepository { + + public void updateAbnormalHandlePlan(@Param("list") List list); + + + /** + * 请购采购更新 + * + * @param entityList + */ + void updateBatch(@Param("list") List entityList); +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierContactInfoRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierContactInfoRepository.java new file mode 100644 index 0000000..57f7174 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierContactInfoRepository.java @@ -0,0 +1,7 @@ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +public interface SupplierContactInfoRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierRepository.java new file mode 100644 index 0000000..8cffe34 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/1 + */ +public interface SupplierRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/FontSupplierService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/FontSupplierService.java new file mode 100644 index 0000000..8d11c9d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/FontSupplierService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/1 + */ +public interface FontSupplierService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/FontSupplierServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/FontSupplierServiceImpl.java new file mode 100644 index 0000000..ad1fafa --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/FontSupplierServiceImpl.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.infra.service.Impl; + + +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.app.infra.repository.FontSupplierRepository; +import com.digiwin.athena.app.infra.service.FontSupplierService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: bk + * @date: 2023/9/1 + */ +@Service +public class FontSupplierServiceImpl extends AbsBaseService implements FontSupplierService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/ItemExecutorServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/ItemExecutorServiceImpl.java new file mode 100644 index 0000000..2c1449a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/ItemExecutorServiceImpl.java @@ -0,0 +1,17 @@ +package com.digiwin.athena.app.infra.service.Impl; + +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.app.infra.repository.ItemExecutorRepository; +import com.digiwin.athena.app.infra.service.ItemExecutorService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:20 + * @Version 1.0 + * @Description + */ +@Service +public class ItemExecutorServiceImpl extends AbsBaseService implements ItemExecutorService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/PurchaseDemoServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/PurchaseDemoServiceImpl.java new file mode 100644 index 0000000..567e01c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/PurchaseDemoServiceImpl.java @@ -0,0 +1,18 @@ +package com.digiwin.athena.app.infra.service.Impl; + +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; +import com.digiwin.athena.app.infra.service.PurchaseDemoService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @author lz + * @description 请购单业务类 + * @throws + * @time 2023/8/29 16:38 + */ +@Service +public class PurchaseDemoServiceImpl extends AbsBaseService implements PurchaseDemoService { + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierContactInfoServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierContactInfoServiceImpl.java new file mode 100644 index 0000000..2e19bdc --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierContactInfoServiceImpl.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.infra.service.Impl; + +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.app.infra.repository.SupplierContactInfoRepository; +import com.digiwin.athena.app.infra.service.SupplierContactInfoService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @author CR-7 + * create: 2023-09-01 16:16 + * Description: + */ +@Service +public class SupplierContactInfoServiceImpl extends AbsBaseService implements SupplierContactInfoService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierServiceImpl.java new file mode 100644 index 0000000..dc3fa8d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierServiceImpl.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.infra.service.Impl; + + +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.app.infra.repository.SupplierRepository; +import com.digiwin.athena.app.infra.service.SupplierService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/1 + */ +@Service +public class SupplierServiceImpl extends AbsBaseService implements SupplierService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/ItemExecutorService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/ItemExecutorService.java new file mode 100644 index 0000000..ab0f133 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/ItemExecutorService.java @@ -0,0 +1,13 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:19 + * @Version 1.0 + * @Description + */ +public interface ItemExecutorService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/PurchaseDemoService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/PurchaseDemoService.java new file mode 100644 index 0000000..e74993e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/PurchaseDemoService.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +import java.util.List; + +/** + * @description + * @author lz + * @throws + * @time 2023/8/29 16:18 + */ +public interface PurchaseDemoService extends IBaseService { + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierContactInfoService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierContactInfoService.java new file mode 100644 index 0000000..39094ee --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierContactInfoService.java @@ -0,0 +1,7 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +public interface SupplierContactInfoService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierService.java new file mode 100644 index 0000000..1a9ea45 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/1 + */ +public interface SupplierService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/entity/ChatFileEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/entity/ChatFileEntity.java new file mode 100644 index 0000000..888c15d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/entity/ChatFileEntity.java @@ -0,0 +1,72 @@ +package com.digiwin.athena.app.kcfr.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.util.Date; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_chat_file", autoResultMap = true) +public class ChatFileEntity extends BaseMgrEntity { + + + @SerializedName(value = "question") + private String question; + + @SerializedName(value = "user_id") + private String userId; + + @SerializedName(value = "question_no") + private String questionNo; + + + @SerializedName(value = "feedback_person") + private String feedbackPerson; + + + @SerializedName(value = "feedback_date") + private Date feedbackDate; + + + @SerializedName(value = "urgency") + private Integer urgency; + + + @SerializedName(value = "question_type") + private Integer questionType; + + @SerializedName(value = "question_source") + private Integer questionSource; + + + @SerializedName(value = "question_complete_by") + private String questionCompleteBy; + + + @SerializedName(value = "complete_date") + private Date completeDate; + + + + @SerializedName(value = "complete_explain") + private String completeExplain; + + @SerializedName(value = "is_join") + private Boolean isJoin; + + @SerializedName(value = "tab_status") + private Integer tabStatus; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml new file mode 100644 index 0000000..f9298ad --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml @@ -0,0 +1,24 @@ + + + + + + + UPDATE cim_chat_file + + `question` = #{question}, + `question_source` = #{questionSource}, + `question_type` = #{questionType}, + `urgency` = #{urgency}, + `question_complete_by` = #{questionCompleteBy}, + `complete_explain` = #{completeExplain}, + `complete_date` = #{completeDate}, + `is_join` = #{isJoin} + + WHERE `id`=#{id} + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/repository/ChatFileRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/repository/ChatFileRepository.java new file mode 100644 index 0000000..fb17b37 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/repository/ChatFileRepository.java @@ -0,0 +1,14 @@ +package com.digiwin.athena.app.kcfr.infra.repository; + +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +public interface ChatFileRepository extends BaseRepository { + + void updateBatch(ChatFileEntity chatFile); + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/ChatFileService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/ChatFileService.java new file mode 100644 index 0000000..61f001b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/ChatFileService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.kcfr.infra.service; + +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +public interface ChatFileService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/impl/ChatFileServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/impl/ChatFileServiceImpl.java new file mode 100644 index 0000000..d144ab9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/impl/ChatFileServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.kcfr.infra.service.impl; + +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.kcfr.infra.repository.ChatFileRepository; +import com.digiwin.athena.app.kcfr.infra.service.ChatFileService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +@Service +public class ChatFileServiceImpl extends AbsBaseService implements ChatFileService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/ChatFileEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/ChatFileEAIService.java new file mode 100644 index 0000000..62986c9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/ChatFileEAIService.java @@ -0,0 +1,24 @@ +package com.digiwin.athena.app.kcfr.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.kcfr.service.ChatFileUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +public interface ChatFileEAIService extends DWService { + + @EAIService(id = ChatFileUtil.CA_CHAT_FILE_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + @EAIService(id = ChatFileUtil.CA_CHAT_FILE_INFO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; + + @EAIService(id = ChatFileUtil.CA_CHAT_FILE_INFO_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/impl/ChatFileEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/impl/ChatFileEAIServiceImpl.java new file mode 100644 index 0000000..9d0cf6c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/impl/ChatFileEAIServiceImpl.java @@ -0,0 +1,35 @@ +package com.digiwin.athena.app.kcfr.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.kcfr.provider.ChatFileEAIService; +import com.digiwin.athena.app.kcfr.service.ChatFileUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +public class ChatFileEAIServiceImpl implements ChatFileEAIService { + + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ChatFileUtil.CA_CHAT_FILE_INFO_GET,headers,messageBody); + } + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ChatFileUtil.CA_CHAT_FILE_INFO_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ChatFileUtil.CA_CHAT_FILE_INFO_UPDATE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileCreateEAIService.java new file mode 100644 index 0000000..67a0b99 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileCreateEAIService.java @@ -0,0 +1,52 @@ +package com.digiwin.athena.app.kcfr.service; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.kcfr.infra.service.ChatFileService; +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.Date; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +@Service +@Log4j2 +public class ChatFileCreateEAIService extends AbsEAIService { + + @Resource + private ChatFileService chatFileService; + + @Override + public String getServiceName() { + return ChatFileUtil.CA_CHAT_FILE_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List chatFileInfoList = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + ChatFileEntity chatFileInfo = chatFileInfoList.get(0); + + if (Objects.isNull(chatFileInfo)){ + throw new DWBusinessException("缺少必要参数chat_file_info"); + } + //反馈时间 + chatFileInfo.setFeedbackDate(new Date()); + + + chatFileService.save(chatFileInfo); + + return buildOK("chat_file_info",chatFileInfo); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileGetEAIService.java new file mode 100644 index 0000000..634e9aa --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileGetEAIService.java @@ -0,0 +1,52 @@ +package com.digiwin.athena.app.kcfr.service; + +import com.alibaba.fastjson.TypeReference; +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.kcfr.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.kcfr.infra.service.ChatFileService; +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.Map; +import java.util.Objects; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +@Service +@Log4j2 +public class ChatFileGetEAIService extends AbsEAIService { + + + @Resource + private ChatFileService chatFileService; + + @Override + public String getServiceName() { + return ChatFileUtil.CA_CHAT_FILE_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); + + if (Objects.isNull(chatFileInfo)){ + throw new DWBusinessException("缺少必要参数chat_file_info"); + } + + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(ChatFileEntity::getId,chatFileInfo.getId()); + ChatFileEntity chatFileServiceOne = chatFileService.getOne(lmq); + + return buildOK("chat_file_info",chatFileServiceOne); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUpdateEAIService.java new file mode 100644 index 0000000..e46109e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUpdateEAIService.java @@ -0,0 +1,44 @@ +package com.digiwin.athena.app.kcfr.service; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.kcfr.infra.repository.ChatFileRepository; +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.*; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +@Service +@Log4j2 +public class ChatFileUpdateEAIService extends AbsEAIService { + + @Resource + private ChatFileRepository chatFileRepository; + + @Override + public String getServiceName() { + return ChatFileUtil.CA_CHAT_FILE_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); + + if (Objects.isNull(chatFileInfo.getCompleteDate())){ + chatFileInfo.setCompleteDate(new Date()); + } + + chatFileRepository.updateBatch(chatFileInfo); + return buildOK(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUtil.java new file mode 100644 index 0000000..7fa4dd4 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUtil.java @@ -0,0 +1,17 @@ +package com.digiwin.athena.app.kcfr.service; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +public class ChatFileUtil { + + /*** + * 工博会chat_file + */ + public static final String CA_CHAT_FILE_INFO_CREATE = "demo.kcfr.chat.file.info.create"; + + public static final String CA_CHAT_FILE_INFO_UPDATE = "demo.kcfr.chat.file.info.update"; + + public static final String CA_CHAT_FILE_INFO_GET = "demo.kcfr.chat.file.info.get"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/FontSupplierEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/FontSupplierEAIService.java new file mode 100644 index 0000000..2d5fae5 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/FontSupplierEAIService.java @@ -0,0 +1,56 @@ +package com.digiwin.athena.app.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.service.supplier.FontSupplierUtil; + +import java.util.Map; + +/** + * @auther: bk + * @date: 2023/9/1 + */ +public interface FontSupplierEAIService extends DWService { + + + /** + * 品号供应商修改 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; + + /** + * 品号供应商获取 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + /** + * 品号供应商新增 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; + + /** + * 品号供应商删除 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_DELETE) + DWEAIResult delete(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/ItemExecutorEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/ItemExecutorEAIService.java new file mode 100644 index 0000000..357af7c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/ItemExecutorEAIService.java @@ -0,0 +1,71 @@ +package com.digiwin.athena.app.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.service.executor.ExecutorUtil; + +import java.util.Map; + +/** + * @Author: xieps + * @Date: 2023/9/4 10:28 + * @Version 1.0 + * @Description + */ +public interface ItemExecutorEAIService extends DWService { + + + /** + * 品号执行人信息新增 + * + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_CREATE) + DWEAIResult itemExecutorInfoCreate(Map headers, String messageBody) throws Exception; + + + + /** + * 品号执行人信息查询 + * + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_GET) + DWEAIResult itemExecutorInfoGet(Map headers, String messageBody) throws Exception; + + + + /** + * 品号执行人信息删除 + * + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_DELETE) + DWEAIResult itemExecutorInfoDelete(Map headers, String messageBody) throws Exception; + + + + /** + * 品号执行人信息更新 + * + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_UPDATE) + DWEAIResult itemExecutorInfoUpdate(Map headers, String messageBody) throws Exception; + + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java new file mode 100644 index 0000000..839d9d9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java @@ -0,0 +1,32 @@ +package com.digiwin.athena.app.provider; + +import com.digiwin.app.service.AllowAnonymous; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.service.purchase.PurchaseUtil; + +import java.util.Map; + +/** + * @author lz + * @description 请购单EAI + * @throws + * @time 2023/8/29 16:41 + */ +public interface PurchaseDemoEAIService extends DWService { + + @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; + + @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + @EAIService(id = PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE) + DWEAIResult abnormalUpdate(Map headers, String messageBody) throws Exception; + + + @EAIService(id = PurchaseUtil.DEMO_PURCHASE_ORDER_UPDATE) + DWEAIResult purchaseOrderUpdate(Map headers, String messageBody) throws Exception; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierContactInfoEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierContactInfoEAIService.java new file mode 100644 index 0000000..d0526cc --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierContactInfoEAIService.java @@ -0,0 +1,52 @@ +package com.digiwin.athena.app.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.service.supplier.SupplierContactUtil; + +import java.util.Map; + +public interface SupplierContactInfoEAIService extends DWService { + + /** + * 供应商联系人查询 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierContactUtil.DEMO_DATA_CONTACT_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + /** + * 供应商联系人新增 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierContactUtil.DEMO_DATA_CONTACT_INFO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; + + /** + * 供应商联系人修改 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierContactUtil.DEMO_DATA_CONTACT_INFO_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; + + + /** + * 供应商联系人删除 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierContactUtil.DEMO_DATA_CONTACT_INFO_DELETE) + DWEAIResult delete(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierEAIService.java new file mode 100644 index 0000000..931b22c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierEAIService.java @@ -0,0 +1,56 @@ +package com.digiwin.athena.app.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.service.supplier.SupplierUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/1 + */ +public interface SupplierEAIService extends DWService { + + + /** + * 品号供应商修改 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; + + /** + * 品号供应商获取 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + /** + * 品号供应商新增 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; + + /** + * 品号供应商删除 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_DELETE) + DWEAIResult delete(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/FontSupplierEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/FontSupplierEAIServiceImpl.java new file mode 100644 index 0000000..07c4855 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/FontSupplierEAIServiceImpl.java @@ -0,0 +1,40 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.FontSupplierEAIService; +import com.digiwin.athena.app.service.supplier.FontSupplierUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: bk + * @date: 2023/9/1 + */ +public class FontSupplierEAIServiceImpl implements FontSupplierEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_UPDATE,headers,messageBody); + } + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_GET,headers,messageBody); + } + + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult delete(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_DELETE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/ItemExecutorEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/ItemExecutorEAIServiceImpl.java new file mode 100644 index 0000000..e16e7c7 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/ItemExecutorEAIServiceImpl.java @@ -0,0 +1,44 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.ItemExecutorEAIService; +import com.digiwin.athena.app.service.executor.ExecutorUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @Author: xieps + * @Date: 2023/9/4 10:31 + * @Version 1.0 + * @Description + */ +public class ItemExecutorEAIServiceImpl implements ItemExecutorEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + + @Override + public DWEAIResult itemExecutorInfoCreate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_CREATE, headers, messageBody); + } + + @Override + public DWEAIResult itemExecutorInfoGet(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_GET, headers, messageBody); + } + + @Override + public DWEAIResult itemExecutorInfoDelete(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_DELETE, headers, messageBody); + } + + @Override + public DWEAIResult itemExecutorInfoUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_UPDATE, headers, messageBody); + } + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java new file mode 100644 index 0000000..3dbd9f0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java @@ -0,0 +1,42 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.PurchaseDemoEAIService; +import com.digiwin.athena.app.service.purchase.PurchaseUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @author lz + * @version 1.0 + * @title PurchaseDemoEAIServiceImpl + * @description + * @create 2023/8/30 16:50 + */ +public class PurchaseDemoEAIServiceImpl implements PurchaseDemoEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_DEMO_CREATE, headers, messageBody); + } + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_DEMO_GET, headers, messageBody); + } + + @Override + public DWEAIResult abnormalUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE, headers, messageBody); + } + + @Override + public DWEAIResult purchaseOrderUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_ORDER_UPDATE, headers, messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierContactInfoEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierContactInfoEAIServiceImpl.java new file mode 100644 index 0000000..f1f1b84 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierContactInfoEAIServiceImpl.java @@ -0,0 +1,41 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.SupplierContactInfoEAIService; +import com.digiwin.athena.app.service.supplier.SupplierContactUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @author CR-7 + * create: 2023-09-01 15:54 + * Description: + */ +public class SupplierContactInfoEAIServiceImpl implements SupplierContactInfoEAIService { + + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierContactUtil.DEMO_DATA_CONTACT_INFO_GET,headers,messageBody); + } + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierContactUtil.DEMO_DATA_CONTACT_INFO_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierContactUtil.DEMO_DATA_CONTACT_INFO_UPDATE,headers,messageBody); + } + + @Override + public DWEAIResult delete(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierContactUtil.DEMO_DATA_CONTACT_INFO_DELETE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierEAIServiceImpl.java new file mode 100644 index 0000000..9c3906a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierEAIServiceImpl.java @@ -0,0 +1,40 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.SupplierEAIService; +import com.digiwin.athena.app.service.supplier.SupplierUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/1 + */ +public class SupplierEAIServiceImpl implements SupplierEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_UPDATE,headers,messageBody); + } + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_GET,headers,messageBody); + } + + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult delete(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_DELETE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java new file mode 100644 index 0000000..2c662de --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java @@ -0,0 +1,131 @@ +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; +import java.util.Date; + +/** + * cim_collection_detail + * + * @author zhenggl + * @date 2023-09-12 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_collection_detail", autoResultMap = true) +public class CollectionDetailEntity 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 = "amount_tax") + private BigDecimal amountTax; + + /** 品号 */ + @SerializedName(value = "sku_code") + private String skuCode; + + /** 品名 */ + @SerializedName(value = "sku_name") + private String skuName; + + /** 规格 */ + @SerializedName(value = "sku_spec") + private String skuSpec; + + /** 含税单价 */ + @SerializedName(value = "price_tax") + private BigDecimal priceTax; + + /** 数量 */ + @SerializedName(value = "quantity") + private BigDecimal quantity; + + /** 应收日期 */ + @SerializedName(value = "receivable_date") + private Date receivableDate; + + /** 联系人 */ + @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 = "work_no") + private String workNo; + + /** 生产主管 */ + @SerializedName(value = "produce_boss") + private String produceBoss; + + /** 逾期天数 */ + @SerializedName(value = "overdue_days") + private String overdueDays; + + /** 处理人 */ + @SerializedName(value = "processed_by") + private String processedBy; + + /** 额度占用百分比 */ + @SerializedName(value = "quota_details") + private String quotaDetails; + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitCreditEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitCreditEntity.java new file mode 100644 index 0000000..db10bd9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitCreditEntity.java @@ -0,0 +1,34 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +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/12 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_limit_credit", autoResultMap = true) +public class LimitCreditEntity { + + /** 客户编号 */ + @SerializedName(value = "customer_no") + private String customerNo; + + /** 客户名称 */ + @SerializedName(value = "customer_name") + private String customerName; + + /** 信用额度 */ + @SerializedName(value = "limit_amount") + private BigDecimal limitAmount; +} 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..e5a1fcc --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java @@ -0,0 +1,118 @@ +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 + */ +@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; + + /** 限制金额 */ + @TableField(exist = false) + @SerializedName(value = "limit_amount") + private BigDecimal limitAmount; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ProductionDetailsEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ProductionDetailsEntity.java new file mode 100644 index 0000000..cd64455 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ProductionDetailsEntity.java @@ -0,0 +1,119 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import java.math.BigDecimal; +import java.util.Date; + +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; + +/** + * cim_production_details + * + * @author zhenggl + * @date 2023-09-12 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_production_details", autoResultMap = true) +public class ProductionDetailsEntity extends BaseMgrEntity +{ + + + /** 工厂编号 */ + @SerializedName(value = "factory_no") + private String factoryNo; + + /** 工厂名称 */ + @SerializedName(value = "factory_name") + private String factoryName; + + /** 性质 */ + @SerializedName(value = "nature") + private String nature; + + /** 预计产量 */ + @SerializedName(value = "expected_quantity") + private BigDecimal expectedQuantity; + + /** 预计开工日期 */ + @SerializedName(value = "expected_commencement_date") + private Date expectedCommencementDate; + + /** 预计完工日期 */ + @SerializedName(value = "estimated_completion_date") + private Date estimatedCompletionDate; + + /** 生管人员 */ + @SerializedName(value = "production_management_person") + private String productionManagementPerson; + + /** 生管部门 */ + @SerializedName(value = "production_management_department") + private String productionManagementDepartment; + + /** 工单单号 */ + @SerializedName(value = "work_no") + private String workNo; + + /** 状态 */ + @SerializedName(value = "production_status") + private String productionStatus; + + /** 生产批号 */ + @SerializedName(value = "batch_no") + private String batchNo; + + /** 品号 */ + @SerializedName(value = "sku_code") + private String skuCode; + + /** 品名 */ + @SerializedName(value = "sku_name") + private String skuName; + + /** 规格 */ + @SerializedName(value = "sku_spec") + private String skuSpec; + + /** 单位 */ + @SerializedName(value = "unit") + private String unit; + + /** 生产主管 */ + @SerializedName(value = "produce_boss") + private String produceBoss; + + /** 逾期天数 */ + @SerializedName(value = "overdue_days") + private String overdueDays; + + /** 额度占用百分比 */ + @SerializedName(value = "quota_details") + private String quotaDetails; + + /** 冻结原因 */ + @SerializedName(value = "freeze_reason") + private String freezeReason; + + /** 客户名称 */ + @SerializedName(value = "customer_name") + private String customerName; + + /** 客户编号 */ + @SerializedName(value = "customer_no") + private String customerNo; + + + public ProductionDetailsEntity(String factoryNo, String factoryName, String productionManagementPerson) { + this.factoryNo = factoryNo; + this.factoryName = factoryName; + this.productionManagementPerson = productionManagementPerson; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java new file mode 100644 index 0000000..230a02b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java @@ -0,0 +1,152 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import java.math.BigDecimal; +import java.util.Date; + +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; + +/** + * cim_receivables_detail + * + * @author zhenggl + * @date 2023-09-12 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_receivables_detail", autoResultMap = true) +public class ReceivablesDetailEntity 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 = "amount_tax") + private BigDecimal amountTax; + + /** 品号 */ + @SerializedName(value = "sku_code") + private String skuCode; + + /** 品名 */ + @SerializedName(value = "sku_name") + private String skuName; + + /** 规格 */ + @SerializedName(value = "sku_spec") + private String skuSpec; + + /** 含税单价 */ + @SerializedName(value = "price_tax") + private BigDecimal priceTax; + + /** 数量 */ + @SerializedName(value = "quantity") + private BigDecimal quantity; + + /** 应收日期 */ + @SerializedName(value = "receivable_date") + private Date receivableDate; + + /** 联系人 */ + @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 = "work_no") + private String workNo; + + /** 逾期天数 */ + @SerializedName(value = "overdue_days") + private String overdueDays; + + /** 生产主管 */ + @SerializedName(value = "produce_boss") + private String produceBoss; + + /** 限制金额 */ + @SerializedName(value = "limit_amount") + private BigDecimal limitAmount; + + /** 邮箱 */ + @SerializedName(value = "email") + private String email; + + /** 额度占用百分比 */ + @SerializedName(value = "quota_details") + private String quotaDetails; + + public ReceivablesDetailEntity(String customerName, String customerNo, String contacts, String contactInformation, BigDecimal priceTax, BigDecimal quantity, BigDecimal amountTax, BigDecimal limitAmount, Date receivableDate,String quotaDetails) { + this.customerNo = customerNo; + this.customerName = customerName; + this.contacts = contacts; + this.contactInformation = contactInformation; + this.priceTax = priceTax; + this.quantity = quantity; + this.amountTax = amountTax; + this.limitAmount = limitAmount; + this.receivableDate = receivableDate; + this.quotaDetails = quotaDetails; + } + + public ReceivablesDetailEntity(String skuCode, String skuName, String skuSpec) { + this.skuCode = skuCode; + this.skuName = skuName; + this.skuSpec = skuSpec; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/CollectionDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/CollectionDetailMapper.xml new file mode 100644 index 0000000..6930fd0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/CollectionDetailMapper.xml @@ -0,0 +1,18 @@ + + + + + + delete from cim_collection_detail where tenantsid=#{tenantSid} and + + ( + sales_order = #{item.salesOrder} + and sales_order_number = #{item.salesOrderNumber} + ) + + + + + 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/mapper/ReceivablesDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml new file mode 100644 index 0000000..5791908 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml @@ -0,0 +1,17 @@ + + + + + + + delete from cim_receivables_detail where tenantsid=#{tenantSid} and + + ( + sales_order = #{item.salesOrder} + and sales_order_number = #{item.salesOrderNumber} + ) + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/CollectionDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/CollectionDetailRepository.java new file mode 100644 index 0000000..faaa1a1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/CollectionDetailRepository.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.ptc.infra.repository; + + +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface CollectionDetailRepository extends BaseRepository { + void deleteBatch(@Param("list") List list,@Param("tenantSid")Long tenantSid); +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitCreditRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitCreditRepository.java new file mode 100644 index 0000000..a152bc5 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitCreditRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.LimitCreditEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface LimitCreditRepository extends BaseRepository { +} 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/repository/ProductionDetailsRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ProductionDetailsRepository.java new file mode 100644 index 0000000..86585bf --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ProductionDetailsRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.ProductionDetailsEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ProductionDetailsRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ReceivablesDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ReceivablesDetailRepository.java new file mode 100644 index 0000000..387e1c4 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ReceivablesDetailRepository.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ReceivablesDetailRepository extends BaseRepository { + void deleteBatch(@Param("list") List list, @Param("tenantSid")Long tenantSid); +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/CollectionDetailService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/CollectionDetailService.java new file mode 100644 index 0000000..a351398 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/CollectionDetailService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface CollectionDetailService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitCreditService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitCreditService.java new file mode 100644 index 0000000..f2ae130 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitCreditService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.LimitCreditEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface LimitCreditService extends IBaseService { +} 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/ProductionDetailsService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ProductionDetailsService.java new file mode 100644 index 0000000..7c3504d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ProductionDetailsService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.ProductionDetailsEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ProductionDetailsService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ReceivablesDetailService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ReceivablesDetailService.java new file mode 100644 index 0000000..a458041 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ReceivablesDetailService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ReceivablesDetailService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/CollectionDetailServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/CollectionDetailServiceImpl.java new file mode 100644 index 0000000..a8d253f --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/CollectionDetailServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; +import com.digiwin.athena.app.ptc.infra.service.CollectionDetailService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +public class CollectionDetailServiceImpl extends AbsBaseService implements CollectionDetailService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitCreditServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitCreditServiceImpl.java new file mode 100644 index 0000000..86a2ad9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitCreditServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.LimitCreditEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitCreditRepository; +import com.digiwin.athena.app.ptc.infra.service.LimitCreditService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +public class LimitCreditServiceImpl extends AbsBaseService implements LimitCreditService { +} 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/infra/service/impl/ProductionDetailsServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ProductionDetailsServiceImpl.java new file mode 100644 index 0000000..d11b3f0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ProductionDetailsServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.ProductionDetailsEntity; +import com.digiwin.athena.app.ptc.infra.repository.ProductionDetailsRepository; +import com.digiwin.athena.app.ptc.infra.service.ProductionDetailsService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +public class ProductionDetailsServiceImpl extends AbsBaseService implements ProductionDetailsService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ReceivablesDetailServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ReceivablesDetailServiceImpl.java new file mode 100644 index 0000000..d179cb4 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ReceivablesDetailServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.ReceivablesDetailRepository; +import com.digiwin.athena.app.ptc.infra.service.ReceivablesDetailService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +public class ReceivablesDetailServiceImpl extends AbsBaseService implements ReceivablesDetailService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitCreditEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitCreditEAIService.java new file mode 100644 index 0000000..2f4088e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitCreditEAIService.java @@ -0,0 +1,10 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWService; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface LimitCreditEAIService extends DWService { +} 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/ProductionDetailsEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ProductionDetailsEAIService.java new file mode 100644 index 0000000..770a003 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ProductionDetailsEAIService.java @@ -0,0 +1,25 @@ +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.production.ProductionUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ProductionDetailsEAIService extends DWService { + + @EAIService(id = ProductionUtil.PRODUCTION_TASK_GET) + DWEAIResult taskGet(Map headers, String messageBody) throws Exception; + + @EAIService(id = ProductionUtil.PRODUCTION_TASK_UPDATE) + DWEAIResult taskUpdate(Map headers, String messageBody) throws Exception; + + @EAIService(id = ProductionUtil.PRODUCTION_TASK_CREATE) + DWEAIResult taskCreate(Map headers, String messageBody) throws Exception; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ReceivablesDetailEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ReceivablesDetailEAIService.java new file mode 100644 index 0000000..79fb392 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ReceivablesDetailEAIService.java @@ -0,0 +1,30 @@ +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.receivables.ReceivablesUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ReceivablesDetailEAIService extends DWService { + + @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_GET) + DWEAIResult taskGet(Map headers, String messageBody) throws Exception; + + @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_CREATE) + DWEAIResult taskCreate(Map headers, String messageBody) throws Exception; + + @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_UPDATE) + DWEAIResult taskUpdate(Map headers, String messageBody) throws Exception; + + @EAIService(id = ReceivablesUtil.RECEIVABLES_INITIAL_CREATE) + DWEAIResult initialCreate(Map headers, String messageBody) throws Exception; + + @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_DELETE) + DWEAIResult taskDelete(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitCreditEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitCreditEAIServiceImpl.java new file mode 100644 index 0000000..7984633 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitCreditEAIServiceImpl.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.athena.app.ptc.provider.LimitCreditEAIService; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public class LimitCreditEAIServiceImpl implements LimitCreditEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; +} 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/provider/impl/ProductionDetailsEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ProductionDetailsEAIServiceImpl.java new file mode 100644 index 0000000..042dac7 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ProductionDetailsEAIServiceImpl.java @@ -0,0 +1,34 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.ProductionDetailsEAIService; +import com.digiwin.athena.app.ptc.service.production.ProductionUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public class ProductionDetailsEAIServiceImpl implements ProductionDetailsEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult taskGet(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ProductionUtil.PRODUCTION_TASK_GET,headers,messageBody); + } + + @Override + public DWEAIResult taskUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ProductionUtil.PRODUCTION_TASK_UPDATE,headers,messageBody); + } + + @Override + public DWEAIResult taskCreate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ProductionUtil.PRODUCTION_TASK_CREATE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java new file mode 100644 index 0000000..6aa553e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java @@ -0,0 +1,44 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.ReceivablesDetailEAIService; +import com.digiwin.athena.app.ptc.service.receivables.ReceivablesUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public class ReceivablesDetailEAIServiceImpl implements ReceivablesDetailEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult taskGet(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_TASK_GET,headers,messageBody); + } + + @Override + public DWEAIResult taskCreate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_TASK_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult taskUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_TASK_UPDATE,headers,messageBody); + } + + @Override + public DWEAIResult initialCreate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_INITIAL_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult taskDelete(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(ReceivablesUtil.RECEIVABLES_TASK_DELETE,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..bc83041 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java @@ -0,0 +1,82 @@ +package com.digiwin.athena.app.ptc.service.paymentdetails; + +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.alibaba.nacos.common.utils.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitCreditEntity; +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.app.ptc.infra.service.LimitCreditService; +import com.digiwin.athena.app.ptc.infra.service.ReceivablesDetailService; +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.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class ReceivablesGetEAIService extends AbsEAIService { + + @Resource + private ReceivablesDetailService receivablesDetailService; + + @Resource + private LimitCreditService limitCreditService; + + @Override + public String getServiceName() { + return PaymentDetailsUtil.RECEIVABLES_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest build = EAIRequest.build(messageBody); + String startTime = build.getString("start_datetime"); + String endTime = build.getString("end_datetime"); + + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(ReceivablesDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + if (StringUtils.isNotEmpty(startTime)&&StringUtils.isNotEmpty(endTime)){ + lmq.gt(ReceivablesDetailEntity::getCreateDate,startTime); + lmq.le(ReceivablesDetailEntity::getCreateDate,endTime); + } + + List list = receivablesDetailService.list(lmq); + + if (CollectionUtils.isEmpty(list)){ + return buildOK("query_result",list); + } + + //查询限制额度 + List customerNoList = list.stream().map(ReceivablesDetailEntity::getCustomerNo).collect(Collectors.toList()); + LambdaQueryWrapper creditLmq = new LambdaQueryWrapper<>(); + creditLmq.in(LimitCreditEntity::getCustomerNo,customerNoList); + List limitCreditEntityList = limitCreditService.list(creditLmq); + + if (CollectionUtils.isNotEmpty(limitCreditEntityList)){ + for (ReceivablesDetailEntity receivablesDetailEntity : list) { + for (LimitCreditEntity limitCreditEntity : limitCreditEntityList) { + if (Objects.nonNull(limitCreditEntity.getLimitAmount())&&receivablesDetailEntity.getCustomerNo().equals(limitCreditEntity.getCustomerNo())){ + receivablesDetailEntity.setLimitAmount(limitCreditEntity.getLimitAmount()); + } + } + } + } + + + return buildOK("query_result",list); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java new file mode 100644 index 0000000..1c62239 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java @@ -0,0 +1,99 @@ +package com.digiwin.athena.app.ptc.service.production; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.ptc.infra.entity.ProductionDetailsEntity; +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.app.ptc.infra.service.ProductionDetailsService; +import com.digiwin.athena.app.ptc.infra.service.ReceivablesDetailService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import org.apache.commons.lang.time.DateUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +public class ProductionCreateEAIService extends AbsEAIService { + + @Resource + private ProductionDetailsService productionDetailsService; + + @Resource + private ReceivablesDetailService receivablesDetailService; + + + + @Override + public String getServiceName() { + return ProductionUtil.PRODUCTION_TASK_CREATE; + } + + //随机赋值list + private List list = Arrays.asList( + new ProductionDetailsEntity("001", "一号工厂", "一号工厂刘晓鹏"), + new ProductionDetailsEntity("002", "二号工厂", "二号工厂饶文豪"), + new ProductionDetailsEntity("003", "三号工厂", "三号工厂卢人辅")); + + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List productionDetailsEntities = eaiRequest.getObject("get_data", new TypeReference>() { + }); + + + //根据工单单号查询应收表 + List woNoList = productionDetailsEntities.stream().map(ProductionDetailsEntity::getWorkNo).collect(Collectors.toList()); + LambdaQueryWrapper receivablesLmq = new LambdaQueryWrapper(); + receivablesLmq.in(ReceivablesDetailEntity::getWorkNo, woNoList); + List receivablesDetailEntities = receivablesDetailService.list(receivablesLmq); + + + + Random random = new Random(); + //默认赋值 + Integer batchNo = 1; + for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { + int randomNumber = random.nextInt(3); + int nature = random.nextInt(2)+1; + productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo()); + productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName()); + productionDetailsEntity.setProductionManagementPerson(this.list.get(randomNumber).getProductionManagementPerson()); + productionDetailsEntity.setProductionManagementDepartment("生管一部"); + productionDetailsEntity.setProduceBoss("23467345221"); + productionDetailsEntity.setProductionStatus(TabStatusEnums.PENDING.getValue().toString()); + productionDetailsEntity.setNature(String.valueOf(nature)); + productionDetailsEntity.setBatchNo("MMDD-000"+batchNo); + productionDetailsEntity.setUnit("pcs"); + productionDetailsEntity.setFreezeReason("剩余信用额度比例不足"); + batchNo = batchNo+1; + //预计产量赋值 + if (CollectionUtils.isNotEmpty(receivablesDetailEntities)) { + for (ReceivablesDetailEntity receivablesDetailEntity : receivablesDetailEntities) { + productionDetailsEntity.setExpectedQuantity(receivablesDetailEntity.getQuantity()); + //取应收日期前后5天 + productionDetailsEntity.setExpectedCommencementDate(DateUtils.addDays(receivablesDetailEntity.getReceivableDate(), random.nextInt(11) - 5)); + //取预计开工日期后5-10天 + productionDetailsEntity.setEstimatedCompletionDate(DateUtils.addDays(productionDetailsEntity.getExpectedCommencementDate(), random.nextInt(6) + 5)); + productionDetailsEntity.setSkuCode(receivablesDetailEntity.getSkuCode()); + productionDetailsEntity.setSkuName(receivablesDetailEntity.getSkuName()); + productionDetailsEntity.setSkuSpec(receivablesDetailEntity.getSkuSpec()); + } + } + } + productionDetailsService.saveBatch(productionDetailsEntities); + return buildOK(); + } + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java new file mode 100644 index 0000000..39c14b1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java @@ -0,0 +1,59 @@ +package com.digiwin.athena.app.ptc.service.production; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.StringUtils; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.ptc.infra.entity.ProductionDetailsEntity; +import com.digiwin.athena.app.ptc.infra.service.ProductionDetailsService; +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.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +@Log4j2 +public class ProductionTasUpdateEAIService extends AbsEAIService { + + @Resource + private ProductionDetailsService productionDetailsService; + + @Override + public String getServiceName() { + return ProductionUtil.PRODUCTION_TASK_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //根据bk更新状态为已完成 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List productionDetailsEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { + if (StringUtils.isEmpty(productionDetailsEntity.getWorkNo())){ + throw new DWBusinessException("缺少必填参数"); + } + } + + LambdaUpdateWrapper ump = new LambdaUpdateWrapper<>(); + ump.set(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.COMPLETED.getValue().toString()); + List woNoList = productionDetailsEntities.stream().map(ProductionDetailsEntity::getWorkNo).collect(Collectors.toList()); + ump.in(ProductionDetailsEntity::getWorkNo,woNoList); + + + productionDetailsService.update(ump); + + return buildOK(); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java new file mode 100644 index 0000000..44050a4 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java @@ -0,0 +1,62 @@ +package com.digiwin.athena.app.ptc.service.production; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.StringUtils; +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.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.ptc.infra.entity.ProductionDetailsEntity; +import com.digiwin.athena.app.ptc.infra.service.ProductionDetailsService; +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.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +@Log4j2 +public class ProductionTaskGetEAIService extends AbsEAIService { + + @Resource + private ProductionDetailsService productionDetailsService; + + @Override + public String getServiceName() { + return ProductionUtil.PRODUCTION_TASK_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //根据bk获取数据 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List productionDetailsEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + String status = eaiRequest.getString("production_status"); + + for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { + if (StringUtils.isEmpty(productionDetailsEntity.getWorkNo())){ + throw new DWBusinessException("缺少必填参数"); + } + } + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + List woNoList = productionDetailsEntities.stream().map(ProductionDetailsEntity::getWorkNo).collect(Collectors.toList()); + lmq.eq(ProductionDetailsEntity::getTenantSid,SecurityUtil.getUserProfile().getTenantSid()); + lmq.eq(ProductionDetailsEntity::getProductionStatus, status); + lmq.in(ProductionDetailsEntity::getWorkNo,woNoList); + List list = productionDetailsService.list(lmq); + + + return buildOK("query_result",list); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionUtil.java new file mode 100644 index 0000000..46c592e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionUtil.java @@ -0,0 +1,19 @@ +package com.digiwin.athena.app.ptc.service.production; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public class ProductionUtil { + + public static final String PRODUCTION_TASK_GET = "demo.ptc.athenapot.production.task.get"; + + + public static final String PRODUCTION_TASK_UPDATE = "demo.ptc.athenapot.production.task.update"; + + public static final String PRODUCTION_TASK_CREATE = "demo.ptc.athenapot.production.task.create"; + + + public static final String KEY = "demo-ptc-athenaopt"; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesCreateEAIService.java new file mode 100644 index 0000000..8c14253 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesCreateEAIService.java @@ -0,0 +1,69 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; +import com.digiwin.athena.app.ptc.infra.service.CollectionDetailService; +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.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Log4j2 +@Service +public class ReceivablesCreateEAIService extends AbsEAIService { + + @Resource + private CollectionDetailService collectionDetailService; + + @Resource + private CollectionDetailRepository collectionDetailRepository; + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_TASK_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List receivablesDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + /*//根据bk删除数据 + //先删除 + collectionDetailRepository.deleteBatch(receivablesDetailEntities, SecurityUtil.getUserProfile().getTenantSid());*/ + //根据bk查询数据,删除已存在 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.and(queryWrapperInner -> { + for (CollectionDetailEntity collectionDetailEntity : receivablesDetailEntities) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(CollectionDetailEntity::getSalesOrder, collectionDetailEntity.getSalesOrder()) + .eq(CollectionDetailEntity::getSalesOrderNumber, collectionDetailEntity.getSalesOrderNumber()) + ); + } + + }); + List list = collectionDetailService.list(lmq); + Map collect = list.stream().collect(Collectors.toMap(item -> item.getSalesOrder() + "-" + item.getSalesOrderNumber(), Function.identity())); + + + List receivablesList = receivablesDetailEntities.stream().filter(item -> !collect.containsKey(item.getSalesOrder() + "-" + item.getSalesOrderNumber())).collect(Collectors.toList()); + + + collectionDetailService.saveBatch(receivablesList); + return buildOK("query_result",receivablesList); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java new file mode 100644 index 0000000..fc202f2 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java @@ -0,0 +1,160 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; +import com.digiwin.athena.app.ptc.infra.repository.ReceivablesDetailRepository; +import com.digiwin.athena.app.ptc.infra.service.CollectionDetailService; +import com.digiwin.athena.app.ptc.infra.service.ReceivablesDetailService; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.generator.SnowflakeWorker; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.*; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Log4j2 +@Service +public class ReceivablesInitialCreateEAIService extends AbsEAIService { + + @Resource + private CollectionDetailRepository collectionDetailRepository; + + @Resource + private ReceivablesDetailRepository receivablesDetailRepository; + + + @Resource + private ReceivablesDetailService receivablesDetailService; + + @Resource + private CollectionDetailService collectionDetailService; + + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_INITIAL_CREATE; + } + + + + /** 品号品名规格赋值list*/ + private List skuList = Arrays.asList( + new ReceivablesDetailEntity("24080Y100231","曲股组件(右)","仅前端钻接头孔"), + new ReceivablesDetailEntity("24070Y100230","直股组件(右)","仅前端钻接头孔"), + new ReceivablesDetailEntity("24100Y400023","可动心轨辙叉组件(右)","20992mm;无砟道床"), + new ReceivablesDetailEntity("220500100187","导轨","60kg/m,16193mm(两端均钻接头孔)"), + new ReceivablesDetailEntity("2111H0320001","60AT1-75单头锻压件(右轨)","U75V,在线淬火轨"), + new ReceivablesDetailEntity("24020Z100018","曲基本轨-组装(左)","60kg/m,(600+16792+600)mm"), + new ReceivablesDetailEntity("22040Y200001","曲线尖轨(右)","60AT1,21450mm"), + new ReceivablesDetailEntity("10940000124","手动扳道器-库改","60AT1,21450mm"), + new ReceivablesDetailEntity("3011040Y5014","60kg/m钢轨18号可动心轨单开道岔(右)","60-18"), + new ReceivablesDetailEntity("3011010Y1037","60kg/m钢轨9号单开道岔(右)","60-9(详见:营销2022261号-排20220800083号;顺坡垫板设置2处)(试车线、#64)"), + new ReceivablesDetailEntity("230300100008","胶接轨","60kg/m,20913(7809+8+13096)mm"), + new ReceivablesDetailEntity("220600200004","侧向护轨","50kg/m,4800mm"), + new ReceivablesDetailEntity("241200100015","叉心组件","直股后加长1800mm,不钻接头孔;曲股不加长,钻接头孔"), + new ReceivablesDetailEntity("2112H0610001","60AT1-模锻翼轨单头锻压件(左轨)","U71Mn,在线淬火轨"), + new ReceivablesDetailEntity("230109100004","序号9活动心轨(焊接轨件)","60kg/m+60AT1,15020(10737+4283)mm"), + new ReceivablesDetailEntity("221700200001","左侧尖轨","50AT1,6450mm(按图纸要求钻孔)") + ); + + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + //生成6个随机且不重复的随机整数 + Random random = new Random(); + HashSet set = new HashSet<>(); + int count = 0; + while (count < 6) { + int num = random.nextInt(26); + if (!set.contains(num)) { + set.add(num); + count++; + } + } + List indexList = new ArrayList<>(set); + //客户名称随机生成 + String[] abcArray = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; + + + Date date = new Date(); + Date date1 = org.apache.commons.lang.time.DateUtils.addDays(date, -1); + Date date2 = org.apache.commons.lang.time.DateUtils.addDays(date, -7); + + //随机赋值list + List list = Arrays.asList( + new ReceivablesDetailEntity("鼎捷"+abcArray[indexList.get(0)]+"半导体有限公司",abcArray[indexList.get(0)]+indexList.get(0),"张三","186****9498",new BigDecimal("10000"),new BigDecimal("135"),new BigDecimal("1350000"),new BigDecimal("20000000"),date,"34.2%"), + new ReceivablesDetailEntity("鼎捷"+abcArray[indexList.get(0)]+"半导体有限公司",abcArray[indexList.get(0)]+indexList.get(0),"李四","158****4794",new BigDecimal("800"),new BigDecimal("2500"),new BigDecimal("2000000"),new BigDecimal("20000000"),date1,"34.2%"), + new ReceivablesDetailEntity("鼎捷"+abcArray[indexList.get(0)]+"半导体有限公司",abcArray[indexList.get(0)]+indexList.get(0),"王五","150****9529",new BigDecimal("50000"),new BigDecimal("70"),new BigDecimal("3500000"),new BigDecimal("20000000"),date2,"34.2%"), + new ReceivablesDetailEntity("鼎新"+abcArray[indexList.get(1)]+"半导体有限公司",abcArray[indexList.get(1)]+indexList.get(1),"赵六","139****0530",new BigDecimal("250000"),new BigDecimal("26"),new BigDecimal("6500000"),new BigDecimal("20000000"),date1,"75%"), + new ReceivablesDetailEntity("鼎新"+abcArray[indexList.get(1)]+"半导体有限公司",abcArray[indexList.get(1)]+indexList.get(1),"陈七","136****5333",new BigDecimal("2500"),new BigDecimal("3400"),new BigDecimal("8500000"),new BigDecimal("20000000"),date2,"75%"), + new ReceivablesDetailEntity("鼎新"+abcArray[indexList.get(2)]+"半导体有限公司",abcArray[indexList.get(2)]+indexList.get(2),"刘八","188****9299",new BigDecimal("10000"),new BigDecimal("20"),new BigDecimal("200000"),new BigDecimal("5000000"),date1,"40%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(2)]+"半导体有限公司",abcArray[indexList.get(2)]+indexList.get(2),"韩九","130****3555",new BigDecimal("360"),new BigDecimal("5000"),new BigDecimal("1800000"),new BigDecimal("5000000"),date2,"40%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(3)]+"半导体有限公司",abcArray[indexList.get(3)]+indexList.get(3),"管十一","138****9999",new BigDecimal("2500"),new BigDecimal("800"),new BigDecimal("2000000"),new BigDecimal("10000000"),date1,"50%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(3)]+"半导体有限公司",abcArray[indexList.get(3)]+indexList.get(3),"丁十三","187****6160",new BigDecimal("30000"),new BigDecimal("100"),new BigDecimal("3000000"),new BigDecimal("10000000"),date2,"50%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(4)]+"半导体有限公司",abcArray[indexList.get(4)]+indexList.get(4),"包十四","187****6160",new BigDecimal("400"),new BigDecimal("10000"),new BigDecimal("4000000"),new BigDecimal("15000000"),date1,"80%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(4)]+"半导体有限公司",abcArray[indexList.get(4)]+indexList.get(4),"董十五","187****6160",new BigDecimal("100"),new BigDecimal("80000"),new BigDecimal("8000000"),new BigDecimal("15000000"),date2,"80%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(5)]+"半导体有限公司",abcArray[indexList.get(5)]+indexList.get(5),"肖十六","187****6160",new BigDecimal("3500"),new BigDecimal("200"),new BigDecimal("7000000"),new BigDecimal("10000000"),date1,"80%"), + new ReceivablesDetailEntity("鼎华"+abcArray[indexList.get(5)]+"半导体有限公司",abcArray[indexList.get(5)]+indexList.get(5),"肖十六","187****6160",new BigDecimal("4000"),new BigDecimal("250"),new BigDecimal("1000000"),new BigDecimal("10000000"),date2,"80%")); + + + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + + //取出已完成的数据 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); + lmq.eq(CollectionDetailEntity::getStatus, "2"); + List collectionDetailEntities = collectionDetailService.list(lmq); + + //删除应收数据 + if (CollectionUtils.isNotEmpty(collectionDetailEntities)){ + receivablesDetailRepository.deleteBatch(collectionDetailEntities,tenantSid); + } + + + + + int no = 1; + //随机新增 + for (ReceivablesDetailEntity receivablesDetailEntity : list) { + + int i = random.nextInt(16); + ReceivablesDetailEntity sku = skuList.get(i); + receivablesDetailEntity.setSkuCode(sku.getSkuCode()); + receivablesDetailEntity.setSkuName(sku.getSkuName()); + receivablesDetailEntity.setSkuSpec(sku.getSkuSpec()); + receivablesDetailEntity.setReceivableNo("RE-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setReceivableNon("SEQ-000"+no); + receivablesDetailEntity.setContractNo("CO"+ SnowflakeWorker.nextId()); + receivablesDetailEntity.setStatus("1"); + receivablesDetailEntity.setSalesOrder("SO-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setSalesOrderNumber("SON-000"+no); + receivablesDetailEntity.setSalesmanAssistant("Sp0001"); + receivablesDetailEntity.setSalesmanBoss("qcuser004"); + receivablesDetailEntity.setSalesman("Sp0001"); + receivablesDetailEntity.setProduceBoss("Sp0002"); + receivablesDetailEntity.setEmail("ath_Sp0001@163.com"); + receivablesDetailEntity.setWorkNo("work-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setOverdueDays(String.valueOf((new Date().getTime()-receivablesDetailEntity.getReceivableDate().getTime())/86400000L)); + no = no +1; + } + + receivablesDetailService.saveBatch(list); + + return buildOK(); + } + + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java new file mode 100644 index 0000000..4f79699 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java @@ -0,0 +1,52 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.StringUtils; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.CollectionDetailRepository; +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.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/13 + */ +@Service +@Log4j2 +public class ReceivablesTaskDeleteEAIService extends AbsEAIService { + + @Resource + private CollectionDetailRepository collectionDetailRepository; + + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_TASK_DELETE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List collectionDetailEntities = eaiRequest.getObject("receivables_info", new TypeReference>() {}); + + + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder()) + ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + throw new DWBusinessException("缺少必要参数"); + } + } + + collectionDetailRepository.deleteBatch(collectionDetailEntities, SecurityUtil.getUserProfile().getTenantSid()); + return buildOK(); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java new file mode 100644 index 0000000..7b923c9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java @@ -0,0 +1,71 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.StringUtils; +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.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.service.CollectionDetailService; +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.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +@Log4j2 +public class ReceivablesTaskGetEAIService extends AbsEAIService { + + @Resource + private CollectionDetailService collectionDetailService; + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_TASK_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List collectionDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + String status = eaiRequest.getString("receivables_status"); + + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder()) + ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + throw new DWBusinessException("缺少必要参数"); + } + } + + + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(CollectionDetailEntity::getStatus, status); + lmq.eq(CollectionDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + lmq.and(queryWrapperInner -> { + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(CollectionDetailEntity::getSalesOrder, collectionDetailEntity.getSalesOrder()) + .eq(CollectionDetailEntity::getSalesOrderNumber, collectionDetailEntity.getSalesOrderNumber()) + ); + } + + }); + + List list = collectionDetailService.list(lmq); + return buildOK("query_result",list); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java new file mode 100644 index 0000000..66310e6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java @@ -0,0 +1,68 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.StringUtils; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.ptc.infra.entity.CollectionDetailEntity; +import com.digiwin.athena.app.ptc.infra.service.CollectionDetailService; +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 org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +@Service +@Log4j2 +public class ReceivablesTaskUpdateEAIService extends AbsEAIService { + + @Resource + private CollectionDetailService collectionDetailService; + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_TASK_UPDATE; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //根据bk更新状态为已完成 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List collectionDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder())||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + throw new DWBusinessException("缺少必要参数"); + } + } + + LambdaUpdateWrapper ump = new LambdaUpdateWrapper<>(); + ump.set(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue().toString()); + ump.eq(CollectionDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + ump.and(queryWrapperInner -> { + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(CollectionDetailEntity::getSalesOrder, collectionDetailEntity.getSalesOrder()) + .eq(CollectionDetailEntity::getSalesOrderNumber, collectionDetailEntity.getSalesOrderNumber()) + ); + } + } + ); + collectionDetailService.update(ump); + + return buildOK("query_result",collectionDetailEntities); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java new file mode 100644 index 0000000..6eacabb --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java @@ -0,0 +1,18 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public class ReceivablesUtil { + + public static final String RECEIVABLES_TASK_GET = "demo.ptc.athenapot.receivables.task.get"; + + public static final String RECEIVABLES_TASK_UPDATE = "demo.ptc.athenapot.receivables.task.update"; + + public static final String RECEIVABLES_TASK_CREATE = "demo.ptc.athenapot.receivables.create"; + + public static final String RECEIVABLES_INITIAL_CREATE = "demo.ptc.athenapot.receivables.initial.create"; + + public static final String RECEIVABLES_TASK_DELETE = "demo.ptc.athenapot.receivables.task.delete"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ExecutorUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ExecutorUtil.java new file mode 100644 index 0000000..6da0d99 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ExecutorUtil.java @@ -0,0 +1,25 @@ +package com.digiwin.athena.app.service.executor; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; + +import java.util.List; + +/** + * @Author: xieps + * @Date: 2023/8/30 13:32 + * @Version 1.0 + * @Description + */ +public class ExecutorUtil { + + public static final String DEMO_ITEM_EXECUTOR_INFO_CREATE = "demo.item.executor.info.create"; + public static final String DEMO_ITEM_EXECUTOR_INFO_UPDATE = "demo.item.executor.info.update"; + public static final String DEMO_ITEM_EXECUTOR_INFO_GET = "demo.item.executor.info.get"; + public static final String DEMO_ITEM_EXECUTOR_INFO_DELETE = "demo.item.executor.info.delete"; + + + public static final TypeReference> ITEM_EXECUTOR_LIST = new TypeReference>() { + }; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorCreateEAIService.java new file mode 100644 index 0000000..47acf67 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorCreateEAIService.java @@ -0,0 +1,129 @@ +package com.digiwin.athena.app.service.executor; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +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.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.app.infra.repository.ItemExecutorRepository; +import com.digiwin.athena.app.infra.service.ItemExecutorService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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 org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentSkipListMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:33 + * @Version 1.0 + * @Description + */ +@Service +@Log4j2 +public class ItemExecutorCreateEAIService extends AbsEAIService { + + + @Resource + private ItemExecutorRepository itemExecutorRepository; + + + @Resource + private ItemExecutorService itemExecutorService; + + + @Override + public String getServiceName() { + return ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = new EAIRequest(messageBody); + List itemExecutorInfo = request.getToList("item_executor_info", ItemExecutorEntity.class); + + //对必传参数 且 品号和执行人编号不可以重复 进行校验 + validateParameter(itemExecutorInfo); + + //进行批量新增 + itemExecutorService.saveBatch(itemExecutorInfo); + + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_executor_info",itemExecutorInfo)); + } + + + /** + * 对入参进行参数校验 + * + * @param itemExecutorInfo + * @throws DWBusinessException + */ + private void validateParameter(List itemExecutorInfo) throws DWBusinessException { + if (Objects.isNull(itemExecutorInfo) || itemExecutorInfo.isEmpty()) { + throw new DWBusinessException("入参数据为空~~"); + } + for (ItemExecutorEntity item : itemExecutorInfo) { + if (StringUtils.isEmpty(item.getItemNo())) { + throw new DWBusinessException("品号字段值不为空或者NULL~"); + } + if (StringUtils.isEmpty(item.getItemName())) { + throw new DWBusinessException("品名字段值不为空或者NULL~"); + } + if (StringUtils.isEmpty(item.getProcurementExecutorCode())) { + throw new DWBusinessException("执行人编号字段值不为空或者NULL~"); + } + if (StringUtils.isEmpty(item.getProcurementExecutorName())) { + throw new DWBusinessException("执行人名称字段值不为空或者NULL~"); + } + } + List distinctList = itemExecutorInfo.stream().filter(distinctByKey(item -> Stream.of(item.getItemNo(), item.getProcurementExecutorCode()).toArray())).collect(Collectors.toList()); + if (itemExecutorInfo.size() > distinctList.size()) { + throw new DWBusinessException("品号和执行人编号入参重复~"); + } + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ItemExecutorEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List entityList = itemExecutorRepository.selectList(queryWrapper); + + if (!entityList.isEmpty()) { + for (ItemExecutorEntity executorEntity : entityList) { + String itemNo = executorEntity.getItemNo(); + String executorNo = executorEntity.getProcurementExecutorCode(); + boolean match = itemExecutorInfo.stream().anyMatch(item -> Objects.equals(item.getItemNo(), itemNo) + && Objects.equals(item.getProcurementExecutorCode(), executorNo)); + if (match) { + throw new DWBusinessException("品号和执行人编号已重复~"); + } + } + } + } + + + /** + * 用于对象去重 + * + * @param keyExtractor 需要去重的属性 + * @param + * @return + */ + private static Predicate distinctByKey(Function keyExtractor) { + //记录已有对象或者属性 + ConcurrentSkipListMap skipListMap = new ConcurrentSkipListMap<>(); + return t -> skipListMap.putIfAbsent(JSON.toJSONString(keyExtractor.apply(t)), Boolean.TRUE) == null; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorDeleteEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorDeleteEAIService.java new file mode 100644 index 0000000..f63a769 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorDeleteEAIService.java @@ -0,0 +1,57 @@ +package com.digiwin.athena.app.service.executor; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.repository.ItemExecutorRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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.*; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:25 + * @Version 1.0 + * @Description + */ +@Service +@Log4j2 +public class ItemExecutorDeleteEAIService extends AbsEAIService { + + + @Resource + private ItemExecutorRepository itemExecutorRepository; + + + @Override + public String getServiceName() { + return ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_DELETE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + JSONObject parameter = new EAIRequest(messageBody).getParameter(); + JSONArray itemExecutorInfo = parameter.getJSONArray("item_executor_info"); + + List idList = new ArrayList<>(); + for (Iterator iterator = itemExecutorInfo.iterator(); iterator.hasNext(); ) { + JSONObject item = (JSONObject) iterator.next(); + Long id = item.getLong("id"); + if (!Objects.isNull(id)) { + idList.add(id); + } + } + + if (!idList.isEmpty()) { + itemExecutorRepository.deleteBatchIds(idList); + } + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorGetEAIService.java new file mode 100644 index 0000000..2dbe3ba --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorGetEAIService.java @@ -0,0 +1,68 @@ +package com.digiwin.athena.app.service.executor; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.app.infra.repository.ItemExecutorRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Author: xieps + * @Date: 2023/8/30 13:55 + * @Version 1.0 + * @Description 品号执行人Get + */ +@Service +@Log4j2 +public class ItemExecutorGetEAIService extends AbsEAIService { + + + @Resource + private ItemExecutorRepository itemExecutorRepository; + + + @Override + public String getServiceName() { + return ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = new EAIRequest(messageBody); + List itemExecutorInfo = request.getToList("item_executor_info", ItemExecutorEntity.class); + //组装查询条件 进行查询 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ItemExecutorEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + if (!itemExecutorInfo.isEmpty()) { + queryWrapper.and( + queryWrapperInner -> { + for (ItemExecutorEntity item : itemExecutorInfo) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(item.getItemNo()), ItemExecutorEntity::getItemNo, item.getItemNo()) + .eq(!StringUtils.isEmpty(item.getItemName()), ItemExecutorEntity::getItemName, item.getItemName()) + .eq(!StringUtils.isEmpty(item.getProcurementExecutorCode()), ItemExecutorEntity::getProcurementExecutorCode, item.getProcurementExecutorCode()) + .eq(!StringUtils.isEmpty(item.getProcurementExecutorName()), ItemExecutorEntity::getProcurementExecutorName, item.getProcurementExecutorName()) + ); + } + } + ); + + } + List itemExecutorEntities = itemExecutorRepository.selectList(queryWrapper); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_executor_info", itemExecutorEntities)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorUpdateEAIService.java new file mode 100644 index 0000000..e76aa96 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorUpdateEAIService.java @@ -0,0 +1,111 @@ +package com.digiwin.athena.app.service.executor; + +import com.alibaba.fastjson.JSON; +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.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.app.infra.repository.ItemExecutorRepository; +import com.digiwin.athena.app.infra.service.ItemExecutorService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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 org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentSkipListMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @Author: xieps + * @Date: 2023/8/30 14:59 + * @Version 1.0 + * @Description + */ +@Service +@Log4j2 +public class ItemExecutorUpdateEAIService extends AbsEAIService { + + @Resource + private ItemExecutorService itemExecutorService; + + + @Resource + private ItemExecutorRepository itemExecutorRepository; + + @Override + public String getServiceName() { + return ExecutorUtil.DEMO_ITEM_EXECUTOR_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = new EAIRequest(messageBody); + List itemExecutorInfo = request.getToList("item_executor_info", ItemExecutorEntity.class); + + //对必传参数 且 品号和执行人编号不可以重复 进行校验 + validateParameter(itemExecutorInfo); + + //根据品号和执行人编号进行更新 + itemExecutorRepository.updateBatch(itemExecutorInfo, SecurityUtil.getUserProfile().getTenantSid()); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } + + + /** + * 对入参进行参数校验 + * + * @param itemExecutorInfo + * @throws DWBusinessException + */ + private void validateParameter(List itemExecutorInfo) throws DWBusinessException { + if (Objects.isNull(itemExecutorInfo) || itemExecutorInfo.isEmpty()) { + throw new DWBusinessException("入参数据为空~~"); + } + for (ItemExecutorEntity item : itemExecutorInfo) { + if (StringUtils.isEmpty(item.getItemNo())) { + throw new DWBusinessException("品号字段值不为空或者NULL~"); + } + if (StringUtils.isEmpty(item.getItemName())) { + throw new DWBusinessException("品名字段值不为空或者NULL~"); + } + if (StringUtils.isEmpty(item.getProcurementExecutorCode())) { + throw new DWBusinessException("执行人编号字段值不为空或者NULL~"); + } + if (StringUtils.isEmpty(item.getProcurementExecutorName())) { + throw new DWBusinessException("执行人名称字段值不为空或者NULL~"); + } + } + List distinctList = itemExecutorInfo.stream().filter(distinctByKey(item -> Stream.of(item.getItemNo(), item.getProcurementExecutorCode()).toArray())).collect(Collectors.toList()); + if (itemExecutorInfo.size() > distinctList.size()) { + throw new DWBusinessException("品号和执行人编号入参重复~"); + } + + } + + + /** + * 用于对象去重 + * + * @param keyExtractor 需要去重的属性 + * @param + * @return + */ + private static Predicate distinctByKey(Function keyExtractor) { + //记录已有对象或者属性 + ConcurrentSkipListMap skipListMap = new ConcurrentSkipListMap<>(); + return t -> skipListMap.putIfAbsent(JSON.toJSONString(keyExtractor.apply(t)), Boolean.TRUE) == null; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoCreateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoCreateService.java new file mode 100644 index 0000000..600cab9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoCreateService.java @@ -0,0 +1,111 @@ +package com.digiwin.athena.app.service.purchase; + +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.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; +import com.digiwin.athena.app.infra.service.PurchaseDemoService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * @author lz + * @description 创建请购单 + * @throws + * @time 2023/8/29 16:16 + */ +@Service +public class PurchaseDemoCreateService extends AbsEAIService { + + @Resource + PurchaseOrderDetailRepository purchaseOrderDetailRepository; + + @Resource + PurchaseDemoService purchaseDemoService; + + @Override + public String getServiceName() { + return PurchaseUtil.DEMO_PURCHASE_DEMO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = new EAIRequest(messageBody); + List purchaseInfos = request.getObject("purchase_info", PurchaseUtil.LIST_ENTITY_PURCHASE); + + //入参非空校验 + validateParameter(purchaseInfos); + + //集合不为空,插入数据库 + if (!purchaseInfos.isEmpty()) { + purchaseDemoService.saveBatch(purchaseInfos); + } + + return EAIUtil.buildEAIResult(new HashMap<>()); + } + + + /** + * @throws + * @description 校验字段不为空 + * @author lz + * @time 2023/9/5 15:01 + */ + private void validateParameter(List purchaseInfos) throws DWBusinessException { + if (Objects.isNull(purchaseInfos) || purchaseInfos.isEmpty()) { + throw new DWBusinessException("入参数据不能为空"); + } + for (PurchaseOrderDetailEntity item : purchaseInfos) { + if (StringUtils.isEmpty(item.getPurchaseOrderNo())) { + throw new DWBusinessException("请购单号不能为空或NULL"); + } + if (StringUtils.isEmpty(item.getPurchaseOrderSeq())) { + throw new DWBusinessException("请购单序号不能为空或NULL"); + } + if (StringUtils.isEmpty(item.getItemNo())) { + throw new DWBusinessException("品号不为空或者NULL"); + } + if (StringUtils.isEmpty(item.getItemName())) { + throw new DWBusinessException("品名不为空或者NULL"); + } + if (StringUtils.isEmpty(item.getProcurementExecutorCode())) { + throw new DWBusinessException("执行人编号不为空或者NULL"); + } + if (item.getRequisitionNum() == 0) { + throw new DWBusinessException("请购数量必须大于0"); + } + } + + //根据请购单号和请购单序号查询是否存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PurchaseOrderDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + queryWrapper.and( + queryWrapperInner -> { + for (PurchaseOrderDetailEntity purchaseOrderDetail : purchaseInfos) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!org.apache.commons.lang.StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderNo()), PurchaseOrderDetailEntity::getPurchaseOrderNo, purchaseOrderDetail.getPurchaseOrderNo()) + .eq(!org.apache.commons.lang.StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderSeq()), PurchaseOrderDetailEntity::getPurchaseOrderSeq, purchaseOrderDetail.getPurchaseOrderSeq()) + + ); + } + } + ); + List purchaseOrderList = purchaseOrderDetailRepository.selectList(queryWrapper); + if (purchaseOrderList != null && purchaseOrderList.size() > 0) { + throw new DWBusinessException("请购单号+请购单序号已存在!"); + } + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java new file mode 100644 index 0000000..d79d3bd --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java @@ -0,0 +1,81 @@ +package com.digiwin.athena.app.service.purchase; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.utils.ResponseUtil; +import com.digiwin.athena.app.infra.common.utils.TransferUtil; +import com.digiwin.athena.app.infra.dto.PurchaseOrderDetailDTO; +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * @author lizhuangzhuang + * @description 查询请购单 + * @throws + * @time 2023/8/30 11:07 + */ +@Service +public class PurchaseDemoGetService extends AbsEAIService { + + @Resource + PurchaseOrderDetailRepository purchaseOrderDetailRepository; + + @Override + public String getServiceName() { + return PurchaseUtil.DEMO_PURCHASE_DEMO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = new EAIRequest(messageBody); + List purchaseInfos = request.getObject("purchase_info", PurchaseUtil.LIST_ENTITY_PURCHASE); + + //根据请购单号+请购单序号+状态+任务卡类型查询 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PurchaseOrderDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + queryWrapper.and( + queryWrapperInner -> { + for (PurchaseOrderDetailEntity purchaseOrderDetail : purchaseInfos) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderNo()), PurchaseOrderDetailEntity::getPurchaseOrderNo, purchaseOrderDetail.getPurchaseOrderNo()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderSeq()), PurchaseOrderDetailEntity::getPurchaseOrderSeq, purchaseOrderDetail.getPurchaseOrderSeq()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getTabStatus()), PurchaseOrderDetailEntity::getTabStatus, purchaseOrderDetail.getTabStatus()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getAbnormalTabStatus()), PurchaseOrderDetailEntity::getAbnormalTabStatus, purchaseOrderDetail.getAbnormalTabStatus()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getReplyTabStatus()), PurchaseOrderDetailEntity::getReplyTabStatus, purchaseOrderDetail.getReplyTabStatus()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getTaskType()), PurchaseOrderDetailEntity::getTaskType, purchaseOrderDetail.getTaskType()) + + ); + } + } + ); + List entities = purchaseOrderDetailRepository.selectList(queryWrapper); + + //String类型的null字段,转换为空字符串 + List purchaseOrderDetailEntities = ResponseUtil.listNullToString(entities); + + List purchaseInfo = new ArrayList<>(); + for (PurchaseOrderDetailEntity e : purchaseOrderDetailEntities) { + purchaseInfo.add(JSON.parseObject(new ObjectMapper().writeValueAsString(e))); + } + + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("purchase_info", purchaseOrderDetailEntities)); + + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java new file mode 100644 index 0000000..59e2ebe --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java @@ -0,0 +1,47 @@ +package com.digiwin.athena.app.service.purchase; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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/4 + */ +@Log4j2 +@Service +public class PurchaseOrderAbnormalUpdateEAIService extends AbsEAIService { + + @Resource + PurchaseOrderDetailRepository purchaseOrderDetailRepository; + + @Override + public String getServiceName() { + return PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + // 入参反序列化 + EAIRequest request = new EAIRequest(messageBody); + List purchaseOrderDetailEntities = request.getToList("purchase_order_info", PurchaseOrderDetailEntity.class); + purchaseOrderDetailRepository.updateAbnormalHandlePlan(purchaseOrderDetailEntities); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderUpdateEAIService.java new file mode 100644 index 0000000..6833f4e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderUpdateEAIService.java @@ -0,0 +1,79 @@ +package com.digiwin.athena.app.service.purchase; + +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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 org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @Author: xieps + * @Date: 2023/9/5 15:29 + * @Version 1.0 + * @Description + */ +@Service +@Log4j2 +public class PurchaseOrderUpdateEAIService extends AbsEAIService { + + + @Resource + PurchaseOrderDetailRepository purchaseOrderDetailRepository; + + @Override + public String getServiceName() { + return PurchaseUtil.DEMO_PURCHASE_ORDER_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = new EAIRequest(messageBody); + List entityList = request.getToList("purchase_info", PurchaseOrderDetailEntity.class); + //校验请购单号、序号 必传 + validateParameter(entityList); + //管理字段赋值 + entityList.stream().forEach(item -> { + item.setTenantSid(SecurityUtil.getUserProfile().getTenantSid()); + item.setModifiedBy(SecurityUtil.getUserProfile().getUserId()); + item.setModifiedDate(new Date()); + }); + //根据单号,序号进行批量更新 + purchaseOrderDetailRepository.updateBatch(entityList); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } + + + /** + * 校验必传参数 + * + * @param entityList + */ + private void validateParameter(List entityList) throws DWBusinessException { + if (Objects.isNull(entityList) || entityList.isEmpty()) { + throw new DWBusinessException("入参数据为空~~"); + } + for (PurchaseOrderDetailEntity entity : entityList) { + + if (StringUtils.isEmpty(entity.getPurchaseOrderNo())) { + throw new DWBusinessException("请购单号不为空或者NULL~"); + } + + if (StringUtils.isEmpty(entity.getPurchaseOrderSeq())) { + throw new DWBusinessException("请购单序号不为空或者NULL~"); + } + } + } + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java new file mode 100644 index 0000000..63f91f0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java @@ -0,0 +1,34 @@ +package com.digiwin.athena.app.service.purchase; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; + +import java.util.List; + +/** + * @author lz + * @version 1.0 + * @title Purchase + * @description 请购单API + * @create 2023/8/29 16:08 + */ +public class PurchaseUtil { + + //创建请购单 + public static final String DEMO_PURCHASE_DEMO_CREATE = "demo.purchase.order.create"; + + //查询请购单 + public static final String DEMO_PURCHASE_DEMO_GET = "demo.purchase.order.get"; + + //异常排除更新 + public static final String DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE = "demo.purchase.order.abnormal.update"; + + public static final TypeReference> LIST_ENTITY_PURCHASE = new TypeReference>() { + + }; + + /** + * 请购单更新 + */ + public static final String DEMO_PURCHASE_ORDER_UPDATE = "demo.purchase.order.update"; +} \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierCreateEAIService.java new file mode 100644 index 0000000..72c5f67 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierCreateEAIService.java @@ -0,0 +1,109 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +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.infra.entity.FontSupplierEntity; +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.app.infra.repository.FontSupplierRepository; +import com.digiwin.athena.app.infra.service.FontSupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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 org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentSkipListMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @auther: bk + * @date: 2023/9/1 + */ +@Log4j2 +@Service +public class FontSupplierCreateEAIService extends AbsEAIService { + + @Resource + private FontSupplierService fontSupplierService; + + @Override + public String getServiceName() { + return FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", FontSupplierUtil.LIST_ENTITY_SUPPLIER); + //对必传参数 且 品号和供应商编号不可以重复 进行校验 + validateParameter(supplierInfo); + + fontSupplierService.saveBatch(supplierInfo); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", supplierInfo)); + } + + private void validateParameter(List supplierInfo) throws DWBusinessException { + if (Objects.isNull(supplierInfo) || supplierInfo.isEmpty()) { + throw new DWBusinessException("入参数据为空"); + } + for (FontSupplierEntity item : supplierInfo) { + if (StringUtils.isEmpty(item.getItemNo())) { + throw new DWBusinessException("品号字段值不为空或者NULL"); + } + if (StringUtils.isEmpty(item.getItemName())) { + throw new DWBusinessException("品名字段值不为空或者NULL"); + } + if (StringUtils.isEmpty(item.getSupplierNo())) { + throw new DWBusinessException("供应商编号字段值不为空或者NULL"); + } + if (StringUtils.isEmpty(item.getSupplierName())) { + throw new DWBusinessException("供应商名称字段值不为空或者NULL"); + } + } + List distinctList = supplierInfo.stream().filter(distinctByKey(item -> Stream.of(item.getItemNo(), item.getSupplierNo()).toArray())).collect(Collectors.toList()); + if (supplierInfo.size() > distinctList.size()) { + throw new DWBusinessException("品号和供应商编号入参重复"); + } + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(FontSupplierEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List entityList =fontSupplierService.list(queryWrapper); + + if (!entityList.isEmpty()) { + for (FontSupplierEntity executorEntity : entityList) { + String itemNo = executorEntity.getItemNo(); + String executorNo = executorEntity.getSupplierNo(); + boolean match = supplierInfo.stream().anyMatch(item -> Objects.equals(item.getItemNo(), itemNo) + && Objects.equals(item.getSupplierNo(), executorNo)); + if (match) { + throw new DWBusinessException("品号和供应商编号入参重复"); + } + } + } + } + + /** + * 用于对象去重 + * + * @param keyExtractor 需要去重的属性 + * @param + * @return + */ + private static Predicate distinctByKey(Function keyExtractor) { + //记录已有对象或者属性 + ConcurrentSkipListMap skipListMap = new ConcurrentSkipListMap<>(); + return t -> skipListMap.putIfAbsent(JSON.toJSONString(keyExtractor.apply(t)), Boolean.TRUE) == null; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierDeleteEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierDeleteEAIService.java new file mode 100644 index 0000000..8a8283e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierDeleteEAIService.java @@ -0,0 +1,46 @@ +package com.digiwin.athena.app.service.supplier; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.app.infra.service.FontSupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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; +import java.util.stream.Collectors; + +/** + * @auther: bk + * @date: 2023/8/31 + */ +@Service +@Log4j2 +public class FontSupplierDeleteEAIService extends AbsEAIService { + + + @Resource + private FontSupplierService fontSupplierService; + + @Override + public String getServiceName() { + return FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_DELETE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", FontSupplierUtil.LIST_ENTITY_SUPPLIER); + List collect = supplierInfo.stream().map(FontSupplierEntity::getId).collect(Collectors.toList()); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.in(FontSupplierEntity::getId,collect); + fontSupplierService.remove(lmq); + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierGetEAIService.java new file mode 100644 index 0000000..009fcdd --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierGetEAIService.java @@ -0,0 +1,61 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.app.infra.service.FontSupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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: bk + * @date: 2023/8/31 + */ +@Service +@Log4j2 +public class FontSupplierGetEAIService extends AbsEAIService { + + + @Resource + private FontSupplierService fontSupplierService; + + @Override + public String getServiceName() { + return FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", FontSupplierUtil.LIST_ENTITY_SUPPLIER); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(FontSupplierEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); + if (CollectionUtils.isNotEmpty(supplierInfo)) { + lmq.and( + queryWrapperInner -> { + for (FontSupplierEntity fontSupplierEntity : supplierInfo) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(FontSupplierEntity::getItemNo, fontSupplierEntity.getItemNo()) + .eq(FontSupplierEntity::getItemName, fontSupplierEntity.getItemName()) + .eq(FontSupplierEntity::getSupplierNo, fontSupplierEntity.getSupplierNo()) + .eq(FontSupplierEntity::getSupplierName, fontSupplierEntity.getSupplierName()) + ); + } + }); + } + + List list = fontSupplierService.list(lmq); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", list)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUpdateEAIService.java new file mode 100644 index 0000000..be3ae56 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUpdateEAIService.java @@ -0,0 +1,91 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.JSON; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.app.infra.entity.ItemExecutorEntity; +import com.digiwin.athena.app.infra.service.FontSupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentSkipListMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @auther: bk + * @date: 2023/8/31 + */ +@Service +@Log4j2 +public class FontSupplierUpdateEAIService extends AbsEAIService { + + @Resource + private FontSupplierService supplierService; + + @Override + public String getServiceName() { + return FontSupplierUtil.DEMO_FONT_ITEM_SUPPLIER_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", FontSupplierUtil.LIST_ENTITY_SUPPLIER); + + //对必传参数 且 品号和执行人编号不可以重复 进行校验 + validateParameter(supplierInfo); + + supplierService.updateBatchById(supplierInfo); + return EAIUtil.buildEAIResult(new HashMap<>()); + } + + private void validateParameter(List supplierInfo) throws DWBusinessException { + if (Objects.isNull(supplierInfo) || supplierInfo.isEmpty()) { + throw new DWBusinessException("入参数据为空"); + } + for (FontSupplierEntity item : supplierInfo) { + if (StringUtils.isEmpty(item.getItemNo())) { + throw new DWBusinessException("品号字段值为空或者NULL"); + } + if (StringUtils.isEmpty(item.getItemName())) { + throw new DWBusinessException("品名字段值为空或者NULL"); + } + if (StringUtils.isEmpty(item.getSupplierNo())) { + throw new DWBusinessException("供应商no为空或者NULL"); + } + if (StringUtils.isEmpty(item.getSupplierName())) { + throw new DWBusinessException("供应商name为空或者NULL"); + } + } + List distinctList = supplierInfo.stream().filter(distinctByKey(item -> Stream.of(item.getItemNo(), item.getSupplierNo()).toArray())).collect(Collectors.toList()); + if (supplierInfo.size() > distinctList.size()) { + throw new DWBusinessException("品号和供应商编号入参重复"); + } + } + + /** + * 用于对象去重 + * + * @param keyExtractor 需要去重的属性 + * @param + * @return + */ + private static Predicate distinctByKey(Function keyExtractor) { + //记录已有对象或者属性 + ConcurrentSkipListMap skipListMap = new ConcurrentSkipListMap<>(); + return t -> skipListMap.putIfAbsent(JSON.toJSONString(keyExtractor.apply(t)), Boolean.TRUE) == null; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUtil.java new file mode 100644 index 0000000..82e6f5a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUtil.java @@ -0,0 +1,29 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.athena.app.infra.entity.FontSupplierEntity; +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; + +import java.awt.*; +import java.util.List; + +/** + * @auther: bk + * @date: 2023/8/31 + */ +public class FontSupplierUtil { + + /** + * 品号供应商get,update,delete + */ + public static final String DEMO_FONT_ITEM_SUPPLIER_INFO_UPDATE = "demo.font.item.supplier.info.update"; + + public static final String DEMO_FONT_ITEM_SUPPLIER_INFO_GET = "demo.font.item.supplier.info.get"; + + public static final String DEMO_FONT_ITEM_SUPPLIER_INFO_DELETE = "demo.font.item.supplier.info.delete"; + + public static final String DEMO_FONT_ITEM_SUPPLIER_INFO_CREATE = "demo.font.item.supplier.info.create"; + + public static final TypeReference> LIST_ENTITY_SUPPLIER = new TypeReference>() { + }; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoCreateEAIService.java new file mode 100644 index 0000000..324c1c8 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoCreateEAIService.java @@ -0,0 +1,57 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.app.infra.service.SupplierContactInfoService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.generator.SnowflakeWorker; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author CR-7 + * create: 2023-09-01 16:03 + * Description: + */ +@Log4j2 +@Service +public class SupplierContactInfoCreateEAIService extends AbsEAIService { + + + @Resource + SupplierContactInfoService supplierContactInfoService; + + @Override + public String getServiceName() { + return SupplierContactUtil.DEMO_DATA_CONTACT_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + // 入参反序列化 + EAIRequest request = new EAIRequest(messageBody); + List supplierContactEntityList = request.getObject("contact_info", new TypeReference>(){}); + + List supplierContactEntities = supplierContactEntityList.stream().map(assemble->{ + SupplierContactEntity supplierContactEntity = new SupplierContactEntity(); + supplierContactEntity.setId(SnowflakeWorker.nextId()); + BeanUtils.copyProperties(assemble,supplierContactEntity); + return supplierContactEntity; + }).collect(Collectors.toList()); + + this.supplierContactInfoService.saveBatch(supplierContactEntities); + + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("contact_info", supplierContactEntities)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoDeleteEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoDeleteEAIService.java new file mode 100644 index 0000000..6b60720 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoDeleteEAIService.java @@ -0,0 +1,49 @@ +package com.digiwin.athena.app.service.supplier; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.service.SupplierContactInfoService; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import lombok.extern.log4j.Log4j2; +import org.assertj.core.util.Lists; +import org.json.JSONArray; +import org.json.JSONObject; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @author CR-7 + * create: 2023-09-01 16:05 + * Description: + */ +@Log4j2 +@Service +public class SupplierContactInfoDeleteEAIService extends AbsEAIService { + + + @Resource + SupplierContactInfoService supplierContactInfoService; + + @Override + public String getServiceName() { + return SupplierContactUtil.DEMO_DATA_CONTACT_INFO_DELETE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + // 入参反序列化 + JSONObject parameter = new JSONObject(messageBody).getJSONObject("std_data").getJSONObject("parameter"); + JSONArray jsonArray = parameter.getJSONArray("contact_info"); + + ArrayList list = null; + for(int i=0;i()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java new file mode 100644 index 0000000..c7e61bd --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java @@ -0,0 +1,58 @@ +package com.digiwin.athena.app.service.supplier; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.app.infra.service.SupplierContactInfoService; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.json.JSONArray; +import org.json.JSONObject; +import org.springframework.stereotype.Service; + + + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @author CR-7 + * create: 2023-09-01 16:02 + * Description: + */ +@Log4j2 +@Service +public class SupplierContactInfoGetEAIService extends AbsEAIService { + + + @Resource + SupplierContactInfoService supplierContactInfoService; + + + @Override + public String getServiceName() { + return SupplierContactUtil.DEMO_DATA_CONTACT_INFO_GET; + } + + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + JSONObject parameter = new JSONObject(messageBody).getJSONObject("std_data").getJSONObject("parameter"); + JSONArray jsonArray = parameter.getJSONArray("contact_info"); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); + + if(!jsonArray.isNull(0)) { + queryWrapper.in(SupplierContactEntity::getSupplierNo, jsonArray.getJSONObject(0).get("supplier_no")); + } + + List list = supplierContactInfoService.list(queryWrapper); + + return EAIUtil.buildEAIResult(new com.alibaba.fastjson.JSONObject().fluentPut("contact_info",list)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoUpdateEAIService.java new file mode 100644 index 0000000..cf50d68 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoUpdateEAIService.java @@ -0,0 +1,46 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.app.infra.service.SupplierContactInfoService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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; + + +/** + * @author CR-7 + * create: 2023-09-01 16:04 + * Description: + */ +@Log4j2 +@Service +public class SupplierContactInfoUpdateEAIService extends AbsEAIService { + + @Resource + SupplierContactInfoService supplierContactInfoService; + + @Override + public String getServiceName() { + return SupplierContactUtil.DEMO_DATA_CONTACT_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + // 入参反序列化 + EAIRequest request = new EAIRequest(messageBody); + List supplierContactEntityList = request.getObject("contact_info", new TypeReference>(){}); + + this.supplierContactInfoService.updateBatchById(supplierContactEntityList); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactUtil.java new file mode 100644 index 0000000..2b21c14 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactUtil.java @@ -0,0 +1,29 @@ +package com.digiwin.athena.app.service.supplier; + +/** + * @author CR-7 + * create: 2023-09-01 15:54 + * Description: + */ +public class SupplierContactUtil { + + /** + * 供应商联系人查询 + */ + public static final String DEMO_DATA_CONTACT_INFO_GET = "demo.data.contact.info.get"; + + /** + * 供应商联系人新增 + */ + public static final String DEMO_DATA_CONTACT_INFO_CREATE = "demo.data.contact.info.create"; + + /** + * 供应商联系人修改 + */ + public static final String DEMO_DATA_CONTACT_INFO_UPDATE = "demo.data.contact.info.update"; + + /** + * 供应商联系人删除 + */ + public static final String DEMO_DATA_CONTACT_INFO_DELETE = "demo.data.contact.info.delete"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierCreateEAIService.java new file mode 100644 index 0000000..db8837d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierCreateEAIService.java @@ -0,0 +1,41 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.app.infra.service.SupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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/1 + */ +@Log4j2 +@Service +public class SupplierCreateEAIService extends AbsEAIService { + + @Resource + private SupplierService supplierService; + + @Override + public String getServiceName() { + return SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); + supplierService.saveBatch(supplierInfo); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", supplierInfo)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierDeleteEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierDeleteEAIService.java new file mode 100644 index 0000000..43c2e90 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierDeleteEAIService.java @@ -0,0 +1,46 @@ +package com.digiwin.athena.app.service.supplier; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.app.infra.service.SupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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; +import java.util.stream.Collectors; + +/** + * @auther: zhenggl + * @date: 2023/8/31 + */ +@Service +@Log4j2 +public class SupplierDeleteEAIService extends AbsEAIService { + + + @Resource + private SupplierService supplierService; + + @Override + public String getServiceName() { + return SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_DELETE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); + List collect = supplierInfo.stream().map(ItemSupplierEntity::getId).collect(Collectors.toList()); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.in(ItemSupplierEntity::getId,collect); + supplierService.remove(lmq); + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java new file mode 100644 index 0000000..345bc51 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java @@ -0,0 +1,61 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.app.infra.service.SupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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/8/31 + */ +@Service +@Log4j2 +public class SupplierGetEAIService extends AbsEAIService { + + + @Resource + private SupplierService supplierService; + + @Override + public String getServiceName() { + return SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(ItemSupplierEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); + if (CollectionUtils.isNotEmpty(supplierInfo)) { + lmq.and( + queryWrapperInner -> { + for (ItemSupplierEntity itemSupplierEntity : supplierInfo) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(ItemSupplierEntity::getItemNo, itemSupplierEntity.getItemNo()) + .eq(ItemSupplierEntity::getItemName, itemSupplierEntity.getItemName()) + .eq(ItemSupplierEntity::getSupplierNo, itemSupplierEntity.getSupplierNo()) + .eq(ItemSupplierEntity::getSupplierName, itemSupplierEntity.getSupplierName()) + ); + } + }); + } + + List list = supplierService.list(lmq); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", list)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUpdateEAIService.java new file mode 100644 index 0000000..1aea2a3 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUpdateEAIService.java @@ -0,0 +1,40 @@ +package com.digiwin.athena.app.service.supplier; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; +import com.digiwin.athena.app.infra.service.SupplierService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +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/8/31 + */ +@Service +@Log4j2 +public class SupplierUpdateEAIService extends AbsEAIService { + + @Resource + private SupplierService supplierService; + + @Override + public String getServiceName() { + return SupplierUtil.DEMO_ITEM_SUPPLIER_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); + supplierService.updateBatchById(supplierInfo); + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUtil.java new file mode 100644 index 0000000..94e55d5 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUtil.java @@ -0,0 +1,27 @@ +package com.digiwin.athena.app.service.supplier; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; + +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/8/31 + */ +public class SupplierUtil { + + /** + * 品号供应商get,update,delete + */ + public static final String DEMO_ITEM_SUPPLIER_INFO_UPDATE = "demo.item.supplier.info.update"; + + public static final String DEMO_ITEM_SUPPLIER_INFO_GET = "demo.item.supplier.info.get"; + + public static final String DEMO_ITEM_SUPPLIER_INFO_DELETE = "demo.item.supplier.info.delete"; + + public static final String DEMO_ITEM_SUPPLIER_INFO_CREATE = "demo.item.supplier.info.create"; + + public static final TypeReference> LIST_ENTITY_SUPPLIER = new TypeReference>() { + }; +} diff --git a/demo-athenaopt_backend/pom.xml b/demo-athenaopt_backend/pom.xml index 35a6d75..f73389e 100644 --- a/demo-athenaopt_backend/pom.xml +++ b/demo-athenaopt_backend/pom.xml @@ -59,7 +59,7 @@ com.digiwin.lcdp lcdp-modeldriven - 1.0.0.3 + 1.0.1.2 diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index b7a1b6a..2adde67 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -1 +1,104 @@ alter table cps_question_info Add column measures_from varchar(520) null default '' AFTER `knowledge_accumulation`, Add column accumulation_from varchar(520) null default '' AFTER `knowledge_accumulation`; + + +CREATE TABLE `cim_chat_file` ( + `id` bigint(20) NOT NULL COMMENT 'id', + `question` varchar(255) DEFAULT '' COMMENT '问题描述', + `feedback_person` varchar(255) DEFAULT '' COMMENT '反馈人', + `feedback_date` datetime DEFAULT NULL COMMENT '反馈时间', + `urgency` int(1) DEFAULT NULL COMMENT '紧急程度1:低,2中,3高', + `question_source` int(1) DEFAULT NULL COMMENT '问题来源', + `question_type` int(1) DEFAULT NULL COMMENT '问题分类', + `question_complete_by` varchar(255) DEFAULT '' COMMENT '问题处理人', + `complete_date` datetime DEFAULT NULL COMMENT '处理时间', + `complete_explain` varchar(255) DEFAULT '' COMMENT '处理说明', + `is_join` int(1) DEFAULT NULL COMMENT '是否加入知识库0否,1是', + `tab_status` int(1) DEFAULT NULL COMMENT '状态', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL COMMENT '租户id', + `create_by` varchar(50) DEFAULT NULL COMMENT '创建者', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `modified_by` varchar(50) DEFAULT NULL COMMENT '修改者', + `modified_date` datetime DEFAULT NULL COMMENT '修改时间', + `version` int(11) DEFAULT '0' COMMENT '版本', + `deleted` tinyint(255) DEFAULT '0' COMMENT '逻辑删除标志,默认0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +alter table cim_chat_file Add column question_no varchar(32) null default '' COMMENT '问题单号'; +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; diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql new file mode 100644 index 0000000..1a7f79a --- /dev/null +++ b/doc/sql/app-20230912-ddl.sql @@ -0,0 +1,151 @@ +CREATE TABLE `cim_production_details` ( + `id` bigint(20) NOT NULL, + `factory_no` varchar(50) DEFAULT '' COMMENT '工厂编号', + `factory_name` varchar(50) DEFAULT '' COMMENT '工厂名称', + `nature` varchar(1) DEFAULT '' COMMENT '性质', + `expected_quantity` decimal(15,3) DEFAULT NULL COMMENT '预计产量', + `expected_commencement_date` datetime DEFAULT NULL COMMENT '预计开工日期', + `estimated_completion_date` datetime DEFAULT NULL COMMENT '预计完工日期', + `production_management_person` varchar(50) DEFAULT '' COMMENT '生管人员', + `production_management_department` varchar(50) DEFAULT '' COMMENT '生管部门', + `work_no` varchar(50) DEFAULT '' COMMENT '工单单号', + `production_status` varchar(32) DEFAULT '' COMMENT '状态', + `batch_no` varchar(32) DEFAULT '' COMMENT '生产批号', + `sku_code` varchar(32) DEFAULT '' COMMENT '品号', + `sku_name` varchar(32) DEFAULT '' COMMENT '品名', + `sku_spec` varchar(32) DEFAULT '' COMMENT '规格', + `unit` varchar(32) DEFAULT '' COMMENT '单位', + `produce_boss` varchar(32) DEFAULT '' COMMENT '生产主管', + `overdue_days` varchar(32) 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; + +CREATE TABLE `cim_receivables_detail` ( + `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(1) DEFAULT '' COMMENT '状态', + `sales_order` varchar(32) DEFAULT '' COMMENT '销售单号', + `sales_order_number` varchar(32) DEFAULT '' COMMENT '销售单序号', + `contract_no` varchar(100) DEFAULT '' COMMENT '合同编号', + `amount_tax` decimal(15,3) DEFAULT NULL COMMENT '含税金额', + `sku_code` varchar(50) DEFAULT '' COMMENT '品号', + `sku_name` varchar(50) DEFAULT '' COMMENT '品名', + `sku_spec` varchar(50) DEFAULT '' COMMENT '规格', + `price_tax` decimal(15,3) DEFAULT NULL COMMENT '含税单价', + `quantity` decimal(15,3) DEFAULT NULL COMMENT '数量', + `receivable_date` datetime DEFAULT NULL COMMENT '应收日期', + `contacts` varchar(50) 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 '业务主管', + `work_no` varchar(100) DEFAULT '' COMMENT '工单单号', + `overdue_days` varchar(50) 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; + +CREATE TABLE `cim_collection_detail` ( + `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(1) DEFAULT '' COMMENT '状态', + `sales_order` varchar(32) DEFAULT '' COMMENT '销售单号', + `sales_order_number` varchar(32) DEFAULT '' COMMENT '销售单序号', + `contract_no` varchar(100) DEFAULT '' COMMENT '合同编号', + `amount_tax` decimal(15,3) DEFAULT NULL COMMENT '含税金额', + `sku_code` varchar(50) DEFAULT '' COMMENT '品号', + `sku_name` varchar(50) DEFAULT '' COMMENT '品名', + `sku_spec` varchar(50) DEFAULT '' COMMENT '规格', + `price_tax` decimal(15,3) DEFAULT NULL COMMENT '含税单价', + `quantity` decimal(15,3) DEFAULT NULL COMMENT '数量', + `receivable_date` datetime DEFAULT NULL COMMENT '应收日期', + `contacts` varchar(50) 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 '业务主管', + `work_no` varchar(100) DEFAULT '' COMMENT '工单单号', + `overdue_days` varchar(50) 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; + +CREATE TABLE `cim_limit_credit` ( + `id` bigint(20) NOT NULL, + `customer_no` varchar(100) DEFAULT '' COMMENT '客户编号', + `customer_name` varchar(100) DEFAULT '' COMMENT '客户名称', + `limit_amount` decimal(15,3) 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; + +-- 修改问题明细长度 +ALTER TABLE `cim_chat_file` MODIFY COLUMN `question` varchar (500); + +-- 催收表新增处理人 +alter table cim_collection_detail Add column processed_by varchar(32) null default '' COMMENT '处理人'; + + +--新增生产主管字段 +alter table cim_collection_detail Add column produce_boss varchar(100) null default '' COMMENT '生产主管'; + +alter table cim_receivables_detail Add column produce_boss varchar(100) null default '' COMMENT '生产主管'; + +--修改问题明细跟处理详情字段类型 +ALTER TABLE `cim_chat_file` MODIFY COLUMN `question` text, MODIFY COLUMN `complete_explain` text; + +--应收表增加邮箱,限制金额字段 +alter table cim_receivables_detail Add column email varchar(50) null default '' COMMENT '邮箱',Add column limit_amount decimal(15,3) DEFAULT NULL COMMENT '限制金额'; + +--修改规格字段长度 +ALTER TABLE `cim_receivables_detail` MODIFY COLUMN `sku_spec` varchar (255); +ALTER TABLE `cim_collection_detail` MODIFY COLUMN `sku_spec` varchar (255); + +--添加消费额度字段 +alter table cim_collection_detail Add column quota_details varchar(32) null default '' COMMENT '消费额度'; +alter table cim_receivables_detail Add column quota_details varchar(32) null default '' COMMENT '消费额度'; + + +--规格字段修改 +ALTER TABLE `cim_production_details` MODIFY COLUMN `sku_spec` varchar (255); + +--生产表新增字段 +alter table cim_production_details Add column quota_details varchar(50) null default '' COMMENT '额度占用百分比', +Add column freeze_reason varchar(255) null default '' COMMENT '冻结原因', +Add column customer_name varchar(255) null default '' COMMENT '客户名称', +Add column customer_no varchar(255) null default '' COMMENT '客户编号';