Browse Source

智能检料开发

master
clong 1 year ago
parent
commit
eceb78b40b
10 changed files with 46 additions and 15 deletions
  1. +13
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java
  2. +2
    -3
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java
  3. +2
    -1
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java
  4. +1
    -1
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SalesOrderDetailServiceImpl.java
  5. +1
    -1
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicApiServiceImpl.java
  6. +1
    -1
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicEAIServiceImpl.java
  7. +1
    -1
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/SalesOrderDetailEAIServiceImpl.java
  8. +4
    -3
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java
  9. +13
    -3
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java
  10. +8
    -1
      doc/sql/app-20230427-ddl.sql

+ 13
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java View File

@ -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";
}

+ 2
- 3
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java View File

@ -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;
}

+ 2
- 1
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java View File

@ -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<SalesOrderDetailEntity> {
/**
* 订单单号
*/


demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/SalesOrderDetailServiceImpl.java → demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/SalesOrderDetailServiceImpl.java View File

@ -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;

demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java → demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicApiServiceImpl.java View File

@ -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;

demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java → demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/BasicEAIServiceImpl.java View File

@ -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;

demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SalesOrderDetailEAIServiceImpl.java → demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/Impl/SalesOrderDetailEAIServiceImpl.java View File

@ -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;

+ 4
- 3
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java View File

@ -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));
}
}

+ 13
- 3
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java View File

@ -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<String, String> headers, String messageBody) throws Exception {
LambdaQueryWrapper queryWrapper = Wrappers.<SalesOrderDetailEntity>lambdaQuery()
.eq(SalesOrderDetailEntity::getTenantSid,0);
EAIRequest request = EAIRequest.build(messageBody);
// 两次开窗查询
LambdaQueryWrapper queryWrapper;
if(request.getParameter().get(ParameterConstant.OPTION).equals(ParameterConstant.SET_NUMBER)){
queryWrapper = Wrappers.<SalesOrderDetailEntity>lambdaQuery()
.eq(SalesOrderDetailEntity::getTenantSid,0L);
}else{
queryWrapper = Wrappers.<SalesOrderDetailEntity>lambdaQuery()
.eq(SalesOrderDetailEntity::getTenantSid,1L);
}
List<SalesOrderDetailEntity> list = salesOrderDetailService.list(queryWrapper);


+ 8
- 1
doc/sql/app-20230427-ddl.sql View File

@ -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='订单明细';

Loading…
Cancel
Save