@ -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; | |||||
} | |||||
} |
@ -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; | |||||
} | |||||
} |
@ -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; | |||||
} | |||||
} |
@ -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<ObjenesisStd> objenesisStdThreadLocal = ThreadLocal.withInitial(ObjenesisStd::new); | |||||
private static ConcurrentHashMap<Class<?>, ConcurrentHashMap<Class<?>, BeanCopier>> cache = new ConcurrentHashMap<>(); | |||||
public static <T> T copy(Object source, Class<T> target) { | |||||
return copy(source, objenesisStdThreadLocal.get().newInstance(target)); | |||||
} | |||||
public static <T> T copy(Object source, T target) { | |||||
BeanCopier beanCopier = getCacheBeanCopier(source.getClass(), target.getClass()); | |||||
beanCopier.copy(source, target, null); | |||||
return target; | |||||
} | |||||
public static <T> List<T> copyList(List<?> sources, Class<T> target) { | |||||
if (sources.isEmpty()) { | |||||
return Collections.emptyList(); | |||||
} | |||||
ArrayList<T> 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> T mapToBean(Map<?, ?> source, Class<T> target) { | |||||
T bean = objenesisStdThreadLocal.get().newInstance(target); | |||||
BeanMap beanMap = BeanMap.create(bean); | |||||
beanMap.putAll(source); | |||||
return bean; | |||||
} | |||||
public static <T> Map<?, ?> beanToMap(T source) { | |||||
return BeanMap.create(source); | |||||
} | |||||
private static <S, T> BeanCopier getCacheBeanCopier(Class<S> source, Class<T> target) { | |||||
ConcurrentHashMap<Class<?>, BeanCopier> copierConcurrentHashMap = cache.computeIfAbsent(source, aClass -> new ConcurrentHashMap<>(16)); | |||||
return copierConcurrentHashMap.computeIfAbsent(target, aClass -> BeanCopier.create(source, target, false)); | |||||
} | |||||
} |
@ -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 <T> List<T> string2List(String messageBody, Class<T> 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 <T> | |||||
* @return | |||||
*/ | |||||
public static <T> List<T> convertString2List(String param, String key, Class<T> clazz) { | |||||
Map<String, Object> paramMap = str2Map(param); | |||||
return getMapTs(paramMap, key, clazz); | |||||
} | |||||
/** | |||||
* String 转 map | |||||
* | |||||
* @param param | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
public static Map<String, Object> str2Map(String param) { | |||||
if (StringUtils.isEmpty(param)) { | |||||
return new HashMap<>(); | |||||
} | |||||
try { | |||||
return objectMapper.readValue(param, new TypeReference<Map<String, Object>>() { | |||||
}); | |||||
} catch (IOException e) { | |||||
log.error(e.getMessage()); | |||||
return new HashMap<>(); | |||||
} | |||||
} | |||||
/** | |||||
* map 取 model list | |||||
* | |||||
* @param map | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
public static <T> List<T> getMapTs(Map map, String key, Class<T> 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; | |||||
} | |||||
} |
@ -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"; | |||||
} |
@ -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<CpsQuestionInfo> { | |||||
@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; | |||||
} |
@ -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<SalesOrderDetailEntity> { | |||||
/** | |||||
* 订单单号 | |||||
*/ | |||||
@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; | |||||
} |
@ -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<StaffEntity> | |||||
{ | |||||
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; | |||||
} | |||||
} |
@ -1 +0,0 @@ | |||||
package com.digiwin.athena.app.infra.entity; |
@ -0,0 +1,58 @@ | |||||
<?xml version="1.0" encoding="UTF-8" ?> | |||||
<!DOCTYPE mapper | |||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.digiwin.athena.app.infra.repository.StaffRepository"> | |||||
<resultMap type="com.digiwin.athena.app.infra.entity.StaffEntity" id="StaffResult"> | |||||
<result property="id" column="id"/> | |||||
<result property="employeeNo" column="employee_no"/> | |||||
<result property="employeeName" column="employee_name"/> | |||||
<result property="enEmployeeName" column="en_employee_name"/> | |||||
<result property="mobileNo" column="mobile_no"/> | |||||
<result property="email" column="email"/> | |||||
<result property="status" column="status"/> | |||||
<result property="tabStatus" column="tab_status"/> | |||||
<result property="registerDate" column="register_date"/> | |||||
<result property="tenantSid" column="tenantsid"/> | |||||
<result property="tenantId" column="tenant_id"/> | |||||
<result property="createBy" column="create_by"/> | |||||
<result property="createDate" column="create_date"/> | |||||
<result property="modifiedBy" column="modified_by"/> | |||||
<result property="modifiedDate" column="modified_date"/> | |||||
<result property="version" column="version"/> | |||||
<result property="deleted" column="deleted"/> | |||||
<result property="timestamp" column="timestamp"/> | |||||
</resultMap> | |||||
<sql id="selectStaffVo"> | |||||
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 | |||||
</sql> | |||||
<update id="updateStaffList"> | |||||
<foreach collection="list" item="item" index="index" close="" open="" separator=";"> | |||||
update cim_staff | |||||
<trim prefix="SET" suffixOverrides=","> | |||||
<if test="item.employeeNo != null">employee_no = #{item.employeeNo},</if> | |||||
<if test="item.employeeName != null">employee_name = #{item.employeeName},</if> | |||||
<if test="item.enEmployeeName != null">en_employee_name = #{item.enEmployeeName},</if> | |||||
<if test="item.mobileNo != null">mobile_no = #{item.mobileNo},</if> | |||||
<if test="item.email != null">email = #{item.email},</if> | |||||
</trim> | |||||
where id = #{item.id} | |||||
</foreach> | |||||
</update> | |||||
<update id="updateStatusAndDate"> | |||||
<foreach collection="list" item="item" index="index" close="" open="" separator=";"> | |||||
update cim_staff | |||||
<trim prefix="SET" suffixOverrides=","> | |||||
<if test="item.tabStatus != null">tab_status = #{item.tabStatus},</if> | |||||
<if test="item.registerDate != null">register_date = #{item.registerDate},</if> | |||||
</trim> | |||||
where id = #{item.id} | |||||
</foreach> | |||||
</update> | |||||
</mapper> |
@ -1 +0,0 @@ | |||||
package com.digiwin.athena.app.infra.mapper; |
@ -1,4 +0,0 @@ | |||||
package com.digiwin.athena.app.infra; | |||||
/* | |||||
*1.基础服务放在此包下:主要是数据持久层,对外面提供基础数据处理 | |||||
*/ |
@ -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<CpsQuestionInfo> { | |||||
} |
@ -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<SalesOrderDetailEntity> { | |||||
} |
@ -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<StaffEntity> { | |||||
public void updateStaffList(@Param("list")List<StaffEntity> list,@Param("tenantsid") Long tenantsid); | |||||
public void updateStatusAndDate(@Param("list")List<StaffEntity> list,@Param("tenantsid") Long tenantsid); | |||||
} |
@ -1 +0,0 @@ | |||||
package com.digiwin.athena.app.infra.repository; |
@ -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<CpsQuestionInfo> { | |||||
} |
@ -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<CpsQuestionInfoRepository, CpsQuestionInfo> implements CpsQuestionInfoService { | |||||
} |
@ -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<SalesOrderDetailRepository, SalesOrderDetailEntity> implements SalesOrderDetailService { | |||||
} |
@ -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<StaffRepository, StaffEntity> implements StaffService { | |||||
} |
@ -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<SalesOrderDetailEntity> { | |||||
} |
@ -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<StaffEntity> { | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception; | |||||
@EAIService(id = CpsUtil.CPS_QUESTION_INFO_UPDATE) | |||||
DWEAIResult cpsQuestionUpdate(Map<String, String> headers, String messageBody) throws Exception; | |||||
@EAIService(id = CpsUtil.CPS_QUESTION_INFO_GET) | |||||
DWEAIResult cpsQuestionGet(Map<String, String> headers, String messageBody) throws Exception; | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception; | |||||
/** | |||||
* 检料订单创建 | |||||
* @param headers | |||||
* @param messageBody | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@EAIService(id = SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_CREATE) | |||||
DWEAIResult create(Map<String, String> headers, String messageBody) throws Exception; | |||||
/** | |||||
* 检料订单创建 | |||||
* @param headers | |||||
* @param messageBody | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@EAIService(id = SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_UPDATE) | |||||
DWEAIResult update(Map<String, String> headers, String messageBody) throws Exception; | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception; | |||||
/** | |||||
* 新人报道侦测 | |||||
* @param headers | |||||
* @param messageBody | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET) | |||||
DWEAIResult get(Map<String, String> headers, String messageBody) throws Exception; | |||||
/** | |||||
* 新人报道创建 | |||||
* @param headers | |||||
* @param messageBody | |||||
* @return | |||||
* @throws Exception | |||||
*/ | |||||
@EAIService(id = StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE) | |||||
DWEAIResult create(Map<String, String> headers, String messageBody) throws Exception; | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(CpsUtil.CPS_QUESTION_INFO_CREATE, headers, messageBody); | |||||
} | |||||
@Override | |||||
public DWEAIResult cpsQuestionGet(Map<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(CpsUtil.CPS_QUESTION_INFO_GET, headers, messageBody); | |||||
} | |||||
@Override | |||||
public DWEAIResult cpsQuestionUpdate(Map<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(CpsUtil.CPS_QUESTION_INFO_UPDATE, headers, messageBody); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_GET,headers,messageBody); | |||||
} | |||||
@Override | |||||
public DWEAIResult create(Map<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_CREATE,headers,messageBody); | |||||
} | |||||
@Override | |||||
public DWEAIResult update(Map<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(SalesOrderDetailUtil.DEMO_SO_ITEM_INFO_UPDATE,headers,messageBody); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_UPDATE,headers,messageBody); | |||||
} | |||||
@Override | |||||
public DWEAIResult get(Map<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_GET,headers,messageBody); | |||||
} | |||||
@Override | |||||
public DWEAIResult create(Map<String, String> headers, String messageBody) throws Exception { | |||||
return eaiServiceContext.execute(StaffUtil.DEMO_WAIT_REGISTER_PERSONNEL_INFO_CREATE,headers,messageBody); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
EAIRequest request = EAIRequest.build(messageBody); | |||||
List<CpsQuestionInfo> questionInfo = request.getObject("question_info", new TypeReference<List<CpsQuestionInfo>>() { | |||||
}); | |||||
questionInfo.forEach(o->{ | |||||
o.setResponsiblePerson(SecurityUtil.getUserProfile().getUserId()); | |||||
o.setResponsiblePersonName(SecurityUtil.getUserProfile().getUserName()); | |||||
}); | |||||
cpsQuestionInfoService.saveBatch(questionInfo); | |||||
return buildOK("question_info", questionInfo); | |||||
} | |||||
} |
@ -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<String, String> 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<CpsQuestionInfo> 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<Map<String, Object>> questionInfo = eaiRequest.getObject("question_info", EAIUtil.TYPE_LIST_MAP_V_OBJ); | |||||
if (questionInfo.isEmpty()) { | |||||
return buildOK("question_info", new ArrayList<>()); | |||||
} | |||||
List<Long> collectIds = questionInfo.stream().map(o -> MapUtils.getLong(o, "id")).collect(Collectors.toList()); | |||||
LambdaQueryChainWrapper<CpsQuestionInfo> 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()); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
EAIRequest request = EAIRequest.build(messageBody); | |||||
List<CpsQuestionInfo> questionInfo = request.getObject("question_info", new TypeReference<List<CpsQuestionInfo>>() { | |||||
}); | |||||
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(); | |||||
} | |||||
} |
@ -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"; | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
// 入参反序列化 | |||||
EAIRequest request = new EAIRequest(messageBody); | |||||
List<SalesOrderDetailEntity> salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference<List<SalesOrderDetailEntity>>(){}); | |||||
List<SalesOrderDetailEntity> 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)); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
EAIRequest request = EAIRequest.build(messageBody); | |||||
List<SalesOrderDetailEntity> salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference<List<SalesOrderDetailEntity>>(){}); | |||||
List<Long> idList = salesOrderDetailDTOList.stream().map(SalesOrderDetailEntity::getId).collect(Collectors.toList()); | |||||
// 两次调get查询 | |||||
LambdaQueryWrapper<SalesOrderDetailEntity> queryWrapper; | |||||
if(request.getParameter().get(ParameterConstant.OPTION).equals(ParameterConstant.SET_NUMBER)){ | |||||
queryWrapper = Wrappers.<SalesOrderDetailEntity>lambdaQuery() | |||||
.eq(SalesOrderDetailEntity::getTenantSid,0L); | |||||
}else{ | |||||
queryWrapper = Wrappers.<SalesOrderDetailEntity>lambdaQuery() | |||||
.in(SalesOrderDetailEntity::getId,idList) | |||||
.eq(SalesOrderDetailEntity::getStatus,salesOrderDetailDTOList.get(0).getStatus()); | |||||
} | |||||
List<SalesOrderDetailEntity> list = salesOrderDetailService.list(queryWrapper); | |||||
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("sales_order_detail",list)); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
// 入参反序列化 | |||||
EAIRequest request = new EAIRequest(messageBody); | |||||
List<SalesOrderDetailEntity> salesOrderDetailDTOList = request.getObject("sales_order_detail", new TypeReference<List<SalesOrderDetailEntity>>(){}); | |||||
List<SalesOrderDetailEntity> 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<>()); | |||||
} | |||||
} |
@ -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"; | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
//反序列化字段 | |||||
EAIRequest request = new EAIRequest(messageBody); | |||||
List<StaffEntity> 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)); | |||||
} | |||||
} |
@ -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<String, String> 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<StaffEntity> lmq = new LambdaQueryWrapper<>(); | |||||
lmq.eq(StaffEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); | |||||
lmq.eq(StaffEntity::getTabStatus, TabStatusEnums.NOSET.getValue()); | |||||
List<StaffEntity> staffEntities = staffRepository.selectList(lmq); | |||||
if (!CollectionUtils.isEmpty(staffEntities)) { | |||||
List<Long> idList = staffEntities.stream().map(StaffEntity::getId).collect(Collectors.toList()); | |||||
LambdaUpdateWrapper<StaffEntity> 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<StaffEntity> list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); | |||||
LambdaQueryWrapper<StaffEntity> 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<StaffEntity> staffEntities = staffRepository.selectList(lmq); | |||||
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); | |||||
} else if (OptionEnums.BASIC.getValue().equals(option)) { | |||||
List<StaffEntity> list = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF); | |||||
LambdaQueryWrapper<StaffEntity> 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<StaffEntity> staffEntities = staffRepository.selectList(lmq); | |||||
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("wait_register_personnel", staffEntities)); | |||||
} | |||||
return EAIUtil.buildEAIResult(new HashMap<>()); | |||||
} | |||||
} |
@ -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<String, String> headers, String messageBody) throws Exception { | |||||
//反序列化字段 | |||||
EAIRequest request = new EAIRequest(messageBody); | |||||
String option = request.getObject("option", String.class); | |||||
List<StaffEntity> 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<Boolean, List<StaffEntity>> collect = staffList.stream().collect(Collectors.groupingBy(item -> ObjectUtils.isEmpty(item.getId()))); | |||||
List<StaffEntity> 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<StaffEntity> 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<Long> idList = staffList.stream().map(StaffEntity::getId).collect(Collectors.toList()); | |||||
LambdaUpdateWrapper<StaffEntity> lmu = new LambdaUpdateWrapper<>(); | |||||
lmu.set(StaffEntity::getStatus, StatusEnums.REPORTED.getValue()); | |||||
lmu.in(StaffEntity::getId, idList); | |||||
staffService.update(lmu); | |||||
} | |||||
return EAIUtil.buildEAIResult(new HashMap<>()); | |||||
} | |||||
} |
@ -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<StaffEntity>> LIST_ENTITY_STAFF = new TypeReference<List<StaffEntity>>() { | |||||
}; | |||||
} |
@ -1,4 +1,4 @@ | |||||
#save dap.info | #save dap.info | ||||
#Sun Jan 29 14:54:12 CST 2023 | #Sun Jan 29 14:54:12 CST 2023 | ||||
group.name=cim | |||||
group.name=demo | |||||
business.extension.layer= | business.extension.layer= |
@ -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; | |||||
@ -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 | |||||
; |
@ -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`; |
@ -1 +0,0 @@ | |||||
-- cim_wo_routing 工单工艺数据 |
@ -1 +1 @@ | |||||
999 | |||||
1032 |