From eceb78b40b1e65578ed099beb7bea2a64ed8f335 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 28 Apr 2023 16:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=A3=80=E6=96=99=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/constant/ParameterConstant.java | 13 +++++++++++++ .../app/infra/dto/order/SalesOrderDetailDTO.java | 5 ++--- .../app/infra/entity/SalesOrderDetailEntity.java | 3 ++- .../SalesOrderDetailServiceImpl.java | 2 +- .../{impl => Impl}/BasicApiServiceImpl.java | 2 +- .../{impl => Impl}/BasicEAIServiceImpl.java | 2 +- .../SalesOrderDetailEAIServiceImpl.java | 2 +- .../order/SalesOrderDetailCreateEAIService.java | 7 ++++--- .../order/SalesOrderDetailGetEAIService.java | 16 +++++++++++++--- doc/sql/app-20230427-ddl.sql | 9 ++++++++- 10 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/{impl => Impl}/SalesOrderDetailServiceImpl.java (91%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/{impl => Impl}/BasicApiServiceImpl.java (97%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/{impl => Impl}/BasicEAIServiceImpl.java (96%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/{impl => Impl}/SalesOrderDetailEAIServiceImpl.java (96%) 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 new file mode 100644 index 0000000..a907d2d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java @@ -0,0 +1,13 @@ +package com.digiwin.athena.app.infra.constant; + +/** + * @author CR-7 + * create: 2023-04-28 13:33 + * Description: 参数常量类 + */ +public class ParameterConstant { + + public static final String OPTION = "option"; + + public static final String SET_NUMBER = "1"; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java index f8b2ca0..ad02ef4 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java @@ -71,7 +71,6 @@ public class SalesOrderDetailDTO { @SerializedName(value = "storage_spaces_name") private String storageSpacesName; - /** * 1.未检料;2.已检料 */ @@ -81,6 +80,6 @@ public class SalesOrderDetailDTO { /** * 租户sid */ - @SerializedName(value = "tenantSid") - private Integer tenantSid; + @SerializedName(value = "tenantsid") + private Integer tenantsid; } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java index 454294d..4fe44cf 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java @@ -18,9 +18,10 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor @Builder -@TableName(value = "sales_order_detail", autoResultMap = true) +@TableName(value = "cim_sales_order_detail", autoResultMap = true) public class SalesOrderDetailEntity extends BaseMgrEntity { + /** * 订单单号 */ diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/SalesOrderDetailServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SalesOrderDetailServiceImpl.java similarity index 91% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/SalesOrderDetailServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SalesOrderDetailServiceImpl.java index cb3a70d..5bed3f7 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/SalesOrderDetailServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SalesOrderDetailServiceImpl.java @@ -1,4 +1,4 @@ -package com.digiwin.athena.app.infra.service.impl; +package com.digiwin.athena.app.infra.service.Impl; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; import com.digiwin.athena.app.infra.repository.SalesOrderDetailRepository; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicApiServiceImpl.java similarity index 97% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicApiServiceImpl.java index 5d2e172..0ff4a68 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicApiServiceImpl.java @@ -6,7 +6,7 @@ * History: * 作者姓名 --修改时间 --版本号--描述 */ -package com.digiwin.athena.app.provider.impl; +package com.digiwin.athena.app.provider.Impl; import com.alibaba.fastjson.JSON; import com.digiwin.app.service.DWServiceContext; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicEAIServiceImpl.java similarity index 96% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicEAIServiceImpl.java index 4b51458..2f1325a 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicEAIServiceImpl.java @@ -5,7 +5,7 @@ * History: * 作者姓名 --修改时间 --版本号--描述 */ -package com.digiwin.athena.app.provider.impl; +package com.digiwin.athena.app.provider.Impl; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.provider.BasicEAIService; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SalesOrderDetailEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/SalesOrderDetailEAIServiceImpl.java similarity index 96% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SalesOrderDetailEAIServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/SalesOrderDetailEAIServiceImpl.java index 25905c6..d2471de 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SalesOrderDetailEAIServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/SalesOrderDetailEAIServiceImpl.java @@ -1,4 +1,4 @@ -package com.digiwin.athena.app.provider.impl; +package com.digiwin.athena.app.provider.Impl; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.provider.SalesOrderDetailEAIService; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java index 0fe645f..3843b64 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java @@ -1,5 +1,6 @@ package com.digiwin.athena.app.service.order; +import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.dto.order.SalesOrderDetailDTO; @@ -14,7 +15,6 @@ 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; @@ -47,12 +47,13 @@ public class SalesOrderDetailCreateEAIService extends AbsEAIService { SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); BeanUtils.copyProperties(assemble,salesOrderDetailEntity); salesOrderDetailEntity.setId(SnowflakeWorker.nextId()); - salesOrderDetailEntity.setTenantSid(null); + salesOrderDetailEntity.setTenantSid(1L); + salesOrderDetailEntity.setStatus(1); return salesOrderDetailEntity; }).collect(Collectors.toList()); salesOrderDetailService.saveBatch(salesOrderDetailEntityList); - return EAIUtil.buildEAIResult(new HashMap<>()); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("sales_order_detail",salesOrderDetailEntityList)); } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java index 87ba15e..5f983cf 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java @@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSONObject; 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.constant.ParameterConstant; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; import com.digiwin.athena.app.infra.service.SalesOrderDetailService; +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; @@ -27,7 +29,6 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { @Resource SalesOrderDetailService salesOrderDetailService; - @Override public String getServiceName() { return SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_GET; @@ -35,8 +36,17 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() - .eq(SalesOrderDetailEntity::getTenantSid,0); + EAIRequest request = EAIRequest.build(messageBody); + + // 两次开窗查询 + LambdaQueryWrapper queryWrapper; + if(request.getParameter().get(ParameterConstant.OPTION).equals(ParameterConstant.SET_NUMBER)){ + queryWrapper = Wrappers.lambdaQuery() + .eq(SalesOrderDetailEntity::getTenantSid,0L); + }else{ + queryWrapper = Wrappers.lambdaQuery() + .eq(SalesOrderDetailEntity::getTenantSid,1L); + } List list = salesOrderDetailService.list(queryWrapper); diff --git a/doc/sql/app-20230427-ddl.sql b/doc/sql/app-20230427-ddl.sql index 647d39b..0808475 100644 --- a/doc/sql/app-20230427-ddl.sql +++ b/doc/sql/app-20230427-ddl.sql @@ -11,6 +11,13 @@ create table `sales_order_detail` ( `warehouse_name` varchar(255) default null comment '仓库', `storage_spaces_name` varchar(255) default null comment '储位', `status` int(1) default null comment '1.未检料;2.已检料', - `tenantSid` int(1) default null comment '租户sid', + `tenantsid` int(1) 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 comment='订单明细';