forked from luyan/epmet-cloud-lingshan
34 changed files with 493 additions and 195 deletions
@ -0,0 +1,48 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description appId、手机号、验证码获取组织-接口入参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class ThirdStaffOrgsFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 4193133227120225342L; |
|||
/** |
|||
* 添加用户操作的用户可见异常分组 |
|||
* 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup |
|||
* 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 |
|||
*/ |
|||
public interface AddUserShowGroup extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
public interface GetMyOrgByPassWordGroup extends CustomerClientShowGroup { |
|||
} |
|||
public interface GetMyOrgByLoginWxmp extends CustomerClientShowGroup{} |
|||
/** |
|||
* 小程序appId |
|||
*/ |
|||
@NotBlank(message = "appId不能为空", groups = {AddUserShowGroup.class}) |
|||
private String appId; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 验证码 |
|||
*/ |
|||
@NotBlank(message="验证码不能为空", groups = {GetMyOrgByLoginWxmp.class}) |
|||
private String smsCode; |
|||
|
|||
@NotBlank(message = "密码不能为空",groups ={GetMyOrgByPassWordGroup.class}) |
|||
private String password; |
|||
} |
|||
|
|||
@ -1,37 +1,65 @@ |
|||
package com.epmet.commons.tools.utils; |
|||
|
|||
import java.io.File; |
|||
import java.io.FileOutputStream; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.nio.file.Files; |
|||
|
|||
/** |
|||
* @author kamui |
|||
*/ |
|||
public class FileUtils { |
|||
|
|||
/** |
|||
* 创建临时文件. |
|||
* |
|||
* @param inputStream 输入文件流 |
|||
* @param name 文件名 |
|||
* @param ext 扩展名 |
|||
* @param tmpDirFile 临时文件夹目录 |
|||
*/ |
|||
public static File createTmpFile(InputStream inputStream, String name, String ext, File tmpDirFile) throws IOException { |
|||
File resultFile = File.createTempFile(name, '.' + ext, tmpDirFile); |
|||
|
|||
resultFile.deleteOnExit(); |
|||
org.apache.commons.io.FileUtils.copyToFile(inputStream, resultFile); |
|||
return resultFile; |
|||
} |
|||
|
|||
/** |
|||
* 创建临时文件. |
|||
* |
|||
* @param inputStream 输入文件流 |
|||
* @param name 文件名 |
|||
* @param ext 扩展名 |
|||
*/ |
|||
public static File createTmpFile(InputStream inputStream, String name, String ext) throws IOException { |
|||
return createTmpFile(inputStream, name, ext, Files.createTempDirectory("weixin-java-tools-temp").toFile()); |
|||
} |
|||
/** |
|||
* 创建临时文件 |
|||
* |
|||
* @param inputStream |
|||
* @param name 文件名 |
|||
* @param ext 扩展名 |
|||
* @param tmpDirFile 临时文件夹目录 |
|||
*/ |
|||
public static File createTmpFile(InputStream inputStream, String name, String ext, File tmpDirFile) throws IOException { |
|||
File tmpFile; |
|||
if (tmpDirFile == null) { |
|||
tmpFile = File.createTempFile(name, '.' + ext); |
|||
} else { |
|||
tmpFile = File.createTempFile(name, '.' + ext, tmpDirFile); |
|||
} |
|||
|
|||
tmpFile.deleteOnExit(); |
|||
FileOutputStream fos = new FileOutputStream(tmpFile); |
|||
try { |
|||
int read = 0; |
|||
byte[] bytes = new byte[1024 * 100]; |
|||
while ((read = inputStream.read(bytes)) != -1) { |
|||
fos.write(bytes, 0, read); |
|||
} |
|||
|
|||
fos.flush(); |
|||
} catch (Exception e) { |
|||
|
|||
} finally { |
|||
if (fos != null) { |
|||
try { |
|||
fos.close(); |
|||
} catch (IOException e) { |
|||
} |
|||
} |
|||
|
|||
} |
|||
return tmpFile; |
|||
} |
|||
|
|||
/** |
|||
* 创建临时文件 |
|||
* |
|||
* @param inputStream |
|||
* @param name 文件名 |
|||
* @param ext 扩展名 |
|||
*/ |
|||
public static File createTmpFile(InputStream inputStream, String name, String ext) throws IOException { |
|||
return createTmpFile(inputStream, name, ext, null); |
|||
} |
|||
|
|||
} |
|||
|
|||
@ -0,0 +1,16 @@ |
|||
CREATE TABLE `customer_app` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', |
|||
`APP_ID` varchar(128) NOT NULL COMMENT '小程序的appId', |
|||
`CLIENT` varchar(32) NOT NULL COMMENT 'resi,work', |
|||
`SECRET` varchar(255) DEFAULT NULL COMMENT 'app的secret', |
|||
`ENABLE_FLAG` int(1) NOT NULL DEFAULT '0' COMMENT '0:停用,1:启用', |
|||
`DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识:0.未删除 1.已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE, |
|||
UNIQUE KEY `unx_app_id` (`APP_ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='客户app表'; |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 根据客户ID、手机号查询政府端工作人员基本信息 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class ThirdCustomerStaffFormDTO implements Serializable{ |
|||
private static final long serialVersionUID = -7994579456530273809L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
* */ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 手机号 |
|||
* */ |
|||
private String mobile; |
|||
} |
|||
Loading…
Reference in new issue