From a74e739a74cf730881623cde6e04843f59ec6ff7 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Tue, 29 Aug 2023 16:14:42 +0800 Subject: [PATCH 01/73] =?UTF-8?q?demo=E9=A1=B9=E7=9B=AE=E8=BF=9B=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 14 +++++++------- README.md | 2 +- VERSION | 2 +- version_control/APP_VERSION | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) 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/VERSION b/VERSION index e6d5cb8..e4c0d46 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.2 \ No newline at end of file +1.0.3 \ No newline at end of file diff --git a/version_control/APP_VERSION b/version_control/APP_VERSION index 6d7de6e..21e8796 100644 --- a/version_control/APP_VERSION +++ b/version_control/APP_VERSION @@ -1 +1 @@ -1.0.2 +1.0.3 From 6ceb9c856f38718cac59324e7c9610a399326658 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Tue, 29 Aug 2023 16:31:58 +0800 Subject: [PATCH 02/73] =?UTF-8?q?demo=E7=89=88=E6=9C=AC=E5=8F=B7=E8=BF=98?= =?UTF-8?q?=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- version_control/APP_VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index e4c0d46..e6d5cb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.3 \ No newline at end of file +1.0.2 \ No newline at end of file diff --git a/version_control/APP_VERSION b/version_control/APP_VERSION index 21e8796..6d7de6e 100644 --- a/version_control/APP_VERSION +++ b/version_control/APP_VERSION @@ -1 +1 @@ -1.0.3 +1.0.2 From 99176063a6059c62fbf4148aefa54d8189a5f2cf Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 1 Sep 2023 17:22:45 +0800 Subject: [PATCH 03/73] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/SupplierContactEntity.java | 44 ++++++++++++++ .../SupplierContactInfoRepository.java | 7 +++ .../Impl/SupplierContactInfoServiceImpl.java | 16 +++++ .../service/SupplierContactInfoService.java | 7 +++ .../SupplierContactInfoEAIService.java | 52 ++++++++++++++++ .../SupplierContactInfoEAIServiceImpl.java | 41 +++++++++++++ .../SupplierContactInfoCreateEAIService.java | 56 ++++++++++++++++++ .../SupplierContactInfoDeleteEAIService.java | 49 +++++++++++++++ .../SupplierContactInfoGetEAIService.java | 59 +++++++++++++++++++ .../SupplierContactInfoUpdateEAIService.java | 48 +++++++++++++++ .../service/supplier/SupplierContactUtil.java | 29 +++++++++ 11 files changed, 408 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SupplierContactEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierContactInfoRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierContactInfoServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierContactInfoService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierContactInfoEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierContactInfoEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoDeleteEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactUtil.java 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/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/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/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/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/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/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..2b3e25e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoCreateEAIService.java @@ -0,0 +1,56 @@ +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 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 HashMap<>()); + } +} 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..853b111 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java @@ -0,0 +1,59 @@ +package com.digiwin.athena.app.service.supplier; + + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +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.apache.commons.lang3.StringUtils; +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 = Wrappers.lambdaQuery() + .eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()) + .in(!StringUtils.isEmpty(jsonArray.getJSONObject(0).get("supplier_no").toString()), + 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..be6a77a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoUpdateEAIService.java @@ -0,0 +1,48 @@ +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 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: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"; +} From 8e365a9f5b38232d06643ba2b2fc27550cf02329 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 1 Sep 2023 17:29:32 +0800 Subject: [PATCH 04/73] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/supplier/SupplierContactInfoGetEAIService.java | 2 -- .../service/supplier/SupplierContactInfoUpdateEAIService.java | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) 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 index 853b111..50b7233 100644 --- 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 @@ -1,9 +1,7 @@ package com.digiwin.athena.app.service.supplier; -import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.entity.SupplierContactEntity; 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 index be6a77a..cf50d68 100644 --- 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 @@ -7,16 +7,14 @@ 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 From 0bddd4191d01a86df0922e13f0c9bc751feeaf35 Mon Sep 17 00:00:00 2001 From: xieps <514331757@qq.com> Date: Mon, 4 Sep 2023 11:34:28 +0800 Subject: [PATCH 05/73] =?UTF-8?q?feat:=E5=93=81=E5=8F=B7=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=BA=BA=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/entity/ItemExecutorEntity.java | 56 ++++++++ .../app/infra/mapper/ItemExecutorMapper.xml | 21 +++ .../repository/ItemExecutorRepository.java | 24 ++++ .../service/Impl/ItemExecutorServiceImpl.java | 17 +++ .../infra/service/ItemExecutorService.java | 13 ++ .../app/provider/ItemExecutorEAIService.java | 71 ++++++++++ .../impl/ItemExecutorEAIServiceImpl.java | 44 ++++++ .../app/service/executor/ExecutorUtil.java | 25 ++++ .../ItemExecutorCreateEAIService.java | 128 ++++++++++++++++++ .../ItemExecutorDeleteEAIService.java | 57 ++++++++ .../executor/ItemExecutorGetEAIService.java | 68 ++++++++++ .../ItemExecutorUpdateEAIService.java | 111 +++++++++++++++ 12 files changed, 635 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemExecutorEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/ItemExecutorMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/ItemExecutorRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/ItemExecutorServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/ItemExecutorService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/ItemExecutorEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/ItemExecutorEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ExecutorUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorDeleteEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorUpdateEAIService.java 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/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/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/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/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/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/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/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..ed366ce --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/executor/ItemExecutorCreateEAIService.java @@ -0,0 +1,128 @@ +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: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 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("品号和执行人编号入参重复~"); + } + + 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; + } +} From 7ae425ed576967843eab2acba0915ac4ab612d49 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 4 Sep 2023 13:28:21 +0800 Subject: [PATCH 06/73] =?UTF-8?q?=E5=A4=96=E5=8D=8F=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/entity/ItemSupplierEntity.java | 45 ++++++++++++++ .../infra/repository/SupplierRepository.java | 11 ++++ .../service/Impl/SupplierServiceImpl.java | 16 +++++ .../app/infra/service/SupplierService.java | 11 ++++ .../app/provider/SupplierEAIService.java | 56 ++++++++++++++++++ .../provider/impl/SupplierEAIServiceImpl.java | 40 +++++++++++++ .../supplier/SupplierCreateEAIService.java | 40 +++++++++++++ .../supplier/SupplierDeleteEAIService.java | 46 +++++++++++++++ .../supplier/SupplierGetEAIService.java | 58 +++++++++++++++++++ .../supplier/SupplierUpdateEAIService.java | 40 +++++++++++++ .../app/service/supplier/SupplierUtil.java | 27 +++++++++ 11 files changed, 390 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/ItemSupplierEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SupplierRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SupplierServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SupplierService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SupplierEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SupplierEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierDeleteEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierUtil.java 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/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/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/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/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/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/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..5f2e761 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierCreateEAIService.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/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 HashMap<>()); + } +} 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..e8fbe5b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java @@ -0,0 +1,58 @@ +package com.digiwin.athena.app.service.supplier; + +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.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()); + 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>() { + }; +} From 25cc6e4d35e2d1c991df1bfb0d0690bc6b9fec97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Mon, 4 Sep 2023 13:30:35 +0800 Subject: [PATCH 07/73] =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E9=87=87=E8=B4=ADcreat?= =?UTF-8?q?e=E3=80=81get=20API=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/common/utils/ResponseUtil.java | 97 +++++++++++++ .../app/infra/constant/ParameterConstant.java | 2 + .../app/infra/dto/PurchaseOrderDetailDTO.java | 133 ++++++++++++++++++ .../entity/PurchaseOrderDetailEntity.java | 131 +++++++++++++++++ .../PurchaseOrderDetailRepository.java | 13 ++ .../service/Impl/PurchaseDemoServiceImpl.java | 18 +++ .../infra/service/PurchaseDemoService.java | 16 +++ .../app/provider/PurchaseDemoEAIService.java | 25 ++++ .../impl/PurchaseDemoEAIServiceImpl.java | 32 +++++ .../purchase/PurchaseDemoCreateService.java | 53 +++++++ .../purchase/PurchaseDemoGetService.java | 78 ++++++++++ .../app/service/purchase/PurchaseUtil.java | 19 +++ 12 files changed, 617 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/ResponseUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/PurchaseOrderDetailDTO.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/PurchaseDemoServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/PurchaseDemoService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoCreateService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java 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..94b5b4d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/PurchaseOrderDetailDTO.java @@ -0,0 +1,133 @@ +package com.digiwin.athena.app.infra.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +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 purchase_price; + + /** + * 金额 + */ + @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 abnormal_handle_plan; + + /** + * 任务卡状态 + */ + @JsonProperty(value = "tab_status") + private String tabStatus; + + /** + * 任务卡类型: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/PurchaseOrderDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java new file mode 100644 index 0000000..8bd0f15 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java @@ -0,0 +1,131 @@ +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; + +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") + private String purchaseOrderNo; + + /** + * 请购单序号 + */ + @SerializedName(value = "purchase_order_seq") + private String purchaseOrderSeq; + + /** + * 品号 + */ + @SerializedName(value = "item_no") + private String itemNo; + + /** + * 品名 + */ + @SerializedName(value = "item_name") + private String itemName; + + /** + * 供应商名称 + */ + @SerializedName(value = "supplier_name") + private String supplierName; + + /** + * 供应商编号 + */ + @SerializedName(value = "supplier_no") + private String supplierNo; + + /** + * 请购数量 + */ + @SerializedName(value = "requisition_num") + private Integer requisitionNum; + + /** + * 采购数量 + */ + @SerializedName(value = "purchase_num") + private Integer purchaseNum; + + /** + * 采购单价 + */ + @SerializedName(value = "purchase_price") + private BigDecimal purchase_price; + + /** + * 金额 + */ + @SerializedName(value = "amount") + private BigDecimal amount; + + /** + * 采购剩余数量 + */ + @SerializedName(value = "purchase_residue_num") + private Integer purchaseResidueNum; + + /** + * 采购执行人 + */ + @SerializedName(value = "procurement_executor_code") + private String procurementExecutorCode; + + /** + * 采购需求日期 + */ + @SerializedName(value = "purchase_date") + private Date purchaseDate; + + /** + * 预计到货日 + */ + @SerializedName(value = "expected_date") + private Date expectedDate; + + /** + * 异常处理方式 + */ + @SerializedName(value = "abnormal_handle_plan") + private String abnormal_handle_plan; + + /** + * 任务卡状态 + */ + @SerializedName(value = "tab_status") + private String tabStatus; + + /** + * 任务卡类型:1是采购任务,2是交期回复任务,3是异常排除任务 + */ + @SerializedName(value = "task_type") + private String taskType; + +} 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..85f84f5 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java @@ -0,0 +1,13 @@ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @author lz + * @description + * @throws + * @time 2023/8/29 16:35 + */ +public interface PurchaseOrderDetailRepository extends BaseRepository { +} 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/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/provider/PurchaseDemoEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java new file mode 100644 index 0000000..8c67163 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java @@ -0,0 +1,25 @@ +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.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; + + +} \ No newline at end of file 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..87a0f4a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java @@ -0,0 +1,32 @@ +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); + } +} 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..8373a20 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoCreateService.java @@ -0,0 +1,53 @@ +package com.digiwin.athena.app.service.purchase; + +import com.digiwin.app.service.DWEAIResult; +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.service.PurchaseDemoService; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +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 lz + * @description 创建请购单 + * @throws + * @time 2023/8/29 16:16 + */ +@Service +public class PurchaseDemoCreateService extends AbsEAIService { + + @Resource + PurchaseDemoService purchaseDemoService; + + @Override + public String getServiceName() { + return PurchaseUtil.DEMO_PURCHASE_DEMO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //将入参值转换为DTO + List purchaseOrderDetailDTOS = TransferUtil.string2List(messageBody, PurchaseOrderDetailDTO.class, "purchase_info"); + + //插入数据库 + List entities = purchaseOrderDetailDTOS.stream() + .map(dto -> { + PurchaseOrderDetailEntity entity = new PurchaseOrderDetailEntity(); + BeanUtils.copyProperties(dto, entity); + return entity; + }) + .collect(Collectors.toList()); + purchaseDemoService.saveBatch(entities); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} 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..e2dbe97 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java @@ -0,0 +1,78 @@ +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.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 { + + //将入参值转换为Dto类存储 + List purchaseOrderDetailDTOS = TransferUtil.string2List(messageBody, PurchaseOrderDetailDTO.class, "purchase_info"); + + //根据请购单号+请购单序号+状态+任务卡类型查询 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PurchaseOrderDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + queryWrapper.and( + queryWrapperInner -> { + for (PurchaseOrderDetailDTO purchaseOrderDetailDTO : purchaseOrderDetailDTOS) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(purchaseOrderDetailDTO.getPurchaseOrderNo()), PurchaseOrderDetailEntity::getPurchaseOrderNo, purchaseOrderDetailDTO.getPurchaseOrderNo()) + .eq(!StringUtils.isEmpty(purchaseOrderDetailDTO.getPurchaseOrderSeq()), PurchaseOrderDetailEntity::getPurchaseOrderSeq, purchaseOrderDetailDTO.getPurchaseOrderSeq()) + .eq(!Objects.isNull(purchaseOrderDetailDTO.getTabStatus()), PurchaseOrderDetailEntity::getTabStatus, purchaseOrderDetailDTO.getTabStatus()) + .eq(!Objects.isNull(purchaseOrderDetailDTO.getTaskType()), PurchaseOrderDetailEntity::getTaskType, purchaseOrderDetailDTO.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", purchaseInfo)); + + } +} 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..7dde132 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java @@ -0,0 +1,19 @@ +package com.digiwin.athena.app.service.purchase; + +/** + * @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"; + + +} From 50f73e0895d7d9d4e5fc9b08cac03e4e6c16d2f9 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 4 Sep 2023 13:48:22 +0800 Subject: [PATCH 08/73] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/supplier/SupplierContactInfoGetEAIService.java | 1 - 1 file changed, 1 deletion(-) 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 index 50b7233..9728b04 100644 --- 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 @@ -44,7 +44,6 @@ public class SupplierContactInfoGetEAIService extends AbsEAIService { JSONObject parameter = new JSONObject(messageBody).getJSONObject("std_data").getJSONObject("parameter"); JSONArray jsonArray = parameter.getJSONArray("contact_info"); - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() .eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()) .in(!StringUtils.isEmpty(jsonArray.getJSONObject(0).get("supplier_no").toString()), From d92302db56e30d5ac0c0b9c753fc95a882668644 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 4 Sep 2023 15:33:30 +0800 Subject: [PATCH 09/73] =?UTF-8?q?=E5=A4=96=E5=8D=8F=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86get=E4=BF=AE=E6=94=B9,=E5=BC=82=E5=B8=B8=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/PurchaseOrderDetailEntity.java | 3 +++ .../PurchaseOrderDetailRepository.java | 5 ++++ .../app/provider/PurchaseDemoEAIService.java | 5 ++-- .../impl/PurchaseDemoEAIServiceImpl.java | 5 ++++ .../app/service/purchase/PurchaseUtil.java | 3 +++ .../supplier/SupplierGetEAIService.java | 27 ++++++++++--------- 6 files changed, 34 insertions(+), 14 deletions(-) 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 index 8bd0f15..1f4c056 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -102,12 +103,14 @@ public class PurchaseOrderDetailEntity extends BaseMgrEntity { + + public void updateAbnormalHandlePlan(@Param("list") List list); } 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 index 8c67163..234233e 100644 --- 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 @@ -21,5 +21,6 @@ public interface PurchaseDemoEAIService extends DWService { @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET) DWEAIResult get(Map headers, String messageBody) throws Exception; - -} \ No newline at end of file + @EAIService(id = PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE) + DWEAIResult abnormalUpdate(Map headers, String messageBody) throws Exception; +} 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 index 87a0f4a..24a12ec 100644 --- 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 @@ -29,4 +29,9 @@ public class PurchaseDemoEAIServiceImpl implements PurchaseDemoEAIService { 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); + } } 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 index 7dde132..cbced95 100644 --- 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 @@ -15,5 +15,8 @@ public class PurchaseUtil { //查询请购单 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"; + } 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 index e8fbe5b..345bc51 100644 --- 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 @@ -1,6 +1,7 @@ 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; @@ -39,18 +40,20 @@ public class SupplierGetEAIService extends AbsEAIService { List supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(ItemSupplierEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); - 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()) - ); - } - }); + 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)); From bfeb79a9687c5a23b6cec2d9fa6a6f791dfaf282 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 4 Sep 2023 15:35:42 +0800 Subject: [PATCH 10/73] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/PurchaseOrderDetailMapper.xml | 25 ++++++++++ ...PurchaseOrderAbnormalUpdateEAIService.java | 47 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java 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..9a806bc --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + UPDATE cim_purchase_order_detail + + abnormal_handle_plan = #{item.abnormal_handle_plan} + + ,purchase_date = #{item.purchaseDate} + + + ,expected_date = #{item.expectedDate} + + + where id = #{item.id} + + + + + 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<>()); + } +} From 5005df18425435d936479ec9ea50cc40cd6099f4 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 4 Sep 2023 15:47:52 +0800 Subject: [PATCH 11/73] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplier/SupplierContactInfoGetEAIService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 index 9728b04..c7e61bd 100644 --- 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 @@ -2,7 +2,6 @@ package com.digiwin.athena.app.service.supplier; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.entity.SupplierContactEntity; import com.digiwin.athena.app.infra.service.SupplierContactInfoService; @@ -10,11 +9,12 @@ 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.lang3.StringUtils; 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; @@ -44,10 +44,12 @@ public class SupplierContactInfoGetEAIService extends AbsEAIService { JSONObject parameter = new JSONObject(messageBody).getJSONObject("std_data").getJSONObject("parameter"); JSONArray jsonArray = parameter.getJSONArray("contact_info"); - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() - .eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()) - .in(!StringUtils.isEmpty(jsonArray.getJSONObject(0).get("supplier_no").toString()), - SupplierContactEntity::getSupplierNo, jsonArray.getJSONObject(0).get("supplier_no")); + 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); From 2666ca2bae4d20f90a6b9ed1acd417fa46edfe62 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 4 Sep 2023 17:02:37 +0800 Subject: [PATCH 12/73] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/supplier/SupplierContactInfoCreateEAIService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 index 2b3e25e..324c1c8 100644 --- 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 @@ -1,5 +1,6 @@ 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; @@ -51,6 +52,6 @@ public class SupplierContactInfoCreateEAIService extends AbsEAIService { this.supplierContactInfoService.saveBatch(supplierContactEntities); - return EAIUtil.buildEAIResult(new HashMap<>()); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("contact_info", supplierContactEntities)); } } From 093e7411607018039ca4e5d5005088969de01768 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 4 Sep 2023 17:04:30 +0800 Subject: [PATCH 13/73] =?UTF-8?q?create=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/supplier/SupplierCreateEAIService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 index 5f2e761..db8837d 100644 --- 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 @@ -1,5 +1,6 @@ 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; @@ -35,6 +36,6 @@ public class SupplierCreateEAIService extends AbsEAIService { EAIRequest eaiRequest = EAIRequest.build(messageBody); List supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); supplierService.saveBatch(supplierInfo); - return EAIUtil.buildEAIResult(new HashMap<>()); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", supplierInfo)); } } From 50eb67cabab4a66196dfba2f7e6081ebc12b4757 Mon Sep 17 00:00:00 2001 From: xieps <514331757@qq.com> Date: Mon, 4 Sep 2023 17:06:50 +0800 Subject: [PATCH 14/73] =?UTF-8?q?fix:=E5=93=81=E5=8F=B7=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=BA=BAcreate=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/executor/ItemExecutorCreateEAIService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 index ed366ce..47acf67 100644 --- 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 @@ -1,6 +1,7 @@ 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; @@ -62,7 +63,7 @@ public class ItemExecutorCreateEAIService extends AbsEAIService { //进行批量新增 itemExecutorService.saveBatch(itemExecutorInfo); - return EAIUtil.buildEAIResult(new HashMap<>()); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_executor_info",itemExecutorInfo)); } From 4e0c09c7c437e3b2acb84fd5e1fb3f6f99485ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Tue, 5 Sep 2023 15:14:43 +0800 Subject: [PATCH 15/73] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AF=B7=E8=B4=AD?= =?UTF-8?q?=E5=8D=95=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/dto/PurchaseOrderDetailDTO.java | 4 +- .../entity/PurchaseOrderDetailEntity.java | 4 +- .../app/provider/PurchaseDemoEAIService.java | 3 + .../purchase/PurchaseDemoCreateService.java | 90 +++++++++++++++---- .../purchase/PurchaseDemoGetService.java | 17 ++-- .../app/service/purchase/PurchaseUtil.java | 9 +- 6 files changed, 98 insertions(+), 29 deletions(-) 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 index 94b5b4d..c0041f5 100644 --- 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 @@ -80,7 +80,7 @@ public class PurchaseOrderDetailDTO { * 采购单价 */ @JsonProperty(value = "purchase_price") - private BigDecimal purchase_price; + private BigDecimal purchasePrice; /** * 金额 @@ -116,7 +116,7 @@ public class PurchaseOrderDetailDTO { * 异常处理方式 */ @JsonProperty(value = "abnormal_handle_plan") - private String abnormal_handle_plan; + private String abnormalHandlePlan; /** * 任务卡状态 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 index 1f4c056..e02a71e 100644 --- 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 @@ -79,7 +79,7 @@ public class PurchaseOrderDetailEntity extends BaseMgrEntity headers, String messageBody) throws Exception; + @AllowAnonymous @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET) DWEAIResult get(Map headers, String messageBody) throws Exception; 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 index 8373a20..600cab9 100644 --- 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 @@ -1,20 +1,23 @@ 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.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.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 org.springframework.beans.BeanUtils; +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.stream.Collectors; +import java.util.Objects; /** * @author lz @@ -25,6 +28,9 @@ import java.util.stream.Collectors; @Service public class PurchaseDemoCreateService extends AbsEAIService { + @Resource + PurchaseOrderDetailRepository purchaseOrderDetailRepository; + @Resource PurchaseDemoService purchaseDemoService; @@ -35,19 +41,71 @@ public class PurchaseDemoCreateService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { - //将入参值转换为DTO - List purchaseOrderDetailDTOS = TransferUtil.string2List(messageBody, PurchaseOrderDetailDTO.class, "purchase_info"); - - //插入数据库 - List entities = purchaseOrderDetailDTOS.stream() - .map(dto -> { - PurchaseOrderDetailEntity entity = new PurchaseOrderDetailEntity(); - BeanUtils.copyProperties(dto, entity); - return entity; - }) - .collect(Collectors.toList()); - purchaseDemoService.saveBatch(entities); + + 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 index e2dbe97..aef6720 100644 --- 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 @@ -9,6 +9,7 @@ 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; @@ -42,21 +43,21 @@ public class PurchaseDemoGetService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { - //将入参值转换为Dto类存储 - List purchaseOrderDetailDTOS = TransferUtil.string2List(messageBody, PurchaseOrderDetailDTO.class, "purchase_info"); + 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 (PurchaseOrderDetailDTO purchaseOrderDetailDTO : purchaseOrderDetailDTOS) { + for (PurchaseOrderDetailEntity purchaseOrderDetail : purchaseInfos) { queryWrapperInner.or( wrapper -> wrapper - .eq(!StringUtils.isEmpty(purchaseOrderDetailDTO.getPurchaseOrderNo()), PurchaseOrderDetailEntity::getPurchaseOrderNo, purchaseOrderDetailDTO.getPurchaseOrderNo()) - .eq(!StringUtils.isEmpty(purchaseOrderDetailDTO.getPurchaseOrderSeq()), PurchaseOrderDetailEntity::getPurchaseOrderSeq, purchaseOrderDetailDTO.getPurchaseOrderSeq()) - .eq(!Objects.isNull(purchaseOrderDetailDTO.getTabStatus()), PurchaseOrderDetailEntity::getTabStatus, purchaseOrderDetailDTO.getTabStatus()) - .eq(!Objects.isNull(purchaseOrderDetailDTO.getTaskType()), PurchaseOrderDetailEntity::getTaskType, purchaseOrderDetailDTO.getTaskType()) + .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.getTaskType()), PurchaseOrderDetailEntity::getTaskType, purchaseOrderDetail.getTaskType()) ); } @@ -72,7 +73,7 @@ public class PurchaseDemoGetService extends AbsEAIService { purchaseInfo.add(JSON.parseObject(new ObjectMapper().writeValueAsString(e))); } - return EAIUtil.buildEAIResult(new JSONObject().fluentPut("purchase_info", purchaseInfo)); + 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/PurchaseUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java index cbced95..0b4594a 100644 --- 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 @@ -1,5 +1,10 @@ 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 @@ -18,5 +23,7 @@ public class PurchaseUtil { //异常排除更新 public static final String DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE = "demo.purchase.order.abnormal.update"; + public static final TypeReference> LIST_ENTITY_PURCHASE = new TypeReference>() { -} + }; +} \ No newline at end of file From a9c45e9737ebe027ba147a2252f9a1f738411988 Mon Sep 17 00:00:00 2001 From: xieps <514331757@qq.com> Date: Tue, 5 Sep 2023 16:26:13 +0800 Subject: [PATCH 16/73] =?UTF-8?q?feat:=E8=AF=B7=E8=B4=AD=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/PurchaseOrderDetailEntity.java | 15 ++++ .../mapper/PurchaseOrderDetailMapper.xml | 60 ++++++++++++++ .../PurchaseOrderDetailRepository.java | 8 ++ .../app/provider/PurchaseDemoEAIService.java | 5 ++ .../impl/PurchaseDemoEAIServiceImpl.java | 5 ++ .../PurchaseOrderUpdateEAIService.java | 79 +++++++++++++++++++ .../app/service/purchase/PurchaseUtil.java | 5 ++ 7 files changed, 177 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderUpdateEAIService.java 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 index e02a71e..7ae4483 100644 --- 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 @@ -31,72 +31,84 @@ public class PurchaseOrderDetailEntity extends BaseMgrEntity + + + + 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}, + + + 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/PurchaseOrderDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/PurchaseOrderDetailRepository.java index d2c7425..a6bebcf 100644 --- 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 @@ -15,4 +15,12 @@ import java.util.List; 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/provider/PurchaseDemoEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java index faa160c..32dda5f 100644 --- 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 @@ -26,4 +26,9 @@ public interface PurchaseDemoEAIService extends DWService { @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/impl/PurchaseDemoEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java index 24a12ec..3dbd9f0 100644 --- 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 @@ -34,4 +34,9 @@ public class PurchaseDemoEAIServiceImpl implements PurchaseDemoEAIService { 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/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 index 0b4594a..63f91f0 100644 --- 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 @@ -26,4 +26,9 @@ public class PurchaseUtil { 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 From a1dce882f2344c5dc369e9d4da18ea6cdb7761c1 Mon Sep 17 00:00:00 2001 From: baokuo <490176649@qq.com> Date: Tue, 5 Sep 2023 16:58:09 +0800 Subject: [PATCH 17/73] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=B5=84=E6=96=99=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/entity/FontSupplierEntity.java | 46 ++++++++ .../repository/FontSupplierRepository.java | 11 ++ .../infra/service/FontSupplierService.java | 11 ++ .../service/Impl/FontSupplierServiceImpl.java | 16 +++ .../app/provider/FontSupplierEAIService.java | 56 +++++++++ .../impl/FontSupplierEAIServiceImpl.java | 40 +++++++ .../FontSupplierCreateEAIService.java | 109 ++++++++++++++++++ .../FontSupplierDeleteEAIService.java | 46 ++++++++ .../supplier/FontSupplierGetEAIService.java | 61 ++++++++++ .../FontSupplierUpdateEAIService.java | 91 +++++++++++++++ .../service/supplier/FontSupplierUtil.java | 29 +++++ 11 files changed, 516 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/FontSupplierEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/FontSupplierRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/FontSupplierService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/FontSupplierServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/FontSupplierEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/FontSupplierEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierDeleteEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/FontSupplierUtil.java 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/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/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/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/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/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>() { + }; +} From 9d2e4a130bfd5c9b5efde7ccc159d3c74f7146b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Tue, 5 Sep 2023 17:38:40 +0800 Subject: [PATCH 18/73] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/digiwin/athena/app/provider/PurchaseDemoEAIService.java | 2 -- 1 file changed, 2 deletions(-) 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 index 32dda5f..839d9d9 100644 --- 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 @@ -16,11 +16,9 @@ import java.util.Map; */ public interface PurchaseDemoEAIService extends DWService { - @AllowAnonymous @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_CREATE) DWEAIResult create(Map headers, String messageBody) throws Exception; - @AllowAnonymous @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET) DWEAIResult get(Map headers, String messageBody) throws Exception; From 38d8f9b345f43d242e3fe0e5037e3d49c6849f7f Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 7 Sep 2023 14:14:56 +0800 Subject: [PATCH 19/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chatFile/infra/entity/ChatFileEntity.java | 66 +++++++++++++++++++ .../chatFile/infra/mapper/ChatFileMapper.xml | 26 ++++++++ .../infra/repository/ChatFileRepository.java | 17 +++++ .../infra/service/ChatFileService.java | 11 ++++ .../service/impl/ChatFileServiceImpl.java | 15 +++++ .../chatFile/provider/ChatFileEAIService.java | 24 +++++++ .../provider/impl/ChatFileEAIServiceImpl.java | 35 ++++++++++ .../chatFile/ChatFileCreateEAIService.java | 54 +++++++++++++++ .../chatFile/ChatFileGetEAIService.java | 55 ++++++++++++++++ .../chatFile/ChatFileUpdateEAIService.java | 47 +++++++++++++ .../service/chatFile/ChatFileUtil.java | 17 +++++ 11 files changed, 367 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/impl/ChatFileServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/ChatFileEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/impl/ChatFileEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java new file mode 100644 index 0000000..191bcaf --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java @@ -0,0 +1,66 @@ +package com.digiwin.athena.app.chatFile.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 = "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 Integer isJoin; + + @SerializedName(value = "tab_status") + private Integer tabStatus; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml new file mode 100644 index 0000000..b124bd8 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + UPDATE cim_chat_file + + `question` = #{item.question}, + `question_source` = #{item.questionSource}, + `question_type` = #{item.questionType}, + `urgency` = #{item.urgency}, + `question_complete_by` = #{item.questionCompleteBy}, + `complete_explain` = #{item.completeExplain}, + `complete_date` = #{item.completeDate}, + `is_join` = #{item.isJoin}, + + WHERE `id`=#{item.id} + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java new file mode 100644 index 0000000..2cd4550 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java @@ -0,0 +1,17 @@ +package com.digiwin.athena.app.chatFile.infra.repository; + +import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/7 + */ +public interface ChatFileRepository extends BaseRepository { + + void updateBatch(@Param("list") List list); + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java new file mode 100644 index 0000000..ecedf7d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.chatFile.infra.service; + +import com.digiwin.athena.app.chatFile.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/chatFile/infra/service/impl/ChatFileServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/impl/ChatFileServiceImpl.java new file mode 100644 index 0000000..bb046d5 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/impl/ChatFileServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.chatFile.infra.service.impl; + +import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.chatFile.infra.repository.ChatFileRepository; +import com.digiwin.athena.app.chatFile.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/chatFile/provider/ChatFileEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/ChatFileEAIService.java new file mode 100644 index 0000000..3a464cb --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/ChatFileEAIService.java @@ -0,0 +1,24 @@ +package com.digiwin.athena.app.chatFile.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.chatFile.service.chatFile.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/chatFile/provider/impl/ChatFileEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/impl/ChatFileEAIServiceImpl.java new file mode 100644 index 0000000..0a66b82 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/impl/ChatFileEAIServiceImpl.java @@ -0,0 +1,35 @@ +package com.digiwin.athena.app.chatFile.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.chatFile.provider.ChatFileEAIService; +import com.digiwin.athena.app.chatFile.service.chatFile.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/chatFile/service/chatFile/ChatFileCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java new file mode 100644 index 0000000..50a2440 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java @@ -0,0 +1,54 @@ +package com.digiwin.athena.app.chatFile.service.chatFile; + +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.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.chatFile.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; + +/** + * @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 chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + + Date date = new Date(); + for (ChatFileEntity chatFileEntity : chatFileInfo) { + if (StringUtils.isEmpty(chatFileEntity.getQuestion())){ + throw new DWBusinessException("问题描述不能为空"); + } + //反馈时间 + chatFileEntity.setFeedbackDate(date); + } + + + chatFileService.saveBatch(chatFileInfo); + + return buildOK("chat_file_info",chatFileInfo); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java new file mode 100644 index 0000000..48d0a08 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java @@ -0,0 +1,55 @@ +package com.digiwin.athena.app.chatFile.service.chatFile; + +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.chatFile.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.apache.commons.collections.CollectionUtils; +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/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); + List chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + + if (CollectionUtils.isEmpty(chatFileInfo)){ + return buildOK(new HashMap<>()); + } + + List idList = chatFileInfo.stream().map(ChatFileEntity::getId).collect(Collectors.toList()); + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.in(ChatFileEntity::getId,idList); + List list = chatFileService.list(lmq); + + return buildOK("chat_file_info",list); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java new file mode 100644 index 0000000..6e76f77 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -0,0 +1,47 @@ +package com.digiwin.athena.app.chatFile.service.chatFile; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.chatFile.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.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @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); + List chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + + chatFileInfo.forEach(item -> { + item.setCompleteDate(new Date()); + }); + + chatFileRepository.updateBatch(chatFileInfo); + return buildOK(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java new file mode 100644 index 0000000..3bcd5de --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java @@ -0,0 +1,17 @@ +package com.digiwin.athena.app.chatFile.service.chatFile; + +/** + * @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"; +} From b65cc3b1660ee7031368e238469e0af45a150044 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 7 Sep 2023 14:29:04 +0800 Subject: [PATCH 20/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chatFile/infra/mapper/ChatFileMapper.xml | 22 ++++++++-------- .../infra/repository/ChatFileRepository.java | 2 +- .../chatFile/ChatFileCreateEAIService.java | 17 ++++++------- .../chatFile/ChatFileGetEAIService.java | 11 ++++---- .../chatFile/ChatFileUpdateEAIService.java | 8 +++--- doc/sql/app-20230703-ddl.sql | 25 +++++++++++++++++++ 6 files changed, 54 insertions(+), 31 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml index b124bd8..8b01e8e 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml @@ -5,21 +5,19 @@ - - + UPDATE cim_chat_file - `question` = #{item.question}, - `question_source` = #{item.questionSource}, - `question_type` = #{item.questionType}, - `urgency` = #{item.urgency}, - `question_complete_by` = #{item.questionCompleteBy}, - `complete_explain` = #{item.completeExplain}, - `complete_date` = #{item.completeDate}, - `is_join` = #{item.isJoin}, + `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`=#{item.id} - + WHERE `id`=#{id} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java index 2cd4550..e3608c8 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java @@ -12,6 +12,6 @@ import java.util.List; */ public interface ChatFileRepository extends BaseRepository { - void updateBatch(@Param("list") List list); + void updateBatch(ChatFileEntity chatFile); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java index 50a2440..34f90a9 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java @@ -1,6 +1,7 @@ package com.digiwin.athena.app.chatFile.service.chatFile; import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.StringUtils; import com.digiwin.app.container.exceptions.DWBusinessException; import com.digiwin.app.service.DWEAIResult; @@ -15,6 +16,7 @@ import javax.annotation.Resource; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Objects; /** * @auther: zhenggl @@ -35,19 +37,16 @@ public class ChatFileCreateEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest eaiRequest = EAIRequest.build(messageBody); - List chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); - Date date = new Date(); - for (ChatFileEntity chatFileEntity : chatFileInfo) { - if (StringUtils.isEmpty(chatFileEntity.getQuestion())){ - throw new DWBusinessException("问题描述不能为空"); - } - //反馈时间 - chatFileEntity.setFeedbackDate(date); + if (Objects.isNull(chatFileInfo)){ + throw new DWBusinessException("缺少必要参数chat_file_info"); } + //反馈时间 + chatFileInfo.setFeedbackDate(new Date()); - chatFileService.saveBatch(chatFileInfo); + chatFileService.save(chatFileInfo); return buildOK("chat_file_info",chatFileInfo); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java index 48d0a08..5f16bd5 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java @@ -2,6 +2,7 @@ package com.digiwin.athena.app.chatFile.service.chatFile; 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.chatFile.infra.entity.ChatFileEntity; import com.digiwin.athena.app.chatFile.infra.service.ChatFileService; @@ -15,6 +16,7 @@ import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -38,16 +40,15 @@ public class ChatFileGetEAIService extends AbsEAIService { public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest eaiRequest = EAIRequest.build(messageBody); - List chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); - if (CollectionUtils.isEmpty(chatFileInfo)){ - return buildOK(new HashMap<>()); + if (Objects.isNull(chatFileInfo)){ + throw new DWBusinessException("缺少必要参数chat_file_info"); } - List idList = chatFileInfo.stream().map(ChatFileEntity::getId).collect(Collectors.toList()); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - lmq.in(ChatFileEntity::getId,idList); + lmq.eq(ChatFileEntity::getId,chatFileInfo.getId()); List list = chatFileService.list(lmq); return buildOK("chat_file_info",list); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java index 6e76f77..9ab4307 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -35,11 +35,11 @@ public class ChatFileUpdateEAIService extends AbsEAIService { public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest eaiRequest = EAIRequest.build(messageBody); - List chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); + + + chatFileInfo.setCompleteDate(new Date()); - chatFileInfo.forEach(item -> { - item.setCompleteDate(new Date()); - }); chatFileRepository.updateBatch(chatFileInfo); return buildOK(new HashMap<>()); diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index b7a1b6a..6f39910 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -1 +1,26 @@ 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; From f231d00a2a764f4c6c8f2bf85ef52fdad873bcb3 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 10:14:21 +0800 Subject: [PATCH 21/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5question=5Fno?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/chatFile/infra/entity/ChatFileEntity.java | 3 +++ doc/sql/app-20230703-ddl.sql | 2 ++ 2 files changed, 5 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java index 191bcaf..51f78a5 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java @@ -25,6 +25,9 @@ public class ChatFileEntity extends BaseMgrEntity { @SerializedName(value = "question") private String question; + @SerializedName(value = "question_no") + private String questionNo; + @SerializedName(value = "feedback_person") private String feedbackPerson; diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index 6f39910..0e3ff5a 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -24,3 +24,5 @@ CREATE TABLE `cim_chat_file` ( `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 '问题单号'; From e45afdb7eb63796ef231ef44bf7f4d746aad29c4 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 16:59:16 +0800 Subject: [PATCH 22/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5user=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/chatFile/infra/entity/ChatFileEntity.java | 3 +++ doc/sql/app-20230703-ddl.sql | 1 + 2 files changed, 4 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java index 51f78a5..0857b83 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java @@ -25,6 +25,9 @@ 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; diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index 0e3ff5a..3df6683 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -26,3 +26,4 @@ CREATE TABLE `cim_chat_file` ( ) 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'; From cfeac0226bc4a0521537148cfd5797f405bb854c Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 17:15:48 +0800 Subject: [PATCH 23/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/chatFile/service/chatFile/ChatFileGetEAIService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java index 5f16bd5..280d683 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java @@ -49,8 +49,8 @@ public class ChatFileGetEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(ChatFileEntity::getId,chatFileInfo.getId()); - List list = chatFileService.list(lmq); + ChatFileEntity chatFileServiceOne = chatFileService.getOne(lmq); - return buildOK("chat_file_info",list); + return buildOK("chat_file_info",chatFileServiceOne); } } From f51a775ff1eb8817f82d7b907442e8aa030c8a2a Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 17:16:51 +0800 Subject: [PATCH 24/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/chatFile/service/chatFile/ChatFileGetEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java index 280d683..51d9027 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java @@ -49,7 +49,7 @@ public class ChatFileGetEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(ChatFileEntity::getId,chatFileInfo.getId()); - ChatFileEntity chatFileServiceOne = chatFileService.getOne(lmq); + ChatFileEntity chatFileServiceOne = chatFileService.getById(lmq); return buildOK("chat_file_info",chatFileServiceOne); } From 725f09e09a44fe089b5d28d2e47089ffaf1b9979 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 17:23:25 +0800 Subject: [PATCH 25/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/chatFile/service/chatFile/ChatFileGetEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java index 51d9027..280d683 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java @@ -49,7 +49,7 @@ public class ChatFileGetEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(ChatFileEntity::getId,chatFileInfo.getId()); - ChatFileEntity chatFileServiceOne = chatFileService.getById(lmq); + ChatFileEntity chatFileServiceOne = chatFileService.getOne(lmq); return buildOK("chat_file_info",chatFileServiceOne); } From 3bd1e190b697fb2ea8751000ac78b122eb5fd562 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 17:30:13 +0800 Subject: [PATCH 26/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=20update=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chatFile/service/chatFile/ChatFileUpdateEAIService.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java index 9ab4307..c3ca014 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -38,9 +38,6 @@ public class ChatFileUpdateEAIService extends AbsEAIService { ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); - chatFileInfo.setCompleteDate(new Date()); - - chatFileRepository.updateBatch(chatFileInfo); return buildOK(new HashMap<>()); } From e6551958276f7adf3787bc1ef08358be2951918a Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 8 Sep 2023 17:33:06 +0800 Subject: [PATCH 27/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=20update=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/chatFile/ChatFileUpdateEAIService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java index c3ca014..6d07faa 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -10,10 +10,7 @@ import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @auther: zhenggl @@ -37,6 +34,11 @@ public class ChatFileUpdateEAIService extends AbsEAIService { 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<>()); From 238b4546b7d370d811721f6480a313b5f70218de Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 11 Sep 2023 11:38:56 +0800 Subject: [PATCH 28/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/chatFile/infra/entity/ChatFileEntity.java | 2 +- doc/sql/app-20230703-ddl.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java index 0857b83..263e181 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java @@ -64,7 +64,7 @@ public class ChatFileEntity extends BaseMgrEntity { private String completeExplain; @SerializedName(value = "is_join") - private Integer isJoin; + private Boolean isJoin; @SerializedName(value = "tab_status") private Integer tabStatus; diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index 3df6683..fb8dff5 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -27,3 +27,5 @@ CREATE TABLE `cim_chat_file` ( 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); From 27b713406061dfa78adfd69b5829b45ac2b6e034 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 11 Sep 2023 14:06:03 +0800 Subject: [PATCH 29/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86=E4=BA=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/chatFile/service/chatFile/ChatFileUpdateEAIService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java index 6d07faa..e58c75f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -6,6 +6,7 @@ import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; import com.digiwin.athena.app.chatFile.infra.repository.ChatFileRepository; 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; @@ -36,6 +37,7 @@ public class ChatFileUpdateEAIService extends AbsEAIService { if (Objects.isNull(chatFileInfo.getCompleteDate())){ chatFileInfo.setCompleteDate(new Date()); + chatFileInfo.setQuestionCompleteBy(SecurityUtil.getUserProfile().getUserName()); } From 6968b4e948229c08d3abb06c6096c60a8c4e5f7d Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 11 Sep 2023 14:36:14 +0800 Subject: [PATCH 30/73] =?UTF-8?q?feat:=E5=B7=A5=E5=8D=9A=E4=BC=9AchatFile?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86=E4=BA=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chatFile/service/chatFile/ChatFileUpdateEAIService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java index e58c75f..95a6c3c 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -37,10 +37,9 @@ public class ChatFileUpdateEAIService extends AbsEAIService { if (Objects.isNull(chatFileInfo.getCompleteDate())){ chatFileInfo.setCompleteDate(new Date()); - chatFileInfo.setQuestionCompleteBy(SecurityUtil.getUserProfile().getUserName()); } - + chatFileInfo.setQuestionCompleteBy(SecurityUtil.getUserProfile().getUserName()); chatFileRepository.updateBatch(chatFileInfo); return buildOK(new HashMap<>()); From 52ec54f7adef53e74b5fd48ee71623c5bd669184 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 11 Sep 2023 18:53:28 +0800 Subject: [PATCH 31/73] =?UTF-8?q?feat:=E5=9B=9E=E6=AC=BE=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E9=A2=9D=E5=BA=A6=E7=AE=A1=E7=90=86=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=B5=84=E6=96=99,=E5=BA=94=E6=94=B6=E8=B4=A6?= =?UTF-8?q?=E6=AC=BE=E5=BA=94=E6=94=B6=E6=98=8E=E7=BB=86=E4=BE=A6=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/LimitManagementDetailEntity.java | 59 +++++++++ .../infra/entity/LimitManagementEntity.java | 49 ++++++++ .../infra/entity/PaymentDetailsEntity.java | 112 ++++++++++++++++++ .../mapper/LimitManagementDetailMapper.xml | 24 ++++ .../infra/mapper/LimitManagementMapper.xml | 9 ++ .../LimitManagementDetailRepository.java | 17 +++ .../repository/LimitManagementRepository.java | 11 ++ .../repository/PaymentDetailsRepository.java | 11 ++ .../service/LimitManagementDetailService.java | 11 ++ .../infra/service/LimitManagementService.java | 11 ++ .../infra/service/PaymentDetailsService.java | 11 ++ .../LimitManagementDetailServiceImpl.java | 15 +++ .../impl/LimitManagementServiceImpl.java | 15 +++ .../impl/PaymentDetailsServiceImpl.java | 15 +++ .../LimitManagementDetailEAIService.java | 21 ++++ .../provider/LimitManagementEAIService.java | 19 +++ .../provider/PaymentDetailsEAIService.java | 18 +++ .../LimitManagementDetailEAIServiceImpl.java | 29 +++++ .../impl/LimitManagementEAIServiceImpl.java | 25 ++++ .../impl/PaymentDetailsEAIServiceImpl.java | 23 ++++ .../LimitManagementGetEAIService.java | 48 ++++++++ .../LimitManagementDetailGetEAIService.java | 94 +++++++++++++++ ...LimitManagementDetailUpdateEAIService.java | 55 +++++++++ .../LimitManagementDetailUtil.java | 14 +++ .../paymentdetails/PaymentDetailsUtil.java | 10 ++ .../ReceivablesGetEAIService.java | 40 +++++++ doc/sql/app-20230703-ddl.sql | 73 ++++++++++++ 27 files changed, 839 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java new file mode 100644 index 0000000..50a978f --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementDetailEntity.java @@ -0,0 +1,59 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + * @description 额度管理基础资料 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_limit_management_detail", autoResultMap = true) +public class LimitManagementDetailEntity extends BaseMgrEntity { + + + @SerializedName(value = "limit_management_id") + private Long LimitManagementId; + + @SerializedName(value = "user_id") + private String user_id; + + @SerializedName(value = "min_percentage") + private BigDecimal minPercentage; + + + @SerializedName(value = "max_percentage") + private BigDecimal maxPercentage; + + + @SerializedName(value = "overdue_date_range") + private String overdueDateRange; + + + @SerializedName(value = "processed_by") + private String processedBy; + + + @SerializedName(value = "handling_method") + private String handlingMethod; + + + @SerializedName(value = "processed_by_type") + private String processedByType; + + @SerializedName(value = "class_interval_name") + @TableField(exist = false) + private String classIntervalName; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java new file mode 100644 index 0000000..7dacb6b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitManagementEntity.java @@ -0,0 +1,49 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_limit_management", autoResultMap = true) +public class LimitManagementEntity extends BaseMgrEntity { + + + @SerializedName(value = "class_interval_name") + private String classIntervalName; + + + @SerializedName(value = "class_interval_no") + private String classIntervalNo; + + @SerializedName(value = "min_percentage") + private BigDecimal minPercentage; + + + @SerializedName(value = "max_percentage") + private BigDecimal maxPercentage; + + + @TableField(exist = false) + @SerializedName(value = "quota_ratio") + private BigDecimal quotaRatio; + + @TableField(exist = false) + @SerializedName(value = "info") + private List info; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java new file mode 100644 index 0000000..5cd5e41 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java @@ -0,0 +1,112 @@ +package com.digiwin.athena.app.ptc.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_payment_details", autoResultMap = true) +public class PaymentDetailsEntity extends BaseMgrEntity { + + + /** 应收单号 */ + @SerializedName(value = "receivable_no") + private String receivableNo; + + /** 应收序号 */ + @SerializedName(value = "receivable_non") + private String receivableNon; + + /** 客户编号 */ + @SerializedName(value = "customer_no") + private String customerNo; + + /** 客户名称 */ + @SerializedName(value = "customer_name") + private String customerName; + + /** 状态 */ + @SerializedName(value = "status") + private String status; + + /** 销售单号 */ + @SerializedName(value = "sales_order") + private String salesOrder; + + /** 销售单序号 */ + @SerializedName(value = "sales_order_number") + private String salesOrderNumber; + + /** 合同编号 */ + @SerializedName(value = "contract_no") + private String contractNo; + + /** 品号 */ + @SerializedName(value = "sku_code") + private String skuCode; + + /** 品名 */ + @SerializedName(value = "sku_name") + private String skuName; + + /** 规格 */ + @SerializedName(value = "sku_spec") + private String skuSpec; + + /** 联系人 */ + @SerializedName(value = "contacts") + private String contacts; + + /** 联系方式 */ + @SerializedName(value = "contact_information") + private String contactInformation; + + /** 业务助理 */ + @SerializedName(value = "salesman_assistant") + private String salesmanAssistant; + + /** 业务员 */ + @SerializedName(value = "salesman") + private String salesman; + + /** 业务主管 */ + @SerializedName(value = "salesman_boss") + private String salesmanBoss; + + /** 生产主管 */ + @SerializedName(value = "produce_boss") + private String produceBoss; + + /** 工单单号 */ + @SerializedName(value = "work_no") + private String workNo; + + /** 含税金额 */ + @SerializedName(value = "amount_tax") + private BigDecimal amountTax; + + /** 含税单价 */ + @SerializedName(value = "price_tax") + private BigDecimal priceTax; + + /** 数量 */ + @SerializedName(value = "quantity") + private BigDecimal quantity; + + /** 逾期天数 */ + @SerializedName(value = "overdue_days") + private Long overdueDays; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml new file mode 100644 index 0000000..6a58c52 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementDetailMapper.xml @@ -0,0 +1,24 @@ + + + + + + + UPDATE cim_limit_management_detail + + `overdue_date_range` = #{item.overdueDateRange}, + `processed_by` = #{item.processedBy}, + `handling_method` = #{item.handlingMethod}, + `processed_by_type` = #{item.processedByType}, + `modified_date` = now(), + `modified_by` = #{item.modifiedBy} + + + WHERE `id` = #{item.id} + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml new file mode 100644 index 0000000..ba6d765 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/LimitManagementMapper.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java new file mode 100644 index 0000000..0de2334 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementDetailRepository.java @@ -0,0 +1,17 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementDetailRepository extends BaseRepository { + + void updateBatch(@Param("list")List list); + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java new file mode 100644 index 0000000..599ce52 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitManagementRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java new file mode 100644 index 0000000..d77c524 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/PaymentDetailsRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface PaymentDetailsRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java new file mode 100644 index 0000000..99907ea --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementDetailService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementDetailService extends IBaseService{ +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java new file mode 100644 index 0000000..e2388a0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitManagementService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java new file mode 100644 index 0000000..25e19fe --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/PaymentDetailsService.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.service; + +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface PaymentDetailsService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java new file mode 100644 index 0000000..18f214a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementDetailServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitManagementDetailRepository; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementDetailService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +public class LimitManagementDetailServiceImpl extends AbsBaseService implements LimitManagementDetailService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java new file mode 100644 index 0000000..f24f0fa --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitManagementServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitManagementRepository; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +public class LimitManagementServiceImpl extends AbsBaseService implements LimitManagementService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java new file mode 100644 index 0000000..95b50ae --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/PaymentDetailsServiceImpl.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.ptc.infra.service.impl; + +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.app.ptc.infra.repository.PaymentDetailsRepository; +import com.digiwin.athena.app.ptc.infra.service.PaymentDetailsService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +public class PaymentDetailsServiceImpl extends AbsBaseService implements PaymentDetailsService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java new file mode 100644 index 0000000..365d332 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementDetailEAIService.java @@ -0,0 +1,21 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementDetailEAIService extends DWService { + + @EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + @EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java new file mode 100644 index 0000000..74a9ce0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitManagementEAIService.java @@ -0,0 +1,19 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface LimitManagementEAIService extends DWService { + + @EAIService(id = LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java new file mode 100644 index 0000000..9e154dd --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/PaymentDetailsEAIService.java @@ -0,0 +1,18 @@ +package com.digiwin.athena.app.ptc.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.ptc.service.paymentdetails.PaymentDetailsUtil; + +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public interface PaymentDetailsEAIService extends DWService { + + @EAIService(id = PaymentDetailsUtil.RECEIVABLES_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java new file mode 100644 index 0000000..b2f87d3 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementDetailEAIServiceImpl.java @@ -0,0 +1,29 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.LimitManagementDetailEAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class LimitManagementDetailEAIServiceImpl implements LimitManagementDetailEAIService{ + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET,headers,messageBody); + } + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java new file mode 100644 index 0000000..46cdb80 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitManagementEAIServiceImpl.java @@ -0,0 +1,25 @@ +package com.digiwin.athena.app.ptc.provider.impl; + + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.LimitManagementEAIService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class LimitManagementEAIServiceImpl implements LimitManagementEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java new file mode 100644 index 0000000..845dbd9 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/PaymentDetailsEAIServiceImpl.java @@ -0,0 +1,23 @@ +package com.digiwin.athena.app.ptc.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.provider.PaymentDetailsEAIService; +import com.digiwin.athena.app.ptc.service.paymentdetails.PaymentDetailsUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class PaymentDetailsEAIServiceImpl implements PaymentDetailsEAIService { + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PaymentDetailsUtil.RECEIVABLES_GET,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java new file mode 100644 index 0000000..cc4dbce --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/management/LimitManagementGetEAIService.java @@ -0,0 +1,48 @@ +package com.digiwin.athena.app.ptc.service.management; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementDetailService; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementService; +import com.digiwin.athena.app.ptc.service.managementdetail.LimitManagementDetailUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class LimitManagementGetEAIService extends AbsEAIService { + + + @Resource + private LimitManagementService limitManagementService; + + @Resource + private LimitManagementDetailService limitManagementDetailService; + + + + @Override + public String getServiceName() { + return LimitManagementDetailUtil.LIMIT_MANAGEMENT_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //直接捞两个表的数据 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(LimitManagementEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List list = limitManagementService.list(lmq); + return buildOK("query_result",list); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java new file mode 100644 index 0000000..eae3cd6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailGetEAIService.java @@ -0,0 +1,94 @@ +package com.digiwin.athena.app.ptc.service.managementdetail; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.alibaba.nacos.common.utils.Objects; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.container.exceptions.DWBusinessException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementDetailService; +import com.digiwin.athena.app.ptc.infra.service.LimitManagementService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class LimitManagementDetailGetEAIService extends AbsEAIService { + + + @Resource + private LimitManagementDetailService limitManagementDetailService; + + @Resource + private LimitManagementService limitManagementService; + + @Override + public String getServiceName() { + return LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + //根据id查子表 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List limitManagementEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + if (CollectionUtils.isEmpty(limitManagementEntities)){ + throw new DWBusinessException("必填参数为空"); + } + + LimitManagementEntity limitManagementEntity = limitManagementEntities.get(0); + + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + if (Objects.nonNull(limitManagementEntity.getId())){ + + LambdaQueryWrapper mfLmq = new LambdaQueryWrapper<>(); + mfLmq.eq(LimitManagementEntity::getId,limitManagementEntity.getId()); + LimitManagementEntity one = limitManagementService.getOne(mfLmq); + + LambdaQueryWrapper dfLmq = new LambdaQueryWrapper<>(); + dfLmq.eq(LimitManagementDetailEntity::getTenantSid,tenantSid); + dfLmq.eq(LimitManagementDetailEntity::getLimitManagementId,limitManagementEntity.getId()); + List list = limitManagementDetailService.list(dfLmq); + one.setInfo(list); + return buildOK("query_result",one); + } + + if (Objects.nonNull(limitManagementEntity.getQuotaRatio())){ + //根据间距查询主表 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(LimitManagementEntity::getTenantSid,tenantSid); + lmq.le(LimitManagementEntity::getMinPercentage,limitManagementEntity.getQuotaRatio()); + lmq.ge(LimitManagementEntity::getMaxPercentage,limitManagementEntity.getQuotaRatio()); + LimitManagementEntity one = limitManagementService.getOne(lmq); + + //根据id查询子表 + if (Objects.nonNull(one)){ + LambdaQueryWrapper dfLmq = new LambdaQueryWrapper<>(); + dfLmq.eq(LimitManagementDetailEntity::getTenantSid,tenantSid); + dfLmq.eq(LimitManagementDetailEntity::getLimitManagementId,one.getId()); + List list = limitManagementDetailService.list(dfLmq); + one.setInfo(list); + return buildOK("query_result",one); + } + } + return buildOK("query_result",new HashMap<>()); + } + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java new file mode 100644 index 0000000..940bb38 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUpdateEAIService.java @@ -0,0 +1,55 @@ +package com.digiwin.athena.app.ptc.service.managementdetail; + +import com.alibaba.fastjson.TypeReference; +import com.alibaba.nacos.common.utils.CollectionUtils; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementDetailEntity; +import com.digiwin.athena.app.ptc.infra.entity.LimitManagementEntity; +import com.digiwin.athena.app.ptc.infra.repository.LimitManagementDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class LimitManagementDetailUpdateEAIService extends AbsEAIService { + + + @Resource + private LimitManagementDetailRepository limitManagementDetailRepository; + + @Override + public String getServiceName() { + return LimitManagementDetailUtil.LIMIT_MANAGEMENT_DETAIL_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //修改子表 + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List managementDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); + + if (CollectionUtils.isEmpty(managementDetailEntities)){ + return buildOK("query_result",new HashMap<>()); + } + + //获取单身数据 + List info = managementDetailEntities.get(0).getInfo(); + + if (CollectionUtils.isNotEmpty(info)){ + limitManagementDetailRepository.updateBatch(info); + } + return buildOK("query_result",managementDetailEntities); + } + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java new file mode 100644 index 0000000..25d5f8b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/managementdetail/LimitManagementDetailUtil.java @@ -0,0 +1,14 @@ +package com.digiwin.athena.app.ptc.service.managementdetail; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class LimitManagementDetailUtil { + + public static final String LIMIT_MANAGEMENT_DETAIL_UPDATE ="demo.ptc.athenapot.limit.management.detail.update"; + + public static final String LIMIT_MANAGEMENT_DETAIL_GET ="demo.ptc.athenapot.limit.management.detail.get"; + + public static final String LIMIT_MANAGEMENT_GET ="demo.ptc.athenapot.limit.management.get"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java new file mode 100644 index 0000000..338b550 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/PaymentDetailsUtil.java @@ -0,0 +1,10 @@ +package com.digiwin.athena.app.ptc.service.paymentdetails; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +public class PaymentDetailsUtil { + + public static final String RECEIVABLES_GET = "demo.ptc.athenapot.receivables.get"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java new file mode 100644 index 0000000..531cabe --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/paymentdetails/ReceivablesGetEAIService.java @@ -0,0 +1,40 @@ +package com.digiwin.athena.app.ptc.service.paymentdetails; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.app.ptc.infra.service.PaymentDetailsService; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/11 + */ +@Service +@Log4j2 +public class ReceivablesGetEAIService extends AbsEAIService { + + @Resource + private PaymentDetailsService paymentDetailsService; + + @Override + public String getServiceName() { + return PaymentDetailsUtil.RECEIVABLES_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(PaymentDetailsEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List list = paymentDetailsService.list(lmq); + return buildOK("query_result",list); + } +} diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql index fb8dff5..2adde67 100644 --- a/doc/sql/app-20230703-ddl.sql +++ b/doc/sql/app-20230703-ddl.sql @@ -29,3 +29,76 @@ alter table cim_chat_file Add column question_no varchar(32) null default '' COM alter table cim_chat_file Add column user_id varchar(32) null default '' COMMENT '用户id'; ALTER TABLE `cim_chat_file` MODIFY COLUMN `is_join` tinyint(255); + +CREATE TABLE `cim_limit_management_detail` ( + `id` bigint(20) NOT NULL, + `limit_management_id` bigint(20) NOT NULL, + `min_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最小', + `max_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最大', + `overdue_date_range` varchar(100) DEFAULT '' COMMENT '逾期日期区间', + `processed_by` varchar(50) DEFAULT '' COMMENT '处理人', + `handling_method` varchar(1) DEFAULT '' COMMENT '处理方式', + `processed_by_type` varchar(1) DEFAULT '' COMMENT '处理人类型', + `user_id` varchar(50) DEFAULT '' COMMENT '用户id', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL, + `create_by` varchar(50) DEFAULT NULL, + `create_date` datetime DEFAULT NULL, + `modified_by` varchar(50) DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + `deleted` tinyint(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `cim_payment_details` ( + `id` bigint(20) NOT NULL, + `receivable_no` varchar(100) DEFAULT '' COMMENT '应收单号', + `receivable_non` varchar(100) DEFAULT '' COMMENT '应收序号', + `customer_no` varchar(100) DEFAULT '' COMMENT '客户编号', + `customer_name` varchar(100) DEFAULT '' COMMENT '客户名称', + `status` varchar(100) DEFAULT '' COMMENT '状态', + `sales_order` varchar(100) DEFAULT '' COMMENT '销售单号', + `sales_order_number` varchar(100) DEFAULT '' COMMENT '销售单序号', + `contract_no` varchar(100) DEFAULT '' COMMENT '合同编号', + `sku_code` varchar(100) DEFAULT '' COMMENT '品号', + `sku_name` varchar(100) DEFAULT '' COMMENT '品名', + `sku_spec` varchar(100) DEFAULT '' COMMENT '规格', + `contacts` varchar(100) DEFAULT '' COMMENT '联系人', + `contact_information` varchar(100) DEFAULT '' COMMENT '联系方式', + `salesman_assistant` varchar(100) DEFAULT '' COMMENT '业务助理', + `salesman` varchar(100) DEFAULT '' COMMENT '业务员', + `salesman_boss` varchar(100) DEFAULT '' COMMENT '业务主管', + `produce_boss` varchar(100) DEFAULT '' COMMENT '生产主管', + `work_no` varchar(100) DEFAULT '' COMMENT '工单单号', + `amount_tax` decimal(15,3) DEFAULT NULL COMMENT '含税金额', + `price_tax` decimal(15,3) DEFAULT NULL COMMENT '含税单价', + `quantity` decimal(15,3) DEFAULT NULL COMMENT '数量', + `overdue_days` int(11) DEFAULT NULL COMMENT '逾期天数', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL, + `create_by` varchar(50) DEFAULT NULL, + `create_date` datetime DEFAULT NULL, + `modified_by` varchar(50) DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + `deleted` tinyint(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `cim_limit_management` ( + `id` bigint(20) NOT NULL, + `min_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最小', + `max_percentage` decimal(15,3) DEFAULT NULL COMMENT '区间最大', + `class_interval_name` varchar(100) DEFAULT '' COMMENT '级距名称', + `class_interval_no` varchar(100) DEFAULT '' COMMENT '序号', + `tenantsid` bigint(20) DEFAULT NULL COMMENT '租户sid', + `tenant_id` varchar(20) DEFAULT NULL, + `create_by` varchar(50) DEFAULT NULL, + `create_date` datetime DEFAULT NULL, + `modified_by` varchar(50) DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `version` int(11) DEFAULT NULL, + `deleted` tinyint(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; From 049713a0ee755633e45005057ddcd929d1a6bc46 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Tue, 12 Sep 2023 15:59:07 +0800 Subject: [PATCH 32/73] =?UTF-8?q?fix:chatfile=E6=96=B0=E5=A2=9E=E6=97=B6?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=9A=84=E6=95=B0=E6=8D=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chatFile/service/chatFile/ChatFileCreateEAIService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java index 34f90a9..9f73f10 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java @@ -1,8 +1,6 @@ package com.digiwin.athena.app.chatFile.service.chatFile; import com.alibaba.fastjson.TypeReference; -import com.alibaba.nacos.common.utils.CollectionUtils; -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.chatFile.infra.entity.ChatFileEntity; @@ -37,7 +35,8 @@ public class ChatFileCreateEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest eaiRequest = EAIRequest.build(messageBody); - ChatFileEntity chatFileInfo = eaiRequest.getObject("chat_file_info", new TypeReference(){}); + List chatFileInfoList = eaiRequest.getObject("chat_file_info", new TypeReference>(){}); + ChatFileEntity chatFileInfo = chatFileInfoList.get(0); if (Objects.isNull(chatFileInfo)){ throw new DWBusinessException("缺少必要参数chat_file_info"); From eda47ccc70304c4db64f4f3d64ba3e15bc546592 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Tue, 12 Sep 2023 16:57:36 +0800 Subject: [PATCH 33/73] =?UTF-8?q?fix:chatfile=E4=BF=AE=E6=94=B9=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chatFile/service/chatFile/ChatFileUpdateEAIService.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java index 95a6c3c..de31ffd 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java @@ -6,7 +6,6 @@ import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; import com.digiwin.athena.app.chatFile.infra.repository.ChatFileRepository; 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; @@ -39,8 +38,6 @@ public class ChatFileUpdateEAIService extends AbsEAIService { chatFileInfo.setCompleteDate(new Date()); } - chatFileInfo.setQuestionCompleteBy(SecurityUtil.getUserProfile().getUserName()); - chatFileRepository.updateBatch(chatFileInfo); return buildOK(new HashMap<>()); } From 753df37ea9f647a74dbfbf00ddeda919c3cd2f0b Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 10:54:46 +0800 Subject: [PATCH 34/73] =?UTF-8?q?feat:=E5=9B=9E=E6=AC=BE=E6=97=B6=E6=95=88?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=BA=94=E6=94=B6,=E5=82=AC=E6=94=B6,?= =?UTF-8?q?=E9=A2=9D=E5=BA=A6,=E7=94=9F=E4=BA=A7=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/CollectionDetailEntity.java | 128 ++++++++++++++++++ .../ptc/infra/entity/LimitCreditEntity.java | 34 +++++ .../infra/entity/PaymentDetailsEntity.java | 6 + .../infra/entity/ProductionDetailsEntity.java | 102 ++++++++++++++ .../infra/entity/ReceivablesDetailEntity.java | 120 ++++++++++++++++ .../infra/mapper/CollectionDetailMapper.xml | 18 +++ .../CollectionDetailRepository.java | 16 +++ .../repository/LimitCreditRepository.java | 11 ++ .../ProductionDetailsRepository.java | 11 ++ .../ReceivablesDetailRepository.java | 11 ++ .../service/CollectionDetailService.java | 11 ++ .../ptc/infra/service/LimitCreditService.java | 11 ++ .../service/ProductionDetailsService.java | 11 ++ .../service/ReceivablesDetailService.java | 11 ++ .../impl/CollectionDetailServiceImpl.java | 15 ++ .../service/impl/LimitCreditServiceImpl.java | 15 ++ .../impl/ProductionDetailsServiceImpl.java | 15 ++ .../impl/ReceivablesDetailServiceImpl.java | 15 ++ .../ptc/provider/LimitCreditEAIService.java | 10 ++ .../provider/ProductionDetailsEAIService.java | 25 ++++ .../provider/ReceivablesDetailEAIService.java | 27 ++++ .../impl/LimitCreditEAIServiceImpl.java | 16 +++ .../impl/ProductionDetailsEAIServiceImpl.java | 34 +++++ .../impl/ReceivablesDetailEAIServiceImpl.java | 39 ++++++ .../ReceivablesGetEAIService.java | 30 ++++ .../ProductionCreateEAIService.java | 117 ++++++++++++++++ .../ProductionTasUpdateEAIService.java | 59 ++++++++ .../ProductionTaskGetEAIService.java | 60 ++++++++ .../service/production/ProductionUtil.java | 19 +++ .../ReceivablesCreateEAIService.java | 49 +++++++ .../ReceivablesInitialCreateEAIService.java | 90 ++++++++++++ .../ReceivablesTaskGetEAIService.java | 66 +++++++++ .../ReceivablesTaskUpdateEAIService.java | 64 +++++++++ .../service/receivables/ReceivablesUtil.java | 16 +++ doc/sql/app-2023-09-12-ddl.sql | 118 ++++++++++++++++ 35 files changed, 1400 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/LimitCreditEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ProductionDetailsEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/CollectionDetailMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/CollectionDetailRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/LimitCreditRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ProductionDetailsRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ReceivablesDetailRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/CollectionDetailService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/LimitCreditService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ProductionDetailsService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/ReceivablesDetailService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/CollectionDetailServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/LimitCreditServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ProductionDetailsServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/service/impl/ReceivablesDetailServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/LimitCreditEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ProductionDetailsEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ReceivablesDetailEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/LimitCreditEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ProductionDetailsEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTasUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java create mode 100644 doc/sql/app-2023-09-12-ddl.sql 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..8b479a7 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/CollectionDetailEntity.java @@ -0,0 +1,128 @@ +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; + + public CollectionDetailEntity(String customerName, String customerNo, String contacts, String contactInformation) { + this.customerNo = customerNo; + this.customerName = customerName; + this.contacts = contacts; + this.contactInformation = contactInformation; + } +} 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/PaymentDetailsEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/PaymentDetailsEntity.java index 5cd5e41..e5a1fcc 100644 --- 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 @@ -1,5 +1,6 @@ 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; @@ -109,4 +110,9 @@ public class PaymentDetailsEntity extends BaseMgrEntity { /** 逾期天数 */ @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..f180177 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ProductionDetailsEntity.java @@ -0,0 +1,102 @@ +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; + + 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..b394bef --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/entity/ReceivablesDetailEntity.java @@ -0,0 +1,120 @@ +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; + + + +} 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..7f70104 --- /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} + + ( + 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/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..a63d366 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ReceivablesDetailRepository.java @@ -0,0 +1,11 @@ +package com.digiwin.athena.app.ptc.infra.repository; + +import com.digiwin.athena.app.ptc.infra.entity.ReceivablesDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +public interface ReceivablesDetailRepository extends BaseRepository { +} 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/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/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/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..d38f4df --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/ReceivablesDetailEAIService.java @@ -0,0 +1,27 @@ +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_TASK_GET) + DWEAIResult initialCreate(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/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..5a71f22 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java @@ -0,0 +1,39 @@ +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); + } +} 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 index 531cabe..9ce5557 100644 --- 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 @@ -1,8 +1,11 @@ package com.digiwin.athena.app.ptc.service.paymentdetails; +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.LimitCreditEntity; import com.digiwin.athena.app.ptc.infra.entity.PaymentDetailsEntity; +import com.digiwin.athena.app.ptc.infra.service.LimitCreditService; import com.digiwin.athena.app.ptc.infra.service.PaymentDetailsService; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; import com.digiwin.athena.opt.common.security.SecurityUtil; @@ -12,6 +15,8 @@ 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 @@ -24,6 +29,9 @@ public class ReceivablesGetEAIService extends AbsEAIService { @Resource private PaymentDetailsService paymentDetailsService; + @Resource + private LimitCreditService limitCreditService; + @Override public String getServiceName() { return PaymentDetailsUtil.RECEIVABLES_GET; @@ -35,6 +43,28 @@ public class ReceivablesGetEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(PaymentDetailsEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); List list = paymentDetailsService.list(lmq); + + if (CollectionUtils.isEmpty(list)){ + return buildOK("query_result",list); + } + + //查询限制额度 + List customerNoList = list.stream().map(PaymentDetailsEntity::getCustomerNo).collect(Collectors.toList()); + LambdaQueryWrapper creditLmq = new LambdaQueryWrapper<>(); + creditLmq.in(LimitCreditEntity::getCustomerNo,customerNoList); + List limitCreditEntityList = limitCreditService.list(creditLmq); + + if (CollectionUtils.isNotEmpty(limitCreditEntityList)){ + for (PaymentDetailsEntity paymentDetailsEntity : list) { + for (LimitCreditEntity limitCreditEntity : limitCreditEntityList) { + if (Objects.nonNull(limitCreditEntity.getLimitAmount())&&paymentDetailsEntity.getCustomerNo().equals(limitCreditEntity.getCustomerNo())){ + paymentDetailsEntity.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..a1097de --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionCreateEAIService.java @@ -0,0 +1,117 @@ +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 com.digiwin.athena.opt.common.util.RedisUtil; +import org.apache.commons.lang.time.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +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; + + @Autowired + private RedisUtil redisUtil; + + + @Override + public String getServiceName() { + return ProductionUtil.PRODUCTION_TASK_CREATE; + } + + //随机赋值list + 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); + + + + + //默认赋值 + for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { + Random random = new Random(); + int randomNumber = random.nextInt(3); + 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(randomNumber)); + String batchNo = cteateBatchNo(); + productionDetailsEntity.setBatchNo("MMDD-"+batchNo); + //预计产量赋值 + if (CollectionUtils.isNotEmpty(list)) { + 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()); + productionDetailsEntity.setUnit("待定"); + } + } + } + + return buildOK(); + } + + private String cteateBatchNo(){ + StringBuilder sb = new StringBuilder(); + Long batchNo; + if (redisUtil.getRedisTemplate().hasKey(ProductionUtil.KEY)) { + batchNo = redisUtil.incrBy(ProductionUtil.KEY, 1); + } else { + redisUtil.setObject(ProductionUtil.KEY, 1); + batchNo = 1L; + } + + int prefix = 5-batchNo.toString().length(); + for (int i = 0; i < prefix; i++) { + sb.append("0"); + } + return sb.append(batchNo).toString(); + } +} 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..6e467e8 --- /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()); + 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..8ebd441 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/production/ProductionTaskGetEAIService.java @@ -0,0 +1,60 @@ +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>() {}); + + 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, TabStatusEnums.PENDING.getValue()); + 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..f64cd4a --- /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.update"; + + + 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..217823e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesCreateEAIService.java @@ -0,0 +1,49 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +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 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 + */ +@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()); + + collectionDetailService.saveBatch(receivablesDetailEntities); + return buildOK("query_result",receivablesDetailEntities); + } +} 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..ab88599 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java @@ -0,0 +1,90 @@ +package com.digiwin.athena.app.ptc.service.receivables; + +import com.alibaba.fastjson.TypeReference; +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 com.digiwin.athena.opt.common.security.SecurityUtil; +import com.digiwin.athena.opt.common.util.DateUtils; +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 CollectionDetailService collectionDetailService; + + + @Override + public String getServiceName() { + return ReceivablesUtil.RECEIVABLES_INITIAL_CREATE; + } + + + //随机赋值list + List list = Arrays.asList( + new CollectionDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), + new CollectionDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), + new CollectionDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), + new CollectionDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), + new CollectionDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), + new CollectionDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), + new CollectionDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), + new CollectionDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), + new CollectionDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); + + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + List collectionDetailEntities = eaiRequest.getObject("receivables_info", new TypeReference>() {}); + + //先删除 + collectionDetailRepository.deleteBatch(collectionDetailEntities, SecurityUtil.getUserProfile().getTenantSid()); + Random random = new Random(); + //随机新增 + for (CollectionDetailEntity collectionDetailEntity : list) { + int randomNumber = random.nextInt(100); + int nextInt = random.nextInt(30); + int dayInt = random.nextInt(10); + collectionDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); + collectionDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); + collectionDetailEntity.setStatus("1"); + collectionDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); + collectionDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); + collectionDetailEntity.setContractNo(UUID.randomUUID().toString()); + collectionDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); + collectionDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); + collectionDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); + collectionDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); + collectionDetailEntity.setSalesmanBoss("Sp0001"); + collectionDetailEntity.setSalesman("qcuser001"); + collectionDetailEntity.setProduceBoss("Sp0002"); + collectionDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); + collectionDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),collectionDetailEntity.getReceivableDate()))); + } + + collectionDetailService.saveBatch(list); + + + + 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..cb7507d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java @@ -0,0 +1,66 @@ +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>() {}); + + for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder())||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + throw new DWBusinessException("缺少必要参数"); + } + } + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.PENDING.getValue()); + 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..60afcf1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskUpdateEAIService.java @@ -0,0 +1,64 @@ +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 org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/12 + */ +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()); + 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..e15b528 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesUtil.java @@ -0,0 +1,16 @@ +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"; +} diff --git a/doc/sql/app-2023-09-12-ddl.sql b/doc/sql/app-2023-09-12-ddl.sql new file mode 100644 index 0000000..79bc4fe --- /dev/null +++ b/doc/sql/app-2023-09-12-ddl.sql @@ -0,0 +1,118 @@ +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); From eae7b8eec0b637dc0fabd25b432e686b954100cf Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 13:24:15 +0800 Subject: [PATCH 35/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/{app-2023-09-12-ddl.sql => app-20230912-ddl.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/sql/{app-2023-09-12-ddl.sql => app-20230912-ddl.sql} (100%) diff --git a/doc/sql/app-2023-09-12-ddl.sql b/doc/sql/app-20230912-ddl.sql similarity index 100% rename from doc/sql/app-2023-09-12-ddl.sql rename to doc/sql/app-20230912-ddl.sql From c229f46d74f99b17aeb0bcb9df97dba5dec6d419 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 13:42:24 +0800 Subject: [PATCH 36/73] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?bk=E5=88=A0=E9=99=A4=E5=82=AC=E6=94=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3,=E5=82=AC=E6=94=B6=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=A4=84=E7=90=86=E4=BA=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/ptc/infra/entity/CollectionDetailEntity.java | 4 ++++ .../athena/app/ptc/provider/ReceivablesDetailEAIService.java | 5 ++++- .../ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java | 5 +++++ .../service/receivables/ReceivablesTaskGetEAIService.java | 5 ++++- .../athena/app/ptc/service/receivables/ReceivablesUtil.java | 2 ++ doc/sql/app-20230912-ddl.sql | 3 +++ 6 files changed, 22 insertions(+), 2 deletions(-) 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 index 8b479a7..6b9792f 100644 --- 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 @@ -119,6 +119,10 @@ public class CollectionDetailEntity extends BaseMgrEntity headers, String messageBody) throws Exception; - @EAIService(id = ReceivablesUtil.RECEIVABLES_TASK_GET) + @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/ReceivablesDetailEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/provider/impl/ReceivablesDetailEAIServiceImpl.java index 5a71f22..6aa553e 100644 --- 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 @@ -36,4 +36,9 @@ public class ReceivablesDetailEAIServiceImpl implements ReceivablesDetailEAIServ 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/receivables/ReceivablesTaskGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskGetEAIService.java index cb7507d..b61bc9b 100644 --- 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 @@ -41,7 +41,9 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { List collectionDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { - if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder())||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ + if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder()) + ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber()) + ||StringUtils.isEmpty(collectionDetailEntity.getProcessedBy())){ throw new DWBusinessException("缺少必要参数"); } } @@ -55,6 +57,7 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { wrapper -> wrapper .eq(CollectionDetailEntity::getSalesOrder, collectionDetailEntity.getSalesOrder()) .eq(CollectionDetailEntity::getSalesOrderNumber, collectionDetailEntity.getSalesOrderNumber()) + .eq(CollectionDetailEntity::getProcessedBy, collectionDetailEntity.getProcessedBy()) ); } 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 index e15b528..6eacabb 100644 --- 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 @@ -13,4 +13,6 @@ public class ReceivablesUtil { 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/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 79bc4fe..8247887 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -116,3 +116,6 @@ CREATE TABLE `cim_limit_credit` ( -- 修改问题明细长度 ALTER TABLE `cim_chat_file` MODIFY COLUMN `question` varchar (500); + +-- 催收表新增处理人 +alter table cim_collection_detail Add column processed_by varchar(32) null default '' COMMENT '处理人'; From f87e8a1cd0d025cdc193719147f6b0843b6dfb1a Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 13:42:34 +0800 Subject: [PATCH 37/73] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?bk=E5=88=A0=E9=99=A4=E5=82=AC=E6=94=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3,=E5=82=AC=E6=94=B6=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=A4=84=E7=90=86=E4=BA=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReceivablesTaskDeleteEAIService.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java 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..33aca83 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesTaskDeleteEAIService.java @@ -0,0 +1,48 @@ +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 javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/13 + */ +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(); + } +} From b2f7f3d7152fd1e2a54c524726473e0c2a86a59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Wed, 13 Sep 2023 14:13:38 +0800 Subject: [PATCH 38/73] =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=A4=E7=A7=8D=E4=BB=BB=E5=8A=A1=E5=8D=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/dto/PurchaseOrderDetailDTO.java | 13 +++++++++++++ .../infra/entity/PurchaseOrderDetailEntity.java | 14 ++++++++++++++ 2 files changed, 27 insertions(+) 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 index c0041f5..3cb3a72 100644 --- 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 @@ -2,6 +2,7 @@ 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; @@ -124,6 +125,18 @@ public class PurchaseOrderDetailDTO { @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是异常排除任务 */ 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 index 7ae4483..88b464d 100644 --- 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 @@ -139,6 +139,20 @@ public class PurchaseOrderDetailEntity extends BaseMgrEntity Date: Wed, 13 Sep 2023 14:18:04 +0800 Subject: [PATCH 39/73] =?UTF-8?q?feat:stringbuider=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BAstringbuffer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ptc/service/production/ProductionCreateEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index a1097de..8dbd85c 100644 --- 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 @@ -99,7 +99,7 @@ public class ProductionCreateEAIService extends AbsEAIService { } private String cteateBatchNo(){ - StringBuilder sb = new StringBuilder(); + StringBuffer sb = new StringBuffer(); Long batchNo; if (redisUtil.getRedisTemplate().hasKey(ProductionUtil.KEY)) { batchNo = redisUtil.incrBy(ProductionUtil.KEY, 1); From efb130a73fc912e37b4b201bd5fc023e7203e2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Wed, 13 Sep 2023 14:18:46 +0800 Subject: [PATCH 40/73] =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95get=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B0=E5=A2=9E=E7=8A=B6=E6=80=81=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/purchase/PurchaseDemoGetService.java | 2 ++ 1 file changed, 2 insertions(+) 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 index aef6720..d79d3bd 100644 --- 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 @@ -57,6 +57,8 @@ public class PurchaseDemoGetService extends AbsEAIService { .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()) ); From 98f0843320f39916443f7a07295d3966ce9776ad Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 14:35:06 +0800 Subject: [PATCH 41/73] =?UTF-8?q?feat:=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/production/ProductionCreateEAIService.java | 9 ++++----- .../receivables/ReceivablesInitialCreateEAIService.java | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) 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 index 8dbd85c..583f103 100644 --- 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 @@ -43,7 +43,7 @@ public class ProductionCreateEAIService extends AbsEAIService { } //随机赋值list - List list = Arrays.asList( + private List list = Arrays.asList( new ProductionDetailsEntity("001", "一号工厂", "一号工厂刘晓鹏"), new ProductionDetailsEntity("002", "二号工厂", "二号工厂饶文豪"), new ProductionDetailsEntity("003", "三号工厂", "三号工厂卢人辅")); @@ -65,10 +65,9 @@ public class ProductionCreateEAIService extends AbsEAIService { - + Random random = new Random(); //默认赋值 for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { - Random random = new Random(); int randomNumber = random.nextInt(3); productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo()); productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName()); @@ -77,7 +76,7 @@ public class ProductionCreateEAIService extends AbsEAIService { productionDetailsEntity.setProduceBoss("23467345221"); productionDetailsEntity.setProductionStatus(TabStatusEnums.PENDING.getValue().toString()); productionDetailsEntity.setNature(String.valueOf(randomNumber)); - String batchNo = cteateBatchNo(); + String batchNo = createBatchNo(); productionDetailsEntity.setBatchNo("MMDD-"+batchNo); //预计产量赋值 if (CollectionUtils.isNotEmpty(list)) { @@ -98,7 +97,7 @@ public class ProductionCreateEAIService extends AbsEAIService { return buildOK(); } - private String cteateBatchNo(){ + private String createBatchNo(){ StringBuffer sb = new StringBuffer(); Long batchNo; if (redisUtil.getRedisTemplate().hasKey(ProductionUtil.KEY)) { 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 index ab88599..6e30605 100644 --- 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 @@ -38,7 +38,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { //随机赋值list - List list = Arrays.asList( + private List list = Arrays.asList( new CollectionDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), new CollectionDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), new CollectionDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), From cd74983dc1937546c1efe80beae3e138a3603925 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 15:31:35 +0800 Subject: [PATCH 42/73] =?UTF-8?q?feat:=E4=BE=A6=E6=B5=8B=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/mapper/ReceivablesDetailMapper.xml | 17 +++++++++++ .../ReceivablesDetailRepository.java | 5 ++++ .../ReceivablesInitialCreateEAIService.java | 30 ++++++++++++++----- 3 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/mapper/ReceivablesDetailMapper.xml 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..7d4f9e1 --- /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} + + ( + 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/ReceivablesDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/infra/repository/ReceivablesDetailRepository.java index a63d366..387e1c4 100644 --- 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 @@ -1,11 +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/service/receivables/ReceivablesInitialCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/ptc/service/receivables/ReceivablesInitialCreateEAIService.java index 6e30605..544c896 100644 --- 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 @@ -1,11 +1,14 @@ package com.digiwin.athena.app.ptc.service.receivables; 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.CollectionDetailEntity; 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.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; import com.digiwin.athena.opt.common.security.SecurityUtil; import com.digiwin.athena.opt.common.util.DateUtils; @@ -27,6 +30,9 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { @Resource private CollectionDetailRepository collectionDetailRepository; + @Resource + private ReceivablesDetailRepository receivablesDetailRepository; + @Resource private CollectionDetailService collectionDetailService; @@ -53,14 +59,24 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { - EAIRequest eaiRequest = EAIRequest.build(messageBody); - List collectionDetailEntities = eaiRequest.getObject("receivables_info", new TypeReference>() {}); - //先删除 - collectionDetailRepository.deleteBatch(collectionDetailEntities, SecurityUtil.getUserProfile().getTenantSid()); + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + + //取出已完成的数据 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); + lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); + List list = collectionDetailService.list(lmq); + + //删除应收数据 + if (CollectionUtils.isNotEmpty(list)){ + receivablesDetailRepository.deleteBatch(list,tenantSid); + } + + Random random = new Random(); //随机新增 - for (CollectionDetailEntity collectionDetailEntity : list) { + for (CollectionDetailEntity collectionDetailEntity : this.list) { int randomNumber = random.nextInt(100); int nextInt = random.nextInt(30); int dayInt = random.nextInt(10); @@ -81,7 +97,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { collectionDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),collectionDetailEntity.getReceivableDate()))); } - collectionDetailService.saveBatch(list); + collectionDetailService.saveBatch(this.list); From be875ee4ec936bb1f48a64d6b7f99256bcabe8d0 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 15:52:54 +0800 Subject: [PATCH 43/73] =?UTF-8?q?feat:=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/ReceivablesDetailEntity.java | 6 +++++- .../ReceivablesGetEAIService.java | 18 ++++++++++-------- .../ReceivablesCreateEAIService.java | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) 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 index b394bef..901f815 100644 --- 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 @@ -3,6 +3,7 @@ package com.digiwin.athena.app.ptc.infra.entity; import java.math.BigDecimal; import java.util.Date; +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; @@ -115,6 +116,9 @@ public class ReceivablesDetailEntity extends BaseMgrEntity headers, String messageBody) throws Exception { - LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - lmq.eq(PaymentDetailsEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); - List list = paymentDetailsService.list(lmq); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(ReceivablesDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + List list = receivablesDetailService.list(lmq); if (CollectionUtils.isEmpty(list)){ return buildOK("query_result",list); } //查询限制额度 - List customerNoList = list.stream().map(PaymentDetailsEntity::getCustomerNo).collect(Collectors.toList()); + 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 (PaymentDetailsEntity paymentDetailsEntity : list) { + for (ReceivablesDetailEntity receivablesDetailEntity : list) { for (LimitCreditEntity limitCreditEntity : limitCreditEntityList) { - if (Objects.nonNull(limitCreditEntity.getLimitAmount())&&paymentDetailsEntity.getCustomerNo().equals(limitCreditEntity.getCustomerNo())){ - paymentDetailsEntity.setLimitAmount(limitCreditEntity.getLimitAmount()); + if (Objects.nonNull(limitCreditEntity.getLimitAmount())&&receivablesDetailEntity.getCustomerNo().equals(limitCreditEntity.getCustomerNo())){ + receivablesDetailEntity.setLimitAmount(limitCreditEntity.getLimitAmount()); } } } 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 index 217823e..2d5d218 100644 --- 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 @@ -39,9 +39,9 @@ public class ReceivablesCreateEAIService extends AbsEAIService { EAIRequest eaiRequest = EAIRequest.build(messageBody); List receivablesDetailEntities = eaiRequest.getObject("get_data", new TypeReference>() {}); - //根据bk删除数据 + /*//根据bk删除数据 //先删除 - collectionDetailRepository.deleteBatch(receivablesDetailEntities, SecurityUtil.getUserProfile().getTenantSid()); + collectionDetailRepository.deleteBatch(receivablesDetailEntities, SecurityUtil.getUserProfile().getTenantSid());*/ collectionDetailService.saveBatch(receivablesDetailEntities); return buildOK("query_result",receivablesDetailEntities); From d4477b3f1ecea129a79a5c448c44452685f49932 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 16:39:16 +0800 Subject: [PATCH 44/73] =?UTF-8?q?feat:=E7=94=9F=E4=BA=A7=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/app-20230912-ddl.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 8247887..786cf7f 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -119,3 +119,7 @@ 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 '生产主管'; From d0de72afd1551c6763251d1231e595cad806aa94 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 16:53:27 +0800 Subject: [PATCH 45/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E4=BE=A6=E6=B5=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/CollectionDetailEntity.java | 8 +-- .../infra/entity/ReceivablesDetailEntity.java | 10 ++++ .../ReceivablesInitialCreateEAIService.java | 59 ++++++++++--------- doc/sql/app-20230912-ddl.sql | 2 + 4 files changed, 46 insertions(+), 33 deletions(-) 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 index 6b9792f..7afbe51 100644 --- 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 @@ -123,10 +123,6 @@ public class CollectionDetailEntity extends BaseMgrEntity list = Arrays.asList( - new CollectionDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), - new CollectionDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), - new CollectionDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), - new CollectionDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), - new CollectionDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), - new CollectionDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), - new CollectionDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), - new CollectionDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), - new CollectionDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); + private List list = Arrays.asList( + new ReceivablesDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), + new ReceivablesDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), + new ReceivablesDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), + new ReceivablesDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), + new ReceivablesDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), + new ReceivablesDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), + new ReceivablesDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), + new ReceivablesDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), + new ReceivablesDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); @Override @@ -76,28 +82,27 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { Random random = new Random(); //随机新增 - for (CollectionDetailEntity collectionDetailEntity : this.list) { + for (ReceivablesDetailEntity receivablesDetailEntity : this.list) { int randomNumber = random.nextInt(100); int nextInt = random.nextInt(30); int dayInt = random.nextInt(10); - collectionDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); - collectionDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); - collectionDetailEntity.setStatus("1"); - collectionDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); - collectionDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); - collectionDetailEntity.setContractNo(UUID.randomUUID().toString()); - collectionDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); - collectionDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); - collectionDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); - collectionDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); - collectionDetailEntity.setSalesmanBoss("Sp0001"); - collectionDetailEntity.setSalesman("qcuser001"); - collectionDetailEntity.setProduceBoss("Sp0002"); - collectionDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); - collectionDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),collectionDetailEntity.getReceivableDate()))); + receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setStatus("1"); + receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); + receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); + receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); + receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); + receivablesDetailEntity.setSalesmanBoss("Sp0001"); + receivablesDetailEntity.setSalesman("qcuser001"); + receivablesDetailEntity.setProduceBoss("Sp0002"); + receivablesDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),receivablesDetailEntity.getReceivableDate()))); } - collectionDetailService.saveBatch(this.list); + receivablesDetailService.saveBatch(this.list); diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 786cf7f..777dce4 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -123,3 +123,5 @@ alter table cim_collection_detail Add column processed_by varchar(32) null defau --新增生产主管字段 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 '生产主管'; From 0a5f12233507b467b1d68e1fbb52d69d38018234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Wed, 13 Sep 2023 17:12:50 +0800 Subject: [PATCH 46/73] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E9=87=87=E8=B4=AD?= =?UTF-8?q?sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/infra/mapper/PurchaseOrderDetailMapper.xml | 6 ++++++ 1 file changed, 6 insertions(+) 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 index c68524c..3efba72 100644 --- 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 @@ -69,6 +69,12 @@ tab_status = #{item.tabStatus}, + + abnormal_tab_status = #{item.abnormalTabStatus}, + + + reply_tab_status = #{item.replyTabStatus}, + task_type = #{item.taskType}, From e715943ca44113e2e81990740050b0a5e203d051 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 20:21:17 +0800 Subject: [PATCH 47/73] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E6=97=B6=E5=90=AB?= =?UTF-8?q?=E7=A8=8E=E9=87=91=E9=A2=9D=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/ProductionCreateEAIService.java | 2 +- .../ReceivablesInitialCreateEAIService.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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 index 583f103..7cdfbb9 100644 --- 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 @@ -68,7 +68,7 @@ public class ProductionCreateEAIService extends AbsEAIService { Random random = new Random(); //默认赋值 for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { - int randomNumber = random.nextInt(3); + int randomNumber = 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()); 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 index 57acce1..0ca35e5 100644 --- 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 @@ -1,6 +1,5 @@ package com.digiwin.athena.app.ptc.service.receivables; -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; @@ -72,20 +71,20 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); - List list = collectionDetailService.list(lmq); + List collectionDetailEntities = collectionDetailService.list(lmq); //删除应收数据 - if (CollectionUtils.isNotEmpty(list)){ - receivablesDetailRepository.deleteBatch(list,tenantSid); + if (CollectionUtils.isNotEmpty(collectionDetailEntities)){ + receivablesDetailRepository.deleteBatch(collectionDetailEntities,tenantSid); } Random random = new Random(); //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : this.list) { - int randomNumber = random.nextInt(100); - int nextInt = random.nextInt(30); - int dayInt = random.nextInt(10); + int randomNumber = random.nextInt(100)+1; + int nextInt = random.nextInt(30)+1; + int dayInt = random.nextInt(10)+1; receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); receivablesDetailEntity.setStatus("1"); @@ -93,6 +92,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); + receivablesDetailEntity.setAmountTax(receivablesDetailEntity.getPriceTax().multiply(receivablesDetailEntity.getQuantity())); receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); receivablesDetailEntity.setSalesmanBoss("Sp0001"); From e1932654b82e4c4654bca640449a6472221347ea Mon Sep 17 00:00:00 2001 From: zhenggl Date: Wed, 13 Sep 2023 20:34:08 +0800 Subject: [PATCH 48/73] =?UTF-8?q?feat:list=E8=B0=83=E6=95=B4=E4=B8=BA?= =?UTF-8?q?=E5=86=85=E9=83=A8=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReceivablesInitialCreateEAIService.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) 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 index 0ca35e5..fb633b9 100644 --- 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 @@ -48,23 +48,25 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { } - //随机赋值list - private List list = Arrays.asList( - new ReceivablesDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), - new ReceivablesDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), - new ReceivablesDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), - new ReceivablesDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), - new ReceivablesDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), - new ReceivablesDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), - new ReceivablesDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), - new ReceivablesDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), - new ReceivablesDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //随机赋值list + List list = Arrays.asList( + new ReceivablesDetailEntity("鼎捷A半导体有限公司","dj001","张三","186****9498"), + new ReceivablesDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), + new ReceivablesDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), + new ReceivablesDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), + new ReceivablesDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), + new ReceivablesDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), + new ReceivablesDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), + new ReceivablesDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), + new ReceivablesDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); + + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); //取出已完成的数据 @@ -81,7 +83,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { Random random = new Random(); //随机新增 - for (ReceivablesDetailEntity receivablesDetailEntity : this.list) { + for (ReceivablesDetailEntity receivablesDetailEntity : list) { int randomNumber = random.nextInt(100)+1; int nextInt = random.nextInt(30)+1; int dayInt = random.nextInt(10)+1; @@ -102,7 +104,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),receivablesDetailEntity.getReceivableDate()))); } - receivablesDetailService.saveBatch(this.list); + receivablesDetailService.saveBatch(list); From 52c60b3d54619a1360263dce63a6d12994493ee9 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 09:31:17 +0800 Subject: [PATCH 49/73] =?UTF-8?q?feat:=E5=BA=94=E6=94=B6=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receivables/ReceivablesInitialCreateEAIService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 index fb633b9..c746f61 100644 --- 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 @@ -82,11 +82,13 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { Random random = new Random(); + List integerList = Arrays.asList(0,-1,-7); //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : list) { int randomNumber = random.nextInt(100)+1; int nextInt = random.nextInt(30)+1; - int dayInt = random.nextInt(10)+1; + int dateInt = random.nextInt(3); + //int dayInt = random.nextInt(10)+1; receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); receivablesDetailEntity.setStatus("1"); @@ -95,7 +97,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); receivablesDetailEntity.setAmountTax(receivablesDetailEntity.getPriceTax().multiply(receivablesDetailEntity.getQuantity())); - receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),dayInt)); + receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),integerList.get(dateInt))); receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); receivablesDetailEntity.setSalesmanBoss("Sp0001"); receivablesDetailEntity.setSalesman("qcuser001"); @@ -106,8 +108,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailService.saveBatch(list); - - return buildOK(); } + } From 8ca6c45bb321ba64c41d611df873769c4ac1e7ca Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 11:10:39 +0800 Subject: [PATCH 50/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=B7=9F=E5=A4=84=E7=90=86=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/app-20230912-ddl.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 777dce4..dc608de 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -125,3 +125,6 @@ alter table cim_collection_detail Add column processed_by varchar(32) null defau 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; From e90dbdbb7c9b589aca9ff4f4c7a08da34827bb23 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 15:27:56 +0800 Subject: [PATCH 51/73] =?UTF-8?q?feat:=E5=BA=94=E6=94=B6=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=82=AE=E7=AE=B1,=E9=99=90=E5=88=B6=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/ReceivablesDetailEntity.java | 18 +++- .../ReceivablesInitialCreateEAIService.java | 84 ++++++++++++++----- doc/sql/app-20230912-ddl.sql | 3 + 3 files changed, 81 insertions(+), 24 deletions(-) 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 index 77c467f..a116ee9 100644 --- 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 @@ -121,14 +121,28 @@ public class ReceivablesDetailEntity extends BaseMgrEntity 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(27); + 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("鼎捷A半导体有限公司","dj001","张三","186****9498"), - new ReceivablesDetailEntity("鼎捷B半导体有限公司","dj002","李四","158****4794"), - new ReceivablesDetailEntity("鼎捷C半导体有限公司","dj003","王五","150****9529"), - new ReceivablesDetailEntity("鼎新A半导体有限公司","dj004","赵六","139****0530"), - new ReceivablesDetailEntity("鼎新B半导体有限公司","dj005","陈七","136****5333"), - new ReceivablesDetailEntity("鼎新C半导体有限公司","dj006","刘八","188****9299"), - new ReceivablesDetailEntity("鼎华A半导体有限公司","dj007","韩九","130****3555"), - new ReceivablesDetailEntity("鼎华B半导体有限公司","dj008","管十一","138****9999"), - new ReceivablesDetailEntity("鼎华C半导体有限公司","dj009","谢十二","187****6160")); + 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), + 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), + 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), + 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), + 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), + 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), + 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), + 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), + 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), + 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), + 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), + 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), + 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)); Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); @@ -81,29 +124,26 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { } - Random random = new Random(); - List integerList = Arrays.asList(0,-1,-7); + //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : list) { - int randomNumber = random.nextInt(100)+1; - int nextInt = random.nextInt(30)+1; - int dateInt = random.nextInt(3); - //int dayInt = random.nextInt(10)+1; + 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-"+DateUtils.currentTimeString()); receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); receivablesDetailEntity.setStatus("1"); receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); - receivablesDetailEntity.setPriceTax(new BigDecimal(String.valueOf(randomNumber))); - receivablesDetailEntity.setQuantity(new BigDecimal(String.valueOf(nextInt))); - receivablesDetailEntity.setAmountTax(receivablesDetailEntity.getPriceTax().multiply(receivablesDetailEntity.getQuantity())); - receivablesDetailEntity.setReceivableDate(org.apache.commons.lang.time.DateUtils.addDays(new Date(),integerList.get(dateInt))); - receivablesDetailEntity.setSalesmanAssistant("qcsupplierqcuser001"); - receivablesDetailEntity.setSalesmanBoss("Sp0001"); + receivablesDetailEntity.setSalesmanAssistant("Sp0001"); + receivablesDetailEntity.setSalesmanBoss("qcsupplierqcuser001"); receivablesDetailEntity.setSalesman("qcuser001"); receivablesDetailEntity.setProduceBoss("Sp0002"); + receivablesDetailEntity.setEmail("ath_Sp0001@163.com"); receivablesDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); - receivablesDetailEntity.setOverdueDays(String.valueOf(DateUtils.getDayInterval(new Date(),receivablesDetailEntity.getReceivableDate()))); + receivablesDetailEntity.setOverdueDays(String.valueOf((new Date().getTime()-receivablesDetailEntity.getReceivableDate().getTime())/86400000L)); } receivablesDetailService.saveBatch(list); diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index dc608de..2413d0f 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -128,3 +128,6 @@ alter table cim_receivables_detail Add column produce_boss varchar(100) null def --修改问题明细跟处理详情字段类型 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 '限制金额'; From 317d071ec9deed9f61085503847e28e86cc02a67 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 16:41:58 +0800 Subject: [PATCH 52/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/receivables/ReceivablesTaskDeleteEAIService.java | 4 ++++ doc/sql/app-20230912-ddl.sql | 3 +++ 2 files changed, 7 insertions(+) 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 index 33aca83..4f79699 100644 --- 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 @@ -9,6 +9,8 @@ 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; @@ -18,6 +20,8 @@ import java.util.Map; * @auther: zhenggl * @date: 2023/9/13 */ +@Service +@Log4j2 public class ReceivablesTaskDeleteEAIService extends AbsEAIService { @Resource diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 2413d0f..2c3332c 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -131,3 +131,6 @@ ALTER TABLE `cim_chat_file` MODIFY COLUMN `question` text, MODIFY COLUMN `comple --应收表增加邮箱,限制金额字段 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); From ce5ef99c883cf9705888c441b5e1b31a4b7d5395 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 17:08:09 +0800 Subject: [PATCH 53/73] =?UTF-8?q?feat:sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/ptc/infra/mapper/CollectionDetailMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 7f70104..6930fd0 100644 --- 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 @@ -5,7 +5,7 @@ - delete from cim_collection_detail where tenantsid=#{tenantSid} + delete from cim_collection_detail where tenantsid=#{tenantSid} and ( sales_order = #{item.salesOrder} From bd586bd85f299183a51f2ab0b4f008fed5b406dd Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 17:51:20 +0800 Subject: [PATCH 54/73] =?UTF-8?q?feat:=E4=B8=9A=E5=8A=A1=E4=B8=BB=E7=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/receivables/ReceivablesInitialCreateEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 1ec7997..28653c0 100644 --- 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 @@ -138,7 +138,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesmanAssistant("Sp0001"); - receivablesDetailEntity.setSalesmanBoss("qcsupplierqcuser001"); + receivablesDetailEntity.setSalesmanBoss("qcsupplier001"); receivablesDetailEntity.setSalesman("qcuser001"); receivablesDetailEntity.setProduceBoss("Sp0002"); receivablesDetailEntity.setEmail("ath_Sp0001@163.com"); From 42779eb4d328af7ff496c81b33fd86ae55ae7bb7 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 18:25:01 +0800 Subject: [PATCH 55/73] =?UTF-8?q?feat:demo.ptc.athenapot.receivables.get?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=97=B6=E9=97=B4=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paymentdetails/ReceivablesGetEAIService.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 index 5693de0..bc83041 100644 --- 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 @@ -1,14 +1,14 @@ 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.PaymentDetailsEntity; 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.PaymentDetailsService; 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; @@ -42,8 +42,18 @@ public class ReceivablesGetEAIService extends AbsEAIService { @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)){ From 853c70ebca525953ab8c257e3972e491eaf39798 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 18:50:37 +0800 Subject: [PATCH 56/73] =?UTF-8?q?feat:=E5=8E=BB=E9=99=A4=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=BA=BA=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ptc/service/receivables/ReceivablesTaskGetEAIService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 index b61bc9b..aa44389 100644 --- 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 @@ -42,8 +42,7 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { if (StringUtils.isEmpty(collectionDetailEntity.getSalesOrder()) - ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber()) - ||StringUtils.isEmpty(collectionDetailEntity.getProcessedBy())){ + ||StringUtils.isEmpty(collectionDetailEntity.getSalesOrderNumber())){ throw new DWBusinessException("缺少必要参数"); } } @@ -57,7 +56,6 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { wrapper -> wrapper .eq(CollectionDetailEntity::getSalesOrder, collectionDetailEntity.getSalesOrder()) .eq(CollectionDetailEntity::getSalesOrderNumber, collectionDetailEntity.getSalesOrderNumber()) - .eq(CollectionDetailEntity::getProcessedBy, collectionDetailEntity.getProcessedBy()) ); } From b57ba4194ba3938143a6a24e18eaa70bc97e03cb Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 19:29:45 +0800 Subject: [PATCH 57/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receivables/ReceivablesInitialCreateEAIService.java | 2 +- .../service/receivables/ReceivablesTaskGetEAIService.java | 6 +++++- doc/sql/app-20230912-ddl.sql | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) 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 index 28653c0..819804b 100644 --- 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 @@ -133,7 +133,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSkuName(sku.getSkuName()); receivablesDetailEntity.setSkuSpec(sku.getSkuSpec()); receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); - receivablesDetailEntity.setReceivableNo("SEQ-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setReceivableNon("SEQ-"+DateUtils.currentTimeString()); receivablesDetailEntity.setStatus("1"); receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); 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 index aa44389..7b923c9 100644 --- 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 @@ -40,6 +40,8 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { 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())){ @@ -47,8 +49,10 @@ public class ReceivablesTaskGetEAIService extends AbsEAIService { } } + + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.PENDING.getValue()); + lmq.eq(CollectionDetailEntity::getStatus, status); lmq.eq(CollectionDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); lmq.and(queryWrapperInner -> { for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 2c3332c..6fb5920 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -134,3 +134,4 @@ alter table cim_receivables_detail Add column email varchar(50) null default '' --修改规格字段长度 ALTER TABLE `cim_receivables_detail` MODIFY COLUMN `sku_spec` varchar (255); +ALTER TABLE `cim_collection_detail` MODIFY COLUMN `sku_spec` varchar (255); From 3c3d1c8495ce50613b12145bb4d441f22b2f3bcd Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 19:59:20 +0800 Subject: [PATCH 58/73] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=90=88=E5=90=8C?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receivables/ReceivablesInitialCreateEAIService.java | 1 + .../service/receivables/ReceivablesTaskUpdateEAIService.java | 4 ++++ 2 files changed, 5 insertions(+) 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 index 819804b..b91a206 100644 --- 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 @@ -134,6 +134,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSkuSpec(sku.getSkuSpec()); receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); receivablesDetailEntity.setReceivableNon("SEQ-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setContractNo("CO"+DateUtils.currentTimeString()); receivablesDetailEntity.setStatus("1"); receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); 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 index 60afcf1..5dbe2fe 100644 --- 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 @@ -11,6 +11,8 @@ 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; @@ -21,6 +23,8 @@ import java.util.Map; * @auther: zhenggl * @date: 2023/9/12 */ +@Service +@Log4j2 public class ReceivablesTaskUpdateEAIService extends AbsEAIService { @Resource From 924c5c845b1e776b134b99a3ec41e17216fd215c Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 20:16:08 +0800 Subject: [PATCH 59/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E5=80=BC=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionCreateEAIService.java | 19 ++----------------- .../ReceivablesInitialCreateEAIService.java | 15 +++++++++------ 2 files changed, 11 insertions(+), 23 deletions(-) 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 index 7cdfbb9..1da6e96 100644 --- 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 @@ -11,6 +11,7 @@ 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 com.digiwin.athena.opt.common.generator.SnowflakeWorker; import com.digiwin.athena.opt.common.util.RedisUtil; import org.apache.commons.lang.time.DateUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -76,7 +77,7 @@ public class ProductionCreateEAIService extends AbsEAIService { productionDetailsEntity.setProduceBoss("23467345221"); productionDetailsEntity.setProductionStatus(TabStatusEnums.PENDING.getValue().toString()); productionDetailsEntity.setNature(String.valueOf(randomNumber)); - String batchNo = createBatchNo(); + String batchNo = SnowflakeWorker.nextId().toString(); productionDetailsEntity.setBatchNo("MMDD-"+batchNo); //预计产量赋值 if (CollectionUtils.isNotEmpty(list)) { @@ -97,20 +98,4 @@ public class ProductionCreateEAIService extends AbsEAIService { return buildOK(); } - private String createBatchNo(){ - StringBuffer sb = new StringBuffer(); - Long batchNo; - if (redisUtil.getRedisTemplate().hasKey(ProductionUtil.KEY)) { - batchNo = redisUtil.incrBy(ProductionUtil.KEY, 1); - } else { - redisUtil.setObject(ProductionUtil.KEY, 1); - batchNo = 1L; - } - - int prefix = 5-batchNo.toString().length(); - for (int i = 0; i < prefix; i++) { - sb.append("0"); - } - return sb.append(batchNo).toString(); - } } 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 index b91a206..9f377f0 100644 --- 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 @@ -11,6 +11,7 @@ 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 com.digiwin.athena.opt.common.util.DateUtils; import lombok.extern.log4j.Log4j2; @@ -132,18 +133,18 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSkuCode(sku.getSkuCode()); receivablesDetailEntity.setSkuName(sku.getSkuName()); receivablesDetailEntity.setSkuSpec(sku.getSkuSpec()); - receivablesDetailEntity.setReceivableNo("RE-"+DateUtils.currentTimeString()); - receivablesDetailEntity.setReceivableNon("SEQ-"+DateUtils.currentTimeString()); - receivablesDetailEntity.setContractNo("CO"+DateUtils.currentTimeString()); + receivablesDetailEntity.setReceivableNo("RE-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setReceivableNon("SEQ-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setContractNo("CO"+ SnowflakeWorker.nextId()); receivablesDetailEntity.setStatus("1"); - receivablesDetailEntity.setSalesOrder("SO-"+DateUtils.currentTimeString()); - receivablesDetailEntity.setSalesOrderNumber("SON-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setSalesOrder("SO-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setSalesOrderNumber("SON-"+SnowflakeWorker.nextId()); receivablesDetailEntity.setSalesmanAssistant("Sp0001"); receivablesDetailEntity.setSalesmanBoss("qcsupplier001"); receivablesDetailEntity.setSalesman("qcuser001"); receivablesDetailEntity.setProduceBoss("Sp0002"); receivablesDetailEntity.setEmail("ath_Sp0001@163.com"); - receivablesDetailEntity.setWorkNo("work-"+DateUtils.currentTimeString()); + receivablesDetailEntity.setWorkNo("work-"+SnowflakeWorker.nextId()); receivablesDetailEntity.setOverdueDays(String.valueOf((new Date().getTime()-receivablesDetailEntity.getReceivableDate().getTime())/86400000L)); } @@ -152,4 +153,6 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { return buildOK(); } + + } From ce0538a6ab0b0c9d3d6dcd98fc5f82f20480e7dc Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 14 Sep 2023 20:55:01 +0800 Subject: [PATCH 60/73] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E5=8E=BB=E9=87=8D?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReceivablesCreateEAIService.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) 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 index 2d5d218..8c14253 100644 --- 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 @@ -1,19 +1,21 @@ 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 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.function.Function; +import java.util.stream.Collectors; /** * @auther: zhenggl @@ -42,8 +44,26 @@ public class ReceivablesCreateEAIService extends AbsEAIService { /*//根据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()) + ); + } - collectionDetailService.saveBatch(receivablesDetailEntities); - return buildOK("query_result",receivablesDetailEntities); + }); + 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); } } From 1b5d871c0cd5a8a866a4ec8082c844be2f06c152 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 09:54:53 +0800 Subject: [PATCH 61/73] =?UTF-8?q?feat:sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ptc/infra/mapper/ReceivablesDetailMapper.xml | 2 +- .../service/production/ProductionTasUpdateEAIService.java | 2 +- .../service/production/ProductionTaskGetEAIService.java | 2 +- .../receivables/ReceivablesInitialCreateEAIService.java | 7 +++---- .../receivables/ReceivablesTaskUpdateEAIService.java | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) 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 index 7d4f9e1..5791908 100644 --- 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 @@ -6,7 +6,7 @@ - delete from cim_receivables_detail where tenantsid=#{tenantSid} + delete from cim_receivables_detail where tenantsid=#{tenantSid} and ( sales_order = #{item.salesOrder} 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 index 6e467e8..39c14b1 100644 --- 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 @@ -47,7 +47,7 @@ public class ProductionTasUpdateEAIService extends AbsEAIService { } LambdaUpdateWrapper ump = new LambdaUpdateWrapper<>(); - ump.set(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.COMPLETED.getValue()); + ump.set(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.COMPLETED.getValue().toString()); List woNoList = productionDetailsEntities.stream().map(ProductionDetailsEntity::getWorkNo).collect(Collectors.toList()); ump.in(ProductionDetailsEntity::getWorkNo,woNoList); 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 index 8ebd441..6d6acfd 100644 --- 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 @@ -50,7 +50,7 @@ public class ProductionTaskGetEAIService extends AbsEAIService { 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, TabStatusEnums.PENDING.getValue()); + lmq.eq(ProductionDetailsEntity::getProductionStatus, TabStatusEnums.PENDING.getValue().toString()); lmq.in(ProductionDetailsEntity::getWorkNo,woNoList); List list = productionDetailsService.list(lmq); 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 index 9f377f0..48a397e 100644 --- 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 @@ -3,7 +3,6 @@ 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.infra.common.enums.TabStatusEnums; 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; @@ -13,7 +12,6 @@ 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 com.digiwin.athena.opt.common.util.DateUtils; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; @@ -79,7 +77,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { HashSet set = new HashSet<>(); int count = 0; while (count < 6) { - int num = random.nextInt(27); + int num = random.nextInt(26); if (!set.contains(num)) { set.add(num); count++; @@ -116,7 +114,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { //取出已完成的数据 LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(CollectionDetailEntity::getTenantSid,tenantSid); - lmq.eq(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); + lmq.eq(CollectionDetailEntity::getStatus, "2"); List collectionDetailEntities = collectionDetailService.list(lmq); //删除应收数据 @@ -128,6 +126,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : list) { + int i = random.nextInt(16); ReceivablesDetailEntity sku = skuList.get(i); receivablesDetailEntity.setSkuCode(sku.getSkuCode()); 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 index 5dbe2fe..66310e6 100644 --- 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 @@ -49,7 +49,7 @@ public class ReceivablesTaskUpdateEAIService extends AbsEAIService { } LambdaUpdateWrapper ump = new LambdaUpdateWrapper<>(); - ump.set(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue()); + ump.set(CollectionDetailEntity::getStatus, TabStatusEnums.COMPLETED.getValue().toString()); ump.eq(CollectionDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); ump.and(queryWrapperInner -> { for (CollectionDetailEntity collectionDetailEntity : collectionDetailEntities) { From c681cc934dc7bf59f3333cfe0e59472addd457d0 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 10:48:09 +0800 Subject: [PATCH 62/73] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E6=B6=88=E8=80=97?= =?UTF-8?q?=E9=A2=9D=E5=BA=A6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/CollectionDetailEntity.java | 3 ++ .../infra/entity/ReceivablesDetailEntity.java | 8 +++-- .../ReceivablesInitialCreateEAIService.java | 33 ++++++++++--------- doc/sql/app-20230912-ddl.sql | 4 +++ 4 files changed, 31 insertions(+), 17 deletions(-) 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 index 7afbe51..2c662de 100644 --- 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 @@ -123,6 +123,9 @@ public class CollectionDetailEntity extends BaseMgrEntity 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), - 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), - 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), - 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), - 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), - 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), - 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), - 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), - 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), - 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), - 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), - 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), - 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)); + 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(); @@ -124,6 +124,8 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { + + int no = 1; //随机新增 for (ReceivablesDetailEntity receivablesDetailEntity : list) { @@ -133,11 +135,11 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSkuName(sku.getSkuName()); receivablesDetailEntity.setSkuSpec(sku.getSkuSpec()); receivablesDetailEntity.setReceivableNo("RE-"+SnowflakeWorker.nextId()); - receivablesDetailEntity.setReceivableNon("SEQ-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setReceivableNon("SEQ-000"+no); receivablesDetailEntity.setContractNo("CO"+ SnowflakeWorker.nextId()); receivablesDetailEntity.setStatus("1"); receivablesDetailEntity.setSalesOrder("SO-"+SnowflakeWorker.nextId()); - receivablesDetailEntity.setSalesOrderNumber("SON-"+SnowflakeWorker.nextId()); + receivablesDetailEntity.setSalesOrderNumber("SON-000"+no); receivablesDetailEntity.setSalesmanAssistant("Sp0001"); receivablesDetailEntity.setSalesmanBoss("qcsupplier001"); receivablesDetailEntity.setSalesman("qcuser001"); @@ -145,6 +147,7 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { 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); diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 6fb5920..55ec73e 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -135,3 +135,7 @@ alter table cim_receivables_detail Add column email varchar(50) null default '' --修改规格字段长度 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 '消费额度'; From 500a3ba85c4788b4ecae210ca22a5931746f1e6e Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 11:48:19 +0800 Subject: [PATCH 63/73] =?UTF-8?q?feat:=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/ptc/service/production/ProductionUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index f64cd4a..ecec3f2 100644 --- 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 @@ -6,7 +6,7 @@ package com.digiwin.athena.app.ptc.service.production; */ public class ProductionUtil { - public static final String PRODUCTION_TASK_GET =" demo.ptc.athenapot.production.task.update"; + 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"; From 9f8128b577284505d41a1d8a045fe1b79f05886c Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 11:55:16 +0800 Subject: [PATCH 64/73] =?UTF-8?q?feat:=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/ptc/service/production/ProductionUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 index ecec3f2..46c592e 100644 --- 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 @@ -6,12 +6,12 @@ package com.digiwin.athena.app.ptc.service.production; */ public class ProductionUtil { - public static final String PRODUCTION_TASK_GET =" demo.ptc.athenapot.production.task.get"; + 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_UPDATE = "demo.ptc.athenapot.production.task.update"; - public static final String PRODUCTION_TASK_CREATE ="demo.ptc.athenapot.production.task.create"; + public static final String PRODUCTION_TASK_CREATE = "demo.ptc.athenapot.production.task.create"; public static final String KEY = "demo-ptc-athenaopt"; From 177e6b5e3fe1b8ba8f563238ee572008bfb2785d Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 13:45:02 +0800 Subject: [PATCH 65/73] =?UTF-8?q?feat:=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/ChatFileEntity.java | 2 +- .../{chatFile => kcfr}/infra/mapper/ChatFileMapper.xml | 2 +- .../infra/repository/ChatFileRepository.java | 7 ++----- .../infra/service/ChatFileService.java | 4 ++-- .../infra/service/impl/ChatFileServiceImpl.java | 8 ++++---- .../provider/ChatFileEAIService.java | 4 ++-- .../provider/impl/ChatFileEAIServiceImpl.java | 6 +++--- .../service}/ChatFileCreateEAIService.java | 6 +++--- .../service}/ChatFileGetEAIService.java | 10 +++------- .../service}/ChatFileUpdateEAIService.java | 6 +++--- .../chatFile => kcfr/service}/ChatFileUtil.java | 2 +- 11 files changed, 25 insertions(+), 32 deletions(-) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/infra/entity/ChatFileEntity.java (96%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/infra/mapper/ChatFileMapper.xml (95%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/infra/repository/ChatFileRepository.java (55%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/infra/service/ChatFileService.java (60%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/infra/service/impl/ChatFileServiceImpl.java (52%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/provider/ChatFileEAIService.java (85%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile => kcfr}/provider/impl/ChatFileEAIServiceImpl.java (83%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile/service/chatFile => kcfr/service}/ChatFileCreateEAIService.java (88%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile/service/chatFile => kcfr/service}/ChatFileGetEAIService.java (81%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile/service/chatFile => kcfr/service}/ChatFileUpdateEAIService.java (85%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/{chatFile/service/chatFile => kcfr/service}/ChatFileUtil.java (87%) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/entity/ChatFileEntity.java similarity index 96% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/entity/ChatFileEntity.java index 263e181..888c15d 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/entity/ChatFileEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/entity/ChatFileEntity.java @@ -1,4 +1,4 @@ -package com.digiwin.athena.app.chatFile.infra.entity; +package com.digiwin.athena.app.kcfr.infra.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml similarity index 95% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml index 8b01e8e..9f9b77a 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/mapper/ChatFileMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml @@ -5,7 +5,7 @@ - + UPDATE cim_chat_file `question` = #{question}, diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/repository/ChatFileRepository.java similarity index 55% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/repository/ChatFileRepository.java index e3608c8..fb17b37 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/repository/ChatFileRepository.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/repository/ChatFileRepository.java @@ -1,10 +1,7 @@ -package com.digiwin.athena.app.chatFile.infra.repository; +package com.digiwin.athena.app.kcfr.infra.repository; -import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; import com.digiwin.athena.opt.persistence.repository.BaseRepository; -import org.apache.ibatis.annotations.Param; - -import java.util.List; /** * @auther: zhenggl diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/ChatFileService.java similarity index 60% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/ChatFileService.java index ecedf7d..61f001b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/ChatFileService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/ChatFileService.java @@ -1,6 +1,6 @@ -package com.digiwin.athena.app.chatFile.infra.service; +package com.digiwin.athena.app.kcfr.infra.service; -import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; +import com.digiwin.athena.app.kcfr.infra.entity.ChatFileEntity; import com.digiwin.athena.opt.persistence.service.IBaseService; /** diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/impl/ChatFileServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/impl/ChatFileServiceImpl.java similarity index 52% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/impl/ChatFileServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/impl/ChatFileServiceImpl.java index bb046d5..d144ab9 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/infra/service/impl/ChatFileServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/infra/service/impl/ChatFileServiceImpl.java @@ -1,8 +1,8 @@ -package com.digiwin.athena.app.chatFile.infra.service.impl; +package com.digiwin.athena.app.kcfr.infra.service.impl; -import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; -import com.digiwin.athena.app.chatFile.infra.repository.ChatFileRepository; -import com.digiwin.athena.app.chatFile.infra.service.ChatFileService; +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; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/ChatFileEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/ChatFileEAIService.java similarity index 85% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/ChatFileEAIService.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/ChatFileEAIService.java index 3a464cb..62986c9 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/ChatFileEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/ChatFileEAIService.java @@ -1,9 +1,9 @@ -package com.digiwin.athena.app.chatFile.provider; +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.chatFile.service.chatFile.ChatFileUtil; +import com.digiwin.athena.app.kcfr.service.ChatFileUtil; import java.util.Map; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/impl/ChatFileEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/impl/ChatFileEAIServiceImpl.java similarity index 83% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/impl/ChatFileEAIServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/impl/ChatFileEAIServiceImpl.java index 0a66b82..9d0cf6c 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/provider/impl/ChatFileEAIServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/provider/impl/ChatFileEAIServiceImpl.java @@ -1,8 +1,8 @@ -package com.digiwin.athena.app.chatFile.provider.impl; +package com.digiwin.athena.app.kcfr.provider.impl; import com.digiwin.app.service.DWEAIResult; -import com.digiwin.athena.app.chatFile.provider.ChatFileEAIService; -import com.digiwin.athena.app.chatFile.service.chatFile.ChatFileUtil; +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; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileCreateEAIService.java similarity index 88% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileCreateEAIService.java index 9f73f10..67a0b99 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileCreateEAIService.java @@ -1,10 +1,10 @@ -package com.digiwin.athena.app.chatFile.service.chatFile; +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.chatFile.infra.entity.ChatFileEntity; -import com.digiwin.athena.app.chatFile.infra.service.ChatFileService; +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; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileGetEAIService.java similarity index 81% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileGetEAIService.java index 280d683..634e9aa 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileGetEAIService.java @@ -1,23 +1,19 @@ -package com.digiwin.athena.app.chatFile.service.chatFile; +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.chatFile.infra.entity.ChatFileEntity; -import com.digiwin.athena.app.chatFile.infra.service.ChatFileService; +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.apache.commons.collections.CollectionUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; /** * @auther: zhenggl diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUpdateEAIService.java similarity index 85% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUpdateEAIService.java index de31ffd..e46109e 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUpdateEAIService.java @@ -1,9 +1,9 @@ -package com.digiwin.athena.app.chatFile.service.chatFile; +package com.digiwin.athena.app.kcfr.service; import com.alibaba.fastjson.TypeReference; import com.digiwin.app.service.DWEAIResult; -import com.digiwin.athena.app.chatFile.infra.entity.ChatFileEntity; -import com.digiwin.athena.app.chatFile.infra.repository.ChatFileRepository; +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; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUtil.java similarity index 87% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUtil.java index 3bcd5de..7fa4dd4 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/chatFile/service/chatFile/ChatFileUtil.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/kcfr/service/ChatFileUtil.java @@ -1,4 +1,4 @@ -package com.digiwin.athena.app.chatFile.service.chatFile; +package com.digiwin.athena.app.kcfr.service; /** * @auther: zhenggl From 76a109ad36754c8031fd2ff24ade89d350c7f17d Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 14:31:57 +0800 Subject: [PATCH 66/73] =?UTF-8?q?feat:=E5=8D=95=E4=BD=8D=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/ProductionCreateEAIService.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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 index 1da6e96..2c4ddd8 100644 --- 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 @@ -11,10 +11,7 @@ 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 com.digiwin.athena.opt.common.generator.SnowflakeWorker; -import com.digiwin.athena.opt.common.util.RedisUtil; import org.apache.commons.lang.time.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -34,8 +31,6 @@ public class ProductionCreateEAIService extends AbsEAIService { @Resource private ReceivablesDetailService receivablesDetailService; - @Autowired - private RedisUtil redisUtil; @Override @@ -68,8 +63,9 @@ public class ProductionCreateEAIService extends AbsEAIService { Random random = new Random(); //默认赋值 + Integer batchNo = 1; for (ProductionDetailsEntity productionDetailsEntity : productionDetailsEntities) { - int randomNumber = random.nextInt(2)+1; + int randomNumber = random.nextInt(3); productionDetailsEntity.setFactoryNo(this.list.get(randomNumber).getFactoryNo()); productionDetailsEntity.setFactoryName(this.list.get(randomNumber).getFactoryName()); productionDetailsEntity.setProductionManagementPerson(this.list.get(randomNumber).getProductionManagementPerson()); @@ -77,10 +73,11 @@ public class ProductionCreateEAIService extends AbsEAIService { productionDetailsEntity.setProduceBoss("23467345221"); productionDetailsEntity.setProductionStatus(TabStatusEnums.PENDING.getValue().toString()); productionDetailsEntity.setNature(String.valueOf(randomNumber)); - String batchNo = SnowflakeWorker.nextId().toString(); - productionDetailsEntity.setBatchNo("MMDD-"+batchNo); + productionDetailsEntity.setBatchNo("MMDD-000"+batchNo); + productionDetailsEntity.setUnit("pcs"); + batchNo = batchNo+1; //预计产量赋值 - if (CollectionUtils.isNotEmpty(list)) { + if (CollectionUtils.isNotEmpty(receivablesDetailEntities)) { for (ReceivablesDetailEntity receivablesDetailEntity : receivablesDetailEntities) { productionDetailsEntity.setExpectedQuantity(receivablesDetailEntity.getQuantity()); //取应收日期前后5天 @@ -90,11 +87,10 @@ public class ProductionCreateEAIService extends AbsEAIService { productionDetailsEntity.setSkuCode(receivablesDetailEntity.getSkuCode()); productionDetailsEntity.setSkuName(receivablesDetailEntity.getSkuName()); productionDetailsEntity.setSkuSpec(receivablesDetailEntity.getSkuSpec()); - productionDetailsEntity.setUnit("待定"); } } } - + productionDetailsService.saveBatch(productionDetailsEntities); return buildOK(); } From 8d8b21281d649516cc7152324a93d62d196648ae Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 14:37:01 +0800 Subject: [PATCH 67/73] =?UTF-8?q?feat:=E6=95=B0=E6=8D=AE=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=89=8D=E7=AB=AF=E4=BC=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ptc/service/production/ProductionTaskGetEAIService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 index 6d6acfd..44050a4 100644 --- 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 @@ -41,6 +41,8 @@ public class ProductionTaskGetEAIService extends AbsEAIService { 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("缺少必填参数"); @@ -50,7 +52,7 @@ public class ProductionTaskGetEAIService extends AbsEAIService { 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, TabStatusEnums.PENDING.getValue().toString()); + lmq.eq(ProductionDetailsEntity::getProductionStatus, status); lmq.in(ProductionDetailsEntity::getWorkNo,woNoList); List list = productionDetailsService.list(lmq); From b57fbefe1999e857e2181125044386a17c3a8c31 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 15 Sep 2023 18:29:48 +0800 Subject: [PATCH 68/73] =?UTF-8?q?feat:=E7=94=9F=E4=BA=A7=E4=B8=BB=E7=AE=A1?= =?UTF-8?q?=E7=AD=89=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ptc/service/production/ProductionCreateEAIService.java | 3 ++- .../receivables/ReceivablesInitialCreateEAIService.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 index 2c4ddd8..c59e9e8 100644 --- 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 @@ -66,13 +66,14 @@ public class ProductionCreateEAIService extends AbsEAIService { 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(randomNumber)); + productionDetailsEntity.setNature(String.valueOf(nature)); productionDetailsEntity.setBatchNo("MMDD-000"+batchNo); productionDetailsEntity.setUnit("pcs"); batchNo = batchNo+1; 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 index b2fdc4e..fc202f2 100644 --- 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 @@ -141,8 +141,8 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSalesOrder("SO-"+SnowflakeWorker.nextId()); receivablesDetailEntity.setSalesOrderNumber("SON-000"+no); receivablesDetailEntity.setSalesmanAssistant("Sp0001"); - receivablesDetailEntity.setSalesmanBoss("qcsupplier001"); - receivablesDetailEntity.setSalesman("qcuser001"); + receivablesDetailEntity.setSalesmanBoss("qcuser004"); + receivablesDetailEntity.setSalesman("Sp0001"); receivablesDetailEntity.setProduceBoss("Sp0002"); receivablesDetailEntity.setEmail("ath_Sp0001@163.com"); receivablesDetailEntity.setWorkNo("work-"+SnowflakeWorker.nextId()); From 09d913bce9286edc7a7676ecdd6f8921cfb8ec9c Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 18 Sep 2023 09:58:27 +0800 Subject: [PATCH 69/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9mapper=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/digiwin/athena/app/kcfr/infra/mapper/ChatFileMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 9f9b77a..f9298ad 100644 --- 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 @@ -2,7 +2,7 @@ - + From 0aaf1e9de82880deca39da741a8ef124fb7a37b5 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 18 Sep 2023 16:37:57 +0800 Subject: [PATCH 70/73] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/app-20230912-ddl.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/sql/app-20230912-ddl.sql b/doc/sql/app-20230912-ddl.sql index 55ec73e..9ae7f32 100644 --- a/doc/sql/app-20230912-ddl.sql +++ b/doc/sql/app-20230912-ddl.sql @@ -139,3 +139,7 @@ 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); From fe3bf998661b970fb2abedcab99188e8ead3316e Mon Sep 17 00:00:00 2001 From: zhenggl Date: Tue, 19 Sep 2023 10:53:58 +0800 Subject: [PATCH 71/73] =?UTF-8?q?feat:=E5=86=BB=E7=BB=93=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/entity/ProductionDetailsEntity.java | 17 +++++++++++++++++ .../production/ProductionCreateEAIService.java | 1 + .../ReceivablesInitialCreateEAIService.java | 4 ++-- doc/sql/app-20230912-ddl.sql | 6 ++++++ 4 files changed, 26 insertions(+), 2 deletions(-) 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 index f180177..cd64455 100644 --- 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 @@ -94,6 +94,23 @@ public class ProductionDetailsEntity extends BaseMgrEntity Date: Tue, 19 Sep 2023 17:17:48 +0800 Subject: [PATCH 72/73] =?UTF-8?q?feat:=E7=94=9F=E4=BA=A7=E4=B8=BB=E7=AE=A1?= =?UTF-8?q?=E7=AD=89=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E5=8C=BA=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receivables/ReceivablesInitialCreateEAIService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index b2fdc4e..fc202f2 100644 --- 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 @@ -141,8 +141,8 @@ public class ReceivablesInitialCreateEAIService extends AbsEAIService { receivablesDetailEntity.setSalesOrder("SO-"+SnowflakeWorker.nextId()); receivablesDetailEntity.setSalesOrderNumber("SON-000"+no); receivablesDetailEntity.setSalesmanAssistant("Sp0001"); - receivablesDetailEntity.setSalesmanBoss("qcsupplier001"); - receivablesDetailEntity.setSalesman("qcuser001"); + receivablesDetailEntity.setSalesmanBoss("qcuser004"); + receivablesDetailEntity.setSalesman("Sp0001"); receivablesDetailEntity.setProduceBoss("Sp0002"); receivablesDetailEntity.setEmail("ath_Sp0001@163.com"); receivablesDetailEntity.setWorkNo("work-"+SnowflakeWorker.nextId()); From 38a79c53014b37ea0218d800d0b55f35de2f2b4f Mon Sep 17 00:00:00 2001 From: dongsk Date: Sat, 23 Sep 2023 11:38:51 +0800 Subject: [PATCH 73/73] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E4=BD=8E=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=9E=8B=E9=A9=B1=E5=8A=A8=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo-athenaopt_backend/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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