yang_shj
2 years ago
19 changed files with 382 additions and 40 deletions
@ -0,0 +1,44 @@
|
||||
package com.hnac.hzims.ticket.processflow.controller; |
||||
|
||||
import com.hnac.hzims.ticket.processflow.entity.ProcessDict; |
||||
import com.hnac.hzims.ticket.processflow.service.ProcessDictService; |
||||
import groovy.util.logging.Slf4j; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/6/5 9:35 |
||||
*/ |
||||
|
||||
@Slf4j |
||||
@RequestMapping("/process-dict") |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
public class ProcessDictController { |
||||
|
||||
|
||||
private final ProcessDictService processDictService; |
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/test") |
||||
public void test(){ |
||||
ProcessDict processDict = new ProcessDict(); |
||||
processDict.setDictKey("networking"); |
||||
processDict.setDictSort(0); |
||||
processDict.setDictValue("workTicketFlow"); |
||||
processDict.setDictLabel("第一种工作票"); |
||||
processDict.setIsDefault("Y"); |
||||
processDict.setRemark("第一种工作票"); |
||||
processDict.setDictType("工作票"); |
||||
processDictService.save(processDict); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,115 @@
|
||||
package com.hnac.hzims.ticket.processflow.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.experimental.Accessors; |
||||
import org.springblade.core.mp.base.BaseEntity; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* 票据字典表 |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/6/5 8:33 |
||||
*/ |
||||
@Data |
||||
@ApiModel(value = "ProcessDict",description = "票据字典表") |
||||
@Accessors(chain = true) |
||||
@TableName("process_dict") |
||||
public class ProcessDict { |
||||
|
||||
|
||||
/** |
||||
* 票据编码 |
||||
*/ |
||||
@TableId(type = IdType.AUTO) |
||||
@ApiModelProperty("票据编码") |
||||
private Long dictCode; |
||||
|
||||
|
||||
/** |
||||
*票据排序 |
||||
*/ |
||||
@ApiModelProperty("票据排序") |
||||
private Integer dictSort; |
||||
|
||||
|
||||
/** |
||||
*票据字典码 |
||||
*/ |
||||
@ApiModelProperty("票据字典码") |
||||
private String dictKey; |
||||
|
||||
|
||||
/** |
||||
*票据流程标识 |
||||
*/ |
||||
@ApiModelProperty("票据流程标识") |
||||
private String dictValue; |
||||
|
||||
|
||||
|
||||
/** |
||||
*票据标签 |
||||
*/ |
||||
@ApiModelProperty("票据标签") |
||||
private String dictLabel; |
||||
|
||||
/** |
||||
*票据类型 |
||||
*/ |
||||
@ApiModelProperty("票据类型") |
||||
private String dictType; |
||||
|
||||
/** |
||||
*是否默认(Y是 N否) |
||||
*/ |
||||
@ApiModelProperty("是否默认(Y是 N否)") |
||||
private String isDefault; |
||||
|
||||
|
||||
/** |
||||
*状态(0正常 1停用) |
||||
*/ |
||||
@ApiModelProperty("状态(0正常 1停用)") |
||||
private Integer status; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 所属机构 |
||||
*/ |
||||
@ApiModelProperty("所属机构") |
||||
private Long createDept; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
@ApiModelProperty("创建时间") |
||||
private LocalDateTime createTime; |
||||
|
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
@ApiModelProperty("更新时间") |
||||
private LocalDateTime updateTime; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 票据备注 |
||||
*/ |
||||
@ApiModelProperty("票据备注") |
||||
private String remark; |
||||
} |
@ -0,0 +1,14 @@
|
||||
package com.hnac.hzims.ticket.processflow.mapper; |
||||
|
||||
import com.hnac.hzims.ticket.processflow.entity.ProcessDict; |
||||
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/6/5 8:49 |
||||
*/ |
||||
public interface ProcessDictMapper extends UserDataScopeBaseMapper<ProcessDict> { |
||||
|
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.hnac.hzims.ticket.processflow.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.hnac.hzims.ticket.processflow.entity.ProcessDict; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/6/5 8:52 |
||||
*/ |
||||
public interface ProcessDictService extends IService<ProcessDict> { |
||||
|
||||
|
||||
/** |
||||
* 根据字典key查询字典value |
||||
*/ |
||||
String selectDictValueByKey(String dictKey); |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.hnac.hzims.ticket.processflow.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.hnac.hzims.ticket.processflow.entity.ProcessDict; |
||||
import com.hnac.hzims.ticket.processflow.mapper.ProcessDictMapper; |
||||
import com.hnac.hzims.ticket.processflow.service.ProcessDictService; |
||||
import groovy.util.logging.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2023/6/5 8:59 |
||||
*/ |
||||
@Slf4j |
||||
@Service |
||||
public class ProcessDictServiceImpl extends ServiceImpl<ProcessDictMapper, ProcessDict> implements ProcessDictService { |
||||
/** |
||||
* 根据字典key查询字典value |
||||
* |
||||
* @param dictKey |
||||
*/ |
||||
@Override |
||||
public String selectDictValueByKey(String dictKey) { |
||||
LambdaQueryChainWrapper<ProcessDict> processDictLambdaQueryChainWrapper = new LambdaQueryChainWrapper<>(baseMapper); |
||||
processDictLambdaQueryChainWrapper.eq(ProcessDict::getDictKey,dictKey); |
||||
return processDictLambdaQueryChainWrapper.one().getDictValue(); |
||||
} |
||||
} |
@ -0,0 +1,5 @@
|
||||
<?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.hnac.hzims.ticket.processflow.mapper.ProcessDictMapper"> |
||||
|
||||
</mapper> |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue