Commit cfadad32 by 谢海旭

[+]新增接口:根据 门店ID+状态 查询旅程列表、根据活动ID查询门店旅程详情

1 parent 1943d6f0
Showing 17 changed files with 755 additions and 233 deletions
package cn.com.glsx.process.api;
import cn.com.glsx.process.modules.model.SopInstDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.Map;
/**
* @author payu
*/
@FeignClient(name = "rest-admin", contextId = "sop-inst", path = "/api/sopInsts/", decode404 = true)
public interface SopInstFeignClient {
/**
* 一、FeignClients使用注意事项:
* 1. @EnableFeignClients 默认扫描 xxxxApplication启动入口 所在包路径下的 @FeignClient bean,若无法扫描到, 可以在使用Feign调用外部模块的api时候,
* 需要在引用服务中 xxxxApplication 中的 `@EnableFeignClients(basePackages = "cn.tendyron.customer")` 添加外部包需要扫描FeignClient的路径,否则无法注入bean
* 2. @FeignClient 声明的类,使用 spring.application.name 作为 name配置 @FeignClient(name="xxxx"),如果想保留 context-path , 则需要配置 path 属性 ,如:@FeignClient(name="xxxx" , path="xxxx(context-path)")
* 3. @FeignClient 接口对应的实现类,需要使用 @RestController注解 声明
* 4. mapper注解不支持 : @GetMapping,@PostMapping , 参数要加 @RequestParam(“xxx”)
* 5. FeignClient 调用,实质是httpClient调用 ,若我们暴露的接口api,声明了对应的 http mapper 信息,在调用方调用时候,通过代理 发起了 http请求,到服务提供方对应的http服务上去,所以在服务提供方的接口,可以使用 @RestController
* 来声明接口的 实现,否则调用方无法找到 http 对应的路径,会报404 ;
* 或者 根据 api 声明的http 信息,构建一个 Controller ,再来调用接口的实现类,但是这样不太方便;
* 6.FeignClient是一个“客户端”,它是用来发起请求的,不是提供服务的。
*
*
* 二、fallback 几种模式:
* 1.EchoCenterFeignServiceFallback.class 直接fallback,获取不到HTTP请求错误状态码和信息
* 2.EchoCenterFeignFactory.class 特定类型工厂模式
* 3.FunFallbackFactory 使用统一的工厂模式处理
*
*
* 三、性能问题
* 1.Feign是一个http请求调用的轻量级框架,基于http协议,性能不如rpc
* 2.可以为Feign配置连接池,配合使用okhttp等
*/
/**
* 测试Feign Get ,普通处理
* 注意: @RequestParam("xx") 注解一定要写,而且属性名xx不能省略
*/
/**
* 通过实例默认输入参数查询指定门店模板实例
*
* @param instParam
* @return
*/
@GetMapping("/getOneByInstParam")
SopInstDTO getOneByInstParam(Map<String, Object> instParam);
}
...@@ -9,8 +9,8 @@ public class SopInst { ...@@ -9,8 +9,8 @@ public class SopInst {
/** /**
* 启用状态:0,未启用;1,启用;-1,已删除/过期; * 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/ */
public static final Byte INST_STATUS_UNUSED = 0; public static final byte INST_STATUS_UNUSED = 0;
public static final Byte INST_STATUS_DELETED = -1; public static final byte INST_STATUS_DELETED = -1;
/** /**
* 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态 * 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
......
package cn.com.glsx.process.modules.mapper; package cn.com.glsx.process.modules.mapper;
import cn.com.glsx.process.modules.entity.SopInst; import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.model.SopInstSearch;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper; import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface SopInstMapper extends CommonBaseMapper<SopInst> { public interface SopInstMapper extends CommonBaseMapper<SopInst> {
List<SopInst> selectByGroupId(SopInstSearch search);
/**
* 通过门店模板实例初始参数查询
*
* @param instParamJson
* @return
*/
List<SopInst> selectByInstParam(@Param("instParamJson") String instParamJson);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.process.modules.model;
import cn.com.glsx.process.modules.entity.SopInstLink;
import cn.com.glsx.process.modules.entity.SopInstNode;
import java.util.Date;
import java.util.List;
public class SopInstDTO {
/**
* 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
private String instId;
/**
* 实例分组:当前场景下,分组id就是门店id
*/
private Integer grantId;
/**
* 实例名
*/
private String instName;
/**
* cron表达式,sop执行周期
*/
private String instCron;
/**
* sop简介
*/
private String instRemark;
private Date createTime;
private Date updateTime;
/**
* 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
private Byte instStatus;
/**
* 实例默认输入参数
*/
private String instParam;
/**
* sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
private Date expireTime;
/**
* 当前生效的批次
*/
private String batchNo;
/**
* sop任务节点
*/
private List<SopInstNode> nodes;
/**
* sop任务节点连接
*/
private List<SopInstLink> links;
/**
* 获取实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @return inst_id - 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public String getInstId() {
return instId;
}
/**
* 设置实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @param instId 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public void setInstId(String instId) {
this.instId = instId == null ? null : instId.trim();
}
/**
* 获取实例分组:当前场景下,分组id就是门店id
*
* @return grant_id - 实例分组:当前场景下,分组id就是门店id
*/
public Integer getGrantId() {
return grantId;
}
/**
* 设置实例分组:当前场景下,分组id就是门店id
*
* @param grantId 实例分组:当前场景下,分组id就是门店id
*/
public void setGrantId(Integer grantId) {
this.grantId = grantId;
}
/**
* 获取实例名
*
* @return inst_name - 实例名
*/
public String getInstName() {
return instName;
}
/**
* 设置实例名
*
* @param instName 实例名
*/
public void setInstName(String instName) {
this.instName = instName == null ? null : instName.trim();
}
/**
* 获取cron表达式,sop执行周期
*
* @return inst_cron - cron表达式,sop执行周期
*/
public String getInstCron() {
return instCron;
}
/**
* 设置cron表达式,sop执行周期
*
* @param instCron cron表达式,sop执行周期
*/
public void setInstCron(String instCron) {
this.instCron = instCron == null ? null : instCron.trim();
}
/**
* 获取sop简介
*
* @return inst_remark - sop简介
*/
public String getInstRemark() {
return instRemark;
}
/**
* 设置sop简介
*
* @param instRemark sop简介
*/
public void setInstRemark(String instRemark) {
this.instRemark = instRemark == null ? null : instRemark.trim();
}
/**
* @return create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取启用状态:0,未启用;1,启用;-1,已删除/过期;
*
* @return inst_status - 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
public Byte getInstStatus() {
return instStatus;
}
/**
* 设置启用状态:0,未启用;1,启用;-1,已删除/过期;
*
* @param instStatus 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
public void setInstStatus(Byte instStatus) {
this.instStatus = instStatus;
}
public String getInstParam() {
return instParam;
}
public void setInstParam(String instParam) {
this.instParam = instParam;
}
/**
* 获取sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @return expire_time - sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public Date getExpireTime() {
return expireTime;
}
/**
* 设置sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @param expireTime sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
/**
* 获取当前生效的批次
*
* @return batch_no - 当前生效的批次
*/
public String getBatchNo() {
return batchNo;
}
/**
* 设置当前生效的批次
*
* @param batchNo 当前生效的批次
*/
public void setBatchNo(String batchNo) {
this.batchNo = batchNo == null ? null : batchNo.trim();
}
public List<SopInstNode> getNodes() {
return nodes;
}
public void setNodes(List<SopInstNode> nodes) {
this.nodes = nodes;
}
public List<SopInstLink> getLinks() {
return links;
}
public void setLinks(List<SopInstLink> links) {
this.links = links;
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.process.modules.model;
import cn.hutool.db.Page;
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;
public class SopInstSearch extends Page {
/**
* 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
private String instId;
/**
* 实例分组:当前场景下,分组id就是门店id
*/
private Integer grantId;
/**
* 实例名
*/
private String instName;
/**
* cron表达式,sop执行周期
*/
private String instCron;
/**
* sop简介
*/
private String instRemark;
private Date createTime;
private Date updateTime;
/**
* 启用状态:0,未启用;1,启用;-1,已删除/过期;
*/
private List<Byte> instStatuses;
/**
* 实例默认输入参数
*/
private String instParam;
/**
* sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
private Date expireTime;
/**
* 当前生效的批次
*/
private String batchNo;
/**
* 分组id就是门店id
*/
@NotEmpty(message = "门店id不能为空!")
private String groupId;
/**
* 获取实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @return inst_id - 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public String getInstId() {
return instId;
}
/**
* 设置实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*
* @param instId 实例id,一般sop只允许一个实例。特殊情况可以根据输入参数来区分不同实例。实例名可以用于在cdp保存状态
*/
public void setInstId(String instId) {
this.instId = instId == null ? null : instId.trim();
}
/**
* 获取实例分组:当前场景下,分组id就是门店id
*
* @return grant_id - 实例分组:当前场景下,分组id就是门店id
*/
public Integer getGrantId() {
return grantId;
}
/**
* 设置实例分组:当前场景下,分组id就是门店id
*
* @param grantId 实例分组:当前场景下,分组id就是门店id
*/
public void setGrantId(Integer grantId) {
this.grantId = grantId;
}
/**
* 获取实例名
*
* @return inst_name - 实例名
*/
public String getInstName() {
return instName;
}
/**
* 设置实例名
*
* @param instName 实例名
*/
public void setInstName(String instName) {
this.instName = instName == null ? null : instName.trim();
}
/**
* 获取cron表达式,sop执行周期
*
* @return inst_cron - cron表达式,sop执行周期
*/
public String getInstCron() {
return instCron;
}
/**
* 设置cron表达式,sop执行周期
*
* @param instCron cron表达式,sop执行周期
*/
public void setInstCron(String instCron) {
this.instCron = instCron == null ? null : instCron.trim();
}
/**
* 获取sop简介
*
* @return inst_remark - sop简介
*/
public String getInstRemark() {
return instRemark;
}
/**
* 设置sop简介
*
* @param instRemark sop简介
*/
public void setInstRemark(String instRemark) {
this.instRemark = instRemark == null ? null : instRemark.trim();
}
/**
* @return create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<Byte> getInstStatuses() {
return instStatuses;
}
public void setInstStatuses(List<Byte> instStatuses) {
this.instStatuses = instStatuses;
}
public String getInstParam() {
return instParam;
}
public void setInstParam(String instParam) {
this.instParam = instParam;
}
/**
* 获取sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @return expire_time - sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public Date getExpireTime() {
return expireTime;
}
/**
* 设置sop有效期,每个sop都设置一个有效期,到期自动停止。
*
* @param expireTime sop有效期,每个sop都设置一个有效期,到期自动停止。
*/
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
/**
* 获取当前生效的批次
*
* @return batch_no - 当前生效的批次
*/
public String getBatchNo() {
return batchNo;
}
/**
* 设置当前生效的批次
*
* @param batchNo 当前生效的批次
*/
public void setBatchNo(String batchNo) {
this.batchNo = batchNo == null ? null : batchNo.trim();
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ import cn.hutool.db.Page; ...@@ -4,7 +4,7 @@ import cn.hutool.db.Page;
import lombok.Data; import lombok.Data;
@Data @Data
public class SopTplSearch extends Page { public class SopTplSearch extends Page {
private String id; private String id;
......
package cn.com.glsx.process.modules.api;
import cn.com.glsx.process.api.SopInstFeignClient;
import cn.com.glsx.process.modules.model.SopInstDTO;
import cn.com.glsx.process.modules.service.SopInstService;
import com.glsx.plat.core.annotation.ResponseResultBody;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;
/**
* 微服务应用在网关中处理统一返回体
*
* @author payu
*/
@Slf4j
@Tag(name = "SOP门店模板实例开放接口(Demo)")
@RestController
@RequestMapping(value = "/api/sopInsts")
@ResponseResultBody
public class SopInstApiController implements SopInstFeignClient {
@Resource
private SopInstService sopInstService;
@GetMapping("/getOneByInstParam")
@Override
public SopInstDTO getOneByInstParam(@RequestParam Map<String, Object> instParam) {
return sopInstService.getOneByInstParam(instParam);
}
}
package cn.com.glsx.process.modules.controller;
import cn.com.glsx.process.modules.BaseController;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.model.SopInstSearch;
import cn.com.glsx.process.modules.service.SopInstService;
import com.github.pagehelper.PageInfo;
import com.glsx.plat.core.annotation.ResponseResultBody;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Slf4j
@Tag(name = "SOP门店模板实例开放接口")
@RestController
@RequestMapping(value = "/sop/sopInsts")
@ResponseResultBody
public class SopInstController extends BaseController {
@Resource
private SopInstService sopInstService;
@Operation(summary = "查询SOP门店模板实例分页列表", description = "查询SOP门店模板实例分页列表")
@GetMapping("/byGroupId")
public PageInfo<SopInst> selectByGroupId(@Validated SopInstSearch search) {
return sopInstService.selectByGroupId(search);
}
}
...@@ -30,8 +30,7 @@ public class SopTplController extends BaseController { ...@@ -30,8 +30,7 @@ public class SopTplController extends BaseController {
@Operation(summary = "SOP模板列表", description = "SOP模板列表") @Operation(summary = "SOP模板列表", description = "SOP模板列表")
@GetMapping @GetMapping
public PageInfo<SopTpl> page(SopTplSearch search) { public PageInfo<SopTpl> page(SopTplSearch search) {
PageInfo<SopTpl> list = sopTplService.page(search); return sopTplService.page(search);
return list;
} }
@Operation(summary = "SOP模板详情", description = "SOP模板详情") @Operation(summary = "SOP模板详情", description = "SOP模板详情")
......
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.model.SopInstDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface SopInstConverter {
SopInstConverter INSTANCE = Mappers.getMapper(SopInstConverter.class);
SopInst do2do(SopInst sopInst);
SopInstDTO do2dto(SopInst sopInst);
}
package cn.com.glsx.process.modules.service; package cn.com.glsx.process.modules.service;
import cn.com.glsx.process.modules.converter.SopInstConverter;
import cn.com.glsx.process.modules.entity.SopInst; import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.entity.SopInstLink;
import cn.com.glsx.process.modules.entity.SopInstNode;
import cn.com.glsx.process.modules.mapper.SopInstLinkMapper;
import cn.com.glsx.process.modules.mapper.SopInstMapper; import cn.com.glsx.process.modules.mapper.SopInstMapper;
import cn.com.glsx.process.modules.mapper.SopInstNodeMapper;
import cn.com.glsx.process.modules.model.SopInstDTO;
import cn.com.glsx.process.modules.model.SopInstSearch;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
@Service @Service
public class SopInstService { public class SopInstService {
...@@ -11,6 +26,11 @@ public class SopInstService { ...@@ -11,6 +26,11 @@ public class SopInstService {
@Autowired @Autowired
private SopInstMapper sopInstMapper; private SopInstMapper sopInstMapper;
@Autowired
private SopInstLinkMapper sopInstLinkMapper;
@Autowired
private SopInstNodeMapper sopInstNodeMapper;
/** /**
* 根据id查询 * 根据id查询
* *
...@@ -58,4 +78,44 @@ public class SopInstService { ...@@ -58,4 +78,44 @@ public class SopInstService {
} }
return false; return false;
} }
/**
* 查询SOP门店模板实例分页列表
*
* @param search
* @return
*/
public PageInfo<SopInst> selectByGroupId(SopInstSearch search) {
PageHelper.startPage(search.getPageNumber(), search.getPageSize());
List<SopInst> list = sopInstMapper.selectByGroupId(search);
return new PageInfo<>(list);
}
/**
* 通过实例默认输入参数查询指定门店模板实例
*
* @param instParam
* @return
*/
public SopInstDTO getOneByInstParam(Map<String, Object> instParam) {
String instParamJsonStr = JSONUtil.toJsonStr(instParam);
List<SopInst> sopInsts = sopInstMapper.selectByInstParam(instParamJsonStr);
if (CollectionUtils.isEmpty(sopInsts)) {
return null;
}
Assert.state(sopInsts.size() < 2, "根据查询条件找到多条记录,请检查参数是否有误!");
SopInstDTO sopInstDTO = SopInstConverter.INSTANCE.do2dto(sopInsts.get(0));
String instId = sopInstDTO.getInstId();
SopInstNode nodeQuery = new SopInstNode();
nodeQuery.setInstId(instId);
List<SopInstNode> nodes = sopInstNodeMapper.select(nodeQuery);
sopInstDTO.setNodes(nodes);
SopInstLink linkQuery = new SopInstLink();
linkQuery.setInstId(instId);
List<SopInstLink> links = sopInstLinkMapper.select(linkQuery);
sopInstDTO.setLinks(links);
return sopInstDTO;
}
} }
...@@ -64,7 +64,6 @@ public class SopTplGrantService { ...@@ -64,7 +64,6 @@ public class SopTplGrantService {
SopTplLink linkQuery = new SopTplLink(); SopTplLink linkQuery = new SopTplLink();
linkQuery.setTplId(tplId); linkQuery.setTplId(tplId);
List<SopTplLink> links = sopTplLinkMapper.select(linkQuery); List<SopTplLink> links = sopTplLinkMapper.select(linkQuery);
int count = sopTplGrantMapper.countAllByTplId(tplId);
SopTplConverter sopTplConverter = SopTplConverter.INSTANCE; SopTplConverter sopTplConverter = SopTplConverter.INSTANCE;
SopTplLinKConverter sopTplLinKConverter = SopTplLinKConverter.INSTANCE; SopTplLinKConverter sopTplLinKConverter = SopTplLinKConverter.INSTANCE;
......
...@@ -25,4 +25,25 @@ ...@@ -25,4 +25,25 @@
inst_id, grant_id, inst_name, inst_cron, inst_remark, create_time, update_time, inst_status, inst_id, grant_id, inst_name, inst_cron, inst_remark, create_time, update_time, inst_status,
inst_param, inst_snapshot, expire_time, batch_no inst_param, inst_snapshot, expire_time, batch_no
</sql> </sql>
<select id="selectByGroupId" resultType="cn.com.glsx.process.modules.entity.SopInst">
SELECT si.inst_id, si.grant_id, si.inst_name, si.inst_cron, si.inst_remark, si.create_time, si.update_time, si.inst_status,
si.expire_time, si.batch_no
FROM sop_inst AS si
INNER JOIN sop_tpl_grant AS stg ON si.grant_id = stg.grant_id
WHERE stg.group_id = #{groupId}
<if test="instStatuses != null and instStatuses.size() > 0">
AND si.inst_status IN
<foreach collection="instStatuses" open="(" separator="," close=")" item="status">
#{status}
</foreach>
</if>
ORDER BY si.inst_status DESC
</select>
<select id="selectByInstParam" resultType="cn.com.glsx.process.modules.entity.SopInst">
SELECT
<include refid="Base_Column_List"/>
FROM sop_inst WHERE JSON_CONTAINS(inst_param, #{instParamJson},'$');
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInst;
import cn.com.glsx.process.modules.entity.SopTpl;
import cn.com.glsx.process.modules.model.SopTplDTO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class SopTplConverterImpl implements SopTplConverter {
@Override
public SopTplDTO do2dto(SopTpl sopTpl) {
if ( sopTpl == null ) {
return null;
}
SopTplDTO sopTplDTO = new SopTplDTO();
sopTplDTO.setTplId( sopTpl.getTplId() );
sopTplDTO.setTplName( sopTpl.getTplName() );
sopTplDTO.setTplCron( sopTpl.getTplCron() );
sopTplDTO.setTplRemark( sopTpl.getTplRemark() );
sopTplDTO.setTplStatus( sopTpl.getTplStatus() );
sopTplDTO.setTplParamDef( sopTpl.getTplParamDef() );
sopTplDTO.setTplResultDef( sopTpl.getTplResultDef() );
sopTplDTO.setTplSingleton( sopTpl.getTplSingleton() );
sopTplDTO.setCreateTime( sopTpl.getCreateTime() );
sopTplDTO.setUpdateTime( sopTpl.getUpdateTime() );
return sopTplDTO;
}
@Override
public SopTpl dto2do(SopTplDTO sopTplDTO) {
if ( sopTplDTO == null ) {
return null;
}
SopTpl sopTpl = new SopTpl();
sopTpl.setTplId( sopTplDTO.getTplId() );
sopTpl.setTplName( sopTplDTO.getTplName() );
sopTpl.setTplCron( sopTplDTO.getTplCron() );
sopTpl.setTplRemark( sopTplDTO.getTplRemark() );
sopTpl.setTplStatus( sopTplDTO.getTplStatus() );
sopTpl.setTplParamDef( sopTplDTO.getTplParamDef() );
sopTpl.setTplResultDef( sopTplDTO.getTplResultDef() );
sopTpl.setTplSingleton( sopTplDTO.getTplSingleton() );
sopTpl.setCreateTime( sopTplDTO.getCreateTime() );
sopTpl.setUpdateTime( sopTplDTO.getUpdateTime() );
return sopTpl;
}
@Override
public SopInst do2inst(SopTpl sopTpl) {
if ( sopTpl == null ) {
return null;
}
SopInst sopInst = new SopInst();
sopInst.setInstName( sopTpl.getTplName() );
sopInst.setInstCron( sopTpl.getTplCron() );
sopInst.setInstRemark( sopTpl.getTplRemark() );
sopInst.setInstParam( sopTpl.getTplParamDef() );
sopInst.setCreateTime( sopTpl.getCreateTime() );
sopInst.setUpdateTime( sopTpl.getUpdateTime() );
return sopInst;
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInstLink;
import cn.com.glsx.process.modules.entity.SopTplLink;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class SopTplLinKConverterImpl implements SopTplLinKConverter {
@Override
public SopInstLink tpl2inst(SopTplLink link) {
if ( link == null ) {
return null;
}
SopInstLink sopInstLink = new SopInstLink();
sopInstLink.setSourceId( link.getSourceId() );
sopInstLink.setTargetId( link.getTargetId() );
return sopInstLink;
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.SopInstNode;
import cn.com.glsx.process.modules.entity.SopTplNode;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class SopTplNodeConverterImpl implements SopTplNodeConverter {
@Override
public SopInstNode tpl2inst(SopTplNode node) {
if ( node == null ) {
return null;
}
SopInstNode sopInstNode = new SopInstNode();
sopInstNode.setNodeParam( node.getNodeParamDef() );
sopInstNode.setNodeContent( node.getNodeContentDef() );
sopInstNode.setNodeId( node.getNodeId() );
sopInstNode.setNodeName( node.getNodeName() );
sopInstNode.setNodeType( node.getNodeType() );
sopInstNode.setNodeLabel( node.getNodeLabel() );
sopInstNode.setNodeKey( node.getNodeKey() );
sopInstNode.setNodeShow( node.getNodeShow() );
sopInstNode.setNodeVisible( node.getNodeVisible() );
sopInstNode.setNodeCron( node.getNodeCron() );
sopInstNode.setNodeExpireCron( node.getNodeExpireCron() );
return sopInstNode;
}
}
package cn.com.glsx.process.modules.converter;
import cn.com.glsx.process.modules.entity.User;
import cn.com.glsx.process.modules.model.UserBO;
import cn.com.glsx.process.modules.model.UserDTO;
import javax.annotation.Generated;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2023-09-11T15:01:39+0800",
comments = "version: 1.5.2.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
)
public class UserConverterImpl implements UserConverter {
@Override
public UserDTO do2dto(User user) {
if ( user == null ) {
return null;
}
UserDTO userDTO = new UserDTO();
userDTO.setId( user.getId() );
userDTO.setAccount( user.getAccount() );
userDTO.setUsername( user.getUsername() );
userDTO.setRealname( user.getRealname() );
userDTO.setPassword( user.getPassword() );
userDTO.setPhone( user.getPhone() );
return userDTO;
}
@Override
public User dto2do(UserDTO userDTO) {
if ( userDTO == null ) {
return null;
}
User user = new User();
user.setId( userDTO.getId() );
user.setAccount( userDTO.getAccount() );
user.setPassword( userDTO.getPassword() );
user.setUsername( userDTO.getUsername() );
user.setRealname( userDTO.getRealname() );
user.setPhone( userDTO.getPhone() );
return user;
}
@Override
public UserBO do2bo(User user) {
if ( user == null ) {
return null;
}
UserBO userBO = new UserBO();
userBO.setRealName( user.getRealname() );
userBO.setId( user.getId() );
userBO.setAccount( user.getAccount() );
userBO.setPassword( user.getPassword() );
userBO.setUsername( user.getUsername() );
userBO.setPhone( user.getPhone() );
userBO.setAvatar( user.getAvatar() );
return userBO;
}
@Override
public User bo2do(UserBO userBO) {
if ( userBO == null ) {
return null;
}
User user = new User();
user.setRealname( userBO.getRealName() );
user.setId( userBO.getId() );
user.setAccount( userBO.getAccount() );
user.setPassword( userBO.getPassword() );
user.setUsername( userBO.getUsername() );
user.setPhone( userBO.getPhone() );
user.setAvatar( userBO.getAvatar() );
return user;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!