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/infra/service/impl/StaffServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/StaffServiceImpl.java similarity index 100% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/StaffServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/StaffServiceImpl.java 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/provider/impl/StaffEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/StaffEAIServiceImpl.java similarity index 100% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/StaffEAIServiceImpl.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/StaffEAIServiceImpl.java 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/demo-athenaopt_backend/develop/src/test/java/com/digiwin/athena/app/provider/impl/temp.txt b/demo-athenaopt_backend/develop/src/test/java/com/digiwin/athena/app/provider/Impl/temp.txt similarity index 100% rename from demo-athenaopt_backend/develop/src/test/java/com/digiwin/athena/app/provider/impl/temp.txt rename to demo-athenaopt_backend/develop/src/test/java/com/digiwin/athena/app/provider/Impl/temp.txt 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='订单明细';