Commit cad61c5f by 赵剑炜

合并

parent 08ef56e2
......@@ -8,15 +8,13 @@
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="jyzb-common" />
<module name="jyzb-process" />
<module name="jyzb-api" />
<module name="jyzb-boot" />
<module name="jyzb-biz" />
<module name="jyzb-process" />
<module name="jyzb-boot" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="jyzb-business" target="1.8" />
</bytecodeTargetLevel>
<bytecodeTargetLevel target="9" />
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
......@@ -24,7 +22,6 @@
<module name="jyzb-api" options="-parameters" />
<module name="jyzb-biz" options="-parameters" />
<module name="jyzb-boot" options="-parameters" />
<module name="jyzb-business" options="-parameters" />
<module name="jyzb-common" options="-parameters" />
<module name="jyzb-process" options="-parameters" />
</option>
......
......@@ -2,6 +2,7 @@
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/jyzb-api/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-api/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-biz/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-biz/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-boot/src/main/java" charset="UTF-8" />
......@@ -10,5 +11,7 @@
<file url="file://$PROJECT_DIR$/jyzb-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-process/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-process/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
......@@ -2,14 +2,9 @@
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="oss" />
<option name="name" value="oss" />
<option name="url" value="https://oss.sonatype.org/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="junmp-public" />
<option name="name" value="junmp-public" />
<option name="url" value="http://maven.sothing.top/repository/junmp-public/" />
<option name="id" value="aliyun" />
<option name="name" value="aliyun" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
......@@ -17,24 +12,29 @@
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="junmp-public" />
<option name="name" value="junmp-public" />
<option name="url" value="http://maven.sothing.top/repository/junmp-public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="spring-milestones" />
<option name="name" value="Spring Milestones" />
<option name="url" value="https://repo.spring.io/libs-milestone" />
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="aliyun" />
<option name="name" value="aliyun" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
<option name="id" value="oss" />
<option name="name" value="oss" />
<option name="url" value="https://oss.sonatype.org/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
<option name="id" value="spring-milestones" />
<option name="name" value="Spring Milestones" />
<option name="url" value="https://repo.spring.io/libs-milestone" />
</remote-repository>
</component>
</project>
\ No newline at end of file
......@@ -17,5 +17,5 @@
</set>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (3)" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
......@@ -3,39 +3,70 @@ package com.junmp.junmpProcess.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.junmp.junmpProcess.common.Result;
import com.junmp.junmpProcess.doc.BpmnDoc;
import com.junmp.junmpProcess.utils.BpmnConvert;
import com.junmp.junmpProcess.vo.ProcessVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import com.junmp.junmpProcess.service.Bussiness.WorkProcessService;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.repository.Deployment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.sql.DataSource;
@Slf4j
@RestController
@RequestMapping("/Bpmn")
public class BpmnController implements BpmnDoc {
@Resource
private DataSource dataSource;
@Autowired
private WorkProcessService ProcessService;
@Override
@PostMapping(value = "bpmn/create")
public boolean create(@RequestBody String nodeJson) {
public Result<String> create(@RequestBody ProcessVO processVO) throws JsonProcessingException {
// ProcessEngineConfiguration.
ProcessEngineConfiguration config = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
config.setDataSource(dataSource);
config.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
ProcessEngine processEngine = config.buildProcessEngine();
//流程定义
ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = null;
try {
jsonNode = objectMapper.readTree(nodeJson);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return ProcessService.createBpmn(jsonNode);
JsonNode processJsonNode = objectMapper.readTree(processVO.getProcessJson());
ObjectMapper formMapper = new ObjectMapper();
JsonNode formJsonNode = objectMapper.readTree(processVO.getFormJson());
//将json转换为bpmn
BpmnConvert bpmnConvert=new BpmnConvert();
BpmnModel bpmnModel = bpmnConvert.toBpmn(processJsonNode,formJsonNode);
Deployment deployment = processEngine.getRepositoryService()
.createDeployment()
.addBpmnModel(bpmnModel.getProcesses().get(0).getId()+".bpmn20.xml", bpmnModel)
.deploy();
return Result.OK(deployment.getId());
}
}
package com.junmp.junmpProcess.doc;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.junmp.junmpProcess.common.Result;
import com.junmp.junmpProcess.vo.ProcessVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -10,5 +13,5 @@ public interface BpmnDoc {
* bpmn划线
*/
@ApiOperation(value = "bpmn划线", tags = "bpmn划线")
boolean create(String nodeJson);
Result<String> create(ProcessVO processVO) throws JsonProcessingException;
}
spring: #环境 dev|test|pro|preview
profiles:
active: dev
servlet:
multipart: #文件传输配置
max-file-size: 100MB #单个数据大小限制
max-request-size: 100MB #请求总数据大小限制
enabled: true #是否启用分段上传支持
mvc:
hiddenmethod: #隐式方法过滤器
filter:
enabled: true #默认关闭。开启以支持:PUT,DELETE表单提交方法
jackson: #序列化和反序列化json框架
serialization:
write-dates-as-timestamps: true #是否写入日期时间时间戳格式
time-zone: GMT+8 #指定日期格式化时区
main:
allow-bean-definition-overriding: true #允许同名bean后者覆盖,默认:true
allow-circular-references: true #允许Bean相互引用,默认:false
server:
error:
whitelabel:
enabled: false
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--日志格式应用spring boot默认的格式,也可以自己更改-->
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<!--定义日志存放的位置,默认存放在项目启动的相对路径的目录-->
<springProperty scope="context" name="LOG_PATH" source="log.path" defaultValue="log/systemLog"/>
<!-- ****************************************************************************************** -->
<!-- ****************************** 本地开发只在控制台打印日志 ************************************ -->
<!-- ****************************************************************************************** -->
<springProfile name="dev">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!--默认所有的包以info-->
<root level="info">
<appender-ref ref="STDOUT"/>
</root>
<!--各个服务的包在本地执行的时候,打开debug模式-->
<logger name="com" level="debug" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
</springProfile>
<!-- ********************************************************************************************** -->
<!-- **** 放到服务器上不管在什么环境都只在文件记录日志,控制台(catalina.out)打印logback捕获不到的日志 **** -->
<!-- ********************************************************************************************** -->
<springProfile name="test,pro,me,preview">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 日志记录器,日期滚动记录,level为 ERROR 日志 -->
<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_error.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录error级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>error</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 INFO 日志 -->
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_info.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 WARN 日志 -->
<appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_warn.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 DEBUG 日志 -->
<appender name="FILE_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_debug.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 日志记录器,日期滚动记录,level为 ALL 日志 -->
<appender name="FILE_ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${LOG_PATH}/log_total.log</file>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
<fileNamePattern>${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--日志最大的历史7天-->
<maxHistory>7</maxHistory>
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
命名日志文件,例如log-error-2013-12-21.0.log -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- 追加方式记录日志 -->
<append>true</append>
<!-- 日志文件的格式 -->
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf-8</charset>
</encoder>
</appender>
<!--记录到文件时-->
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE_ERROR"/>
<appender-ref ref="FILE_INFO"/>
<appender-ref ref="FILE_WARN"/>
<appender-ref ref="FILE_DEBUG"/>
<appender-ref ref="FILE_ALL"/>
</root>
</springProfile>
</configuration>
# 应用服务器
server:
tomcat:
uri-encoding: UTF-8 #tomcat编码
port: 8999 #tomcat端口
#===================== 数据源配置 =====================
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${MYSQL_USER:junmp} #junmp
password: ${MYSQL_PWD:123456} #123456
url: jdbc:mysql://${MYSQL_HOST:192.168.3.128}:${MYSQL_PORT:3306}/${MYSQL_DB:db_jyzb}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&queryTimeout=2400&nullCatalogMeansCurrent=true
#===================== Redis配置 =====================
redis:
database: 1 #缓存库编号
host: 127.0.0.1
port: 6379
password:
timeout: 3000 #超时时间(单位:秒)
lettuce: #Lettuce为Redis的Java驱动包
pool:
max-active: 8 # 连接池最大连接数
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
min-idle: 0 # 连接池中的最小空闲连接
max-idle: 8 # 连接池中的最大空闲连接
mail:
host: smtp.qq.com #邮件服务器的host
password: sb #邮件服务器的发件人密码
username: 6666@qq.com #邮件服务器的发件人
port: 25 #smtp默认端口
protocol: smtp #使用smtp协议
default-encoding: UTF-8 #邮件使用的字符集
properties:
mail:
debug: true #启调试模式(发送邮件的细节都能看出来) 默认值为fasle
debug.auth: true
smtp:
auth: true #如果为true ,则尝试使用auth命令对用户进行身份验证 默认为false
connectiontimeout: 20000 #套接字连接超时值(毫秒)。默认值为无限超时。
sendpartial: true #如果为true 并且邮件有一些有效和无效的地址 并使用SendFailException 报告部分失败, 如果设置为false(默认值) 如果存在无效的收件人地址, 则不会将邮件发送给任何收件人
starttls:
#如果为true,则在发出任何登录命令之前,启用starttl命令(如果服务器支持) 将连接切换到受TLS保护的连接,请注意,必须配置适当的信任存储,以便客户端信任服务器的证书,默认为false
enable: true
# 如果为true,则需要使用 starttl命令,如果服务器不支持此命令,或者该命令失败,connect()将失败,默认为false 如果此设置为true james邮件服务器会报错 STARTTLS is required but host does not support STARTTLS
required: false
timeout: 20000 #I/O超时值(ms) 默认为无限超时
userset: true #如果设置为true,则在isConnected()中使用RSET命令而不是NOOP命令 在某些情况下,sendmail在执行许多NOOP命令后响应缓存,使用RSET可以避免这个sendMail问题,默认为false
flowable:
dmn:
enabled: false
cmmn:
enabled: false
idm:
enabled: false
async-history-executor-activate: false
async-executor-activate: false
check-process-definitions: false
content:
enabled: false
app:
enabled: false
eventregistry:
enabled: false
config:
minio:
endpoint: http://192.168.0.147:9000/ #服务端地址
accessKey: admin #账号
secretKey: test. #密码
fileHost: http://192.168.0.147:9000/ #地址
scanner:
open: false
# 配置第三方请求
junmp:
swagger:
base-package: com.junmp
id:
worker-id: 1
data-center-id: 1
epoch: 1656036996843
max: 9999
log:
type: db
ds: true #是否多数据源
knife4j:
enable: true
setting:
enableDebug: false
basic:
enable: true
username: ning
password: ning
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
#jdbc:mysql://192.168.3.128:3306/db_jyzb?
url: jdbc:mysql://192.168.3.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
# junmp 123456
username: junmp
password: 123456
redis:
host: 127.0.0.1
port: 6379
database: 1
password:
flowable:
dmn:
enabled: false
cmmn:
enabled: false
idm:
enabled: false
async-history-executor-activate: false
async-executor-activate: false
check-process-definitions: false
content:
enabled: false
app:
enabled: false
eventregistry:
enabled: false
#mybatis plus 设置
mybatis-plus:
configuration:
cache-enabled: true
lazy-loading-enabled: true
multiple-result-sets-enabled: true
map-underscore-to-camel-case: true #开启驼峰命名
global-config:
banner: false
enable-sql-runner: true
db-config:
id-type: assign_id
table-underline: true
mapper-locations: classpath*:/mapper/**/*Mapper.xml
......@@ -8,7 +8,7 @@ spring:
application:
name: jyzb-app
profiles:
#local
#@spring.active@
active: local
servlet:
multipart:
......
<?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.junmp.jyzb.mapper.CabinetMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.Cabinet">
<!--@mbg.generated-->
<!--@Table base_cabinet-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="cabinet_num" jdbcType="VARCHAR" property="cabinetNum" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="location" jdbcType="VARCHAR" property="location" />
<result column="error_state" jdbcType="INTEGER" property="errorState" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_user" jdbcType="TIMESTAMP" property="createUser" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, cabinet_num, `name`, org_id, `location`, error_state, create_time, update_time,
create_user, update_user
</sql>
<insert id="addCabinet" parameterType="com.junmp.jyzb.domain.Warehouse">
insert into base_cabinet
(id,cabinet_num,name,org_id,location,error_state,create_time,update_user,delete_flag)
values
(#{id},#{cabinetNum},#{name},#{orgId},#{location},#{errorState},#{createTime},#{updateUser},0)
</insert>
<select id="getOneCabinet" resultType="Map">
select id,cabinet_num,name,org_id,location,error_state from base_cabinet p
where p.id=#{id} and delete_flag=0
</select>
<delete id="deleteCabinet">
delete from base_cabinet w
where w.id =#{id}
</delete>
<update id="updateCabinet">
update base_cabinet p
set cabinet_num = #{cabinetNum},name=#{name},org_id=#{orgId},location=#{location},error_state=#{errorState},update_time=#{updateTime},update_user=#{updateUser}
where p.id =#{id} and delete_flag=0
</update>
<select id="getAllCabinet" resultType="Map">
select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info
from base_policeman p,base_police_finger f
where p.id=f.police_id
and p.org_id=#{orgId}
and delete_flag=0
</select>
<select id="getAllCabinetId" resultType="String">
select id
from base_cabinet w
where org_id=#{orgId} and delete_flag=0;
</select>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.EquipmentSizeMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.EquipmentSize">
<!--@mbg.generated-->
<!--@Table base_equipment_size-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
<result column="detail_id" jdbcType="VARCHAR" property="detailId" />
<result column="code" jdbcType="INTEGER" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="note" jdbcType="VARCHAR" property="note" />
<result column="epc_type" jdbcType="INTEGER" property="epcType" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, type_id, detail_id, code, `name`, create_time, update_time, note, epc_type
</sql>
<insert id="addSize" parameterType="com.junmp.jyzb.domain.EquipmentSize">
insert into base_equipment_size
(id,type_id as typeId,code,name,create_time as createTime,note,price,state,epcType)
values
(#{id},#{typeId},#{code},#{name},#{createTime},#{note},#{price},#{state},#{epcType})
</insert>
<select id="getOneSize" resultType="Map">
select id,code,name,note,price,state,epc_type as epcType from base_equipment_size p
where p.id=#{id}
</select>
<update id="deleteSize">
update base_equipment_size w
set state = #{state}
where w.id =#{id}
</update>
<update id="updateSize">
update base_equipment_size p
set type_id = #{typeId},code=#{code},name=#{name},update_time=#{updateTime},note=#{note},price=#{price},state=#{state},epc_type=#{epcType}
where p.id =#{id}
</update>
<select id="getAllSizeId" resultType="String">
select id
from base_equipment_size w
where type_id=#{typeId}
</select>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.EquipmentTypeMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.EquipmentType">
<!--@mbg.generated-->
<!--@Table base_equipment_type-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="note" jdbcType="VARCHAR" property="note" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, `name`, code, parent_id, create_time, update_time, `state`, note
</sql>
<select id="selectAllEquipment" resultMap="BaseResultMap">
SELECT id,name,unit,unit_type,code,parent_id,state,note,code
FROM base_equipment_type
</select>
<!--SELECT id,name,unit,unit_type,code,parent_id,state,note,-->
<!-- CASE-->
<!-- WHEN update_time IS NULL THEN create_time-->
<!-- ELSE update_time-->
<!-- END AS update_time-->
<!-- FROM base_equipment_type-->
<insert id="addEquipment" parameterType="com.junmp.jyzb.domain.EquipmentType">
insert into base_warehouse
(id,name,unit,unit_type,code,parent_id,create_time,state,note)
values
(#{id},#{name},#{unit},#{unitType},#{code},#{parentId},#{createTime},1,#{note})
</insert>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.PoliceFingerMapper">
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, police_id, finger_info, create_time, update_time
</sql>
<select id="getFingersByUserId" parameterType="String" resultType="java.util.Map">
SELECT f.id as fingerId,f.name,f.finger_info as fingerInfo
FROM base_police_finger f
WHERE f.police_id = #{userId}
</select>
<insert id="addFingers">
insert into base_police_finger
(police_id,name,finger_info,create_time) VALUES (#{policeId},#{name},#{fingerInfo},#{createTime})
</insert>
<update id="updateFingers">
update base_police_finger p
set name = #{name},finger_info=#{fingerInfo},update_time=#{updateTime}
where p.id =#{id}
</update>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.PolicemanMapper">
<resultMap id="PolicemanMap" type="com.junmp.jyzb.domain.Policeman">
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="cabinet_id" property="cabinetId"/>
<result column="org_id" property="orgId"/>
<result column="police_code" property="policeCode"/>
<result column="sex" property="sex"/>
<result column="face_info" property="faceInfo"/>
<result column="isCreatedAccount" property="isCreatedAccount"/>
<result column="door_code" property="doorCode"/>
<result column="password" property="password"/>
<result column="photo" property="photo"/>
<result column="phone" property="phone"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="id_card" property="idCard"/>
<result column="update_user" property="updateUser"/>
<result column="state" property="state"/>
</resultMap>
<insert id="addPoliceman" parameterType="com.junmp.jyzb.domain.Policeman">
insert into base_policeman
(id,org_id,name,police_code,sex,isCreatedAccount,
cabinet_id,phone,id_card,photo,update_user,create_time)
values
(#{id},#{orgId},#{name},#{policeCode},#{sex},#{isCreatedAccount},
#{cabinetId},#{phone},#{idCard},#{photo},#{updateUser},#{createTime})
</insert>
<select id="getOnePolice" resultType="Map">
SELECT
p.id AS id,
o.org_id AS orgId,
o.area_name AS orgName,
p.name AS name,
p.sex,
p.phone,
p.photo,
p.police_code AS policeCode,
c.id AS cabinetId,
c.name AS cabinetName,
p.update_time AS updateTime
FROM base_policeman p
LEFT JOIN pub_org o ON p.org_id = o.org_id
LEFT JOIN base_cabinet c ON p.cabinet_id = c.id
WHERE p.id = #{id};
</select>
<delete id="deletePolice">
DELETE FROM base_policeman p WHERE p.id =#{id};
</delete>
<update id="updatePolice">
update base_policeman p
set
org_id=#{orgId},
name = #{name},
police_code=#{policeCode},
sex=#{sex},
isCreatedAccount=#{isCreatedAccount},
cabinet_id=#{cabinetId},
phone=#{phone},
id_card=#{idCard},
update_user=#{updateUser},
photo=#{photo},
update_time=#{updateTime}
where p.id =#{id}
</update>
<select id="getAllPoliceman" resultType="Map">
select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info
from base_policeman p,base_police_finger f
where p.id=f.police_id
and p.org_id=#{orgId}
and delete_flag=0
</select>
<select id="getAllPoliceId" resultType="String">
select id
from base_policeman p
where org_id=#{orgId}
</select>
<delete id="deleteFinger">
delete from base_police_finger
where id =#{fingerId}
</delete>
<select id="getAllPoliceIdByCabinet" resultType="String">
select id
from base_policeman p
where cabinet_id=#{cabinetId} and delete_flag=0;
</select>
<update id="addFaceInfo" parameterType="com.junmp.jyzb.domain.Policeman">
update base_policeman p
set face_info=#{faceInfo},update_time=#{updateTime}
where p.id=#{id}
</update>
<update id="changePoliceState">
update base_policeman p
set state = #{state}
where p.id =#{id}
</update>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.SupplierMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.Supplier">
<!--@mbg.generated-->
<!--@Table base_supplier-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="equipment_id" jdbcType="VARCHAR" property="equipmentId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="supplier_code" jdbcType="VARCHAR" property="supplierCode" />
<result column="short_name" jdbcType="VARCHAR" property="shortName" />
<result column="contacts" jdbcType="VARCHAR" property="contacts" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, equipment_id, `name`, supplier_code, short_name, contacts, create_time, create_user,
update_time, update_user
</sql>
<insert id="addSupplier" parameterType="com.junmp.jyzb.domain.Supplier">
insert into base_supplier
(id,name,code,short_name,contacts,phone,create_time,create_user)
values
(#{id},#{name},#{code},#{shortName},#{contacts},#{phone},#{createTime},#{createUser})
</insert>
<select id="getOneSupplier" resultType="Map">
SELECT id, name, code, short_name AS shortName, contacts, phone, update_user,
CASE
WHEN update_time IS NULL THEN create_time
ELSE update_time
END AS updateTime
FROM base_supplier
WHERE id = #{id};
</select>
<update id="deleteSupplier">
update base_supplier w
set delete_flag = 1
where w.id =#{id}
</update>
<update id="updateSupplier">
update base_supplier p
set name=#{name},code=#{code},short_name=#{shortName},contacts=#{contacts},phone=#{phone},
update_time=#{updateTime},update_user=#{updateUser}
where p.id =#{id}
</update>
<select id="getAllSupplierId" resultType="String">
select id
from base_supplier w
</select>
</mapper>
\ No newline at end of file
<?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.junmp.jyzb.mapper.WarehouseMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.Warehouse">
<!--@mbg.generated-->
<!--@Table base_warehouse-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="location" jdbcType="VARCHAR" property="location" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user" jdbcType="VARCHAR" property="updateUser" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="sum" jdbcType="INTEGER" property="sum" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, `name`, `location`, phone, create_time, update_time, update_user, org_id, `sum`
</sql>
<insert id="addWarehouse" parameterType="com.junmp.jyzb.domain.Warehouse">
insert into base_warehouse
(id,name,location,phone,create_time,update_user,org_id,videp,state)
values
(#{id},#{name},#{location},#{phone},#{createTime},#{updateUser},#{orgId},#{video},1)
</insert>
<select id="getOneWarehouse" resultType="Map">
select w.id as warehouseId,o.name as orgName,w.name as name,w.state,location,phone,update_time as updateTime
from base_warehouse w,base_organization o
where w.org_id=o.id and p.id=#{id}
</select>
<update id="changeWarehouseState">
update base_warehouse w
set state = #{state}
where w.id =#{id}
</update>
<delete id="deleteWarehouse">
delete from base_warehouse w
where id =#{id}
</delete>
<update id="updateWarehouse">
update base_warehouse p
set name = #{name},location=#{location},phone=#{phone},update_time=#{updateTime},update_user=#{updateUser},org_id=#{orgId}
where p.id =#{id}
</update>
<select id="getAllWarehouseId" resultType="String">
select id
from base_warehouse w
where org_id=#{orgId}
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论