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/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/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..c2855f0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/constant/ParameterConstant.java @@ -0,0 +1,15 @@ +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 STATUS = "status"; + + public static final String SET_NUMBER = "1"; +} 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..18e3d0b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/CpsQuestionInfo.java @@ -0,0 +1,81 @@ +/* + * 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 com.google.gson.annotations.SerializedName; +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 { + @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; + @SerializedName(value = "measures_from") + private String measuresFrom; + @SerializedName(value = "accumulation_from") + private String accumulationFrom; + private String timestamp; +} 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..4fe44cf --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/SalesOrderDetailEntity.java @@ -0,0 +1,80 @@ +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 = "cim_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/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..bddea14 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java @@ -0,0 +1,75 @@ +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; + +/** + * 人资报道对象 cim_staff + * + * @author zhenggl + * @date 2023-04-28 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +@TableName(value = "cim_staff", autoResultMap = true) +public class StaffEntity extends BaseMgrEntity +{ + private static final long serialVersionUID = 1L; + + + /** 员工编号 */ + @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; + + /** 数据状态 */ + @SerializedName("tab_status") + private Integer tabStatus; + + /** 报道日期 */ + @SerializedName("register_date") + private Date registerDate; + + + /** 时间戳 */ + @SerializedName("timestamp") + 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/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/StaffMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/StaffMapper.xml new file mode 100644 index 0000000..fc160e2 --- /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 cim_staff + + + + + + update 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} + + + + + + update cim_staff + + tab_status = #{item.tabStatus}, + register_date = #{item.registerDate}, + + where id = #{item.id} + + + + 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/SalesOrderDetailRepository.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java new file mode 100644 index 0000000..72a3651 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java @@ -0,0 +1,10 @@ +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/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..d7a95f1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/StaffRepository.java @@ -0,0 +1,19 @@ +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/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..4aeb583 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/service/Impl/CpsQuestionInfoServiceImpl.java @@ -0,0 +1,24 @@ +/* + * 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; +import org.springframework.stereotype.Service; + +/** + * CpsQuestionInfoServiceImpl + * + * @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 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..5bed3f7 --- /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/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/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/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/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/SalesOrderDetailEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java new file mode 100644 index 0000000..3402931 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/SalesOrderDetailEAIService.java @@ -0,0 +1,42 @@ +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/StaffEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java new file mode 100644 index 0000000..2548b1b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/StaffEAIService.java @@ -0,0 +1,46 @@ +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_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/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/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/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..cab39a4 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/StaffEAIServiceImpl.java @@ -0,0 +1,36 @@ +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 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/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..075cc5f --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionCreateService.java @@ -0,0 +1,60 @@ +/* + * 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 com.digiwin.athena.opt.common.security.SecurityUtil; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * CpsQuestionCreateService + * + * @author DONGSK 2023/6/30 19:57 + * @since 1.0.0 + */ +@Service +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>() { + }); + + questionInfo.forEach(o->{ + o.setResponsiblePerson(SecurityUtil.getUserProfile().getUserId()); + o.setResponsiblePersonName(SecurityUtil.getUserProfile().getUserName()); + }); + + 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..5236f07 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionGetService.java @@ -0,0 +1,129 @@ +/* + * Author: DONGSK + * Datetime: 2023/6/30 19:57 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +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.common.security.SecurityUtil; +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; +import java.util.stream.Collectors; + +/** + * CpsQuestionUpdateService + * + * @author DONGSK 2023/6/30 19:57 + * @since 1.0.0 + */ +@Service +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"); + + Long tenantSid = SecurityUtil.getUserProfile().getTenantSid(); + + // 侦测 + if (StringUtils.isBlank(option)) { + + List list = cpsQuestionInfoService.lambdaQuery().eq(CpsQuestionInfo::getStatus, 0).eq(CpsQuestionInfo::getTenantSid,tenantSid).list(); + list.forEach(o -> { + o.setStatus(1); + }); + cpsQuestionInfoService.updateBatchById(list); + return buildOK("change_objects", list); + } + + // 任务卡查询 + List> questionInfo = eaiRequest.getObject("question_info", EAIUtil.TYPE_LIST_MAP_V_OBJ); + + 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().eq(CpsQuestionInfo::getTenantSid,tenantSid).in(CpsQuestionInfo::getId, collectIds); + + String status = eaiRequest.getString("status"); + + /*switch (option) { + case "1": + lambdaQuery.eq(CpsQuestionInfo::getStatus1, MapUtils.getInteger(questionInfo.get(0), "status1")); + break; + case "2": + lambdaQuery.eq(CpsQuestionInfo::getStatus2, MapUtils.getInteger(questionInfo.get(0), "status2")); + break; + case "3": + lambdaQuery.eq(CpsQuestionInfo::getStatus3, MapUtils.getInteger(questionInfo.get(0), "status3")); + break; + case "4": + lambdaQuery.eq(CpsQuestionInfo::getStatus4, MapUtils.getInteger(questionInfo.get(0), "status4")); + break; + case "5": + lambdaQuery.eq(CpsQuestionInfo::getStatus5, MapUtils.getInteger(questionInfo.get(0), "status5")); + break; + case "6": + lambdaQuery.eq(CpsQuestionInfo::getStatus6, MapUtils.getInteger(questionInfo.get(0), "status6")); + break; + }*/ + + if (StringUtils.isBlank(status)) { + status = "1"; + } + + 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..c5f9bff --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/cps/CpsQuestionUpdateService.java @@ -0,0 +1,79 @@ +/* + * 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 com.digiwin.athena.opt.common.util.DateUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * CpsQuestionUpdateService + * + * @author DONGSK 2023/6/30 19:57 + * @since 1.0.0 + */ +@Service +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(2); + break; + case "2": + o.setStatus2(2); + break; + case "3": + o.setStatus3(2); + o.setCompletionTime(DateUtils.getDateTimeNow()); + break; + case "4": + o.setStatus4(2); + break; + case "5": + o.setStatus5(2); + break; + case "6": + o.setStatus6(2); + 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/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..7e4d18d --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailCreateEAIService.java @@ -0,0 +1,57 @@ +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.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.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.setStatus(1); + return salesOrderDetailEntity; + }).collect(Collectors.toList()); + + salesOrderDetailService.saveBatch(salesOrderDetailEntityList); + + 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 new file mode 100644 index 0000000..1e1a69b --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailGetEAIService.java @@ -0,0 +1,60 @@ +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; +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; +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 + * 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 { + EAIRequest request = EAIRequest.build(messageBody); + 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() + .eq(SalesOrderDetailEntity::getTenantSid,0L); + }else{ + queryWrapper = Wrappers.lambdaQuery() + .in(SalesOrderDetailEntity::getId,idList) + .eq(SalesOrderDetailEntity::getStatus,salesOrderDetailDTOList.get(0).getStatus()); + } + + 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..4d03702 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java @@ -0,0 +1,57 @@ +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; +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/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..cecc9d6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffCreateEAIService.java @@ -0,0 +1,58 @@ +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; +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; +import java.util.List; +import java.util.Map; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +@Service +@Log4j2 +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 + @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_ENTITY_STAFF); + if (CollectionUtils.isEmpty(staffList)){ + throw new DWRuntimeException("缺少必要参数"); + } + staffList.forEach(item ->{ + item.setStatus(StatusEnums.TOBEREPORTED.getValue()); + item.setTabStatus(TabStatusEnums.NOSET.getValue()); + }); + staffService.saveBatch(staffList); + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel",staffList)); + } +} 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..c7dc4b6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffGetEAIService.java @@ -0,0 +1,112 @@ +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.OptionEnums; +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.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; + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +@Service +@Log4j2 +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 { + //反序列化字段 + 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.getValue()); + lmu.in(StaffEntity::getId, idList); + staffService.update(lmu); + //修改查询到的参数 + staffEntities.forEach(item -> { + item.setTabStatus(TabStatusEnums.PENDING.getValue()); + }); + } + 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<>(); + lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); + 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()); + 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)); + } + return EAIUtil.buildEAIResult(new HashMap<>()); + } +} 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..dd98cd0 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java @@ -0,0 +1,90 @@ +package com.digiwin.athena.app.service.staff; + +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; +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.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.ObjectUtils; +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; + + +/** + * @Auther: zhenggl + * @Date: 2023/4/28 + */ +@Service +@Log4j2 +public class StaffUpdateEAIService extends AbsEAIService { + + @Resource + private StaffRepository staffRepository; + + @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); + 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)) { + staffList.forEach(item ->{ + item.setStatus(StatusEnums.TOBEREPORTED.getValue()); + item.setTabStatus(TabStatusEnums.NOSET.getValue()); + }); + staffService.saveBatch(staffList); + } else if (OptionEnums.BASIC.getValue().equals(option)) { + //区分是否有id没有则新增 + Map> collect = staffList.stream().collect(Collectors.groupingBy(item -> ObjectUtils.isEmpty(item.getId()))); + List insert = collect.get(true); + 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); + if (!CollectionUtils.isEmpty(update)){ + staffService.updateBatchById(update); + } + } else if (OptionEnums.TASK.getValue().equals(option)) { + 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.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 new file mode 100644 index 0000000..f1dcae2 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUtil.java @@ -0,0 +1,26 @@ +package com.digiwin.athena.app.service.staff; + +import com.alibaba.fastjson.TypeReference; +import com.digiwin.athena.app.infra.entity.StaffEntity; + +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 TypeReference> LIST_ENTITY_STAFF = new TypeReference>() { + }; +} 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= diff --git a/doc/sql/app-20230427-ddl.sql b/doc/sql/app-20230427-ddl.sql new file mode 100644 index 0000000..6ac2b66 --- /dev/null +++ b/doc/sql/app-20230427-ddl.sql @@ -0,0 +1,48 @@ + + -- 订单明细表 +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 '序号', + `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', + `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='订单明细'; + + + -- 新人报道表 +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; + 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-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`; 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 工单工艺数据 diff --git a/version_control/BUILD b/version_control/BUILD index cf5106d..4ac943d 100644 --- a/version_control/BUILD +++ b/version_control/BUILD @@ -1 +1 @@ -999 \ No newline at end of file +1032