Compare commits

..

No commits in common. "10ee8994c2291c7a27583a3e1ea65c62292769c2" and "8a49d3f2507a2f811485dc7e21db30be14a50698" have entirely different histories.

12 changed files with 147 additions and 315 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
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;
@ -8,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
*

View File

@ -1,11 +1,9 @@
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;
@ -93,26 +91,6 @@ 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);
}
}
/**
*
*

View File

@ -17,7 +17,7 @@ public class MimeTypeUtils
public static final String IMAGE_GIF = "image/gif";
public static final String[] IMAGE_EXTENSION = { "jpg", "jpeg", "png" };
public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
public static final String[] FLASH_EXTENSION = { "swf", "flv" };

View File

@ -11,23 +11,11 @@ import java.util.Base64;
*/
public class MultipartFileUtils {
/**
* Base64
* @param
* @return
*/
public static MultipartFile base64ToMultipartFile(String base64) throws IOException {
String[] parts = base64.split(",");
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);
}
String contentType = parts[0].split(";")[0].split(":")[1];
byte[] bytes = Base64.getDecoder().decode(parts[1]);
return new MockMultipartFile("file", "file", contentType, bytes);
}
}

View File

@ -2,9 +2,7 @@ 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;
@ -12,23 +10,19 @@ 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;

View File

@ -32,23 +32,6 @@ 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)
@ -69,19 +52,6 @@ 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

View File

@ -30,14 +30,6 @@ public interface SurProjectAttendanceUserMapper
*/
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
* []
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*

View File

@ -30,14 +30,6 @@ public interface ISurProjectAttendanceUserService
*/
public SurProjectAttendanceUser findCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
* []
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser);
/**
*
*

View File

@ -49,16 +49,6 @@ public class SurProjectAttendanceUserServiceImpl implements ISurProjectAttendanc
return surProjectAttendanceUserMapper.findCurrentAttendanceUser(surProjectAttendanceUser);
}
/**
* []
*
* @param surProjectAttendanceUser
* @return
*/
public SurProjectAttendanceUser findYzCurrentAttendanceUser(SurProjectAttendanceUser surProjectAttendanceUser){
return surProjectAttendanceUserMapper.findYzCurrentAttendanceUser(surProjectAttendanceUser);
}
/**
*
*

View File

@ -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 != ''"> and workerId = #{workerId}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
<if test="workerId != null "> and workerId = #{workerId}</if>
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
</where>
order by attendance_time desc
</select>

View File

@ -158,14 +158,6 @@ 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=",">