From 10d68158b8b87f46432347fb457dc605410803a3 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 28 Apr 2023 09:11:03 +0800 Subject: [PATCH 01/90] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=A3=80=E6=96=99?= =?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/dto/order/SalesOrderDetailDTO.java | 86 +++++++++++++++++++ .../infra/entity/SalesOrderDetailEntity.java | 79 +++++++++++++++++ .../SalesOrderDetailRepository.java | 8 ++ .../service/SalesOrderDetailService.java | 7 ++ .../impl/SalesOrderDetailServiceImpl.java | 16 ++++ .../provider/SalesOrderDetailEAIService.java | 41 +++++++++ .../impl/SalesOrderDetailEAIServiceImpl.java | 35 ++++++++ .../SalesOrderDetailCreateEAIService.java | 58 +++++++++++++ .../order/SalesOrderDetailGetEAIService.java | 45 ++++++++++ .../SalesOrderDetailUpdateEAIService.java | 56 ++++++++++++ .../service/order/SalesOrderDetailUtil.java | 24 ++++++ doc/sql/app-20230427-ddl.sql | 16 ++++ 12 files changed, 471 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SalesOrderDetailService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/SalesOrderDetailServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SalesOrderDetailEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUtil.java create mode 100644 doc/sql/app-20230427-ddl.sql 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 new file mode 100644 index 0000000..f8b2ca0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java @@ -0,0 +1,86 @@ +package com.digiwin.athena.app.infra.dto.order; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author CR-7 + * create: 2023-04-27 14:41 + * Description: + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class SalesOrderDetailDTO { + + /** + * 主键id + */ + @SerializedName(value = "id") + private Long id; + + /** + * 订单单号 + */ + @SerializedName(value = "doc_no") + private String docNo; + + /** + * 序号 + */ + @SerializedName(value = "doc_seq") + private String docSeq; + + /** + * 品号 + */ + @SerializedName(value = "item_no") + private String itemNo; + + /** + * 品名 + */ + @SerializedName(value = "item_name") + private String itemName; + + /** + * 规格 + */ + @SerializedName(value = "item_spec") + private String itemSpec; + + /** + * 数量 + */ + @SerializedName(value = "qty") + private Integer qty; + + /** + * 仓库 + */ + @SerializedName(value = "warehouse_name") + private String warehouseName; + + /** + * 储位 + */ + @SerializedName(value = "storage_spaces_name") + private String storageSpacesName; + + + /** + * 1.未检料;2.已检料 + */ + @SerializedName(value = "status") + private Integer status; + + /** + * 租户sid + */ + @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 new file mode 100644 index 0000000..454294d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java @@ -0,0 +1,79 @@ +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; + +/** + * @author CR-7 + * create: 2023-04-27 14:36 + * Description: + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "sales_order_detail", autoResultMap = true) +public class SalesOrderDetailEntity extends BaseMgrEntity { + + /** + * 订单单号 + */ + @SerializedName(value = "doc_no") + private String docNo; + + /** + * 序号 + */ + @SerializedName(value = "doc_seq") + private String docSeq; + + /** + * 品号 + */ + @SerializedName(value = "item_no") + private String itemNo; + + /** + * 品名 + */ + @SerializedName(value = "item_name") + private String itemName; + + /** + * 规格 + */ + @SerializedName(value = "item_spec") + private String itemSpec; + + /** + * 数量 + */ + @SerializedName(value = "qty") + private Integer qty; + + /** + * 仓库 + */ + @SerializedName(value = "warehouse_name") + private String warehouseName; + + /** + * 储位 + */ + @SerializedName(value = "storage_spaces_name") + private String storageSpacesName; + + + /** + * 1.未检料;2.已检料 + */ + @SerializedName(value = "status") + private Integer status; + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java new file mode 100644 index 0000000..da2fb86 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java @@ -0,0 +1,8 @@ +package com.digiwin.athena.app.infra.repository; + + +import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +public interface SalesOrderDetailRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SalesOrderDetailService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SalesOrderDetailService.java new file mode 100644 index 0000000..7b07ae1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/SalesOrderDetailService.java @@ -0,0 +1,7 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +public interface SalesOrderDetailService extends IBaseService { +} 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 new file mode 100644 index 0000000..cb3a70d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/SalesOrderDetailServiceImpl.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.infra.service.impl; + +import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; +import com.digiwin.athena.app.infra.repository.SalesOrderDetailRepository; +import com.digiwin.athena.app.infra.service.SalesOrderDetailService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @author CR-7 + * create: 2023-04-27 14:54 + * Description: + */ +@Service +public class SalesOrderDetailServiceImpl extends AbsBaseService implements SalesOrderDetailService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java new file mode 100644 index 0000000..e784927 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java @@ -0,0 +1,41 @@ +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.order.SalesOrderDetailUtil; + +import java.util.Map; + +public interface SalesOrderDetailEAIService extends DWService { + + /** + * 检料订单查询 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + /** + * 检料订单创建 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; + + /** + * 检料订单创建 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; +} 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 new file mode 100644 index 0000000..25905c6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/SalesOrderDetailEAIServiceImpl.java @@ -0,0 +1,35 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.SalesOrderDetailEAIService; +import com.digiwin.athena.app.service.order.SalesOrderDetailUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @author CR-7 + * create: 2023-04-27 14:48 + * Description: + */ +public class SalesOrderDetailEAIServiceImpl implements SalesOrderDetailEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_GET,headers,messageBody); + } + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_CREATE,headers,messageBody); + } + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_UPDATE,headers,messageBody); + } +} 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 new file mode 100644 index 0000000..0fe645f --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java @@ -0,0 +1,58 @@ +package com.digiwin.athena.app.service.order; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.dto.order.SalesOrderDetailDTO; +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 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-04-27 15:35 + * Description: + */ +@Log4j2 +@Service +public class SalesOrderDetailCreateEAIService extends AbsEAIService { + + @Resource + SalesOrderDetailService salesOrderDetailService; + + + @Override + public String getServiceName() { + return SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + // 入参反序列化 + EAIRequest request = new EAIRequest(messageBody); + List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); + + List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ + SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); + BeanUtils.copyProperties(assemble,salesOrderDetailEntity); + salesOrderDetailEntity.setId(SnowflakeWorker.nextId()); + salesOrderDetailEntity.setTenantSid(null); + return salesOrderDetailEntity; + }).collect(Collectors.toList()); + + salesOrderDetailService.saveBatch(salesOrderDetailEntityList); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} 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 new file mode 100644 index 0000000..87ba15e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java @@ -0,0 +1,45 @@ +package com.digiwin.athena.app.service.order; + +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.entity.SalesOrderDetailEntity; +import com.digiwin.athena.app.infra.service.SalesOrderDetailService; +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.List; +import java.util.Map; + +/** + * @author CR-7 + * create: 2023-04-27 15:35 + * Description: + */ +@Log4j2 +@Service +public class SalesOrderDetailGetEAIService extends AbsEAIService { + + @Resource + SalesOrderDetailService salesOrderDetailService; + + + @Override + public String getServiceName() { + return SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() + .eq(SalesOrderDetailEntity::getTenantSid,0); + + List list = salesOrderDetailService.list(queryWrapper); + + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("sales_order_detail",list)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java new file mode 100644 index 0000000..c8e92f3 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -0,0 +1,56 @@ +package com.digiwin.athena.app.service.order; + + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.dto.order.SalesOrderDetailDTO; +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; +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-04-27 15:35 + * Description: + */ +@Log4j2 +@Service +public class SalesOrderDetailUpdateEAIService extends AbsEAIService { + + @Resource + SalesOrderDetailService salesOrderDetailService; + + @Override + public String getServiceName() { + return SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_UPDATE; + } + + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + // 入参反序列化 + EAIRequest request = new EAIRequest(messageBody); + List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); + + List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ + SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); + salesOrderDetailEntity.setId(assemble.getId()); + salesOrderDetailEntity.setStatus(2); + return salesOrderDetailEntity; + }).collect(Collectors.toList()); + + salesOrderDetailService.updateBatchById(salesOrderDetailEntityList); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUtil.java new file mode 100644 index 0000000..d005c43 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUtil.java @@ -0,0 +1,24 @@ +package com.digiwin.athena.app.service.order; + +/** + * @author CR-7 + * create: 2023-04-27 14:45 + * Description: + */ +public class SalesOrderDetailUtil { + + /** + * 捡料订单查询 + */ + public static final String DEMO_SO_ITEM_INFO_GET = "demo.so.item.card.info.get"; + + /** + * 捡料订单创建 + */ + public static final String DEMO_SO_ITEM_INFO_CREATE = "demo.so.item.card.info.create"; + + /** + * 捡料订单修改 + */ + public static final String DEMO_SO_ITEM_INFO_UPDATE = "demo.so.item.card.info.update"; +} diff --git a/doc/sql/app-20230427-ddl.sql b/doc/sql/app-20230427-ddl.sql new file mode 100644 index 0000000..647d39b --- /dev/null +++ b/doc/sql/app-20230427-ddl.sql @@ -0,0 +1,16 @@ + + -- 订单明细表 +create table `sales_order_detail` ( + `id` bigint(20) not null comment '主键', + `doc_no` varchar(12) default null comment '订单单号', + `doc_seq` varchar(255) default null comment '序号', + `item_no` varchar(12) default null comment '品号', + `item_name` varchar(255) default null comment '品名', + `item_spec` varchar(255) default null comment '规格', + `qty` int(4) default null comment '数量', + `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', + primary key (`id`) +) engine=innodb default charset=utf8mb4 comment='订单明细'; From 0b78661bbdde2ee0b22105909eac677f36bd73f2 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 28 Apr 2023 12:02:35 +0800 Subject: [PATCH 02/90] =?UTF-8?q?=E6=96=B0=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E8=81=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/common/enums/StatusEnums.java | 26 +++++ .../infra/common/enums/TabStatusEnums.java | 25 +++++ .../app/infra/common/utils/BeanCopyUtil.java | 66 +++++++++++ .../app/infra/common/utils/TransferUtil.java | 105 ++++++++++++++++++ .../athena/app/infra/dto/order/StaffDTO.java | 73 ++++++++++++ .../athena/app/infra/entity/StaffEntity.java | 69 ++++++++++++ .../app/infra/repository/StaffRepository.java | 12 ++ .../app/infra/service/StaffService.java | 7 ++ .../infra/service/impl/StaffServiceImpl.java | 16 +++ .../athena/app/provider/StaffEAIService.java | 55 +++++++++ .../provider/impl/StaffEAIServiceImpl.java | 40 +++++++ .../service/staff/StaffCreateEAIService.java | 69 ++++++++++++ .../app/service/staff/StaffGetEAIService.java | 60 ++++++++++ .../service/staff/StaffQueryEAIService.java | 42 +++++++ .../service/staff/StaffUpdateEAIService.java | 47 ++++++++ .../athena/app/service/staff/StaffUtil.java | 27 +++++ 16 files changed, 739 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/StatusEnums.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/TabStatusEnums.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/BeanCopyUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/TransferUtil.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/StaffService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/StaffServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/StaffEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/StatusEnums.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/StatusEnums.java new file mode 100644 index 0000000..2191e4c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/StatusEnums.java @@ -0,0 +1,26 @@ +package com.digiwin.athena.app.infra.common.enums; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public enum StatusEnums { + + + //待报道 + TOBEREPORTED(1), + //已完成 + REPORTED(2), + //未报道 + NOSHOW(3); + + private final Integer value; + + StatusEnums(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/TabStatusEnums.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/TabStatusEnums.java new file mode 100644 index 0000000..15be41b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/TabStatusEnums.java @@ -0,0 +1,25 @@ +package com.digiwin.athena.app.infra.common.enums; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public enum TabStatusEnums { + //未设定 + NOSET(0), + //待处理 + PENDING(1), + //已完成 + COMPLETED(2); + + private final Integer value; + + TabStatusEnums(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/BeanCopyUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/BeanCopyUtil.java new file mode 100644 index 0000000..52ad492 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/BeanCopyUtil.java @@ -0,0 +1,66 @@ +package com.digiwin.athena.app.infra.common.utils; + +import com.digiwin.app.container.exceptions.DWRuntimeException; +import net.sf.cglib.beans.BeanCopier; +import net.sf.cglib.beans.BeanMap; +import org.springframework.objenesis.ObjenesisStd; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public final class BeanCopyUtil { + private BeanCopyUtil() { + } + + private static ThreadLocal objenesisStdThreadLocal = ThreadLocal.withInitial(ObjenesisStd::new); + private static ConcurrentHashMap, ConcurrentHashMap, BeanCopier>> cache = new ConcurrentHashMap<>(); + + + public static T copy(Object source, Class target) { + return copy(source, objenesisStdThreadLocal.get().newInstance(target)); + } + + public static T copy(Object source, T target) { + BeanCopier beanCopier = getCacheBeanCopier(source.getClass(), target.getClass()); + beanCopier.copy(source, target, null); + return target; + } + + public static List copyList(List sources, Class target) { + if (sources.isEmpty()) { + return Collections.emptyList(); + } + + ArrayList list = new ArrayList<>(sources.size()); + ObjenesisStd objenesisStd = objenesisStdThreadLocal.get(); + for (Object source : sources) { + if (source == null) { + throw new DWRuntimeException("转换异常"); + } + T newInstance = objenesisStd.newInstance(target); + BeanCopier beanCopier = getCacheBeanCopier(source.getClass(), target); + beanCopier.copy(source, newInstance, null); + list.add(newInstance); + } + return list; + } + + public static T mapToBean(Map source, Class target) { + T bean = objenesisStdThreadLocal.get().newInstance(target); + BeanMap beanMap = BeanMap.create(bean); + beanMap.putAll(source); + return bean; + } + + public static Map beanToMap(T source) { + return BeanMap.create(source); + } + + private static BeanCopier getCacheBeanCopier(Class source, Class target) { + ConcurrentHashMap, BeanCopier> copierConcurrentHashMap = cache.computeIfAbsent(source, aClass -> new ConcurrentHashMap<>(16)); + return copierConcurrentHashMap.computeIfAbsent(target, aClass -> BeanCopier.create(source, target, false)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/TransferUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/TransferUtil.java new file mode 100644 index 0000000..e6d7d35 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/utils/TransferUtil.java @@ -0,0 +1,105 @@ +package com.digiwin.athena.app.infra.common.utils; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.log4j.Log4j; +import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author: xieps + * @Date: 2023/3/21 13:49 + * @Version 1.0 + * @Description + */ +@Log4j +public class TransferUtil { + + + public static final ObjectMapper objectMapper = new ObjectMapper(); + + + public static List string2List(String messageBody, Class clazz, String key) { + // 获取请求参数 + JSONObject parameter = TransferUtil.getAthenaParameter(messageBody); + return TransferUtil.convertString2List(parameter.toJSONString(), key, clazz); + } + + /** + * String 转model List + * @param param + * @param key + * @param clazz + * @param + * @return + */ + public static List convertString2List(String param, String key, Class clazz) { + Map paramMap = str2Map(param); + return getMapTs(paramMap, key, clazz); + } + + + + + /** + * String 转 map + * + * @param param + * @return + * @throws Exception + */ + public static Map str2Map(String param) { + if (StringUtils.isEmpty(param)) { + return new HashMap<>(); + } + try { + return objectMapper.readValue(param, new TypeReference>() { + }); + } catch (IOException e) { + log.error(e.getMessage()); + return new HashMap<>(); + } + } + + + /** + * map 取 model list + * + * @param map + * @return + * @throws Exception + */ + public static List getMapTs(Map map, String key, Class clazz) { + if (!MapUtils.isEmpty(map)) { + Object obj = map.get(key); + if (obj != null) { + ObjectMapper mapper = new ObjectMapper(); + try { + String objStr = mapper.writeValueAsString(obj); + JavaType type = mapper.getTypeFactory().constructCollectionType(List.class, clazz); + return mapper.readValue(objStr, type); + } catch (Exception ex) { + log.error(ex.getMessage()); + return new ArrayList<>(); + } + } + } + return new ArrayList<>(); + } + + + public static JSONObject getAthenaParameter(String messageBody){ + JSONObject stdData = JSONObject.parseObject(messageBody).getJSONObject("std_data"); + JSONObject parameter = stdData.getJSONObject("parameter"); + return parameter; + } + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java new file mode 100644 index 0000000..c1cf70a --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java @@ -0,0 +1,73 @@ +package com.digiwin.athena.app.infra.dto.order; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 人资报道对象 ca_cim_staff + * + * @author zhenggl + * @date 2023-04-28 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class StaffDTO +{ + + @SerializedName("id") + private Long id; + + /** 员工编号 */ + @SerializedName("employee_no") + private String employeeNo; + + /** 员工名称 */ + @SerializedName("employee_name") + private String employeeName; + + /** 员工英文名称 */ + @SerializedName("en_employee_name") + private String enEmployeeName; + + /** 手机号码 */ + @SerializedName("mobile_no") + private Long mobileNo; + + /** 电子邮件 */ + @SerializedName("email") + private String email; + + /** 状态 */ + @SerializedName("status") + private Integer status = 1; + + /** 数据状态 */ + @SerializedName("tab_status") + private Integer tabStatus = 0; + + /** 报道日期 */ + @SerializedName("register_date") + private Date registerDate; + + + /** 时间戳 */ + @SerializedName("timestamp") + private String timestamp; + + //==========冗余============== + @SerializedName("register_personnel_id") + public Long registerPersonnelId; + + + public StaffDTO(String employeeNo, Long registerPersonnelId) { + this.employeeNo = employeeNo; + this.registerPersonnelId = registerPersonnelId; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java new file mode 100644 index 0000000..ea7d5ff --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java @@ -0,0 +1,69 @@ +package com.digiwin.athena.app.infra.entity; + +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; + +/** + * 人资报道对象 ca_cim_staff + * + * @author zhenggl + * @date 2023-04-28 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "ca_cim_staff", autoResultMap = true) +public class StaffEntity extends BaseMgrEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 员工编号 */ + @SerializedName("employee_no") + private String employeeNo; + + /** 员工名称 */ + @SerializedName("employee_name") + private String employeeName; + + /** 员工英文名称 */ + @SerializedName("en_employee_name") + private String enEmployeeName; + + /** 手机号码 */ + @SerializedName("mobile_no") + private Long mobileNo; + + /** 电子邮件 */ + @SerializedName("email") + private String email; + + /** 状态 */ + @SerializedName("status") + private Integer status; + + /** 数据状态 */ + @SerializedName("tab_status") + private Integer tabStatus; + + /** 报道日期 */ + @SerializedName("register_date") + private Date registerDate; + + + /** 时间戳 */ + @SerializedName("timestamp") + private String timestamp; + + +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java new file mode 100644 index 0000000..321d132 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java @@ -0,0 +1,12 @@ +package com.digiwin.athena.app.infra.repository; + + +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public interface StaffRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/StaffService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/StaffService.java new file mode 100644 index 0000000..bc6192e --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/StaffService.java @@ -0,0 +1,7 @@ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +public interface StaffService extends IBaseService { +} 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 new file mode 100644 index 0000000..58c7eaa --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/impl/StaffServiceImpl.java @@ -0,0 +1,16 @@ +package com.digiwin.athena.app.infra.service.impl; + +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.app.infra.repository.StaffRepository; +import com.digiwin.athena.app.infra.service.StaffService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; + +/** + * @author zhenggl + * create: 2023-04-28 + * Description: + */ +@Service +public class StaffServiceImpl extends AbsBaseService implements StaffService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java new file mode 100644 index 0000000..5fa1639 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java @@ -0,0 +1,55 @@ +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.staff.StaffUtil; + +import java.util.Map; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public interface StaffEAIService extends DWService { + + /** + * 新人报道修改 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE) + DWEAIResult update(Map headers, String messageBody) throws Exception; + + /** + * 新人报道侦测 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; + + /** + * 新人报道查询 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY) + DWEAIResult query(Map headers, String messageBody) throws Exception; + + /** + * 新人报道创建 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE) + DWEAIResult create(Map headers, String messageBody) throws Exception; +} 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 new file mode 100644 index 0000000..688db87 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/StaffEAIServiceImpl.java @@ -0,0 +1,40 @@ +package com.digiwin.athena.app.provider.impl; + + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.StaffEAIService; +import com.digiwin.athena.app.service.staff.StaffUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public class StaffEAIServiceImpl implements StaffEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult update(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE,headers,messageBody); + } + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET,headers,messageBody); + } + + @Override + public DWEAIResult query(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY,headers,messageBody); + } + + @Override + public DWEAIResult create(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE,headers,messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java new file mode 100644 index 0000000..80e844c --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -0,0 +1,69 @@ +package com.digiwin.athena.app.service.staff; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.digiwin.app.container.exceptions.DWRuntimeException; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.utils.BeanCopyUtil; +import com.digiwin.athena.app.infra.dto.order.StaffDTO; +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.app.infra.repository.StaffRepository; +import com.digiwin.athena.app.infra.service.StaffService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import org.springframework.util.CollectionUtils; + +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/4/28 + */ +public class StaffCreateEAIService extends AbsEAIService { + + @Resource + private StaffRepository staffRepository; + + @Resource + private StaffService staffService; + + @Override + public String getServiceName() { + return StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //反序列化字段 + EAIRequest request = new EAIRequest(messageBody); + List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + //判断编号跟邮箱是否存在 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.or(queryWrapperInner -> { + for (StaffDTO staffDTO : staffList) { + queryWrapperInner.or( + wrapper->wrapper + .eq(StaffEntity::getEmployeeNo,staffDTO.getEmployeeNo()) + ); + queryWrapperInner.or( + wrapper->wrapper + .eq(StaffEntity::getEmail,staffDTO.getEmail()) + ); + } + }); + List staffEntities = staffRepository.selectList(lmq); + if (!CollectionUtils.isEmpty(staffEntities)){ + throw new DWRuntimeException("员工编号或邮箱重复"); + } + List staffEntityList = BeanCopyUtil.copyList(staffList, StaffEntity.class); + staffService.saveBatch(staffEntityList); + List collect = staffEntities.stream().map(item -> new StaffDTO(item.getEmployeeNo(), item.getId())).collect(Collectors.toList()); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",collect)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java new file mode 100644 index 0000000..0aee092 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -0,0 +1,60 @@ +package com.digiwin.athena.app.service.staff; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.app.infra.repository.StaffRepository; +import com.digiwin.athena.app.infra.service.StaffService; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public class StaffGetEAIService extends AbsEAIService { + + @Resource + private StaffRepository staffRepository; + + @Resource + private StaffService staffService; + + @Override + public String getServiceName() { + return StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //查询所有tab_status=0的数据然后把他们全部修改为1 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + lmq.eq(StaffEntity::getTabStatus, TabStatusEnums.NOSET.getValue()); + List staffEntities = staffRepository.selectList(lmq); + if (!CollectionUtils.isEmpty(staffEntities)){ + List idList = staffEntities.stream().map(StaffEntity::getId).collect(Collectors.toList()); + LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); + lmu.set(StaffEntity::getTabStatus,TabStatusEnums.PENDING); + lmu.in(StaffEntity::getId,idList); + staffService.update(lmu); + //修改查询到的参数 + staffEntities.forEach(item ->{ + item.setTabStatus(TabStatusEnums.PENDING.getValue()); + }); + } + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffEntities)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java new file mode 100644 index 0000000..ee4ffd6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java @@ -0,0 +1,42 @@ +package com.digiwin.athena.app.service.staff; + +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.enums.TabStatusEnums; +import com.digiwin.athena.app.infra.dto.order.StaffDTO; +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.app.infra.repository.StaffRepository; +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 javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public class StaffQueryEAIService extends AbsEAIService { + + @Resource + private StaffRepository staffRepository; + + @Override + public String getServiceName() { + return StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + lmq.eq(StaffEntity::getTabStatus, TabStatusEnums.NOSET.getValue()); + List staffEntities = staffRepository.selectList(lmq); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffEntities)); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java new file mode 100644 index 0000000..b2dda3d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -0,0 +1,47 @@ +package com.digiwin.athena.app.service.staff; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.app.infra.service.StaffService; +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.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public class StaffUpdateEAIService extends AbsEAIService { + + @Resource + private StaffService staffService; + + @Override + public String getServiceName() { + return StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + //反序列化字段 + EAIRequest request = new EAIRequest(messageBody); + List staffList = request.getObject("wait_register_personnel", new ArrayList().getClass()); + if (!CollectionUtils.isEmpty(staffList)){ + LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); + lmu.set(StaffEntity::getTabStatus, TabStatusEnums.COMPLETED.getValue()); + lmu.in(StaffEntity::getId,staffList); + staffService.update(lmu); + } + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java new file mode 100644 index 0000000..ccbc564 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java @@ -0,0 +1,27 @@ +package com.digiwin.athena.app.service.staff; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.athena.app.infra.dto.order.StaffDTO; + +import java.util.List; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public class StaffUtil { + /** + * 新人报道增改查 + * @Author zhenggl + * @Param + * @return + * @Throw + */ + public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE = "demo.wait.register.personnel.info.create"; + public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE = "demo.wait.register.personnel.info.update"; + public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET = "demo.wait.register.personnel.info.get"; + public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY = "demo.wait.register.personnel.info.query"; + + public static final TypeReference> LIST_DTO_STAFF = new TypeReference>() { + }; +} From e720e9c70d8d56200f4e95fc44cad2d310e87976 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 28 Apr 2023 13:28:50 +0800 Subject: [PATCH 03/90] =?UTF-8?q?=E6=96=B0=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E8=81=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digiwin/athena/app/service/staff/StaffCreateEAIService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index 80e844c..eca98fd 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -12,11 +12,9 @@ import com.digiwin.athena.app.infra.service.StaffService; import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.EAIUtil; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; -import com.digiwin.athena.opt.common.security.SecurityUtil; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; From 30452789f4b021df01e2421f6ec8a87c4632af38 Mon Sep 17 00:00:00 2001 From: robot Date: Fri, 28 Apr 2023 08:34:30 +0000 Subject: [PATCH 04/90] auto increment build version 1000 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index cf5106d..83b33d2 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -999 \ No newline at end of file +1000 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 05/90] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=A3=80=E6=96=99?= =?UTF-8?q?=E5=BC=80=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='订单明细'; From 2ca999bbd49de118807149f2acccfa6cd67f1c63 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 28 Apr 2023 17:08:27 +0800 Subject: [PATCH 06/90] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=A3=80=E6=96=99?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/digiwin/athena/app/provider/{impl => Impl}/temp.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename demo-athenaopt_backend/develop/src/test/java/com/digiwin/athena/app/provider/{impl => Impl}/temp.txt (100%) 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 From 1d5fe86cf490705873869f9c2338f8fde9f2a8e0 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 28 Apr 2023 17:48:22 +0800 Subject: [PATCH 07/90] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digiwin/athena/app/provider/Impl/BasicApiServiceImpl.java | 2 +- .../digiwin/athena/app/provider/Impl/BasicEAIServiceImpl.java | 2 +- .../app/provider/Impl/SalesOrderDetailEAIServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 index 0ff4a68..5d2e172 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 index 2f1325a..4b51458 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 index d2471de..25905c6 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; From 64c566be078f307538c6e16cefb9c79b61b72b27 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 28 Apr 2023 18:37:30 +0800 Subject: [PATCH 08/90] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/provider/{Impl => impl}/BasicApiServiceImpl.java | 2 +- .../athena/app/provider/{Impl => impl}/BasicEAIServiceImpl.java | 2 +- .../provider/{Impl => impl}/SalesOrderDetailEAIServiceImpl.java | 2 +- .../athena/app/provider/{Impl => impl}/StaffEAIServiceImpl.java | 0 .../com/digiwin/athena/app/provider/{Impl => impl}/temp.txt | 0 5 files changed, 3 insertions(+), 3 deletions(-) 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%) rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/{Impl => impl}/StaffEAIServiceImpl.java (100%) rename demo-athenaopt_backend/develop/src/test/java/com/digiwin/athena/app/provider/{Impl => impl}/temp.txt (100%) 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 0ff4a68..5d2e172 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 2f1325a..4b51458 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 d2471de..25905c6 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/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 From 4e778805ffdfbd49deb8450c68933c5dc95968fe Mon Sep 17 00:00:00 2001 From: robot Date: Fri, 28 Apr 2023 10:42:58 +0000 Subject: [PATCH 09/90] auto increment build version 1001 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 83b33d2..dd11724 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1000 +1001 From 42c271470a749100a393e7702589bbb4ac72fca6 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 28 Apr 2023 20:51:32 +0800 Subject: [PATCH 10/90] =?UTF-8?q?=E6=96=B0=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E8=81=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/common/enums/OptionEnums.java | 24 ++++++ .../infra/dto/{order => staff}/StaffDTO.java | 11 +-- .../athena/app/infra/entity/StaffEntity.java | 6 +- .../athena/app/infra/mapper/StaffMapper.xml | 58 ++++++++++++++ .../app/infra/repository/StaffRepository.java | 7 ++ .../athena/app/provider/StaffEAIService.java | 11 +-- .../provider/impl/StaffEAIServiceImpl.java | 4 - .../service/staff/StaffCreateEAIService.java | 26 +++--- .../app/service/staff/StaffGetEAIService.java | 79 +++++++++++++++---- .../service/staff/StaffQueryEAIService.java | 42 ---------- .../service/staff/StaffUpdateEAIService.java | 44 +++++++++-- .../athena/app/service/staff/StaffUtil.java | 3 +- 12 files changed, 213 insertions(+), 102 deletions(-) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/OptionEnums.java rename demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/{order => staff}/StaffDTO.java (79%) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/OptionEnums.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/OptionEnums.java new file mode 100644 index 0000000..8c55266 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/common/enums/OptionEnums.java @@ -0,0 +1,24 @@ +package com.digiwin.athena.app.infra.common.enums; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +public enum OptionEnums { + //任务卡 + TASK("task"), + //界面 + BASIC("basic"), + //流程 + FLOW("flow"); + + private final String value; + + OptionEnums(String value) { + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java similarity index 79% rename from demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java rename to demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java index c1cf70a..e70936c 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/StaffDTO.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java @@ -1,4 +1,4 @@ -package com.digiwin.athena.app.infra.dto.order; +package com.digiwin.athena.app.infra.dto.staff; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; @@ -38,7 +38,7 @@ public class StaffDTO /** 手机号码 */ @SerializedName("mobile_no") - private Long mobileNo; + private String mobileNo; /** 电子邮件 */ @SerializedName("email") @@ -61,13 +61,10 @@ public class StaffDTO @SerializedName("timestamp") private String timestamp; - //==========冗余============== - @SerializedName("register_personnel_id") - public Long registerPersonnelId; - public StaffDTO(String employeeNo, Long registerPersonnelId) { + public StaffDTO(String employeeNo, Long id) { this.employeeNo = employeeNo; - this.registerPersonnelId = registerPersonnelId; + this.id = id; } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java index ea7d5ff..0c2fa2e 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java @@ -42,7 +42,7 @@ public class StaffEntity extends BaseMgrEntity /** 手机号码 */ @SerializedName("mobile_no") - private Long mobileNo; + private String mobileNo; /** 电子邮件 */ @SerializedName("email") @@ -50,11 +50,11 @@ public class StaffEntity extends BaseMgrEntity /** 状态 */ @SerializedName("status") - private Integer status; + private Integer status = 1; /** 数据状态 */ @SerializedName("tab_status") - private Integer tabStatus; + private Integer tabStatus = 0; /** 报道日期 */ @SerializedName("register_date") diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml new file mode 100644 index 0000000..5ca9738 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, employee_no, employee_name, en_employee_name, mobile_no, email, status, tab_status, register_date, tenantsid, tenant_id, create_by, create_date, modified_by, modified_date, version, deleted, timestamp from ca_cim_staff + + + + + + update ca_cim_staff + + employee_no = #{item.employeeNo}, + employee_name = #{item.employeeName}, + en_employee_name = #{item.enEmployeeName}, + mobile_no = #{item.mobileNo}, + email = #{item.email}, + + where id = #{item.id} and `tenantsid`=#{tenantSid} + + + + + + update ca_cim_staff + + status = #{item.status}, + tab_status = #{item.tabStatus}, + + where id = #{item.id} and `tenantsid`=#{tenantSid} + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java index 321d132..d7a95f1 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java @@ -3,10 +3,17 @@ package com.digiwin.athena.app.infra.repository; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @Auther: zhenggl * @Date: 2023/4/28 */ public interface StaffRepository extends BaseRepository { + + public void updateStaffList(@Param("list")List list,@Param("tenantsid") Long tenantsid); + + public void updateStatusAndDate(@Param("list")List list,@Param("tenantsid") Long tenantsid); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java index 5fa1639..36ee95f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java @@ -1,5 +1,6 @@ package com.digiwin.athena.app.provider; +import com.digiwin.app.service.AllowAnonymous; import com.digiwin.app.service.DWEAIResult; import com.digiwin.app.service.DWService; import com.digiwin.app.service.eai.EAIService; @@ -33,15 +34,6 @@ public interface StaffEAIService extends DWService { @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET) DWEAIResult get(Map headers, String messageBody) throws Exception; - /** - * 新人报道查询 - * @param headers - * @param messageBody - * @return - * @throws Exception - */ - @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY) - DWEAIResult query(Map headers, String messageBody) throws Exception; /** * 新人报道创建 @@ -51,5 +43,6 @@ public interface StaffEAIService extends DWService { * @throws Exception */ @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE) + @AllowAnonymous DWEAIResult create(Map headers, String messageBody) throws Exception; } 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 index 688db87..cab39a4 100644 --- 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 @@ -28,10 +28,6 @@ public class StaffEAIServiceImpl implements StaffEAIService { return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET,headers,messageBody); } - @Override - public DWEAIResult query(Map headers, String messageBody) throws Exception { - return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY,headers,messageBody); - } @Override public DWEAIResult create(Map headers, String messageBody) throws Exception { diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index eca98fd..5f5d0a3 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.digiwin.app.container.exceptions.DWRuntimeException; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.common.utils.BeanCopyUtil; -import com.digiwin.athena.app.infra.dto.order.StaffDTO; +import com.digiwin.athena.app.infra.dto.staff.StaffDTO; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; 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.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; @@ -23,6 +26,8 @@ import java.util.stream.Collectors; * @Auther: zhenggl * @Date: 2023/4/28 */ +@Service +@Log4j2 public class StaffCreateEAIService extends AbsEAIService { @Resource @@ -37,31 +42,24 @@ public class StaffCreateEAIService extends AbsEAIService { } @Override + @Transactional(rollbackFor = Exception.class) public DWEAIResult execute(Map headers, String messageBody) throws Exception { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); //判断编号跟邮箱是否存在 LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - lmq.or(queryWrapperInner -> { - for (StaffDTO staffDTO : staffList) { - queryWrapperInner.or( - wrapper->wrapper - .eq(StaffEntity::getEmployeeNo,staffDTO.getEmployeeNo()) - ); - queryWrapperInner.or( - wrapper->wrapper - .eq(StaffEntity::getEmail,staffDTO.getEmail()) - ); - } - }); + List employeeNoList = staffList.stream().map(StaffDTO::getEmployeeNo).collect(Collectors.toList()); + List emailList = staffList.stream().map(StaffDTO::getEmail).collect(Collectors.toList()); + lmq.in(StaffEntity::getEmployeeNo,employeeNoList); + lmq.or().in(StaffEntity::getEmail,emailList); List staffEntities = staffRepository.selectList(lmq); if (!CollectionUtils.isEmpty(staffEntities)){ throw new DWRuntimeException("员工编号或邮箱重复"); } List staffEntityList = BeanCopyUtil.copyList(staffList, StaffEntity.class); staffService.saveBatch(staffEntityList); - List collect = staffEntities.stream().map(item -> new StaffDTO(item.getEmployeeNo(), item.getId())).collect(Collectors.toList()); + List collect = staffEntityList.stream().map(item -> new StaffDTO(item.getEmployeeNo(), item.getId())).collect(Collectors.toList()); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",collect)); } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java index 0aee092..f03e649 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -4,17 +4,24 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.OptionEnums; import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.infra.dto.staff.StaffDTO; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; +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.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +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; @@ -23,6 +30,8 @@ import java.util.stream.Collectors; * @Auther: zhenggl * @Date: 2023/4/28 */ +@Service +@Log4j2 public class StaffGetEAIService extends AbsEAIService { @Resource @@ -39,22 +48,62 @@ public class StaffGetEAIService extends AbsEAIService { @Override @Transactional(rollbackFor = Exception.class) public DWEAIResult execute(Map headers, String messageBody) throws Exception { - //查询所有tab_status=0的数据然后把他们全部修改为1 - LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); - lmq.eq(StaffEntity::getTabStatus, TabStatusEnums.NOSET.getValue()); - List staffEntities = staffRepository.selectList(lmq); - if (!CollectionUtils.isEmpty(staffEntities)){ - List idList = staffEntities.stream().map(StaffEntity::getId).collect(Collectors.toList()); - LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); - lmu.set(StaffEntity::getTabStatus,TabStatusEnums.PENDING); - lmu.in(StaffEntity::getId,idList); - staffService.update(lmu); - //修改查询到的参数 - staffEntities.forEach(item ->{ - item.setTabStatus(TabStatusEnums.PENDING.getValue()); + //反序列化字段 + EAIRequest request = new EAIRequest(messageBody); + String option = request.getObject("option", String.class); + //为空走侦测逻辑 + if (StringUtils.isEmpty(option)) { + //查询所有tab_status=0的数据然后把他们全部修改为1 + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + lmq.eq(StaffEntity::getTabStatus, TabStatusEnums.NOSET.getValue()); + List staffEntities = staffRepository.selectList(lmq); + if (!CollectionUtils.isEmpty(staffEntities)) { + List idList = staffEntities.stream().map(StaffEntity::getId).collect(Collectors.toList()); + LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); + lmu.set(StaffEntity::getTabStatus, TabStatusEnums.PENDING); + lmu.in(StaffEntity::getId, idList); + staffService.update(lmu); + //修改查询到的参数 + staffEntities.forEach(item -> { + item.setTabStatus(TabStatusEnums.PENDING.getValue()); + }); + } + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); + } else if (OptionEnums.TASK.equals(option)) { + List staffDTOS = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + lmq.and(queryWrapperInner -> { + for (StaffDTO staffDTO : staffDTOS) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(staffDTO.getTabStatus()), StaffEntity::getTabStatus, staffDTO.getTabStatus()) + .eq(!StringUtils.isEmpty(staffDTO.getId()), StaffEntity::getId, staffDTO.getId()) + ); + } }); + List staffEntities = staffRepository.selectList(lmq); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); + } else if (OptionEnums.BASIC.equals(option)) { + List staffDTOS = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); + lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + lmq.and(queryWrapperInner -> { + for (StaffDTO staffDTO : staffDTOS) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(staffDTO.getEmployeeNo()), StaffEntity::getEmployeeNo, staffDTO.getEmployeeNo()) + .eq(!StringUtils.isEmpty(staffDTO.getEmployeeName()), StaffEntity::getEmployeeName, staffDTO.getEmployeeName()) + .eq(!StringUtils.isEmpty(staffDTO.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staffDTO.getEnEmployeeName()) + .eq(!StringUtils.isEmpty(staffDTO.getEmail()), StaffEntity::getEmail, staffDTO.getEmail()) + .eq(!StringUtils.isEmpty(staffDTO.getMobileNo()), StaffEntity::getMobileNo, staffDTO.getMobileNo()) + ); + } + }); + List staffEntities = staffRepository.selectList(lmq); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); } - return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffEntities)); + return EAIUtil.buildEAIResult(new HashMap<>()); } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java deleted file mode 100644 index ee4ffd6..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffQueryEAIService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.digiwin.athena.app.service.staff; - -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.enums.TabStatusEnums; -import com.digiwin.athena.app.infra.dto.order.StaffDTO; -import com.digiwin.athena.app.infra.entity.StaffEntity; -import com.digiwin.athena.app.infra.repository.StaffRepository; -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 javax.annotation.Resource; -import java.util.List; -import java.util.Map; - -/** - * @Auther: zhenggl - * @Date: 2023/4/28 - */ -public class StaffQueryEAIService extends AbsEAIService { - - @Resource - private StaffRepository staffRepository; - - @Override - public String getServiceName() { - return StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY; - } - - @Override - public DWEAIResult execute(Map headers, String messageBody) throws Exception { - LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); - lmq.eq(StaffEntity::getTabStatus, TabStatusEnums.NOSET.getValue()); - List staffEntities = staffRepository.selectList(lmq); - return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffEntities)); - } -} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index b2dda3d..56bd70f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -2,27 +2,40 @@ package com.digiwin.athena.app.service.staff; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.digiwin.app.service.DWEAIResult; -import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; +import com.digiwin.athena.app.infra.common.enums.OptionEnums; +import com.digiwin.athena.app.infra.common.enums.StatusEnums; +import com.digiwin.athena.app.infra.common.utils.BeanCopyUtil; +import com.digiwin.athena.app.infra.dto.staff.StaffDTO; import com.digiwin.athena.app.infra.entity.StaffEntity; +import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; 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.CollectionUtils; +import org.springframework.util.StringUtils; import javax.annotation.Resource; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @Auther: zhenggl * @Date: 2023/4/28 */ +@Service +@Log4j2 public class StaffUpdateEAIService extends AbsEAIService { + @Resource + private StaffRepository staffRepository; + @Resource private StaffService staffService; @@ -35,13 +48,32 @@ public class StaffUpdateEAIService extends AbsEAIService { public DWEAIResult execute(Map headers, String messageBody) throws Exception { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); - List staffList = request.getObject("wait_register_personnel", new ArrayList().getClass()); - if (!CollectionUtils.isEmpty(staffList)){ + String option = request.getObject("option", String.class); + List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + //界面 + if (OptionEnums.BASIC.getValue().equals(option)){ + if (!CollectionUtils.isEmpty(staffList)){ + List staffEntities = BeanCopyUtil.copyList(staffList, StaffEntity.class); + //区分是否有id没有则新增 + Map> collect = staffEntities.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); + List insert = collect.get(true); + staffService.saveBatch(insert); + List update = collect.get(false); + staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); + } + }else if (OptionEnums.TASK.getValue().equals(option)){ + if (!CollectionUtils.isEmpty(staffList)){ + List staffEntities = BeanCopyUtil.copyList(staffList, StaffEntity.class); + staffRepository.updateStatusAndDate(staffEntities,SecurityUtil.getUserProfile().getTenantSid()); + } + }else if (OptionEnums.FLOW.getValue().equals(option)){ + List idList = staffList.stream().map(StaffDTO::getId).collect(Collectors.toList()); LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); - lmu.set(StaffEntity::getTabStatus, TabStatusEnums.COMPLETED.getValue()); - lmu.in(StaffEntity::getId,staffList); + lmu.set(StaffEntity::getStatus, StatusEnums.REPORTED.getValue()); + lmu.in(StaffEntity::getId,idList); staffService.update(lmu); } + return EAIUtil.buildEAIResult(new HashMap<>()); } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java index ccbc564..2cbb944 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java @@ -1,7 +1,7 @@ package com.digiwin.athena.app.service.staff; import com.alibaba.fastjson.TypeReference; -import com.digiwin.athena.app.infra.dto.order.StaffDTO; +import com.digiwin.athena.app.infra.dto.staff.StaffDTO; import java.util.List; @@ -20,7 +20,6 @@ public class StaffUtil { public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE = "demo.wait.register.personnel.info.create"; public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE = "demo.wait.register.personnel.info.update"; public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET = "demo.wait.register.personnel.info.get"; - public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_QUERY = "demo.wait.register.personnel.info.query"; public static final TypeReference> LIST_DTO_STAFF = new TypeReference>() { }; From ee0d907c9179f6045d19b1d1b7558021dc9baa22 Mon Sep 17 00:00:00 2001 From: robot Date: Fri, 28 Apr 2023 13:03:23 +0000 Subject: [PATCH 11/90] auto increment build version 1002 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index dd11724..7d802a3 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1001 +1002 From bbd76eb11b30aae9865098d5b034d483b2b0fba5 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 09:41:46 +0800 Subject: [PATCH 12/90] =?UTF-8?q?=E6=96=B0=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E8=81=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/infra/dto/staff/StaffDTO.java | 70 ------------------- .../athena/app/infra/entity/StaffEntity.java | 12 +++- .../athena/app/infra/mapper/StaffMapper.xml | 6 +- .../service/staff/StaffCreateEAIService.java | 9 ++- .../app/service/staff/StaffGetEAIService.java | 23 +++--- .../service/staff/StaffUpdateEAIService.java | 20 +++--- .../athena/app/service/staff/StaffUtil.java | 4 +- doc/sql/app-20230427-ddl.sql | 23 ++++++ 8 files changed, 62 insertions(+), 105 deletions(-) delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java deleted file mode 100644 index e70936c..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/staff/StaffDTO.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.digiwin.athena.app.infra.dto.staff; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * 人资报道对象 ca_cim_staff - * - * @author zhenggl - * @date 2023-04-28 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class StaffDTO -{ - - @SerializedName("id") - private Long id; - - /** 员工编号 */ - @SerializedName("employee_no") - private String employeeNo; - - /** 员工名称 */ - @SerializedName("employee_name") - private String employeeName; - - /** 员工英文名称 */ - @SerializedName("en_employee_name") - private String enEmployeeName; - - /** 手机号码 */ - @SerializedName("mobile_no") - private String mobileNo; - - /** 电子邮件 */ - @SerializedName("email") - private String email; - - /** 状态 */ - @SerializedName("status") - private Integer status = 1; - - /** 数据状态 */ - @SerializedName("tab_status") - private Integer tabStatus = 0; - - /** 报道日期 */ - @SerializedName("register_date") - private Date registerDate; - - - /** 时间戳 */ - @SerializedName("timestamp") - private String timestamp; - - - - public StaffDTO(String employeeNo, Long id) { - this.employeeNo = employeeNo; - this.id = id; - } -} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java index 0c2fa2e..5ab600b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java @@ -11,7 +11,7 @@ import lombok.Data; import lombok.NoArgsConstructor; /** - * 人资报道对象 ca_cim_staff + * 人资报道对象 cim_staff * * @author zhenggl * @date 2023-04-28 @@ -20,7 +20,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor @Builder -@TableName(value = "ca_cim_staff", autoResultMap = true) +@TableName(value = "cim_staff", autoResultMap = true) public class StaffEntity extends BaseMgrEntity { private static final long serialVersionUID = 1L; @@ -66,4 +66,12 @@ public class StaffEntity extends BaseMgrEntity private String timestamp; + public StaffEntity(Long id, String employeeNo) { + this.id = id; + this.employeeNo = employeeNo; + } + + public StaffEntity(Long id) { + this.id = id; + } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml index 5ca9738..aa517de 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml @@ -26,13 +26,13 @@ - select id, employee_no, employee_name, en_employee_name, mobile_no, email, status, tab_status, register_date, tenantsid, tenant_id, create_by, create_date, modified_by, modified_date, version, deleted, timestamp from ca_cim_staff + select id, employee_no, employee_name, en_employee_name, mobile_no, email, status, tab_status, register_date, tenantsid, tenant_id, create_by, create_date, modified_by, modified_date, version, deleted, timestamp from cim_staff - update ca_cim_staff + update cim_staff employee_no = #{item.employeeNo}, employee_name = #{item.employeeName}, @@ -46,7 +46,7 @@ - update ca_cim_staff + update cim_staff status = #{item.status}, tab_status = #{item.tabStatus}, diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index 5f5d0a3..91215a6 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.digiwin.app.container.exceptions.DWRuntimeException; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.common.utils.BeanCopyUtil; -import com.digiwin.athena.app.infra.dto.staff.StaffDTO; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; @@ -46,11 +45,11 @@ public class StaffCreateEAIService extends AbsEAIService { public DWEAIResult execute(Map headers, String messageBody) throws Exception { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); - List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); //判断编号跟邮箱是否存在 LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - List employeeNoList = staffList.stream().map(StaffDTO::getEmployeeNo).collect(Collectors.toList()); - List emailList = staffList.stream().map(StaffDTO::getEmail).collect(Collectors.toList()); + List employeeNoList = staffList.stream().map(StaffEntity::getEmployeeNo).collect(Collectors.toList()); + List emailList = staffList.stream().map(StaffEntity::getEmail).collect(Collectors.toList()); lmq.in(StaffEntity::getEmployeeNo,employeeNoList); lmq.or().in(StaffEntity::getEmail,emailList); List staffEntities = staffRepository.selectList(lmq); @@ -59,7 +58,7 @@ public class StaffCreateEAIService extends AbsEAIService { } List staffEntityList = BeanCopyUtil.copyList(staffList, StaffEntity.class); staffService.saveBatch(staffEntityList); - List collect = staffEntityList.stream().map(item -> new StaffDTO(item.getEmployeeNo(), item.getId())).collect(Collectors.toList()); + List collect = staffEntityList.stream().map(item -> new StaffEntity(item.getId(),item.getEmployeeNo())).collect(Collectors.toList()); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",collect)); } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java index f03e649..ca6dc8f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.common.enums.OptionEnums; import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; -import com.digiwin.athena.app.infra.dto.staff.StaffDTO; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; @@ -71,33 +70,33 @@ public class StaffGetEAIService extends AbsEAIService { } return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); } else if (OptionEnums.TASK.equals(option)) { - List staffDTOS = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); lmq.and(queryWrapperInner -> { - for (StaffDTO staffDTO : staffDTOS) { + for (StaffEntity staff : list) { queryWrapperInner.or( wrapper -> wrapper - .eq(!StringUtils.isEmpty(staffDTO.getTabStatus()), StaffEntity::getTabStatus, staffDTO.getTabStatus()) - .eq(!StringUtils.isEmpty(staffDTO.getId()), StaffEntity::getId, staffDTO.getId()) + .eq(!StringUtils.isEmpty(staff.getTabStatus()), StaffEntity::getTabStatus, staff.getTabStatus()) + .eq(!StringUtils.isEmpty(staff.getId()), StaffEntity::getId, staff.getId()) ); } }); List staffEntities = staffRepository.selectList(lmq); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); } else if (OptionEnums.BASIC.equals(option)) { - List staffDTOS = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); lmq.and(queryWrapperInner -> { - for (StaffDTO staffDTO : staffDTOS) { + for (StaffEntity staff : list) { queryWrapperInner.or( wrapper -> wrapper - .eq(!StringUtils.isEmpty(staffDTO.getEmployeeNo()), StaffEntity::getEmployeeNo, staffDTO.getEmployeeNo()) - .eq(!StringUtils.isEmpty(staffDTO.getEmployeeName()), StaffEntity::getEmployeeName, staffDTO.getEmployeeName()) - .eq(!StringUtils.isEmpty(staffDTO.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staffDTO.getEnEmployeeName()) - .eq(!StringUtils.isEmpty(staffDTO.getEmail()), StaffEntity::getEmail, staffDTO.getEmail()) - .eq(!StringUtils.isEmpty(staffDTO.getMobileNo()), StaffEntity::getMobileNo, staffDTO.getMobileNo()) + .eq(!StringUtils.isEmpty(staff.getEmployeeNo()), StaffEntity::getEmployeeNo, staff.getEmployeeNo()) + .eq(!StringUtils.isEmpty(staff.getEmployeeName()), StaffEntity::getEmployeeName, staff.getEmployeeName()) + .eq(!StringUtils.isEmpty(staff.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staff.getEnEmployeeName()) + .eq(!StringUtils.isEmpty(staff.getEmail()), StaffEntity::getEmail, staff.getEmail()) + .eq(!StringUtils.isEmpty(staff.getMobileNo()), StaffEntity::getMobileNo, staff.getMobileNo()) ); } }); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 56bd70f..85ec971 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -1,11 +1,11 @@ package com.digiwin.athena.app.service.staff; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.common.enums.OptionEnums; import com.digiwin.athena.app.infra.common.enums.StatusEnums; -import com.digiwin.athena.app.infra.common.utils.BeanCopyUtil; -import com.digiwin.athena.app.infra.dto.staff.StaffDTO; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; @@ -19,7 +19,6 @@ import org.springframework.util.CollectionUtils; 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; @@ -49,13 +48,12 @@ public class StaffUpdateEAIService extends AbsEAIService { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); String option = request.getObject("option", String.class); - List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_DTO_STAFF); + List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); //界面 if (OptionEnums.BASIC.getValue().equals(option)){ if (!CollectionUtils.isEmpty(staffList)){ - List staffEntities = BeanCopyUtil.copyList(staffList, StaffEntity.class); //区分是否有id没有则新增 - Map> collect = staffEntities.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); + Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); List insert = collect.get(true); staffService.saveBatch(insert); List update = collect.get(false); @@ -63,17 +61,17 @@ public class StaffUpdateEAIService extends AbsEAIService { } }else if (OptionEnums.TASK.getValue().equals(option)){ if (!CollectionUtils.isEmpty(staffList)){ - List staffEntities = BeanCopyUtil.copyList(staffList, StaffEntity.class); - staffRepository.updateStatusAndDate(staffEntities,SecurityUtil.getUserProfile().getTenantSid()); + staffRepository.updateStatusAndDate(staffList,SecurityUtil.getUserProfile().getTenantSid()); } }else if (OptionEnums.FLOW.getValue().equals(option)){ - List idList = staffList.stream().map(StaffDTO::getId).collect(Collectors.toList()); + List idList = staffList.stream().map(StaffEntity::getId).collect(Collectors.toList()); LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); lmu.set(StaffEntity::getStatus, StatusEnums.REPORTED.getValue()); + lmu.set(StaffEntity::getTabStatus, TabStatusEnums.COMPLETED.getValue()); lmu.in(StaffEntity::getId,idList); staffService.update(lmu); } - - return EAIUtil.buildEAIResult(new HashMap<>()); + List collect = staffList.stream().map(item -> new StaffEntity(item.getId())).collect(Collectors.toList()); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", collect)); } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java index 2cbb944..f1dcae2 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java @@ -1,7 +1,7 @@ package com.digiwin.athena.app.service.staff; import com.alibaba.fastjson.TypeReference; -import com.digiwin.athena.app.infra.dto.staff.StaffDTO; +import com.digiwin.athena.app.infra.entity.StaffEntity; import java.util.List; @@ -21,6 +21,6 @@ public class StaffUtil { public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE = "demo.wait.register.personnel.info.update"; public static final String DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET = "demo.wait.register.personnel.info.get"; - public static final TypeReference> LIST_DTO_STAFF = new TypeReference>() { + public static final TypeReference> LIST_ENTITY_STAFF = new TypeReference>() { }; } diff --git a/doc/sql/app-20230427-ddl.sql b/doc/sql/app-20230427-ddl.sql index 0808475..81c5770 100644 --- a/doc/sql/app-20230427-ddl.sql +++ b/doc/sql/app-20230427-ddl.sql @@ -21,3 +21,26 @@ create table `sales_order_detail` ( `deleted` tinyint(255) DEFAULT NULL, primary key (`id`) ) engine=innodb default charset=utf8mb4 comment='订单明细'; + -- 新人报道表 +CREATE TABLE `cim_staff` ( + `id` bigint(20) NOT NULL, + `employee_no` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '员工编号', + `employee_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '员工名称', + `en_employee_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '员工英文名称', + `mobile_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '电子邮件', + `status` int(2) NULL DEFAULT NULL COMMENT '状态', + `tab_status` int(2) NULL DEFAULT NULL COMMENT '数据状态', + `register_date` datetime(0) NULL DEFAULT NULL COMMENT '报道日期', + `tenantsid` bigint(20) NULL DEFAULT NULL, + `tenant_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `create_date` datetime(0) NULL DEFAULT NULL, + `modified_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `modified_date` datetime(0) NULL DEFAULT NULL, + `version` int(11) NULL DEFAULT NULL, + `deleted` tinyint(255) NULL DEFAULT NULL, + `timestamp` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '人资报道表' ROW_FORMAT = Dynamic; + From 3e965d08411bd84be0ad85f3e052dc4fbe9e0140 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Thu, 4 May 2023 09:59:28 +0800 Subject: [PATCH 13/90] =?UTF-8?q?=E7=A7=BB=E9=99=A4dto=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/dto/order/SalesOrderDetailDTO.java | 85 ------------------- .../provider/SalesOrderDetailEAIService.java | 1 + .../SalesOrderDetailCreateEAIService.java | 3 +- .../SalesOrderDetailUpdateEAIService.java | 3 +- doc/sql/app-20230427-ddl.sql | 4 +- 5 files changed, 6 insertions(+), 90 deletions(-) delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java 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 deleted file mode 100644 index ad02ef4..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/dto/order/SalesOrderDetailDTO.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.digiwin.athena.app.infra.dto.order; - -import com.google.gson.annotations.SerializedName; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author CR-7 - * create: 2023-04-27 14:41 - * Description: - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class SalesOrderDetailDTO { - - /** - * 主键id - */ - @SerializedName(value = "id") - private Long id; - - /** - * 订单单号 - */ - @SerializedName(value = "doc_no") - private String docNo; - - /** - * 序号 - */ - @SerializedName(value = "doc_seq") - private String docSeq; - - /** - * 品号 - */ - @SerializedName(value = "item_no") - private String itemNo; - - /** - * 品名 - */ - @SerializedName(value = "item_name") - private String itemName; - - /** - * 规格 - */ - @SerializedName(value = "item_spec") - private String itemSpec; - - /** - * 数量 - */ - @SerializedName(value = "qty") - private Integer qty; - - /** - * 仓库 - */ - @SerializedName(value = "warehouse_name") - private String warehouseName; - - /** - * 储位 - */ - @SerializedName(value = "storage_spaces_name") - private String storageSpacesName; - - /** - * 1.未检料;2.已检料 - */ - @SerializedName(value = "status") - private Integer status; - - /** - * 租户sid - */ - @SerializedName(value = "tenantsid") - private Integer tenantsid; -} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java index e784927..3402931 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java @@ -1,5 +1,6 @@ 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; 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 3843b64..5798834 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 @@ -3,7 +3,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; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; import com.digiwin.athena.app.infra.service.SalesOrderDetailService; import com.digiwin.athena.opt.common.eai.EAIRequest; @@ -41,7 +40,7 @@ public class SalesOrderDetailCreateEAIService extends AbsEAIService { public DWEAIResult execute(Map headers, String messageBody) throws Exception { // 入参反序列化 EAIRequest request = new EAIRequest(messageBody); - List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); + List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java index c8e92f3..00bf187 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -3,7 +3,6 @@ package com.digiwin.athena.app.service.order; import com.alibaba.fastjson.TypeReference; import com.digiwin.app.service.DWEAIResult; -import com.digiwin.athena.app.infra.dto.order.SalesOrderDetailDTO; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; import com.digiwin.athena.app.infra.service.SalesOrderDetailService; import com.digiwin.athena.opt.common.eai.EAIRequest; @@ -40,7 +39,7 @@ public class SalesOrderDetailUpdateEAIService extends AbsEAIService { public DWEAIResult execute(Map headers, String messageBody) throws Exception { // 入参反序列化 EAIRequest request = new EAIRequest(messageBody); - List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); + List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); diff --git a/doc/sql/app-20230427-ddl.sql b/doc/sql/app-20230427-ddl.sql index 81c5770..6ac2b66 100644 --- a/doc/sql/app-20230427-ddl.sql +++ b/doc/sql/app-20230427-ddl.sql @@ -1,6 +1,6 @@ -- 订单明细表 -create table `sales_order_detail` ( +create table `cim_sales_order_detail` ( `id` bigint(20) not null comment '主键', `doc_no` varchar(12) default null comment '订单单号', `doc_seq` varchar(255) default null comment '序号', @@ -21,6 +21,8 @@ create table `sales_order_detail` ( `deleted` tinyint(255) DEFAULT NULL, primary key (`id`) ) engine=innodb default charset=utf8mb4 comment='订单明细'; + + -- 新人报道表 CREATE TABLE `cim_staff` ( `id` bigint(20) NOT NULL, From 27f64aecc6e6ecb89abb028ccbc928e44552b243 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 10:01:40 +0800 Subject: [PATCH 14/90] =?UTF-8?q?=E6=96=B0=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E8=81=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffCreateEAIService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index 91215a6..0d70bee 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.digiwin.app.container.exceptions.DWRuntimeException; import com.digiwin.app.service.DWEAIResult; -import com.digiwin.athena.app.infra.common.utils.BeanCopyUtil; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; @@ -46,6 +45,9 @@ public class StaffCreateEAIService extends AbsEAIService { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); + if (CollectionUtils.isEmpty(staffList)){ + throw new DWRuntimeException("缺少必要参数"); + } //判断编号跟邮箱是否存在 LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); List employeeNoList = staffList.stream().map(StaffEntity::getEmployeeNo).collect(Collectors.toList()); @@ -56,9 +58,8 @@ public class StaffCreateEAIService extends AbsEAIService { if (!CollectionUtils.isEmpty(staffEntities)){ throw new DWRuntimeException("员工编号或邮箱重复"); } - List staffEntityList = BeanCopyUtil.copyList(staffList, StaffEntity.class); - staffService.saveBatch(staffEntityList); - List collect = staffEntityList.stream().map(item -> new StaffEntity(item.getId(),item.getEmployeeNo())).collect(Collectors.toList()); + staffService.saveBatch(staffList); + List collect = staffList.stream().map(item -> new StaffEntity(item.getId(),item.getEmployeeNo())).collect(Collectors.toList()); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",collect)); } } From 25f64721473e16c495fd8767fe4ee23f3c931dfc Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 02:03:24 +0000 Subject: [PATCH 15/90] auto increment build version 1003 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 7d802a3..baccd03 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1002 +1003 From 71865b111a17dd6330a1c9a24ec084b1a88b6fa3 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 02:07:40 +0000 Subject: [PATCH 16/90] auto increment build version 1004 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index baccd03..59c1122 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1003 +1004 From 291161f9e2328e1cdb940e5a88038d2d045fa9e8 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 10:13:43 +0800 Subject: [PATCH 17/90] =?UTF-8?q?=E6=96=B0=E5=91=98=E5=B7=A5=E5=85=A5?= =?UTF-8?q?=E8=81=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/digiwin/athena/app/provider/StaffEAIService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java index 36ee95f..2548b1b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java @@ -1,6 +1,5 @@ package com.digiwin.athena.app.provider; -import com.digiwin.app.service.AllowAnonymous; import com.digiwin.app.service.DWEAIResult; import com.digiwin.app.service.DWService; import com.digiwin.app.service.eai.EAIService; @@ -43,6 +42,5 @@ public interface StaffEAIService extends DWService { * @throws Exception */ @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE) - @AllowAnonymous DWEAIResult create(Map headers, String messageBody) throws Exception; } From c8d53536fefc68611a9c9cb5493a42528e773042 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 02:21:03 +0000 Subject: [PATCH 18/90] auto increment build version 1005 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 59c1122..49bc272 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1004 +1005 From aeb4022ea363dc47c7e652d403f5bf3489cf47cd Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 10:31:53 +0800 Subject: [PATCH 19/90] =?UTF-8?q?json=E6=A0=BC=E5=BC=8F=E5=8C=96=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/digiwin/athena/app/infra/entity/StaffEntity.java | 2 -- .../java/com/digiwin/athena/app/provider/StaffEAIService.java | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java index 5ab600b..d602e5f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java @@ -25,8 +25,6 @@ public class StaffEntity extends BaseMgrEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ - private Long id; /** 员工编号 */ @SerializedName("employee_no") diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java index 2548b1b..36ee95f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java @@ -1,5 +1,6 @@ package com.digiwin.athena.app.provider; +import com.digiwin.app.service.AllowAnonymous; import com.digiwin.app.service.DWEAIResult; import com.digiwin.app.service.DWService; import com.digiwin.app.service.eai.EAIService; @@ -42,5 +43,6 @@ public interface StaffEAIService extends DWService { * @throws Exception */ @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE) + @AllowAnonymous DWEAIResult create(Map headers, String messageBody) throws Exception; } From 2b017998c791a6455e56fdc4794c5a677245283f Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 02:35:11 +0000 Subject: [PATCH 20/90] auto increment build version 1006 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 49bc272..9540e56 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1005 +1006 From 294a111499e294583a2fad3cb064c8fbee1b4c95 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 10:52:26 +0800 Subject: [PATCH 21/90] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=8C=BF=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/digiwin/athena/app/provider/StaffEAIService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java index 36ee95f..2548b1b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java @@ -1,6 +1,5 @@ package com.digiwin.athena.app.provider; -import com.digiwin.app.service.AllowAnonymous; import com.digiwin.app.service.DWEAIResult; import com.digiwin.app.service.DWService; import com.digiwin.app.service.eai.EAIService; @@ -43,6 +42,5 @@ public interface StaffEAIService extends DWService { * @throws Exception */ @EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE) - @AllowAnonymous DWEAIResult create(Map headers, String messageBody) throws Exception; } From 2cc0a876393d59d206fcdb4e7030d472d6924b98 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 02:54:38 +0000 Subject: [PATCH 22/90] auto increment build version 1007 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 9540e56..fb35a14 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1006 +1007 From 7595bcb9214964c5baf9237c0af18b1aac592416 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 11:08:12 +0800 Subject: [PATCH 23/90] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffGetEAIService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java index ca6dc8f..d62f421 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -60,7 +60,7 @@ public class StaffGetEAIService extends AbsEAIService { if (!CollectionUtils.isEmpty(staffEntities)) { List idList = staffEntities.stream().map(StaffEntity::getId).collect(Collectors.toList()); LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); - lmu.set(StaffEntity::getTabStatus, TabStatusEnums.PENDING); + lmu.set(StaffEntity::getTabStatus, TabStatusEnums.PENDING.getValue()); lmu.in(StaffEntity::getId, idList); staffService.update(lmu); //修改查询到的参数 @@ -69,7 +69,7 @@ public class StaffGetEAIService extends AbsEAIService { }); } return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); - } else if (OptionEnums.TASK.equals(option)) { + } else if (OptionEnums.TASK.getValue().equals(option)) { List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); @@ -84,7 +84,7 @@ public class StaffGetEAIService extends AbsEAIService { }); List staffEntities = staffRepository.selectList(lmq); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); - } else if (OptionEnums.BASIC.equals(option)) { + } else if (OptionEnums.BASIC.getValue().equals(option)) { List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); From 53a3e21f63f470ecdafcbe27a8efe83f8de59838 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 03:10:06 +0000 Subject: [PATCH 24/90] auto increment build version 1008 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index fb35a14..617ba1c 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1007 +1008 From a7766ca00bf6fdd57f08f23f5c899a8b110691d8 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 11:39:02 +0800 Subject: [PATCH 25/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A1?= =?UTF-8?q?=E5=88=B0=E8=BE=BE=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml index aa517de..93e07b4 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml @@ -49,7 +49,7 @@ update cim_staff status = #{item.status}, - tab_status = #{item.tabStatus}, + register_date = #{item.registerDate}, where id = #{item.id} and `tenantsid`=#{tenantSid} From d71c1f51cbca791cb9a0e6d325fbdc7fea7a2fb2 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 03:40:34 +0000 Subject: [PATCH 26/90] auto increment build version 1009 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 617ba1c..6cb3869 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1008 +1009 From 6db5565a7c34145c9753029580b742516621826b Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 13:23:45 +0800 Subject: [PATCH 27/90] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=BF=85=E4=BC=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/staff/StaffGetEAIService.java | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java index d62f421..624ab26 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -73,33 +73,37 @@ public class StaffGetEAIService extends AbsEAIService { List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); - lmq.and(queryWrapperInner -> { - for (StaffEntity staff : list) { - queryWrapperInner.or( - wrapper -> wrapper - .eq(!StringUtils.isEmpty(staff.getTabStatus()), StaffEntity::getTabStatus, staff.getTabStatus()) - .eq(!StringUtils.isEmpty(staff.getId()), StaffEntity::getId, staff.getId()) - ); - } - }); + if (!CollectionUtils.isEmpty(list)) { + lmq.and(queryWrapperInner -> { + for (StaffEntity staff : list) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(staff.getTabStatus()), StaffEntity::getTabStatus, staff.getTabStatus()) + .eq(!StringUtils.isEmpty(staff.getId()), StaffEntity::getId, staff.getId()) + ); + } + }); + } List staffEntities = staffRepository.selectList(lmq); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); } else if (OptionEnums.BASIC.getValue().equals(option)) { List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); - lmq.and(queryWrapperInner -> { - for (StaffEntity staff : list) { - queryWrapperInner.or( - wrapper -> wrapper - .eq(!StringUtils.isEmpty(staff.getEmployeeNo()), StaffEntity::getEmployeeNo, staff.getEmployeeNo()) - .eq(!StringUtils.isEmpty(staff.getEmployeeName()), StaffEntity::getEmployeeName, staff.getEmployeeName()) - .eq(!StringUtils.isEmpty(staff.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staff.getEnEmployeeName()) - .eq(!StringUtils.isEmpty(staff.getEmail()), StaffEntity::getEmail, staff.getEmail()) - .eq(!StringUtils.isEmpty(staff.getMobileNo()), StaffEntity::getMobileNo, staff.getMobileNo()) - ); - } - }); + if (!CollectionUtils.isEmpty(list)) { + lmq.and(queryWrapperInner -> { + for (StaffEntity staff : list) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(staff.getEmployeeNo()), StaffEntity::getEmployeeNo, staff.getEmployeeNo()) + .eq(!StringUtils.isEmpty(staff.getEmployeeName()), StaffEntity::getEmployeeName, staff.getEmployeeName()) + .eq(!StringUtils.isEmpty(staff.getEnEmployeeName()), StaffEntity::getEnEmployeeName, staff.getEnEmployeeName()) + .eq(!StringUtils.isEmpty(staff.getEmail()), StaffEntity::getEmail, staff.getEmail()) + .eq(!StringUtils.isEmpty(staff.getMobileNo()), StaffEntity::getMobileNo, staff.getMobileNo()) + ); + } + }); + } List staffEntities = staffRepository.selectList(lmq); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); } From 608215594dceff69a8900df5ebcd2b98d5d07786 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 05:25:25 +0000 Subject: [PATCH 28/90] auto increment build version 1010 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 6cb3869..52a9f4e 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1009 +1010 From 2fa2af513d0e53478f7186675f01c86e1ac60563 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 15:40:03 +0800 Subject: [PATCH 29/90] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91=E5=88=86=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffUpdateEAIService.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 85ec971..55dbd07 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -52,12 +52,8 @@ public class StaffUpdateEAIService extends AbsEAIService { //界面 if (OptionEnums.BASIC.getValue().equals(option)){ if (!CollectionUtils.isEmpty(staffList)){ - //区分是否有id没有则新增 - Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); - List insert = collect.get(true); - staffService.saveBatch(insert); - List update = collect.get(false); - staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); + //修改 + staffRepository.updateStaffList(staffList, SecurityUtil.getUserProfile().getTenantSid()); } }else if (OptionEnums.TASK.getValue().equals(option)){ if (!CollectionUtils.isEmpty(staffList)){ From 3c529f74d7b206fff9437ef44b4c11971f37fd62 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 15:47:57 +0800 Subject: [PATCH 30/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/staff/StaffUpdateEAIService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 55dbd07..7f72a1a 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -50,10 +50,14 @@ public class StaffUpdateEAIService extends AbsEAIService { String option = request.getObject("option", String.class); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); //界面 - if (OptionEnums.BASIC.getValue().equals(option)){ + if (StringUtils.isEmpty(option)){ if (!CollectionUtils.isEmpty(staffList)){ - //修改 - staffRepository.updateStaffList(staffList, SecurityUtil.getUserProfile().getTenantSid()); + //区分是否有id没有则新增 + Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); + List insert = collect.get(true); + staffService.saveBatch(insert); + List update = collect.get(false); + staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); } }else if (OptionEnums.TASK.getValue().equals(option)){ if (!CollectionUtils.isEmpty(staffList)){ From 18f3fb0fc46dfc34c636c6216ca9636308e896c0 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 07:49:37 +0000 Subject: [PATCH 31/90] auto increment build version 1011 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 52a9f4e..d488f1c 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1010 +1011 From 157ed0a96ea4ff12fd85fbee5f259f311e818710 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 16:00:24 +0800 Subject: [PATCH 32/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/infra/entity/StaffEntity.java | 4 ++-- .../service/staff/StaffUpdateEAIService.java | 24 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java index d602e5f..bddea14 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java @@ -48,11 +48,11 @@ public class StaffEntity extends BaseMgrEntity /** 状态 */ @SerializedName("status") - private Integer status = 1; + private Integer status; /** 数据状态 */ @SerializedName("tab_status") - private Integer tabStatus = 0; + private Integer tabStatus; /** 报道日期 */ @SerializedName("register_date") diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 7f72a1a..843b2c3 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -50,25 +50,37 @@ public class StaffUpdateEAIService extends AbsEAIService { String option = request.getObject("option", String.class); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); //界面 - if (StringUtils.isEmpty(option)){ + if (StringUtils.isEmpty(option)) { if (!CollectionUtils.isEmpty(staffList)){ + staffList.forEach(item ->{ + item.setStatus(1); + item.setTabStatus(0); + }); + staffService.saveBatch(staffList); + } + } else if (OptionEnums.BASIC.getValue().equals(option)) { + if (!CollectionUtils.isEmpty(staffList)) { //区分是否有id没有则新增 Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); List insert = collect.get(true); + insert.forEach(item ->{ + item.setStatus(1); + item.setTabStatus(0); + }); staffService.saveBatch(insert); List update = collect.get(false); staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); } - }else if (OptionEnums.TASK.getValue().equals(option)){ - if (!CollectionUtils.isEmpty(staffList)){ - staffRepository.updateStatusAndDate(staffList,SecurityUtil.getUserProfile().getTenantSid()); + } else if (OptionEnums.TASK.getValue().equals(option)) { + if (!CollectionUtils.isEmpty(staffList)) { + staffRepository.updateStatusAndDate(staffList, SecurityUtil.getUserProfile().getTenantSid()); } - }else if (OptionEnums.FLOW.getValue().equals(option)){ + } else if (OptionEnums.FLOW.getValue().equals(option)) { List idList = staffList.stream().map(StaffEntity::getId).collect(Collectors.toList()); LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); lmu.set(StaffEntity::getStatus, StatusEnums.REPORTED.getValue()); lmu.set(StaffEntity::getTabStatus, TabStatusEnums.COMPLETED.getValue()); - lmu.in(StaffEntity::getId,idList); + lmu.in(StaffEntity::getId, idList); staffService.update(lmu); } List collect = staffList.stream().map(item -> new StaffEntity(item.getId())).collect(Collectors.toList()); From 1899545b95b8882680c24af5e08d8962e2131cdb Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 08:02:07 +0000 Subject: [PATCH 33/90] auto increment build version 1012 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index d488f1c..2d1420d 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1011 +1012 From 5ce420f8c48fc41a4c278f1cb455de9a5fcdc363 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 16:03:01 +0800 Subject: [PATCH 34/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=80=BC=E4=B8=BA=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffUpdateEAIService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 843b2c3..0badec3 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -53,8 +53,8 @@ public class StaffUpdateEAIService extends AbsEAIService { if (StringUtils.isEmpty(option)) { if (!CollectionUtils.isEmpty(staffList)){ staffList.forEach(item ->{ - item.setStatus(1); - item.setTabStatus(0); + item.setStatus(StatusEnums.TOBEREPORTED.getValue()); + item.setTabStatus(TabStatusEnums.NOSET.getValue()); }); staffService.saveBatch(staffList); } @@ -64,8 +64,8 @@ public class StaffUpdateEAIService extends AbsEAIService { Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); List insert = collect.get(true); insert.forEach(item ->{ - item.setStatus(1); - item.setTabStatus(0); + item.setStatus(StatusEnums.TOBEREPORTED.getValue()); + item.setTabStatus(TabStatusEnums.NOSET.getValue()); }); staffService.saveBatch(insert); List update = collect.get(false); From 6e4146432743fc83848fae1231cc4fb33b72591f Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 08:04:53 +0000 Subject: [PATCH 35/90] auto increment build version 1013 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 2d1420d..9951021 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1012 +1013 From 850811f5c3bc29bd4b89c0cc5dfa168059689f13 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 17:52:32 +0800 Subject: [PATCH 36/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9update=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?get=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/infra/mapper/StaffMapper.xml | 2 +- .../app/service/staff/StaffCreateEAIService.java | 11 ----------- .../app/service/staff/StaffGetEAIService.java | 2 +- .../app/service/staff/StaffUpdateEAIService.java | 16 ++++++---------- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml index 93e07b4..3725c6d 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml @@ -48,7 +48,7 @@ update cim_staff - status = #{item.status}, + tab_status = #{item.tabStatus}, register_date = #{item.registerDate}, where id = #{item.id} and `tenantsid`=#{tenantSid} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index 0d70bee..a2b2948 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -1,7 +1,6 @@ package com.digiwin.athena.app.service.staff; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.digiwin.app.container.exceptions.DWRuntimeException; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.entity.StaffEntity; @@ -48,16 +47,6 @@ public class StaffCreateEAIService extends AbsEAIService { if (CollectionUtils.isEmpty(staffList)){ throw new DWRuntimeException("缺少必要参数"); } - //判断编号跟邮箱是否存在 - LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); - List employeeNoList = staffList.stream().map(StaffEntity::getEmployeeNo).collect(Collectors.toList()); - List emailList = staffList.stream().map(StaffEntity::getEmail).collect(Collectors.toList()); - lmq.in(StaffEntity::getEmployeeNo,employeeNoList); - lmq.or().in(StaffEntity::getEmail,emailList); - List staffEntities = staffRepository.selectList(lmq); - if (!CollectionUtils.isEmpty(staffEntities)){ - throw new DWRuntimeException("员工编号或邮箱重复"); - } staffService.saveBatch(staffList); List collect = staffList.stream().map(item -> new StaffEntity(item.getId(),item.getEmployeeNo())).collect(Collectors.toList()); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",collect)); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java index 624ab26..c7dc4b6 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -68,7 +68,7 @@ public class StaffGetEAIService extends AbsEAIService { item.setTabStatus(TabStatusEnums.PENDING.getValue()); }); } - return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("change_objects", staffEntities)); } else if (OptionEnums.TASK.getValue().equals(option)) { List list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); LambdaQueryWrapper lmq = new LambdaQueryWrapper<>(); diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 0badec3..c792481 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -1,7 +1,7 @@ package com.digiwin.athena.app.service.staff; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.container.exceptions.DWRuntimeException; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.common.enums.OptionEnums; import com.digiwin.athena.app.infra.common.enums.StatusEnums; @@ -19,6 +19,7 @@ import org.springframework.util.CollectionUtils; 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; @@ -49,17 +50,17 @@ public class StaffUpdateEAIService extends AbsEAIService { EAIRequest request = new EAIRequest(messageBody); String option = request.getObject("option", String.class); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); + if (!CollectionUtils.isEmpty(staffList)) { + throw new DWRuntimeException("必要参数不可为空"); + } //界面 if (StringUtils.isEmpty(option)) { - if (!CollectionUtils.isEmpty(staffList)){ staffList.forEach(item ->{ item.setStatus(StatusEnums.TOBEREPORTED.getValue()); item.setTabStatus(TabStatusEnums.NOSET.getValue()); }); staffService.saveBatch(staffList); - } } else if (OptionEnums.BASIC.getValue().equals(option)) { - if (!CollectionUtils.isEmpty(staffList)) { //区分是否有id没有则新增 Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); List insert = collect.get(true); @@ -70,20 +71,15 @@ public class StaffUpdateEAIService extends AbsEAIService { staffService.saveBatch(insert); List update = collect.get(false); staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); - } } else if (OptionEnums.TASK.getValue().equals(option)) { - if (!CollectionUtils.isEmpty(staffList)) { staffRepository.updateStatusAndDate(staffList, SecurityUtil.getUserProfile().getTenantSid()); - } } else if (OptionEnums.FLOW.getValue().equals(option)) { List idList = staffList.stream().map(StaffEntity::getId).collect(Collectors.toList()); LambdaUpdateWrapper lmu = new LambdaUpdateWrapper<>(); lmu.set(StaffEntity::getStatus, StatusEnums.REPORTED.getValue()); - lmu.set(StaffEntity::getTabStatus, TabStatusEnums.COMPLETED.getValue()); lmu.in(StaffEntity::getId, idList); staffService.update(lmu); } - List collect = staffList.stream().map(item -> new StaffEntity(item.getId())).collect(Collectors.toList()); - return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", collect)); + return EAIUtil.buildEAIResult(new HashMap<>()); } } From 185e5fdf286dc935eb7c41752d1f6cd52f010e85 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 09:54:29 +0000 Subject: [PATCH 37/90] auto increment build version 1014 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 9951021..7cf69b1 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1013 +1014 From bc9ad01d1ef2666f19f102edbf02c4e3b76386cd Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 18:03:14 +0800 Subject: [PATCH 38/90] =?UTF-8?q?=E5=BF=85=E8=A6=81=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digiwin/athena/app/service/staff/StaffUpdateEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index c792481..8c8aac5 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -50,7 +50,7 @@ public class StaffUpdateEAIService extends AbsEAIService { EAIRequest request = new EAIRequest(messageBody); String option = request.getObject("option", String.class); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); - if (!CollectionUtils.isEmpty(staffList)) { + if (CollectionUtils.isEmpty(staffList)) { throw new DWRuntimeException("必要参数不可为空"); } //界面 From 848a14c7609081479d057667dae23f61bc538375 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 10:04:44 +0000 Subject: [PATCH 39/90] auto increment build version 1015 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 7cf69b1..07b0c76 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1014 +1015 From c11c769546de49ffe6574b356d1596814ce5e405 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 18:28:34 +0800 Subject: [PATCH 40/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=A4=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/staff/StaffUpdateEAIService.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index 8c8aac5..f485954 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -16,6 +16,7 @@ import com.digiwin.athena.opt.common.security.SecurityUtil; import lombok.extern.log4j.Log4j2; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import javax.annotation.Resource; @@ -62,15 +63,19 @@ public class StaffUpdateEAIService extends AbsEAIService { staffService.saveBatch(staffList); } else if (OptionEnums.BASIC.getValue().equals(option)) { //区分是否有id没有则新增 - Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId()))); + Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> ObjectUtils.isEmpty(item.getId()))); List insert = collect.get(true); - insert.forEach(item ->{ - item.setStatus(StatusEnums.TOBEREPORTED.getValue()); - item.setTabStatus(TabStatusEnums.NOSET.getValue()); - }); - staffService.saveBatch(insert); + if (!CollectionUtils.isEmpty(insert)){ + insert.forEach(item ->{ + item.setStatus(StatusEnums.TOBEREPORTED.getValue()); + item.setTabStatus(TabStatusEnums.NOSET.getValue()); + }); + staffService.saveBatch(insert); + } List update = collect.get(false); - staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); + if (!CollectionUtils.isEmpty(update)){ + staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); + } } else if (OptionEnums.TASK.getValue().equals(option)) { staffRepository.updateStatusAndDate(staffList, SecurityUtil.getUserProfile().getTenantSid()); } else if (OptionEnums.FLOW.getValue().equals(option)) { From 6304a52271540e5535a628ebd2f3662a37353987 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 10:30:02 +0000 Subject: [PATCH 41/90] auto increment build version 1016 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 07b0c76..8618e61 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1015 +1016 From f4ca503a7a277ee6d6476990a069e44679a84775 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 18:38:59 +0800 Subject: [PATCH 42/90] =?UTF-8?q?create=E8=BF=87=E6=BB=A4=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffCreateEAIService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index a2b2948..c2ecf01 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -17,7 +17,6 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * @Auther: zhenggl @@ -48,7 +47,6 @@ public class StaffCreateEAIService extends AbsEAIService { throw new DWRuntimeException("缺少必要参数"); } staffService.saveBatch(staffList); - List collect = staffList.stream().map(item -> new StaffEntity(item.getId(),item.getEmployeeNo())).collect(Collectors.toList()); - return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",collect)); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffList)); } } From 4778c4a192c77d0e2cfcb342c59b7230495f12dd Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 18:44:47 +0800 Subject: [PATCH 43/90] =?UTF-8?q?update=E8=AF=B7=E6=B1=82=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digiwin/athena/app/service/staff/StaffUpdateEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java index f485954..dd98cd0 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -74,7 +74,7 @@ public class StaffUpdateEAIService extends AbsEAIService { } List update = collect.get(false); if (!CollectionUtils.isEmpty(update)){ - staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid()); + staffService.updateBatchById(update); } } else if (OptionEnums.TASK.getValue().equals(option)) { staffRepository.updateStatusAndDate(staffList, SecurityUtil.getUserProfile().getTenantSid()); From 03078f7d63ada86e6486fc014f3f457904d46711 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 10:46:34 +0000 Subject: [PATCH 44/90] auto increment build version 1017 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 8618e61..0842778 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1016 +1017 From c308d63eda17d7b0184f2b9beceacd5fa92565f6 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 18:49:03 +0800 Subject: [PATCH 45/90] =?UTF-8?q?update=E5=8F=96=E6=B6=88tenantsid?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml index 3725c6d..fc160e2 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml @@ -40,7 +40,7 @@ mobile_no = #{item.mobileNo}, email = #{item.email}, - where id = #{item.id} and `tenantsid`=#{tenantSid} + where id = #{item.id} @@ -51,7 +51,7 @@ tab_status = #{item.tabStatus}, register_date = #{item.registerDate}, - where id = #{item.id} and `tenantsid`=#{tenantSid} + where id = #{item.id} From f689ecd664af620e1cb9e5f283d72010af302173 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 10:50:36 +0000 Subject: [PATCH 46/90] auto increment build version 1018 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 0842778..4d042af 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1017 +1018 From a264d06ae5a353a1f830abc56b45391a3e281200 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Thu, 4 May 2023 20:12:04 +0800 Subject: [PATCH 47/90] =?UTF-8?q?create=E6=8E=A5=E5=8F=A3=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffCreateEAIService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index c2ecf01..4d424b2 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -3,6 +3,8 @@ package com.digiwin.athena.app.service.staff; import com.alibaba.fastjson.JSONObject; import com.digiwin.app.container.exceptions.DWRuntimeException; import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.common.enums.StatusEnums; +import com.digiwin.athena.app.infra.common.enums.TabStatusEnums; import com.digiwin.athena.app.infra.entity.StaffEntity; import com.digiwin.athena.app.infra.repository.StaffRepository; import com.digiwin.athena.app.infra.service.StaffService; @@ -43,6 +45,10 @@ public class StaffCreateEAIService extends AbsEAIService { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); + staffList.forEach(item ->{ + item.setStatus(StatusEnums.TOBEREPORTED.getValue()); + item.setTabStatus(TabStatusEnums.NOSET.getValue()); + }); if (CollectionUtils.isEmpty(staffList)){ throw new DWRuntimeException("缺少必要参数"); } From b4aed15ff6fc118cc95d73fefee851081829da7e Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 4 May 2023 12:14:22 +0000 Subject: [PATCH 48/90] auto increment build version 1019 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 4d042af..1a8c1ea 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1018 +1019 From 971290f5be4137c70335ed96d37214fdcd073b34 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Fri, 5 May 2023 08:58:36 +0800 Subject: [PATCH 49/90] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=A4=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/staff/StaffCreateEAIService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java index 4d424b2..cecc9d6 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -45,13 +45,13 @@ public class StaffCreateEAIService extends AbsEAIService { //反序列化字段 EAIRequest request = new EAIRequest(messageBody); List staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); + if (CollectionUtils.isEmpty(staffList)){ + throw new DWRuntimeException("缺少必要参数"); + } staffList.forEach(item ->{ item.setStatus(StatusEnums.TOBEREPORTED.getValue()); item.setTabStatus(TabStatusEnums.NOSET.getValue()); }); - if (CollectionUtils.isEmpty(staffList)){ - throw new DWRuntimeException("缺少必要参数"); - } staffService.saveBatch(staffList); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffList)); } From 61f15c70c07a9d2a54cc290899642ec9d4ef7267 Mon Sep 17 00:00:00 2001 From: robot Date: Fri, 5 May 2023 01:33:48 +0000 Subject: [PATCH 50/90] auto increment build version 1020 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 1a8c1ea..49efa1e 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1019 +1020 From 40b1ab5e4faa17985f6e2d1f49e30d6b6ebcb152 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 5 May 2023 19:56:25 +0800 Subject: [PATCH 51/90] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailGetEAIService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 5f983cf..2d0ed69 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 @@ -1,6 +1,7 @@ package com.digiwin.athena.app.service.order; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.digiwin.app.service.DWEAIResult; @@ -16,6 +17,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @author CR-7 @@ -37,7 +39,8 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest request = EAIRequest.build(messageBody); - + List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); + List idList = salesOrderDetailDTOList.stream().map(SalesOrderDetailEntity::getId).collect(Collectors.toList()); // 两次开窗查询 LambdaQueryWrapper queryWrapper; if(request.getParameter().get(ParameterConstant.OPTION).equals(ParameterConstant.SET_NUMBER)){ @@ -45,7 +48,8 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { .eq(SalesOrderDetailEntity::getTenantSid,0L); }else{ queryWrapper = Wrappers.lambdaQuery() - .eq(SalesOrderDetailEntity::getTenantSid,1L); + .eq(SalesOrderDetailEntity::getTenantSid,1L) + .in(SalesOrderDetailEntity::getId,idList); } List list = salesOrderDetailService.list(queryWrapper); From 7fdea9aab03417829bf1c96f2497ba46ad04c264 Mon Sep 17 00:00:00 2001 From: robot Date: Fri, 5 May 2023 12:03:52 +0000 Subject: [PATCH 52/90] auto increment build version 1021 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 49efa1e..8463e09 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1020 +1021 From a59521501ec0eb765b291b284b035261d415e4ed Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Fri, 5 May 2023 21:03:47 +0800 Subject: [PATCH 53/90] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailGetEAIService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 2d0ed69..813af3d 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 @@ -39,8 +39,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest request = EAIRequest.build(messageBody); - List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); - List idList = salesOrderDetailDTOList.stream().map(SalesOrderDetailEntity::getId).collect(Collectors.toList()); + // 两次开窗查询 LambdaQueryWrapper queryWrapper; if(request.getParameter().get(ParameterConstant.OPTION).equals(ParameterConstant.SET_NUMBER)){ @@ -49,7 +48,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { }else{ queryWrapper = Wrappers.lambdaQuery() .eq(SalesOrderDetailEntity::getTenantSid,1L) - .in(SalesOrderDetailEntity::getId,idList); + .eq(SalesOrderDetailEntity::getStatus,1); } List list = salesOrderDetailService.list(queryWrapper); From 839ae2ea2e1167f6ec2a2d9b798e5d1a8332bb68 Mon Sep 17 00:00:00 2001 From: robot Date: Fri, 5 May 2023 13:05:28 +0000 Subject: [PATCH 54/90] auto increment build version 1022 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 8463e09..c778141 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1021 +1022 From fba0412258368870a6a3c6171927f709ed8911cf Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Sat, 6 May 2023 14:17:20 +0800 Subject: [PATCH 55/90] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailGetEAIService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 813af3d..17c23dc 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 @@ -47,8 +47,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { .eq(SalesOrderDetailEntity::getTenantSid,0L); }else{ queryWrapper = Wrappers.lambdaQuery() - .eq(SalesOrderDetailEntity::getTenantSid,1L) - .eq(SalesOrderDetailEntity::getStatus,1); + .eq(SalesOrderDetailEntity::getTenantSid,1L); } List list = salesOrderDetailService.list(queryWrapper); From 9802ac44a87910bf0e3fff078e380235669e8be5 Mon Sep 17 00:00:00 2001 From: robot Date: Sat, 6 May 2023 06:18:58 +0000 Subject: [PATCH 56/90] auto increment build version 1023 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index c778141..b70608f 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1022 +1023 From 060178f31a68ea1f6005e37e8d181a33841b15e9 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Sat, 6 May 2023 15:33:32 +0800 Subject: [PATCH 57/90] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../digiwin/athena/app/infra/constant/ParameterConstant.java | 2 ++ .../app/service/order/SalesOrderDetailGetEAIService.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 a907d2d..c2855f0 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 @@ -9,5 +9,7 @@ public class ParameterConstant { public static final String OPTION = "option"; + public static final String STATUS = "status"; + public static final String SET_NUMBER = "1"; } 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 17c23dc..14aaaad 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 @@ -47,7 +47,8 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { .eq(SalesOrderDetailEntity::getTenantSid,0L); }else{ queryWrapper = Wrappers.lambdaQuery() - .eq(SalesOrderDetailEntity::getTenantSid,1L); + .eq(SalesOrderDetailEntity::getTenantSid,1L) + .eq(SalesOrderDetailEntity::getStatus,request.getParameter().get(ParameterConstant.STATUS)); } List list = salesOrderDetailService.list(queryWrapper); From db55e6cf44060b40980a19b4df5004aa49f5aab6 Mon Sep 17 00:00:00 2001 From: robot Date: Sat, 6 May 2023 07:37:55 +0000 Subject: [PATCH 58/90] auto increment build version 1024 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index b70608f..d7b1c44 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1023 +1024 From f1632b7e1ced7af6ac0c81579c0dec85a0c80689 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 8 May 2023 09:25:55 +0800 Subject: [PATCH 59/90] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailGetEAIService.java | 3 +++ 1 file changed, 3 insertions(+) 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 14aaaad..442bfdb 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 @@ -39,6 +39,8 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { @Override public DWEAIResult execute(Map headers, String messageBody) throws Exception { EAIRequest request = EAIRequest.build(messageBody); + List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); + List idList = salesOrderDetailDTOList.stream().map(SalesOrderDetailEntity::getId).collect(Collectors.toList()); // 两次开窗查询 LambdaQueryWrapper queryWrapper; @@ -48,6 +50,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { }else{ queryWrapper = Wrappers.lambdaQuery() .eq(SalesOrderDetailEntity::getTenantSid,1L) + .in(SalesOrderDetailEntity::getId,idList) .eq(SalesOrderDetailEntity::getStatus,request.getParameter().get(ParameterConstant.STATUS)); } From 65144c82fdd5f4c4d6d879d6a436f9a737f9135f Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 8 May 2023 09:53:15 +0800 Subject: [PATCH 60/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9get=20API=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/order/SalesOrderDetailGetEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 442bfdb..4950d95 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 @@ -51,7 +51,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { queryWrapper = Wrappers.lambdaQuery() .eq(SalesOrderDetailEntity::getTenantSid,1L) .in(SalesOrderDetailEntity::getId,idList) - .eq(SalesOrderDetailEntity::getStatus,request.getParameter().get(ParameterConstant.STATUS)); + .eq(SalesOrderDetailEntity::getStatus,salesOrderDetailDTOList.get(0).getStatus()); } List list = salesOrderDetailService.list(queryWrapper); From e7621ce85558fb3cb5e0cab8b0745fab16844e1e Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 8 May 2023 10:17:52 +0800 Subject: [PATCH 61/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9get=20API=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/order/SalesOrderDetailGetEAIService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4950d95..c54419b 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 @@ -42,7 +42,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { List salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference>(){}); List idList = salesOrderDetailDTOList.stream().map(SalesOrderDetailEntity::getId).collect(Collectors.toList()); - // 两次开窗查询 + // 两次调get查询 LambdaQueryWrapper queryWrapper; if(request.getParameter().get(ParameterConstant.OPTION).equals(ParameterConstant.SET_NUMBER)){ queryWrapper = Wrappers.lambdaQuery() From ab5b809639d843058bc73b109888d18b7384b745 Mon Sep 17 00:00:00 2001 From: robot Date: Mon, 8 May 2023 02:21:26 +0000 Subject: [PATCH 62/90] auto increment build version 1025 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index d7b1c44..bec4b5c 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1024 +1025 From 25102bd7e4e6ab9b1dfc873d666b940e641dfae8 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 8 May 2023 15:33:05 +0800 Subject: [PATCH 63/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9get=20API=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailCreateEAIService.java | 1 - 1 file changed, 1 deletion(-) 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 5798834..e9c33b5 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 @@ -45,7 +45,6 @@ public class SalesOrderDetailCreateEAIService extends AbsEAIService { List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); BeanUtils.copyProperties(assemble,salesOrderDetailEntity); - salesOrderDetailEntity.setId(SnowflakeWorker.nextId()); salesOrderDetailEntity.setTenantSid(1L); salesOrderDetailEntity.setStatus(1); return salesOrderDetailEntity; From d653ea3210bb80eb17c8e7a869f48d8501c35239 Mon Sep 17 00:00:00 2001 From: robot Date: Mon, 8 May 2023 07:34:51 +0000 Subject: [PATCH 64/90] auto increment build version 1026 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index bec4b5c..d90f2b1 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1025 +1026 From df2951655346f9c3658f8cfc4da9436c686db557 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 8 May 2023 16:09:36 +0800 Subject: [PATCH 65/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailUpdateEAIService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java index 00bf187..735a26b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -44,6 +44,7 @@ public class SalesOrderDetailUpdateEAIService extends AbsEAIService { List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); salesOrderDetailEntity.setId(assemble.getId()); + salesOrderDetailEntity.setTenantSid(1L); salesOrderDetailEntity.setStatus(2); return salesOrderDetailEntity; }).collect(Collectors.toList()); From af31bf8242db325888035159ad13d72fa687bbec Mon Sep 17 00:00:00 2001 From: robot Date: Mon, 8 May 2023 08:11:18 +0000 Subject: [PATCH 66/90] auto increment build version 1027 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index d90f2b1..327f63b 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1026 +1027 From 59330683dd1d19c86f062becb090ab8b12317c87 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 8 May 2023 16:53:05 +0800 Subject: [PATCH 67/90] =?UTF-8?q?=E4=BF=AE=E6=94=B9update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/mapper/SalesOrderDetailMapper.xml | 16 ++++++++++++++++ .../repository/SalesOrderDetailRepository.java | 9 +++++++++ .../order/SalesOrderDetailUpdateEAIService.java | 6 +++--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml new file mode 100644 index 0000000..1943d7b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + update cim_sales_order_detail set status = 2 + where id = #{item.id} and tenantsid = #{item.tenantSid} + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java index da2fb86..927af17 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java @@ -3,6 +3,15 @@ package com.digiwin.athena.app.infra.repository; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; import com.digiwin.athena.opt.persistence.repository.BaseRepository; +import org.apache.ibatis.annotations.Param; + +import java.util.List; public interface SalesOrderDetailRepository extends BaseRepository { + + /** + * 更新数据 + * @param list + */ + void updateStatus(@Param("list") List list); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java index 735a26b..9e58616 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -4,6 +4,7 @@ package com.digiwin.athena.app.service.order; import com.alibaba.fastjson.TypeReference; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; +import com.digiwin.athena.app.infra.repository.SalesOrderDetailRepository; import com.digiwin.athena.app.infra.service.SalesOrderDetailService; import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.EAIUtil; @@ -27,7 +28,7 @@ import java.util.stream.Collectors; public class SalesOrderDetailUpdateEAIService extends AbsEAIService { @Resource - SalesOrderDetailService salesOrderDetailService; + SalesOrderDetailRepository salesOrderDetailRepository; @Override public String getServiceName() { @@ -45,11 +46,10 @@ public class SalesOrderDetailUpdateEAIService extends AbsEAIService { SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); salesOrderDetailEntity.setId(assemble.getId()); salesOrderDetailEntity.setTenantSid(1L); - salesOrderDetailEntity.setStatus(2); return salesOrderDetailEntity; }).collect(Collectors.toList()); - salesOrderDetailService.updateBatchById(salesOrderDetailEntityList); + salesOrderDetailRepository.updateStatus(salesOrderDetailEntityList); return EAIUtil.buildEAIResult(new HashMap<>()); } From dcf6f64ab362d71df42edded0e1a7f5fe8e46fae Mon Sep 17 00:00:00 2001 From: robot Date: Mon, 8 May 2023 08:54:41 +0000 Subject: [PATCH 68/90] auto increment build version 1028 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 327f63b..1f3d8a7 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1027 +1028 From 52e5f187cf01e8a687872dfa21f8f22e41fe9fe5 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Tue, 9 May 2023 08:54:14 +0800 Subject: [PATCH 69/90] =?UTF-8?q?=E5=9B=9E=E5=BD=92=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailCreateEAIService.java | 1 + .../app/service/order/SalesOrderDetailUpdateEAIService.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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 e9c33b5..5798834 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 @@ -45,6 +45,7 @@ public class SalesOrderDetailCreateEAIService extends AbsEAIService { List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); BeanUtils.copyProperties(assemble,salesOrderDetailEntity); + salesOrderDetailEntity.setId(SnowflakeWorker.nextId()); salesOrderDetailEntity.setTenantSid(1L); salesOrderDetailEntity.setStatus(1); return salesOrderDetailEntity; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java index 9e58616..dbde614 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -28,7 +28,8 @@ import java.util.stream.Collectors; public class SalesOrderDetailUpdateEAIService extends AbsEAIService { @Resource - SalesOrderDetailRepository salesOrderDetailRepository; + SalesOrderDetailService salesOrderDetailService; + @Override public String getServiceName() { @@ -46,10 +47,11 @@ public class SalesOrderDetailUpdateEAIService extends AbsEAIService { SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); salesOrderDetailEntity.setId(assemble.getId()); salesOrderDetailEntity.setTenantSid(1L); + salesOrderDetailEntity.setStatus(2); return salesOrderDetailEntity; }).collect(Collectors.toList()); - salesOrderDetailRepository.updateStatus(salesOrderDetailEntityList); + salesOrderDetailService.updateBatchById(salesOrderDetailEntityList); return EAIUtil.buildEAIResult(new HashMap<>()); } From 55282c44ed24feaf07773a9de46e5d6d15bda814 Mon Sep 17 00:00:00 2001 From: robot Date: Tue, 9 May 2023 00:56:12 +0000 Subject: [PATCH 70/90] auto increment build version 1029 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 1f3d8a7..5208b59 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1028 +1029 From c38fb7fa7936272a49f01490c355a7d3c3f91658 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Tue, 9 May 2023 09:05:46 +0800 Subject: [PATCH 71/90] =?UTF-8?q?=E5=9B=9E=E5=BD=92=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/mapper/SalesOrderDetailMapper.xml | 16 ---------------- .../repository/SalesOrderDetailRepository.java | 7 ------- .../order/SalesOrderDetailUpdateEAIService.java | 1 - 3 files changed, 24 deletions(-) delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml deleted file mode 100644 index 1943d7b..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - update cim_sales_order_detail set status = 2 - where id = #{item.id} and tenantsid = #{item.tenantSid} - - - - - diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java index 927af17..72a3651 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java @@ -3,15 +3,8 @@ package com.digiwin.athena.app.infra.repository; import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; import com.digiwin.athena.opt.persistence.repository.BaseRepository; -import org.apache.ibatis.annotations.Param; -import java.util.List; public interface SalesOrderDetailRepository extends BaseRepository { - /** - * 更新数据 - * @param list - */ - void updateStatus(@Param("list") List list); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java index dbde614..4d03702 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -46,7 +46,6 @@ public class SalesOrderDetailUpdateEAIService extends AbsEAIService { List salesOrderDetailEntityList = salesOrderDetailDTOList.stream().map(assemble->{ SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); salesOrderDetailEntity.setId(assemble.getId()); - salesOrderDetailEntity.setTenantSid(1L); salesOrderDetailEntity.setStatus(2); return salesOrderDetailEntity; }).collect(Collectors.toList()); From fdd572a2eac61a4d3c5aea69d68378ce1f71175f Mon Sep 17 00:00:00 2001 From: robot Date: Tue, 9 May 2023 01:08:11 +0000 Subject: [PATCH 72/90] auto increment build version 1030 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 5208b59..e445c3b 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1029 +1030 From 6a49da97ae2b978249717248dc47a5e6deb015dd Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Thu, 11 May 2023 11:06:33 +0800 Subject: [PATCH 73/90] =?UTF-8?q?=E5=9B=9E=E5=BD=92=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailGetEAIService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 c54419b..1b96cbf 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 @@ -50,8 +50,7 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { }else{ queryWrapper = Wrappers.lambdaQuery() .eq(SalesOrderDetailEntity::getTenantSid,1L) - .in(SalesOrderDetailEntity::getId,idList) - .eq(SalesOrderDetailEntity::getStatus,salesOrderDetailDTOList.get(0).getStatus()); + .in(SalesOrderDetailEntity::getId,idList); } List list = salesOrderDetailService.list(queryWrapper); From c0dba6c513dd33c255bcb51de8f0c6148b1a813d Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 11 May 2023 03:08:11 +0000 Subject: [PATCH 74/90] auto increment build version 1031 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index e445c3b..09de93e 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1030 +1031 From b272e46f7b41cc6c25e1af9d8d1fda09b9e214d5 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Thu, 11 May 2023 11:13:12 +0800 Subject: [PATCH 75/90] =?UTF-8?q?=E5=9B=9E=E5=BD=92=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailGetEAIService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 1b96cbf..c54419b 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 @@ -50,7 +50,8 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { }else{ queryWrapper = Wrappers.lambdaQuery() .eq(SalesOrderDetailEntity::getTenantSid,1L) - .in(SalesOrderDetailEntity::getId,idList); + .in(SalesOrderDetailEntity::getId,idList) + .eq(SalesOrderDetailEntity::getStatus,salesOrderDetailDTOList.get(0).getStatus()); } List list = salesOrderDetailService.list(queryWrapper); From 0a73b8db40ef7ff8d387552d1e50978b29db3ae7 Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 11 May 2023 03:14:33 +0000 Subject: [PATCH 76/90] auto increment build version 1032 [CI SKIP] --- version_control/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_control/BUILD b/version_control/BUILD index 09de93e..4ac943d 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -1031 +1032 From 4b17cc406c27955eac4c8580a73076da1704b04b Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 12 Jun 2023 11:31:14 +0800 Subject: [PATCH 77/90] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E7=A7=9F=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/order/SalesOrderDetailCreateEAIService.java | 1 - .../app/service/order/SalesOrderDetailGetEAIService.java | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) 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 5798834..7e4d18d 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 @@ -46,7 +46,6 @@ public class SalesOrderDetailCreateEAIService extends AbsEAIService { SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity(); BeanUtils.copyProperties(assemble,salesOrderDetailEntity); salesOrderDetailEntity.setId(SnowflakeWorker.nextId()); - salesOrderDetailEntity.setTenantSid(1L); salesOrderDetailEntity.setStatus(1); return salesOrderDetailEntity; }).collect(Collectors.toList()); 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 c54419b..1e1a69b 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 @@ -43,14 +43,13 @@ public class SalesOrderDetailGetEAIService extends AbsEAIService { List idList = salesOrderDetailDTOList.stream().map(SalesOrderDetailEntity::getId).collect(Collectors.toList()); // 两次调get查询 - LambdaQueryWrapper queryWrapper; + 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) - .in(SalesOrderDetailEntity::getId,idList) + .in(SalesOrderDetailEntity::getId,idList) .eq(SalesOrderDetailEntity::getStatus,salesOrderDetailDTOList.get(0).getStatus()); } From 3fce0f1d0b4f463ab9d03e34bf0bf780b9bc64dc Mon Sep 17 00:00:00 2001 From: dongsk Date: Fri, 30 Jun 2023 21:19:44 +0800 Subject: [PATCH 78/90] =?UTF-8?q?=E6=96=B0=E5=A2=9ECPS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/entity/CpsQuestionInfo.java | 50 ++++++++++ .../athena/app/infra/entity/package-info.java | 1 - .../athena/app/infra/mapper/package-info.java | 1 - .../athena/app/infra/package-info.java | 4 - .../repository/CpsQuestionInfoRepository.java | 20 ++++ .../app/infra/repository/package-info.java | 1 - .../infra/service/CpsQuestionInfoService.java | 20 ++++ .../Impl/CpsQuestionInfoServiceImpl.java | 22 +++++ .../athena/app/provider/CpsEAIService.java | 37 ++++++++ .../app/provider/impl/CpsEAIServiceImpl.java | 42 +++++++++ .../service/cps/CpsQuestionCreateService.java | 50 ++++++++++ .../service/cps/CpsQuestionGetService.java | 93 +++++++++++++++++++ .../service/cps/CpsQuestionUpdateService.java | 75 +++++++++++++++ .../athena/app/service/cps/CpsUtil.java | 22 +++++ doc/sql/app-20230630-ddl.sql | 42 +++++++++ doc/sql/app-yyyyMMdd-ddl.sql | 1 - 16 files changed, 473 insertions(+), 8 deletions(-) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/CpsQuestionInfoRepository.java delete mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/CpsQuestionInfoService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/CpsEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/CpsEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsUtil.java create mode 100644 doc/sql/app-20230630-ddl.sql delete mode 100644 doc/sql/app-yyyyMMdd-ddl.sql diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java new file mode 100644 index 0000000..e3428bc --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -0,0 +1,50 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 20:12 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.infra.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import lombok.Data; + +import java.util.Date; + +/** + * CpsQuestionInfo + * + * @author DONGSK 2023/6/30 20:12 + * @since 1.0.0 + */ +@Data +@TableName(value = "cps_question_info", autoResultMap = true) +public class CpsQuestionInfo extends BaseMgrEntity { + private String defectType; + private String questionLocation; + private String questionArea; + private Date questionTime; + private String questionLevel; + private String importanceLevel; + private String timesOneDay; + private String questionInformation; + private String responsiblePerson; + private String containmentMeasures; + private String rootCauseIdentification; + private String correctiveActions; + private String effectVerification; + private String controlStandards; + private String completionTime; + private Date controlArea; + private String knowledgeAccumulation; + private Integer status = 0; + private Integer status1 = 0; + private Integer status2 = 0; + private Integer status3 = 0; + private Integer status4 = 0; + private Integer status5 = 0; + private Integer status6 = 0; + private String timestamp; +} \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java deleted file mode 100644 index 9f3a8c7..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.digiwin.athena.app.infra.entity; \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java deleted file mode 100644 index cc3fbeb..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.digiwin.athena.app.infra.mapper; \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java deleted file mode 100644 index 8a323a8..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.digiwin.athena.app.infra; -/* - *1.基础服务放在此包下:主要是数据持久层,对外面提供基础数据处理 - */ \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/CpsQuestionInfoRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/CpsQuestionInfoRepository.java new file mode 100644 index 0000000..4bb76ac --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/CpsQuestionInfoRepository.java @@ -0,0 +1,20 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 20:18 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.infra.repository; + +import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; +import com.digiwin.athena.opt.persistence.repository.BaseRepository; + +/** + * CpsQuestionInfoRepository + * + * @author DONGSK 2023/6/30 20:18 + * @since 1.0.0 + */ +public interface CpsQuestionInfoRepository extends BaseRepository { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java deleted file mode 100644 index 448908b..0000000 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.digiwin.athena.app.infra.repository; \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/CpsQuestionInfoService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/CpsQuestionInfoService.java new file mode 100644 index 0000000..5c95dcb --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/CpsQuestionInfoService.java @@ -0,0 +1,20 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 20:20 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.infra.service; + +import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; +import com.digiwin.athena.opt.persistence.service.IBaseService; + +/** + * CpsQuestionInfoService + * + * @author DONGSK 2023/6/30 20:20 + * @since 1.0.0 + */ +public interface CpsQuestionInfoService extends IBaseService { +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java new file mode 100644 index 0000000..b5b2873 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java @@ -0,0 +1,22 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 20:21 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.infra.service.Impl; + +import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; +import com.digiwin.athena.app.infra.repository.CpsQuestionInfoRepository; +import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; +import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; + +/** + * CpsQuestionInfoServiceImpl + * + * @author DONGSK 2023/6/30 20:21 + * @since 1.0.0 + */ +public class CpsQuestionInfoServiceImpl extends AbsBaseService implements CpsQuestionInfoService { +} \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/CpsEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/CpsEAIService.java new file mode 100644 index 0000000..b8f7a63 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/CpsEAIService.java @@ -0,0 +1,37 @@ +/* + * Author: DONGSK + * Datetime: 2023/1/29 16:34 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +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.cps.CpsUtil; + +import java.util.Map; + +/** + * BasicEAIApiService + * + * @author DONGSK 2023/1/29 16:34 + * @since 1.0.0 + */ +public interface CpsEAIService extends DWService { + + + @EAIService(id = CpsUtil.CPS_QUESTION_INFO_CREATE) + DWEAIResult cpsQuestionCreate(Map headers, String messageBody) throws Exception; + + @EAIService(id = CpsUtil.CPS_QUESTION_INFO_UPDATE) + DWEAIResult cpsQuestionUpdate(Map headers, String messageBody) throws Exception; + + @EAIService(id = CpsUtil.CPS_QUESTION_INFO_GET) + DWEAIResult cpsQuestionGet(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/CpsEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/CpsEAIServiceImpl.java new file mode 100644 index 0000000..1745369 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/CpsEAIServiceImpl.java @@ -0,0 +1,42 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 19:51 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.CpsEAIService; +import com.digiwin.athena.app.service.cps.CpsUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * CpsEAIServiceImpl + * + * @author DONGSK 2023/6/30 19:51 + * @since 1.0.0 + */ +public class CpsEAIServiceImpl implements CpsEAIService { + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult cpsQuestionCreate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(CpsUtil.CPS_QUESTION_INFO_CREATE, headers, messageBody); + } + + @Override + public DWEAIResult cpsQuestionGet(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(CpsUtil.CPS_QUESTION_INFO_GET, headers, messageBody); + } + + @Override + public DWEAIResult cpsQuestionUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(CpsUtil.CPS_QUESTION_INFO_UPDATE, headers, messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java new file mode 100644 index 0000000..60f7b38 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java @@ -0,0 +1,50 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 19:57 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.service.cps; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; +import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity; +import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; +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 javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * CpsQuestionCreateService + * + * @author DONGSK 2023/6/30 19:57 + * @since 1.0.0 + */ +public class CpsQuestionCreateService extends AbsEAIService { + + @Resource + CpsQuestionInfoService cpsQuestionInfoService; + + @Override + public String getServiceName() { + return CpsUtil.CPS_QUESTION_INFO_CREATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = EAIRequest.build(messageBody); + List questionInfo = request.getObject("question_info", new TypeReference>() { + }); + + cpsQuestionInfoService.saveBatch(questionInfo); + + return buildOK("question_info", questionInfo); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java new file mode 100644 index 0000000..9e68f2d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -0,0 +1,93 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 19:57 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.service.cps; + +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; +import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * CpsQuestionUpdateService + * + * @author DONGSK 2023/6/30 19:57 + * @since 1.0.0 + */ +public class CpsQuestionGetService extends AbsEAIService { + + @Resource + CpsQuestionInfoService cpsQuestionInfoService; + + @Override + public String getServiceName() { + return CpsUtil.CPS_QUESTION_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest eaiRequest = new EAIRequest(messageBody); + + String option = eaiRequest.getString("option"); + + // 侦测 + if (StringUtils.isBlank(option)) { + + List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).list(); + + List ids = list.stream().map(BaseMgrEntity::getId).collect(Collectors.toList()); + + cpsQuestionInfoService.lambdaUpdate().set(CpsQuestionInfo::getStatus, 1).in(CpsQuestionInfo::getId, ids).update(); + + return buildOK("change_objects", list); + } + + // 任务卡查询 + List questionInfo = eaiRequest.getObject("question_info", new TypeReference>() { + }); + + List collectIds = questionInfo.stream().map(BaseMgrEntity::getId).collect(Collectors.toList()); + + String status = eaiRequest.getString("status"); + + LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); + + switch (option) { + case "1": + lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); + break; + case "2": + lambdaQuery.eq(CpsQuestionInfo::getStatus2, status); + break; + case "3": + lambdaQuery.eq(CpsQuestionInfo::getStatus3, status); + break; + case "4": + lambdaQuery.eq(CpsQuestionInfo::getStatus4, status); + break; + case "5": + lambdaQuery.eq(CpsQuestionInfo::getStatus5, status); + break; + case "6": + lambdaQuery.eq(CpsQuestionInfo::getStatus6, status); + break; + } + + return buildOK("question_info", lambdaQuery.list()); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java new file mode 100644 index 0000000..50b86a7 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java @@ -0,0 +1,75 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 19:57 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.service.cps; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; +import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * CpsQuestionUpdateService + * + * @author DONGSK 2023/6/30 19:57 + * @since 1.0.0 + */ +public class CpsQuestionUpdateService extends AbsEAIService { + + @Resource + CpsQuestionInfoService cpsQuestionInfoService; + + @Override + public String getServiceName() { + return CpsUtil.CPS_QUESTION_INFO_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + EAIRequest request = EAIRequest.build(messageBody); + List questionInfo = request.getObject("question_info", new TypeReference>() { + }); + + String option = request.getString("option"); + + questionInfo.forEach(o -> { + + switch (option) { + case "1": + o.setStatus1(1); + break; + case "2": + o.setStatus1(2); + break; + case "3": + o.setStatus1(3); + break; + case "4": + o.setStatus1(4); + break; + case "5": + o.setStatus1(5); + break; + case "6": + o.setStatus1(6); + break; + } + + }); + + cpsQuestionInfoService.updateBatchById(questionInfo); + + return buildOK(); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsUtil.java new file mode 100644 index 0000000..f8790da --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsUtil.java @@ -0,0 +1,22 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 19:52 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.service.cps; + +/** + * CpsUtil + * + * @author DONGSK 2023/6/30 19:52 + * @since 1.0.0 + */ +public class CpsUtil { + + public static final String CPS_QUESTION_INFO_CREATE = "demo.cps.question.info.create"; + public static final String CPS_QUESTION_INFO_UPDATE = "demo.cps.question.info.update"; + public static final String CPS_QUESTION_INFO_GET = "demo.cps.question.info.get"; + +} diff --git a/doc/sql/app-20230630-ddl.sql b/doc/sql/app-20230630-ddl.sql new file mode 100644 index 0000000..cde5566 --- /dev/null +++ b/doc/sql/app-20230630-ddl.sql @@ -0,0 +1,42 @@ +-- cps_question_info 问题管理 +CREATE TABLE `cps_question_info` +( + `id` BIGINT(20) NOT NULL, + `defect_type` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `question_location` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `question_area` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `question_time` DATETIME NULL DEFAULT NULL, + `question_level` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `importance_level` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `times_one_day` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `question_information` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `responsible_person` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `containment_measures` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `root_cause_identification` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `corrective_actions` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `effect_verification` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `control_standards` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `completion_time` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `control_area` DATETIME NULL DEFAULT NULL, + `knowledge_accumulation` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `status` INT(2) NULL DEFAULT '0' COMMENT '状态', + `status1` INT(2) NULL DEFAULT '0' COMMENT '状态1', + `status2` INT(2) NULL DEFAULT '0' COMMENT '状态2', + `status3` INT(2) NULL DEFAULT '0' COMMENT '状态3', + `status4` INT(2) NULL DEFAULT '0' COMMENT '状态4', + `status5` INT(2) NULL DEFAULT '0' COMMENT '状态5', + `status6` INT(2) NULL DEFAULT '0' COMMENT '状态6', + `timestamp` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci', + `tenantsid` BIGINT(20) NULL DEFAULT NULL, + `tenant_id` VARCHAR(20) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci', + `create_by` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci', + `create_date` DATETIME NULL DEFAULT NULL, + `modified_by` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci', + `modified_date` DATETIME NULL DEFAULT NULL, + `version` INT(11) NULL DEFAULT NULL, + `deleted` TINYINT(255) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) COMMENT='cps_问题追踪' +COLLATE='utf8mb4_general_ci' +ENGINE=InnoDB +; diff --git a/doc/sql/app-yyyyMMdd-ddl.sql b/doc/sql/app-yyyyMMdd-ddl.sql deleted file mode 100644 index bcb97cf..0000000 --- a/doc/sql/app-yyyyMMdd-ddl.sql +++ /dev/null @@ -1 +0,0 @@ --- cim_wo_routing 工单工艺数据 From 520c47e07317f56c14a65d0a87b4b6312da3595f Mon Sep 17 00:00:00 2001 From: dongsk Date: Fri, 30 Jun 2023 22:53:21 +0800 Subject: [PATCH 79/90] =?UTF-8?q?=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 --- .../digiwin/athena/app/infra/entity/CpsQuestionInfo.java | 3 ++- .../athena/app/service/cps/CpsQuestionCreateService.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java index e3428bc..ee313b7 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -28,9 +28,10 @@ public class CpsQuestionInfo extends BaseMgrEntity { private Date questionTime; private String questionLevel; private String importanceLevel; - private String timesOneDay; + private Integer timesOneDay; private String questionInformation; private String responsiblePerson; + private String responsiblePersonName; private String containmentMeasures; private String rootCauseIdentification; private String correctiveActions; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java index 60f7b38..b91a4a7 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java @@ -15,6 +15,7 @@ import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; 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 javax.annotation.Resource; import java.util.List; @@ -43,8 +44,15 @@ public class CpsQuestionCreateService extends AbsEAIService { List questionInfo = request.getObject("question_info", new TypeReference>() { }); + questionInfo.forEach(o->{ + o.setResponsiblePerson(SecurityUtil.getUserProfile().getUserId()); + o.setResponsiblePersonName(SecurityUtil.getUserProfile().getUserName()); + }); + cpsQuestionInfoService.saveBatch(questionInfo); + + return buildOK("question_info", questionInfo); } } From 228e6149d0c1080b7f61c9f0507619e6a7b09c10 Mon Sep 17 00:00:00 2001 From: dongsk Date: Fri, 30 Jun 2023 23:08:54 +0800 Subject: [PATCH 80/90] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../athena/app/service/cps/CpsQuestionCreateService.java | 2 ++ .../digiwin/athena/app/service/cps/CpsQuestionGetService.java | 2 ++ .../athena/app/service/cps/CpsQuestionUpdateService.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java index b91a4a7..075cc5f 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java @@ -16,6 +16,7 @@ import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.EAIUtil; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; import com.digiwin.athena.opt.common.security.SecurityUtil; +import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @@ -27,6 +28,7 @@ import java.util.Map; * @author DONGSK 2023/6/30 19:57 * @since 1.0.0 */ +@Service public class CpsQuestionCreateService extends AbsEAIService { @Resource diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index 9e68f2d..d961846 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -16,6 +16,7 @@ import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @@ -28,6 +29,7 @@ import java.util.stream.Collectors; * @author DONGSK 2023/6/30 19:57 * @since 1.0.0 */ +@Service public class CpsQuestionGetService extends AbsEAIService { @Resource diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java index 50b86a7..80982ca 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java @@ -13,6 +13,7 @@ import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @@ -24,6 +25,7 @@ import java.util.Map; * @author DONGSK 2023/6/30 19:57 * @since 1.0.0 */ +@Service public class CpsQuestionUpdateService extends AbsEAIService { @Resource From 764ef834f58787f12f53493ed1b64ea5205e782d Mon Sep 17 00:00:00 2001 From: dongsk Date: Fri, 30 Jun 2023 23:11:44 +0800 Subject: [PATCH 81/90] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/cps/CpsQuestionUpdateService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java index 50b86a7..6571455 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java @@ -50,19 +50,19 @@ public class CpsQuestionUpdateService extends AbsEAIService { o.setStatus1(1); break; case "2": - o.setStatus1(2); + o.setStatus2(1); break; case "3": - o.setStatus1(3); + o.setStatus3(1); break; case "4": - o.setStatus1(4); + o.setStatus4(1); break; case "5": - o.setStatus1(5); + o.setStatus5(1); break; case "6": - o.setStatus1(6); + o.setStatus6(1); break; } From c9522ba2340957e57e78e17358824e68ee8bf98a Mon Sep 17 00:00:00 2001 From: dongsk Date: Fri, 30 Jun 2023 23:27:52 +0800 Subject: [PATCH 82/90] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java | 4 ++-- .../athena/app/service/cps/CpsQuestionUpdateService.java | 2 ++ .../develop/src/main/resources/META-INF/dap.info | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java index ee313b7..efd0a86 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -37,8 +37,8 @@ public class CpsQuestionInfo extends BaseMgrEntity { private String correctiveActions; private String effectVerification; private String controlStandards; - private String completionTime; - private Date controlArea; + private Date completionTime; + private String controlArea; private String knowledgeAccumulation; private Integer status = 0; private Integer status1 = 0; diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java index d7a7ba3..c787a86 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java @@ -13,6 +13,7 @@ import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.util.DateUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -56,6 +57,7 @@ public class CpsQuestionUpdateService extends AbsEAIService { break; case "3": o.setStatus3(1); + o.setCompletionTime(DateUtils.getDateTimeNow()); break; case "4": o.setStatus4(1); diff --git a/demo-athenaopt_backend/develop/src/main/resources/META-INF/dap.info b/demo-athenaopt_backend/develop/src/main/resources/META-INF/dap.info index e107715..5b59365 100644 --- a/demo-athenaopt_backend/develop/src/main/resources/META-INF/dap.info +++ b/demo-athenaopt_backend/develop/src/main/resources/META-INF/dap.info @@ -1,4 +1,4 @@ #save dap.info #Sun Jan 29 14:54:12 CST 2023 -group.name=cim +group.name=demo business.extension.layer= From be508fd5b041362f3545b1802b88ee0629cd3482 Mon Sep 17 00:00:00 2001 From: dongsk Date: Fri, 30 Jun 2023 23:45:48 +0800 Subject: [PATCH 83/90] no message --- .../app/infra/service/Impl/CpsQuestionInfoServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java index b5b2873..4aeb583 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java @@ -11,6 +11,7 @@ import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; import com.digiwin.athena.app.infra.repository.CpsQuestionInfoRepository; import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; +import org.springframework.stereotype.Service; /** * CpsQuestionInfoServiceImpl @@ -18,5 +19,6 @@ import com.digiwin.athena.opt.persistence.service.impl.AbsBaseService; * @author DONGSK 2023/6/30 20:21 * @since 1.0.0 */ +@Service public class CpsQuestionInfoServiceImpl extends AbsBaseService implements CpsQuestionInfoService { } \ No newline at end of file From c04595b8ceb7217f6841a55a36e184fe714a7853 Mon Sep 17 00:00:00 2001 From: dongsk Date: Sat, 1 Jul 2023 00:22:35 +0800 Subject: [PATCH 84/90] =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/cps/CpsQuestionGetService.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index d961846..50784d2 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -21,6 +21,7 @@ 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; /** @@ -51,11 +52,10 @@ public class CpsQuestionGetService extends AbsEAIService { if (StringUtils.isBlank(option)) { List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).list(); - - List ids = list.stream().map(BaseMgrEntity::getId).collect(Collectors.toList()); - - cpsQuestionInfoService.lambdaUpdate().set(CpsQuestionInfo::getStatus, 1).in(CpsQuestionInfo::getId, ids).update(); - + list.forEach(o -> { + o.setStatus(1); + }); + cpsQuestionInfoService.updateBatchById(list); return buildOK("change_objects", list); } @@ -65,10 +65,9 @@ public class CpsQuestionGetService extends AbsEAIService { List collectIds = questionInfo.stream().map(BaseMgrEntity::getId).collect(Collectors.toList()); - String status = eaiRequest.getString("status"); - LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); + String status = eaiRequest.getString("status"); switch (option) { case "1": lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); From dd27ca03267dbe37208f120ff6b063574524f66a Mon Sep 17 00:00:00 2001 From: dongsk Date: Sat, 1 Jul 2023 00:45:00 +0800 Subject: [PATCH 85/90] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/entity/CpsQuestionInfo.java | 12 ++++----- .../service/cps/CpsQuestionGetService.java | 25 +++++++++++-------- .../service/cps/CpsQuestionUpdateService.java | 12 ++++----- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java index efd0a86..0ae0a6b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -41,11 +41,11 @@ public class CpsQuestionInfo extends BaseMgrEntity { private String controlArea; private String knowledgeAccumulation; private Integer status = 0; - private Integer status1 = 0; - private Integer status2 = 0; - private Integer status3 = 0; - private Integer status4 = 0; - private Integer status5 = 0; - private Integer status6 = 0; + private Integer status1 = 1; + private Integer status2 = 1; + private Integer status3 = 1; + private Integer status4 = 1; + private Integer status5 = 1; + private Integer status6 = 1; private String timestamp; } \ No newline at end of file diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index 50784d2..16d8d9a 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -7,18 +7,22 @@ */ package com.digiwin.athena.app.service.cps; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.entity.CpsQuestionInfo; import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; 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.persistence.domain.BaseMgrEntity; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.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; @@ -60,32 +64,33 @@ public class CpsQuestionGetService extends AbsEAIService { } // 任务卡查询 - List questionInfo = eaiRequest.getObject("question_info", new TypeReference>() { - }); + List> questionInfo = eaiRequest.getObject("question_info", EAIUtil.TYPE_LIST_MAP_V_OBJ); - List collectIds = questionInfo.stream().map(BaseMgrEntity::getId).collect(Collectors.toList()); + if (questionInfo.isEmpty()) { + return buildOK("question_info", new ArrayList<>()); + } + List collectIds = questionInfo.stream().map(o -> MapUtils.getLong(o, "id")).collect(Collectors.toList()); LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); - String status = eaiRequest.getString("status"); switch (option) { case "1": - lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); + lambdaQuery.eq(CpsQuestionInfo::getStatus1, MapUtils.getInteger(questionInfo.get(0), "status1")); break; case "2": - lambdaQuery.eq(CpsQuestionInfo::getStatus2, status); + lambdaQuery.eq(CpsQuestionInfo::getStatus2, MapUtils.getInteger(questionInfo.get(0), "status2")); break; case "3": - lambdaQuery.eq(CpsQuestionInfo::getStatus3, status); + lambdaQuery.eq(CpsQuestionInfo::getStatus3, MapUtils.getInteger(questionInfo.get(0), "status3")); break; case "4": - lambdaQuery.eq(CpsQuestionInfo::getStatus4, status); + lambdaQuery.eq(CpsQuestionInfo::getStatus4, MapUtils.getInteger(questionInfo.get(0), "status4")); break; case "5": - lambdaQuery.eq(CpsQuestionInfo::getStatus5, status); + lambdaQuery.eq(CpsQuestionInfo::getStatus5, MapUtils.getInteger(questionInfo.get(0), "status5")); break; case "6": - lambdaQuery.eq(CpsQuestionInfo::getStatus6, status); + lambdaQuery.eq(CpsQuestionInfo::getStatus6, MapUtils.getInteger(questionInfo.get(0), "status6")); break; } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java index c787a86..c5f9bff 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java @@ -50,23 +50,23 @@ public class CpsQuestionUpdateService extends AbsEAIService { switch (option) { case "1": - o.setStatus1(1); + o.setStatus1(2); break; case "2": - o.setStatus2(1); + o.setStatus2(2); break; case "3": - o.setStatus3(1); + o.setStatus3(2); o.setCompletionTime(DateUtils.getDateTimeNow()); break; case "4": - o.setStatus4(1); + o.setStatus4(2); break; case "5": - o.setStatus5(1); + o.setStatus5(2); break; case "6": - o.setStatus6(1); + o.setStatus6(2); break; } From f8713b2c6c9861e2011259f33c08fa473641787c Mon Sep 17 00:00:00 2001 From: dongsk Date: Sat, 1 Jul 2023 22:44:19 +0800 Subject: [PATCH 86/90] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/infra/entity/CpsQuestionInfo.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java index 0ae0a6b..ee3d108 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -9,6 +9,7 @@ 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.Data; import java.util.Date; @@ -22,30 +23,55 @@ import java.util.Date; @Data @TableName(value = "cps_question_info", autoResultMap = true) public class CpsQuestionInfo extends BaseMgrEntity { + @SerializedName(value = "defect_type") private String defectType; + @SerializedName(value = "question_location") private String questionLocation; + @SerializedName(value = "question_area") private String questionArea; + @SerializedName(value = "question_time") private Date questionTime; + @SerializedName(value = "question_level") private String questionLevel; + @SerializedName(value = "importance_level") private String importanceLevel; + @SerializedName(value = "times_one_day") private Integer timesOneDay; + @SerializedName(value = "question_information") private String questionInformation; + @SerializedName(value = "responsible_person") private String responsiblePerson; + @SerializedName(value = "responsible_person_name") private String responsiblePersonName; + @SerializedName(value = "containment_measures") private String containmentMeasures; + @SerializedName(value = "root_cause_identification") private String rootCauseIdentification; + @SerializedName(value = "corrective_actions") private String correctiveActions; + @SerializedName(value = "effect_verification") private String effectVerification; + @SerializedName(value = "control_standards") private String controlStandards; + @SerializedName(value = "completion_time") private Date completionTime; + @SerializedName(value = "control_area") private String controlArea; + @SerializedName(value = "knowledge_accumulation") private String knowledgeAccumulation; + @SerializedName(value = "status") private Integer status = 0; + @SerializedName(value = "status1") private Integer status1 = 1; + @SerializedName(value = "status2") private Integer status2 = 1; + @SerializedName(value = "status3") private Integer status3 = 1; + @SerializedName(value = "status4") private Integer status4 = 1; + @SerializedName(value = "status5") private Integer status5 = 1; + @SerializedName(value = "status6") private Integer status6 = 1; private String timestamp; } \ No newline at end of file From 5d4f1f6f410219e6d826fe44550c9248d56858b2 Mon Sep 17 00:00:00 2001 From: dongsk Date: Sun, 2 Jul 2023 12:55:50 +0800 Subject: [PATCH 87/90] =?UTF-8?q?cps=E8=B0=83=E6=95=B4=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/cps/CpsQuestionGetService.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index 16d8d9a..ad318ca 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -73,7 +73,9 @@ public class CpsQuestionGetService extends AbsEAIService { List collectIds = questionInfo.stream().map(o -> MapUtils.getLong(o, "id")).collect(Collectors.toList()); LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); - switch (option) { + String status = eaiRequest.getString("status"); + + /*switch (option) { case "1": lambdaQuery.eq(CpsQuestionInfo::getStatus1, MapUtils.getInteger(questionInfo.get(0), "status1")); break; @@ -92,6 +94,27 @@ public class CpsQuestionGetService extends AbsEAIService { case "6": lambdaQuery.eq(CpsQuestionInfo::getStatus6, MapUtils.getInteger(questionInfo.get(0), "status6")); break; + }*/ + + switch (option) { + case "1": + lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); + break; + case "2": + lambdaQuery.eq(CpsQuestionInfo::getStatus2, status); + break; + case "3": + lambdaQuery.eq(CpsQuestionInfo::getStatus3, status); + break; + case "4": + lambdaQuery.eq(CpsQuestionInfo::getStatus4, status); + break; + case "5": + lambdaQuery.eq(CpsQuestionInfo::getStatus5, status); + break; + case "6": + lambdaQuery.eq(CpsQuestionInfo::getStatus6, status); + break; } return buildOK("question_info", lambdaQuery.list()); From 4273060f9e52a697e57f503b95948f928fbe6d09 Mon Sep 17 00:00:00 2001 From: dongsk Date: Sun, 2 Jul 2023 13:00:24 +0800 Subject: [PATCH 88/90] no message --- .../digiwin/athena/app/service/cps/CpsQuestionGetService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index ad318ca..d8a475d 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -96,6 +96,10 @@ public class CpsQuestionGetService extends AbsEAIService { break; }*/ + if (StringUtils.isBlank(status)) { + status = "1"; + } + switch (option) { case "1": lambdaQuery.eq(CpsQuestionInfo::getStatus1, status); From 88ba67c4e329e47a330e5573de840c403913812f Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 3 Jul 2023 10:27:38 +0800 Subject: [PATCH 89/90] =?UTF-8?q?=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 --- .../digiwin/athena/app/infra/entity/CpsQuestionInfo.java | 6 +++++- .../athena/app/service/cps/CpsQuestionGetService.java | 7 +++++-- doc/sql/app-20230630-ddl.sql | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java index ee3d108..18e3d0b 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -73,5 +73,9 @@ public class CpsQuestionInfo extends BaseMgrEntity { private Integer status5 = 1; @SerializedName(value = "status6") private Integer status6 = 1; + @SerializedName(value = "measures_from") + private String measuresFrom; + @SerializedName(value = "accumulation_from") + private String accumulationFrom; private String timestamp; -} \ No newline at end of file +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java index d8a475d..5236f07 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -16,6 +16,7 @@ import com.digiwin.athena.app.infra.service.CpsQuestionInfoService; import com.digiwin.athena.opt.common.eai.EAIRequest; import com.digiwin.athena.opt.common.eai.EAIUtil; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import com.digiwin.athena.opt.common.security.SecurityUtil; import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -52,10 +53,12 @@ public class CpsQuestionGetService extends AbsEAIService { String option = eaiRequest.getString("option"); + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + // 侦测 if (StringUtils.isBlank(option)) { - List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).list(); + List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).eq(CpsQuestionInfo::getTenantSid,tenantSid).list(); list.forEach(o -> { o.setStatus(1); }); @@ -71,7 +74,7 @@ public class CpsQuestionGetService extends AbsEAIService { } List collectIds = questionInfo.stream().map(o -> MapUtils.getLong(o, "id")).collect(Collectors.toList()); - LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().in(CpsQuestionInfo::getId, collectIds); + LambdaQueryChainWrapper lambdaQuery = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getTenantSid,tenantSid).in(CpsQuestionInfo::getId, collectIds); String status = eaiRequest.getString("status"); diff --git a/doc/sql/app-20230630-ddl.sql b/doc/sql/app-20230630-ddl.sql index cde5566..0fa5b25 100644 --- a/doc/sql/app-20230630-ddl.sql +++ b/doc/sql/app-20230630-ddl.sql @@ -19,6 +19,8 @@ CREATE TABLE `cps_question_info` `completion_time` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', `control_area` DATETIME NULL DEFAULT NULL, `knowledge_accumulation` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `measures_from` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', + `accumulation_from` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', `status` INT(2) NULL DEFAULT '0' COMMENT '状态', `status1` INT(2) NULL DEFAULT '0' COMMENT '状态1', `status2` INT(2) NULL DEFAULT '0' COMMENT '状态2', From dec83fe4639fa5ab318abe8f5970c24fddd83dac Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 3 Jul 2023 11:04:05 +0800 Subject: [PATCH 90/90] =?UTF-8?q?=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 --- doc/sql/app-20230630-ddl.sql | 2 -- doc/sql/app-20230703-ddl.sql | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 doc/sql/app-20230703-ddl.sql diff --git a/doc/sql/app-20230630-ddl.sql b/doc/sql/app-20230630-ddl.sql index 0fa5b25..cde5566 100644 --- a/doc/sql/app-20230630-ddl.sql +++ b/doc/sql/app-20230630-ddl.sql @@ -19,8 +19,6 @@ CREATE TABLE `cps_question_info` `completion_time` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', `control_area` DATETIME NULL DEFAULT NULL, `knowledge_accumulation` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', - `measures_from` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', - `accumulation_from` VARCHAR(520) NULL DEFAULT '' COLLATE 'utf8mb4_general_ci', `status` INT(2) NULL DEFAULT '0' COMMENT '状态', `status1` INT(2) NULL DEFAULT '0' COMMENT '状态1', `status2` INT(2) NULL DEFAULT '0' COMMENT '状态2', diff --git a/doc/sql/app-20230703-ddl.sql b/doc/sql/app-20230703-ddl.sql new file mode 100644 index 0000000..b7a1b6a --- /dev/null +++ b/doc/sql/app-20230703-ddl.sql @@ -0,0 +1 @@ +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`;