提交代码
parent
b21bbf095d
commit
8b06d3e889
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,5 @@
|
|||
package com.ruoyi.api.labour.domain;
|
||||
|
||||
import com.ruoyi.common.enums.HttpStatusEnum;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.AuthRsaUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.sign.Md5Utils;
|
||||
|
@ -10,7 +8,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 劳务人员签名推送信息 请求参数
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package com.ruoyi.common.utils.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -91,6 +93,26 @@ public class FileUploadUtils
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件[图片]
|
||||
* @return 文件名称
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String uploadImages(String baseDir, MultipartFile file) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return upload(baseDir, file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
|
|
|
@ -17,7 +17,7 @@ public class MimeTypeUtils
|
|||
|
||||
public static final String IMAGE_GIF = "image/gif";
|
||||
|
||||
public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
|
||||
public static final String[] IMAGE_EXTENSION = { "jpg", "jpeg", "png" };
|
||||
|
||||
public static final String[] FLASH_EXTENSION = { "swf", "flv" };
|
||||
|
||||
|
|
|
@ -11,11 +11,23 @@ import java.util.Base64;
|
|||
*/
|
||||
public class MultipartFileUtils {
|
||||
|
||||
/**
|
||||
* 换为Base64为文件
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public static MultipartFile base64ToMultipartFile(String base64) throws IOException {
|
||||
String[] parts = base64.split(",");
|
||||
String contentType = parts[0].split(";")[0].split(":")[1];
|
||||
byte[] bytes = Base64.getDecoder().decode(parts[1]);
|
||||
return new MockMultipartFile("file", "file", contentType, bytes);
|
||||
if(parts.length>1){
|
||||
String contentType = parts[0].split(";")[0].split(":")[1];
|
||||
byte[] bytes = Base64.getDecoder().decode(parts[1]);
|
||||
return new MockMultipartFile("file","file."+contentType.split("/")[1], contentType, bytes);
|
||||
}else{
|
||||
//默认格式为pdf
|
||||
String contentType = "image/jpeg";
|
||||
byte[] bytes = Base64.getDecoder().decode(base64);
|
||||
return new MockMultipartFile("file", "file"+contentType.split("/")[1], contentType, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package com.ruoyi.common.utils.http;
|
|||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.Consts;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
|
@ -10,19 +12,23 @@ import org.apache.http.client.methods.CloseableHttpResponse;
|
|||
import org.apache.http.client.methods.HttpDelete;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.protocol.HTTP;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -32,6 +32,23 @@ public class Md5Utils
|
|||
return null;
|
||||
}
|
||||
|
||||
private static byte[] md5(byte[] bytes)
|
||||
{
|
||||
MessageDigest algorithm;
|
||||
try
|
||||
{
|
||||
algorithm = MessageDigest.getInstance("MD5");
|
||||
algorithm.update(bytes);
|
||||
byte[] messageDigest = algorithm.digest();
|
||||
return messageDigest;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("MD5 Error...", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final String toHex(byte hash[])
|
||||
{
|
||||
if (hash == null)
|
||||
|
@ -52,6 +69,19 @@ public class Md5Utils
|
|||
return buf.toString();
|
||||
}
|
||||
|
||||
public static String hash(byte[] uploadBytes)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new String(toHex(md5(uploadBytes)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("not supported charset...{}", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String hash(String s)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -30,6 +30,14 @@ public interface SurProjectAttendanceUserMapper
|
|||
*/
|
||||
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param surProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
|
|
|
@ -30,6 +30,14 @@ public interface ISurProjectAttendanceUserService
|
|||
*/
|
||||
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param surProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
|
|
|
@ -49,6 +49,16 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
|
|||
return surProjectAttendanceUserMapper.findCurrentAttendanceUser(surProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param surProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser){
|
||||
return surProjectAttendanceUserMapper.findYzCurrentAttendanceUser(surProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
|
|
|
@ -53,8 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
|
||||
<if test="workerId != null and workerId != ''"> and workerId = #{workerId}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
|
||||
</where>
|
||||
order by attendance_time desc
|
||||
</select>
|
||||
|
|
|
@ -158,6 +158,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where u.cfgid=#{cfgid} and u.workerId=#{workerId}
|
||||
</select>
|
||||
|
||||
<select id="findYzCurrentAttendanceUser" parameterType="SurProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select u.companyId,u.companyName,u.`name`,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,u.workTypeCode
|
||||
from sur_project_attendance_user u
|
||||
left join sur_project_attendance_group g on u.groupId = g.serverid and g.cfgid = u.cfgid
|
||||
where u.cfgid=#{cfgid} and u.workerId=#{workerId} ORDER BY u.id desc LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceUser" parameterType="SurProjectAttendanceUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
Loading…
Reference in New Issue