Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd
commit
d9a0c5b99e
|
@ -7,6 +7,10 @@ package com.yanzhu.common.core.constant;
|
|||
*/
|
||||
public class CacheConstants
|
||||
{
|
||||
/**
|
||||
* yanzhu系统应用注册 redis key
|
||||
*/
|
||||
public static final String YANZHU_SYSTEM_CONFIG = "yanzhu_system_config:";
|
||||
|
||||
/**
|
||||
* 缓存有效期,默认720(分钟)
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
/**
|
||||
* 应用配置类型
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum ApplyCfgTypeEnum {
|
||||
|
||||
LABOUR("1", "劳务人员信息接入"),
|
||||
AIBOXS("2", "视频智能预警接入");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
ApplyCfgTypeEnum(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 是否状态
|
||||
*
|
||||
* @author JiangYuQi
|
||||
*/
|
||||
public enum ShiFouEnum {
|
||||
|
||||
FOU("0", "否"), SHI("1", "是");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
ShiFouEnum(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
public Long getLongCode()
|
||||
{
|
||||
return Convert.toLong(code);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.yanzhu.common.core.enums;
|
||||
|
||||
/**
|
||||
* 厂商编号类型枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public enum VendorsCodeEnum {
|
||||
|
||||
YANZHU("yanzhu", "研筑");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
VendorsCodeEnum(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.yanzhu.common.core.utils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.List;
|
||||
|
||||
public class Md5Utils {
|
||||
private static final Logger log = LoggerFactory.getLogger(Md5Utils.class);
|
||||
|
||||
private static byte[] md5(String s)
|
||||
{
|
||||
MessageDigest algorithm;
|
||||
try
|
||||
{
|
||||
algorithm = MessageDigest.getInstance("MD5");
|
||||
algorithm.reset();
|
||||
algorithm.update(s.getBytes("UTF-8"));
|
||||
byte[] messageDigest = algorithm.digest();
|
||||
return messageDigest;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("MD5 Error...", e);
|
||||
}
|
||||
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)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
StringBuffer buf = new StringBuffer(hash.length * 2);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < hash.length; i++)
|
||||
{
|
||||
if ((hash[i] & 0xff) < 0x10)
|
||||
{
|
||||
buf.append("0");
|
||||
}
|
||||
buf.append(Long.toString(hash[i] & 0xff, 16));
|
||||
}
|
||||
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(List<Long> objs)
|
||||
{
|
||||
if(objs==null){
|
||||
return null;
|
||||
}
|
||||
String s = objs.toString();
|
||||
try
|
||||
{
|
||||
return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("not supported charset...{}", e);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
public static String hash(String s)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new String(toHex(md5(s)).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("not supported charset...{}", e);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
public static String yzMd5(String s){
|
||||
String tmp="HelloYanzhu"+s+"陕西研筑";
|
||||
tmp=hash(tmp);
|
||||
tmp=tmp.substring(3,15)+"yanzhu"+tmp.substring(20)+"研筑陕西";
|
||||
tmp=hash(tmp);
|
||||
return "sxyz"+tmp.substring(21,tmp.length()-3)+tmp.substring(3,14);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,356 @@
|
|||
package com.yanzhu.common.core.utils;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.*;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* @description: Rsa非对称加密算法工具类
|
||||
* @author: JiangYuQi
|
||||
* @date: 2024/1/13 15:14
|
||||
*/
|
||||
public final class RSAUtil {
|
||||
|
||||
private RSAUtil() {}
|
||||
|
||||
private static final String RSA = "RSA";
|
||||
|
||||
private static final String SIGN_ALGORITHMS = "SHA1WithRSA";
|
||||
|
||||
private static final Base64.Decoder DECODER = Base64.getDecoder();
|
||||
|
||||
private static final Base64.Encoder ENCODER = Base64.getEncoder();
|
||||
|
||||
|
||||
public static void main(String[] args) throws NoSuchAlgorithmException {
|
||||
// 生成密钥对
|
||||
KeyPair keyPair = getKeyPair();
|
||||
// 公匙
|
||||
String publicKey = getPublicKeyBase64(keyPair);
|
||||
System.out.println("公匙 -> " + publicKey);
|
||||
// 私匙
|
||||
String privateKey = getPrivateKeyBase64(keyPair);
|
||||
System.out.println("私匙 -> " + privateKey);
|
||||
// 明文
|
||||
String plaintext = "hello world!";
|
||||
System.out.println("明文 -> " + plaintext);
|
||||
// 密文base64(公匙加密)
|
||||
String ciphertext = publicKeyEncrypt(plaintext, publicKey);
|
||||
System.out.println("密文base64 -> " + ciphertext);
|
||||
// 解密后明文(私匙解密)
|
||||
String decryptString = privateKeyDecrypt(ciphertext, privateKey);
|
||||
System.out.println("解密后明文 -> " + decryptString);
|
||||
// 数字签名
|
||||
// String sign = sign(ciphertext, privateKey);
|
||||
// System.out.println("数字签名 -> " + decryptString);
|
||||
// // 验证签名
|
||||
// boolean pass = verify(ciphertext, sign, publicKey);
|
||||
// System.out.println("验证签名 -> " + pass);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成秘钥对
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static KeyPair getKeyPair() throws NoSuchAlgorithmException {
|
||||
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(RSA);
|
||||
keyPairGenerator.initialize(1024);
|
||||
return keyPairGenerator.generateKeyPair();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公钥(Base64编码)
|
||||
*
|
||||
* @param keyPair 秘钥对
|
||||
* @return
|
||||
*/
|
||||
public static String getPublicKeyBase64(KeyPair keyPair) {
|
||||
PublicKey publicKey = keyPair.getPublic();
|
||||
byte[] bytes = publicKey.getEncoded();
|
||||
// 先用base64编码,再转换为字符串
|
||||
return new String(ENCODER.encode(bytes), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取私钥(Base64编码)
|
||||
*
|
||||
* @param keyPair 秘钥对
|
||||
* @return
|
||||
*/
|
||||
public static String getPrivateKeyBase64(KeyPair keyPair) {
|
||||
PrivateKey privateKey = keyPair.getPrivate();
|
||||
byte[] bytes = privateKey.getEncoded();
|
||||
// 先用base64编码,再转换为字符串
|
||||
return new String(ENCODER.encode(bytes), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Base64编码后的公钥转换成PublicKey对象
|
||||
*
|
||||
* @param publicKeyBase64 公钥base64
|
||||
* @return
|
||||
*/
|
||||
public static PublicKey getPublicKey(String publicKeyBase64) throws NoSuchAlgorithmException, InvalidKeySpecException {
|
||||
byte[] keyBytes = DECODER.decode(publicKeyBase64);
|
||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA);
|
||||
return keyFactory.generatePublic(keySpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Base64编码后的私钥转换成PrivateKey对象
|
||||
*
|
||||
* @param privateKeyBase64 私钥base64
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static PrivateKey getPrivateKey(String privateKeyBase64) throws NoSuchAlgorithmException, InvalidKeySpecException {
|
||||
byte[] keyBytes = DECODER.decode((privateKeyBase64));
|
||||
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(RSA);
|
||||
return keyFactory.generatePrivate(keySpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥加密
|
||||
*
|
||||
* @param plaintext 明文
|
||||
* @param publicKeyBase64 公钥base64
|
||||
* @return 密文数组base64编码后的字符串
|
||||
*/
|
||||
public static String publicKeyEncrypt(String plaintext, String publicKeyBase64) {
|
||||
try {
|
||||
// 获取明文字节数组
|
||||
byte[] bytes = plaintext.getBytes(StandardCharsets.UTF_8);
|
||||
Cipher cipher = Cipher.getInstance(RSA);
|
||||
// 编码前设定编码方式及密钥
|
||||
PublicKey publicKey = getPublicKey(publicKeyBase64);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
||||
int keyBit = getKeySize(publicKey);
|
||||
int inputLen = bytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offSet = 0;
|
||||
int step = keyBit / 8 - 11;
|
||||
for (int i = 0; inputLen - offSet > 0; offSet = i * step) {
|
||||
byte[] cache;
|
||||
if (inputLen - offSet > step) {
|
||||
cache = cipher.doFinal(bytes, offSet, step);
|
||||
} else {
|
||||
cache = cipher.doFinal(bytes, offSet, inputLen - offSet);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
++i;
|
||||
}
|
||||
// 密文字节数组
|
||||
byte[] ciphertextBytes = out.toByteArray();
|
||||
out.close();
|
||||
// 返回密文字节数组base64编码后的字符串
|
||||
return new String(ENCODER.encode(ciphertextBytes), StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥解密
|
||||
*
|
||||
* @param ciphertext 密文
|
||||
* @param publicKeyBase64 公钥base64
|
||||
* @return 明文
|
||||
*/
|
||||
public static String publicKeyDecrypt(String ciphertext, String publicKeyBase64) {
|
||||
try {
|
||||
// 密文base64解码字节数组
|
||||
byte[] bytes = DECODER.decode(ciphertext.getBytes(StandardCharsets.UTF_8));
|
||||
Cipher cipher = Cipher.getInstance(RSA);
|
||||
PublicKey publicKey = getPublicKey(publicKeyBase64);
|
||||
cipher.init(Cipher.DECRYPT_MODE, publicKey);
|
||||
int keyBit = getKeySize(publicKey);
|
||||
int inputLen = bytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offSet = 0;
|
||||
int step = keyBit / 8;
|
||||
|
||||
for (int i = 0; inputLen - offSet > 0; offSet = i * step) {
|
||||
byte[] cache;
|
||||
if (inputLen - offSet > step) {
|
||||
cache = cipher.doFinal(bytes, offSet, step);
|
||||
} else {
|
||||
cache = cipher.doFinal(bytes, offSet, inputLen - offSet);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
++i;
|
||||
}
|
||||
// 明文字节数组
|
||||
byte[] plaintextBytes = out.toByteArray();
|
||||
out.close();
|
||||
return new String(plaintextBytes, StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 私钥加密
|
||||
*
|
||||
* @param plaintext 明文
|
||||
* @param privateKeyBase64 私钥base64
|
||||
* @return
|
||||
*/
|
||||
public static String privateKeyEncrypt(String plaintext, String privateKeyBase64) {
|
||||
try {
|
||||
// 获取明文字节数组
|
||||
byte[] bytes = plaintext.getBytes(StandardCharsets.UTF_8);
|
||||
Cipher cipher = Cipher.getInstance(RSA);
|
||||
// 编码前设定编码方式及密钥
|
||||
PrivateKey privateKey = getPrivateKey(privateKeyBase64);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
|
||||
int keyBit = getKeySize(privateKey);
|
||||
int inputLen = bytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offSet = 0;
|
||||
int step = keyBit / 8 - 11;
|
||||
|
||||
for (int i = 0; inputLen - offSet > 0; offSet = i * step) {
|
||||
byte[] cache;
|
||||
if (inputLen - offSet > step) {
|
||||
cache = cipher.doFinal(bytes, offSet, step);
|
||||
} else {
|
||||
cache = cipher.doFinal(bytes, offSet, inputLen - offSet);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
++i;
|
||||
}
|
||||
// 密文字节数组
|
||||
byte[] ciphertextBytes = out.toByteArray();
|
||||
out.close();
|
||||
// 返回密文字节数组base64编码后的字符串
|
||||
return new String(ENCODER.encode(ciphertextBytes), StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 私钥解密
|
||||
*
|
||||
* @param ciphertext 密文
|
||||
* @param privateKeyBase64 私钥base64
|
||||
* @return 明文
|
||||
*/
|
||||
public static String privateKeyDecrypt(String ciphertext, String privateKeyBase64) {
|
||||
try {
|
||||
// 密文base64解码字节数组
|
||||
byte[] bytes = DECODER.decode(ciphertext.getBytes(StandardCharsets.UTF_8));
|
||||
Cipher cipher = Cipher.getInstance(RSA);
|
||||
PrivateKey privateKey = getPrivateKey(privateKeyBase64);
|
||||
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
||||
int keyBit = getKeySize(privateKey);
|
||||
int inputLen = bytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offSet = 0;
|
||||
int step = keyBit / 8;
|
||||
|
||||
for (int i = 0; inputLen - offSet > 0; offSet = i * step) {
|
||||
byte[] cache;
|
||||
if (inputLen - offSet > step) {
|
||||
cache = cipher.doFinal(bytes, offSet, step);
|
||||
} else {
|
||||
cache = cipher.doFinal(bytes, offSet, inputLen - offSet);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
++i;
|
||||
}
|
||||
// 明文字节数组
|
||||
byte[] plaintextBytes = out.toByteArray();
|
||||
out.close();
|
||||
return new String(plaintextBytes, StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用私钥对数据进行数字签名
|
||||
*
|
||||
* @param ciphertext 密文
|
||||
* @param privateKeyBase64 私钥Base64
|
||||
* @return 加密后的base64签名
|
||||
*/
|
||||
public static String sign(String ciphertext, String privateKeyBase64) {
|
||||
try {
|
||||
// 密文字节数组
|
||||
byte[] ciphertextBytes = DECODER.decode(ciphertext.getBytes(StandardCharsets.UTF_8));
|
||||
PrivateKey privateKey = getPrivateKey(privateKeyBase64);
|
||||
Signature signature = Signature.getInstance(SIGN_ALGORITHMS);
|
||||
signature.initSign(privateKey);
|
||||
signature.update(ciphertextBytes);
|
||||
byte[] signed = signature.sign();
|
||||
return new String(ENCODER.encode(signed), StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用公钥验证数字签名
|
||||
*
|
||||
* @param ciphertext 密文
|
||||
* @param sign 签名
|
||||
* @param publicKeyBase64 公钥base64
|
||||
* @return 是否篡改了数据
|
||||
*/
|
||||
public static boolean verify(String ciphertext, String sign, String publicKeyBase64) {
|
||||
try {
|
||||
// 密文base64解码字节数组
|
||||
byte[] ciphertextBytes = DECODER.decode(ciphertext.getBytes(StandardCharsets.UTF_8));
|
||||
// 签名base64解码字节数组
|
||||
byte[] signBytes = DECODER.decode(sign.getBytes(StandardCharsets.UTF_8));
|
||||
PublicKey publicKey = getPublicKey(publicKeyBase64);
|
||||
Signature signature = Signature.getInstance(SIGN_ALGORITHMS);
|
||||
signature.initVerify(publicKey);
|
||||
signature.update(ciphertextBytes);
|
||||
return signature.verify(signBytes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公钥长度
|
||||
*
|
||||
* @param publicKey 公钥
|
||||
* @return
|
||||
*/
|
||||
public static int getKeySize(PublicKey publicKey) {
|
||||
RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;
|
||||
return rsaPublicKey.getModulus().bitLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取私钥长度
|
||||
*
|
||||
* @param privateKey 私钥
|
||||
* @return
|
||||
*/
|
||||
public static int getKeySize(PrivateKey privateKey) {
|
||||
RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;
|
||||
return rsaPrivateKey.getModulus().bitLength();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,18 +1,16 @@
|
|||
package com.yanzhu.common.core.utils.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.utils.uuid.IdUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
/**
|
||||
|
@ -104,6 +102,72 @@ public class FileUtils
|
|||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图像后缀
|
||||
*
|
||||
* @param photoByte 图像数据
|
||||
* @return 后缀名
|
||||
*/
|
||||
public static String getFileExtendName(byte[] photoByte)
|
||||
{
|
||||
String strFileExtendName = "jpg";
|
||||
if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56)
|
||||
&& ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97))
|
||||
{
|
||||
strFileExtendName = "gif";
|
||||
}
|
||||
else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70))
|
||||
{
|
||||
strFileExtendName = "jpg";
|
||||
}
|
||||
else if ((photoByte[0] == 66) && (photoByte[1] == 77))
|
||||
{
|
||||
strFileExtendName = "bmp";
|
||||
}
|
||||
else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71))
|
||||
{
|
||||
strFileExtendName = "png";
|
||||
}
|
||||
return strFileExtendName;
|
||||
}
|
||||
|
||||
public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
||||
if (!desc.exists())
|
||||
{
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
desc.getParentFile().mkdirs();
|
||||
}
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
|
||||
public static String writeBytes(byte[] data, String uploadDir,String fileName) throws IOException
|
||||
{
|
||||
FileOutputStream fos = null;
|
||||
String pathName = "";
|
||||
try
|
||||
{
|
||||
String extension = getFileExtendName(data);
|
||||
pathName = DateUtils.datePath() + "/" + fileName;
|
||||
File file = getAbsoluteFile(uploadDir, pathName);
|
||||
if(file.exists()){
|
||||
file.delete();
|
||||
}
|
||||
fos = new FileOutputStream(file);
|
||||
fos.write(data);
|
||||
}
|
||||
finally
|
||||
{
|
||||
IOUtils.close(fos);
|
||||
}
|
||||
return pathName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件名称验证
|
||||
*
|
||||
|
|
|
@ -50,6 +50,25 @@ public class AttendanceCfg extends BaseEntity
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
private Long deptId;
|
||||
private String deptName;
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="AttendanceCfg" id="AttendanceCfgResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="comId" column="com_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="vendorsParameter" column="vendors_parameter" />
|
||||
|
@ -19,16 +20,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="compName" column="comp_name"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="vendorsName" column="vendors_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttendanceCfgVo">
|
||||
SELECT ac.id, ac.com_id, ac.project_id, ac.vendors_code, ac.vendors_parameter, ac.enabled, ac.state, ac.remark, ac.is_del, ac.create_by, ac.create_time, ac.update_by
|
||||
, ac.update_time,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` vendors_name
|
||||
, ac.update_time,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` vendors_name,sd.sub_dept_name dept_name,ac.dept_id
|
||||
FROM attendance_cfg ac
|
||||
LEFT JOIN sys_dept dp ON ac.`com_id`=dp.`dept_id`
|
||||
LEFT JOIN pro_project_info pp ON ac.`project_id`=pp.`id`
|
||||
left join pro_project_info_subdepts sd on ac.dept_id=sd.id
|
||||
LEFT JOIN sys_dict_data dic ON ac.`vendors_code`=dic.`dict_value` AND dic.`dict_type`='attendance_vendors'
|
||||
</sql>
|
||||
|
||||
|
@ -54,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into attendance_cfg
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">com_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="vendorsCode != null">vendors_code,</if>
|
||||
<if test="vendorsParameter != null">vendors_parameter,</if>
|
||||
|
@ -68,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">#{comId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="vendorsCode != null">#{vendorsCode},</if>
|
||||
<if test="vendorsParameter != null">#{vendorsParameter},</if>
|
||||
|
@ -86,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update attendance_cfg
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="comId != null">com_id = #{comId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||
<if test="vendorsParameter != null">vendors_parameter = #{vendorsParameter},</if>
|
||||
|
|
|
@ -78,6 +78,12 @@
|
|||
<artifactId>yanzhu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
<version>5.8.20</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package com.yanzhu.job.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* 通用映射配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class ResourcesConfig implements WebMvcConfigurer
|
||||
{
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
@Value("${file.prefix}")
|
||||
public String localFilePrefix;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry)
|
||||
{
|
||||
/** 本地文件上传路径 */
|
||||
registry.addResourceHandler(localFilePrefix + "/**")
|
||||
.addResourceLocations("file:" + localFilePath + File.separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启跨域
|
||||
*/
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
// 设置允许跨域的路由
|
||||
registry.addMapping(localFilePrefix + "/**")
|
||||
// 设置允许跨域请求的域名
|
||||
.allowedOrigins("*")
|
||||
// 设置允许的方法
|
||||
.allowedMethods("GET");
|
||||
}
|
||||
|
||||
public String getUploadPath(){
|
||||
return (localFilePath+"/upload/").replaceAll("//","/");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 项目考勤配置对象 sur_project_attendance_cfg
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public class QuartzProjectAttendanceCfg extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 公司主键 */
|
||||
@Excel(name = "公司主键")
|
||||
private Long comId;
|
||||
|
||||
/** 分包单位 */
|
||||
@Excel(name = "分包单位")
|
||||
private Long projectId;
|
||||
|
||||
/** 厂商编号(参考字典attendance_vendors) */
|
||||
@Excel(name = " 厂商编号(参考字典attendance_vendors)")
|
||||
private String vendorsCode;
|
||||
|
||||
/** 厂商参数 */
|
||||
@Excel(name = "厂商参数")
|
||||
private String vendorsParameter;
|
||||
|
||||
/** 1-启用,0-停用 */
|
||||
@Excel(name = "1-启用,0-停用")
|
||||
private Long enabled;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Long state;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
private String deptName;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setComId(Long comId)
|
||||
{
|
||||
this.comId = comId;
|
||||
}
|
||||
|
||||
public Long getComId()
|
||||
{
|
||||
return comId;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setVendorsCode(String vendorsCode)
|
||||
{
|
||||
this.vendorsCode = vendorsCode;
|
||||
}
|
||||
|
||||
public String getVendorsCode()
|
||||
{
|
||||
return vendorsCode;
|
||||
}
|
||||
public void setVendorsParameter(String vendorsParameter)
|
||||
{
|
||||
this.vendorsParameter = vendorsParameter;
|
||||
}
|
||||
|
||||
public String getVendorsParameter()
|
||||
{
|
||||
return vendorsParameter;
|
||||
}
|
||||
public void setEnabled(Long enabled)
|
||||
{
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Long getEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
public void setState(Long state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Long getState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
private String compName;
|
||||
private String projectName;
|
||||
private String vendorsName;
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getVendorsName() {
|
||||
return vendorsName;
|
||||
}
|
||||
|
||||
public void setVendorsName(String vendorsName) {
|
||||
this.vendorsName = vendorsName;
|
||||
}
|
||||
|
||||
public String getCompName() {
|
||||
return compName;
|
||||
}
|
||||
|
||||
public void setCompName(String compName) {
|
||||
this.compName = compName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("comId", getComId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("vendorsCode", getVendorsCode())
|
||||
.append("vendorsParameter", getVendorsParameter())
|
||||
.append("enabled", getEnabled())
|
||||
.append("state", getState())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,512 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理对象 sur_project_attendance_data
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public class QuartzProjectAttendanceData extends BaseEntity
|
||||
{
|
||||
public QuartzProjectAttendanceData(){
|
||||
this.year= DateTime.now().year();
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int year;
|
||||
|
||||
public int getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(int year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getWorkerName() {
|
||||
return workerName;
|
||||
}
|
||||
|
||||
public void setWorkerName(String workerName) {
|
||||
this.workerName = workerName;
|
||||
}
|
||||
|
||||
public String getWorkerPhoto() {
|
||||
return workerPhoto;
|
||||
}
|
||||
|
||||
public void setWorkerPhoto(String workerPhoto) {
|
||||
this.workerPhoto = workerPhoto;
|
||||
}
|
||||
|
||||
public Long getWorkerGender() {
|
||||
return workerGender;
|
||||
}
|
||||
|
||||
public void setWorkerGender(Long workerGender) {
|
||||
this.workerGender = workerGender;
|
||||
}
|
||||
|
||||
public Long getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(Long birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getWorkTypeName() {
|
||||
return workTypeName;
|
||||
}
|
||||
|
||||
public void setWorkTypeName(String workTypeName) {
|
||||
this.workTypeName = workTypeName;
|
||||
}
|
||||
|
||||
public String getEthnic() {
|
||||
return ethnic;
|
||||
}
|
||||
|
||||
public void setEthnic(String ethnic) {
|
||||
this.ethnic = ethnic;
|
||||
}
|
||||
|
||||
public String getNativePlace() {
|
||||
return nativePlace;
|
||||
}
|
||||
|
||||
public void setNativePlace(String nativePlace) {
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Integer getSpecWorkType() {
|
||||
return specWorkType;
|
||||
}
|
||||
|
||||
public void setSpecWorkType(Integer specWorkType) {
|
||||
this.specWorkType = specWorkType;
|
||||
}
|
||||
|
||||
public String getCompanyName() {
|
||||
return companyName;
|
||||
}
|
||||
|
||||
public void setCompanyName(String companyName) {
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getAttendanceOutTime() {
|
||||
return attendanceOutTime;
|
||||
}
|
||||
|
||||
public void setAttendanceOutTime(String attendanceOutTime) {
|
||||
this.attendanceOutTime = attendanceOutTime;
|
||||
}
|
||||
|
||||
|
||||
private Long projectId;
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
private Long deptId;
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
@Excel(name = "姓名")
|
||||
private String workerName;
|
||||
|
||||
private String workerPhoto;
|
||||
@Excel(name = "性别0:男 1:女")
|
||||
private Long workerGender;
|
||||
|
||||
private Long birthDate;
|
||||
@Excel(name = "所属班组")
|
||||
private String groupName;
|
||||
@Excel(name = "工种")
|
||||
private String workTypeName;
|
||||
@Excel(name = "民族")
|
||||
private String ethnic;
|
||||
@Excel(name = "籍贯")
|
||||
private String nativePlace;
|
||||
|
||||
@Excel(name = "联系电话")
|
||||
private String phone;
|
||||
@Excel(name = "是否特殊工种")
|
||||
private Integer specWorkType;
|
||||
|
||||
private String companyTypeId;
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
|
||||
private String workerId;
|
||||
|
||||
/** 考勤时间yyyy-MM-dd HH:mm:ss */
|
||||
@Excel(name = "考勤时间(进场)")
|
||||
private String attendanceTime;
|
||||
|
||||
@Excel(name = "考勤时间(离开)")
|
||||
private String attendanceOutTime;
|
||||
/** 身份证号 */
|
||||
@Excel(name = "身份证号")
|
||||
private String identification;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 配置项ID,可以获取项目ID和总包ID */
|
||||
private Long cfgid;
|
||||
|
||||
/** 注册应用ID */
|
||||
private String appId;
|
||||
|
||||
/** 厂商编号参考字典attendance_vendors */
|
||||
private String vendorsCode;
|
||||
|
||||
/** 服务端ID */
|
||||
private String serverid;
|
||||
|
||||
/** 队伍id */
|
||||
private Long teamId;
|
||||
|
||||
/** 工种编码 */
|
||||
private String workTypeCode;
|
||||
|
||||
/** 分包商id */
|
||||
private String companyId;
|
||||
|
||||
/** 平台对应分包商ID */
|
||||
private Long vendorId;
|
||||
|
||||
/** 设备编号 */
|
||||
private String deviceCode;
|
||||
|
||||
/** 照片 */
|
||||
private String scanPhoto;
|
||||
|
||||
/** */
|
||||
private Long isDel;
|
||||
|
||||
private Long subDeptId;
|
||||
|
||||
/** 重要::yanzhu接口接收base64图片 */
|
||||
private String scanPhotoBase64;
|
||||
|
||||
/** 重要::yanzhu出门进门逻辑判断 */
|
||||
private String attendanceType;
|
||||
|
||||
public String getScanPhotoBase64() {
|
||||
return scanPhotoBase64;
|
||||
}
|
||||
|
||||
public void setScanPhotoBase64(String scanPhotoBase64) {
|
||||
this.scanPhotoBase64 = scanPhotoBase64;
|
||||
}
|
||||
|
||||
public String getAttendanceType() {
|
||||
return attendanceType;
|
||||
}
|
||||
|
||||
public void setAttendanceType(String attendanceType) {
|
||||
this.attendanceType = attendanceType;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceData createFromHuazhu(JSONObject j) {
|
||||
QuartzProjectAttendanceData d=new QuartzProjectAttendanceData();
|
||||
d.vendorsCode="huazhu";
|
||||
d.serverid=j.getString("id");
|
||||
d.workerId=j.getString("labourWorkerId");
|
||||
long recordTime=j.getLongValue("recordTime",0);
|
||||
if(recordTime>0){
|
||||
if(j.getIntValue("inOrOut",1)==1){
|
||||
d.setRemark("E");
|
||||
}else{
|
||||
d.setRemark("L");
|
||||
}
|
||||
d.attendanceTime= DateUtil.format(DateUtil.date(recordTime),"yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
d.identification=j.getString("idCardNo");
|
||||
d.teamId=j.getLongValue("teamId",0);
|
||||
d.workTypeCode=j.getString("workerTypeId");
|
||||
d.companyId=j.getString("unitId");
|
||||
d.deviceCode=j.getString("deviceNo");
|
||||
return d;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceData createFromJgw(JSONObject j) {
|
||||
QuartzProjectAttendanceData d=new QuartzProjectAttendanceData();
|
||||
d.vendorsCode="jgw";
|
||||
d.serverid=j.getString("id");
|
||||
d.workerId=j.getString("workerId");
|
||||
if("2".equals(j.getString("machineType"))){
|
||||
d.setRemark("E");
|
||||
}else{
|
||||
d.setRemark("L");
|
||||
}
|
||||
d.attendanceTime = j.getString("checkinTime");
|
||||
|
||||
d.teamId=0l;
|
||||
d.workTypeCode="";
|
||||
d.companyId=j.getString("subcontractorId");
|
||||
d.deviceCode=j.getString("deviceSerialNo");
|
||||
d.isDel=0l;
|
||||
return d;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getSubDeptId() {
|
||||
return subDeptId;
|
||||
}
|
||||
|
||||
public void setSubDeptId(Long subDeptId) {
|
||||
this.subDeptId = subDeptId;
|
||||
}
|
||||
|
||||
public String getCompanyTypeId() {
|
||||
return companyTypeId;
|
||||
}
|
||||
|
||||
public void setCompanyTypeId(String companyTypeId) {
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceData create(JSONObject json) {
|
||||
QuartzProjectAttendanceData d=new QuartzProjectAttendanceData();
|
||||
d.attendanceTime=json.getString("time");
|
||||
if("E".equals(json.getString("type"))){
|
||||
d.setRemark("E");
|
||||
}else{
|
||||
d.setRemark("L");
|
||||
}
|
||||
d.serverid=json.getString("id");
|
||||
d.workerId=json.getString("workerId");
|
||||
d.identification=json.getString("identification");
|
||||
d.teamId=json.getLong("teamId");
|
||||
d.workTypeCode=json.getString("workerTypeId");
|
||||
d.companyId=json.getString("companyId");
|
||||
d.vendorId=json.getLong("vendorId");
|
||||
d.deviceCode=json.getString("deviceCode");
|
||||
d.scanPhoto=json.getString("scanPhoto");
|
||||
d.isDel=0l;
|
||||
return d;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCfgid(Long cfgid)
|
||||
{
|
||||
this.cfgid = cfgid;
|
||||
}
|
||||
|
||||
public Long getCfgid()
|
||||
{
|
||||
return cfgid;
|
||||
}
|
||||
public void setVendorsCode(String vendorsCode)
|
||||
{
|
||||
this.vendorsCode = vendorsCode;
|
||||
}
|
||||
|
||||
public String getVendorsCode()
|
||||
{
|
||||
return vendorsCode;
|
||||
}
|
||||
public void setServerid(String serverid)
|
||||
{
|
||||
this.serverid = serverid;
|
||||
}
|
||||
|
||||
public String getServerid()
|
||||
{
|
||||
return serverid;
|
||||
}
|
||||
public void setWorkerId(String workerId)
|
||||
{
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getWorkerId()
|
||||
{
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setAttendanceTime(String attendanceTime)
|
||||
{
|
||||
this.attendanceTime = attendanceTime;
|
||||
}
|
||||
|
||||
public String getAttendanceTime()
|
||||
{
|
||||
return attendanceTime;
|
||||
}
|
||||
public void setIdentification(String identification)
|
||||
{
|
||||
this.identification = identification;
|
||||
}
|
||||
|
||||
public String getIdentification()
|
||||
{
|
||||
return identification;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setWorkTypeCode(String workTypeCode)
|
||||
{
|
||||
this.workTypeCode = workTypeCode;
|
||||
}
|
||||
|
||||
public String getWorkTypeCode()
|
||||
{
|
||||
return workTypeCode;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
|
||||
public void setDeviceCode(String deviceCode)
|
||||
{
|
||||
this.deviceCode = deviceCode;
|
||||
}
|
||||
|
||||
public String getDeviceCode()
|
||||
{
|
||||
return deviceCode;
|
||||
}
|
||||
|
||||
|
||||
public void setScanPhoto(String scanPhoto)
|
||||
{
|
||||
this.scanPhoto = scanPhoto;
|
||||
}
|
||||
|
||||
public String getScanPhoto()
|
||||
{
|
||||
return scanPhoto;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgid", getCfgid())
|
||||
.append("vendorsCode", getVendorsCode())
|
||||
.append("serverid", getServerid())
|
||||
.append("workerId", getWorkerId())
|
||||
.append("attendanceTime", getAttendanceTime())
|
||||
.append("identification", getIdentification())
|
||||
.append("teamId", getTeamId())
|
||||
.append("workTypeCode", getWorkTypeCode())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("deviceCode", getDeviceCode())
|
||||
.append("scanPhoto", getScanPhoto())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,429 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 广联达班组信息对象 sur_project_attendance_group
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
public class QuartzProjectAttendanceGroup extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** cfgid */
|
||||
@Excel(name = "cfgid")
|
||||
private Long cfgid;
|
||||
|
||||
/** 注册应用ID */
|
||||
@Excel(name = "注册应用ID")
|
||||
private String appId;
|
||||
|
||||
/** 服务器主键id */
|
||||
@Excel(name = "服务器主键id")
|
||||
private String serverid;
|
||||
|
||||
/** 营业执照号 */
|
||||
@Excel(name = "营业执照号")
|
||||
private String bizLicense;
|
||||
|
||||
/** 分包商统一社会信用代码 */
|
||||
@Excel(name = "分包商统一社会信用代码")
|
||||
private String companyCode;
|
||||
|
||||
/** 分包商ID */
|
||||
@Excel(name = "分包商ID")
|
||||
private String companyId;
|
||||
|
||||
/** 分包商名称 */
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
|
||||
/** 分包商类型 */
|
||||
@Excel(name = "分包商类型")
|
||||
private String companyTypeId;
|
||||
|
||||
/** 平台对应分包商ID */
|
||||
@Excel(name = "平台对应分包商ID")
|
||||
private Long vendorId;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String name;
|
||||
|
||||
/** 班组长名称 */
|
||||
@Excel(name = "班组长名称")
|
||||
private String leaderName;
|
||||
|
||||
/** 班组长电话 */
|
||||
@Excel(name = "班组长电话")
|
||||
private String leaderPhone;
|
||||
|
||||
/** 队伍Id */
|
||||
@Excel(name = "队伍Id")
|
||||
private Long teamId;
|
||||
|
||||
/** 队伍名称 */
|
||||
@Excel(name = "队伍名称")
|
||||
private String teamName;
|
||||
|
||||
/** 班组类型0:建筑工人班组;1:管理人员班组 */
|
||||
@Excel(name = "班组类型0:建筑工人班组;1:管理人员班组")
|
||||
private Long type;
|
||||
|
||||
/** 班组长对应的工人ID */
|
||||
@Excel(name = "班组长对应的工人ID")
|
||||
private Long leaderId;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private Integer deleted;
|
||||
|
||||
/** 基础平台对应班组ID */
|
||||
@Excel(name = "基础平台对应班组ID")
|
||||
private Long platformGroupId;
|
||||
|
||||
/** 基础平台对应队伍ID */
|
||||
@Excel(name = "基础平台对应队伍ID")
|
||||
private Long platformTeamId;
|
||||
|
||||
/** 企业进场日期 */
|
||||
@Excel(name = "企业进场日期")
|
||||
private Long enterDate;
|
||||
|
||||
/** 企业退场日期 */
|
||||
@Excel(name = "企业退场日期")
|
||||
private Long exitDate;
|
||||
|
||||
/** 是否有效 */
|
||||
@Excel(name = "是否有效")
|
||||
private Long isDel;
|
||||
|
||||
/** 时间戳 */
|
||||
@Excel(name = "时间戳")
|
||||
private Long createTimestamp;
|
||||
|
||||
public static QuartzProjectAttendanceGroup createHuazhu(JSONObject j) {
|
||||
QuartzProjectAttendanceGroup g=new QuartzProjectAttendanceGroup();
|
||||
g.companyId=""+j.getLongValue("unitId",0);
|
||||
g.companyName=j.getString("unitName");
|
||||
g.companyTypeId=j.getString("unitType");
|
||||
g.serverid=j.getString("id");
|
||||
g.enterDate=j.getLong("enterTime");
|
||||
g.exitDate=j.getLong("leaveTime");
|
||||
g.isDel=0l;
|
||||
return g;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceGroup createJgw(JSONObject j, boolean isDirectlyUnder) {
|
||||
QuartzProjectAttendanceGroup g=new QuartzProjectAttendanceGroup();
|
||||
g.serverid=j.getString("id");
|
||||
if(isDirectlyUnder) {
|
||||
g.companyId = j.getString("leaderTeamId");
|
||||
g.leaderName=j.getString("subcontractorId");
|
||||
g.leaderPhone="directly";
|
||||
}else{
|
||||
g.companyId=j.getString("subcontractorId");
|
||||
}
|
||||
g.companyName=j.getString("corpName");
|
||||
g.teamName=j.getString("teamName");
|
||||
|
||||
g.bizLicense=j.getString("corpCode");
|
||||
g.companyCode=j.getString("teamJobtype");
|
||||
|
||||
g.companyTypeId="0";
|
||||
g.enterDate=0l;
|
||||
g.exitDate=0l;
|
||||
g.isDel=0l;
|
||||
return g;
|
||||
}
|
||||
|
||||
public Long getCreateTimestamp() {
|
||||
return createTimestamp;
|
||||
}
|
||||
|
||||
public void setCreateTimestamp(Long createTimestamp) {
|
||||
this.createTimestamp = createTimestamp;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceGroup create(JSONObject json) {
|
||||
QuartzProjectAttendanceGroup g=new QuartzProjectAttendanceGroup();
|
||||
g.serverid=json.getString("id");
|
||||
g.bizLicense=json.getString("bizLicense");
|
||||
g.companyCode=json.getString("companyCode");
|
||||
g.companyId=""+json.getLongValue("companyId",0);
|
||||
g.companyName=json.getString("companyName");
|
||||
String typeId=json.getString("companyTypeId");
|
||||
if("1".equals(typeId)||"8".equals(typeId)||"9".equals(typeId)){
|
||||
typeId=typeId;
|
||||
}else{
|
||||
typeId="2";
|
||||
}
|
||||
g.companyTypeId=typeId;
|
||||
g.vendorId=json.getLongValue("vendorId",0);
|
||||
g.name=json.getString("name");
|
||||
g.leaderName=json.getString("leaderName");
|
||||
g.leaderPhone=json.getString("leaderPhone");
|
||||
g.teamId=json.getLongValue("teamId",0);
|
||||
g.teamName=json.getString("teamName");
|
||||
g.type=json.getLongValue("type",0);
|
||||
g.leaderId=json.getLongValue("leaderId",0);
|
||||
g.deleted=json.get("deleted")==null?0:(json.getBoolean("deleted")?1:0);
|
||||
g.platformGroupId=json.getLongValue("platformGroupId",0);
|
||||
g.platformTeamId=json.getLongValue("platformTeamId",0);
|
||||
g.enterDate=json.getLongValue("enterDate",0);
|
||||
g.exitDate=json.getLongValue("exitDate",0);
|
||||
g.isDel=0l;
|
||||
return g;
|
||||
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCfgid(Long cfgid)
|
||||
{
|
||||
this.cfgid = cfgid;
|
||||
}
|
||||
|
||||
public Long getCfgid()
|
||||
{
|
||||
return cfgid;
|
||||
}
|
||||
public void setServerid(String serverid)
|
||||
{
|
||||
this.serverid = serverid;
|
||||
}
|
||||
|
||||
public String getServerid()
|
||||
{
|
||||
return serverid;
|
||||
}
|
||||
public void setBizLicense(String bizLicense)
|
||||
{
|
||||
this.bizLicense = bizLicense;
|
||||
}
|
||||
|
||||
public String getBizLicense()
|
||||
{
|
||||
return bizLicense;
|
||||
}
|
||||
public void setCompanyCode(String companyCode)
|
||||
{
|
||||
this.companyCode = companyCode;
|
||||
}
|
||||
|
||||
public String getCompanyCode()
|
||||
{
|
||||
return companyCode;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setCompanyName(String companyName)
|
||||
{
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getCompanyName()
|
||||
{
|
||||
return companyName;
|
||||
}
|
||||
public void setCompanyTypeId(String companyTypeId)
|
||||
{
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
public String getCompanyTypeId()
|
||||
{
|
||||
return companyTypeId;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setLeaderName(String leaderName)
|
||||
{
|
||||
this.leaderName = leaderName;
|
||||
}
|
||||
|
||||
public String getLeaderName()
|
||||
{
|
||||
return leaderName;
|
||||
}
|
||||
public void setLeaderPhone(String leaderPhone)
|
||||
{
|
||||
this.leaderPhone = leaderPhone;
|
||||
}
|
||||
|
||||
public String getLeaderPhone()
|
||||
{
|
||||
return leaderPhone;
|
||||
}
|
||||
public void setTeamId(Long teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Long getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setType(Long type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Long getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setLeaderId(Long leaderId)
|
||||
{
|
||||
this.leaderId = leaderId;
|
||||
}
|
||||
|
||||
public Long getLeaderId()
|
||||
{
|
||||
return leaderId;
|
||||
}
|
||||
public void setDeleted(Integer deleted)
|
||||
{
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public Integer getDeleted()
|
||||
{
|
||||
return deleted;
|
||||
}
|
||||
public void setPlatformGroupId(Long platformGroupId)
|
||||
{
|
||||
this.platformGroupId = platformGroupId;
|
||||
}
|
||||
|
||||
public Long getPlatformGroupId()
|
||||
{
|
||||
return platformGroupId;
|
||||
}
|
||||
public void setPlatformTeamId(Long platformTeamId)
|
||||
{
|
||||
this.platformTeamId = platformTeamId;
|
||||
}
|
||||
|
||||
public Long getPlatformTeamId()
|
||||
{
|
||||
return platformTeamId;
|
||||
}
|
||||
public void setEnterDate(Long enterDate)
|
||||
{
|
||||
this.enterDate = enterDate;
|
||||
}
|
||||
|
||||
public Long getEnterDate()
|
||||
{
|
||||
return enterDate;
|
||||
}
|
||||
public void setExitDate(Long exitDate)
|
||||
{
|
||||
this.exitDate = exitDate;
|
||||
}
|
||||
|
||||
public Long getExitDate()
|
||||
{
|
||||
return exitDate;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgid", getCfgid())
|
||||
.append("serverid", getServerid())
|
||||
.append("bizLicense", getBizLicense())
|
||||
.append("companyCode", getCompanyCode())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("companyName", getCompanyName())
|
||||
.append("companyTypeId", getCompanyTypeId())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("name", getName())
|
||||
.append("leaderName", getLeaderName())
|
||||
.append("leaderPhone", getLeaderPhone())
|
||||
.append("teamId", getTeamId())
|
||||
.append("teamName", getTeamName())
|
||||
.append("type", getType())
|
||||
.append("leaderId", getLeaderId())
|
||||
.append("deleted", getDeleted())
|
||||
.append("createTimestamp", getCreateTimestamp())
|
||||
.append("platformGroupId", getPlatformGroupId())
|
||||
.append("platformTeamId", getPlatformTeamId())
|
||||
.append("enterDate", getEnterDate())
|
||||
.append("exitDate", getExitDate())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,733 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性对象 sur_project_attendance_user
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public class QuartzProjectAttendanceUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 配置项ID,可以获取项目ID和总包ID */
|
||||
|
||||
private Long cfgid;
|
||||
|
||||
/** 注册应用ID */
|
||||
|
||||
private String appId;
|
||||
|
||||
/** 厂商编号参考字典attendance_vendors */
|
||||
|
||||
private String vendorsCode;
|
||||
|
||||
/** 工人id */
|
||||
@Excel(name = "工人id")
|
||||
private String workerId;
|
||||
|
||||
/** 项目工人履历id对于旧劳务,这个字段相当于工人的projectWorkerId,管理人员的registerManagerId */
|
||||
|
||||
private Long laborWorkerId;
|
||||
|
||||
/** 人员类别0:工人,1:管理人员 */
|
||||
@Excel(name = "人员类别0:工人,1:管理人员")
|
||||
private Long workerCategory;
|
||||
|
||||
/** 工号 */
|
||||
|
||||
private Long qrCode;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
|
||||
/** 民族 */
|
||||
@Excel(name = "民族")
|
||||
private String ethnic;
|
||||
|
||||
/** 籍贯 */
|
||||
@Excel(name = "籍贯")
|
||||
private String nativePlace;
|
||||
|
||||
/** 性别0:男 1:女 */
|
||||
@Excel(name = "性别0:男 1:女")
|
||||
private Long gender;
|
||||
|
||||
/** 出生日期时间戳 */
|
||||
@Excel(name = "出生日期时间戳")
|
||||
private Long birthDate;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "联系电话")
|
||||
private String phone;
|
||||
|
||||
/** 学历 */
|
||||
@Excel(name = "学历")
|
||||
private String degreeName;
|
||||
|
||||
/** 身份证照 */
|
||||
@Excel(name = "身份证照")
|
||||
private String photo;
|
||||
|
||||
/** 近照 */
|
||||
|
||||
private String recentPhoto;
|
||||
|
||||
/** 所属班组ID */
|
||||
|
||||
private String groupId;
|
||||
|
||||
/** 所属班组 */
|
||||
@Excel(name = "所属班组")
|
||||
private String groupName;
|
||||
|
||||
/** 是否班组长 */
|
||||
@Excel(name = "是否班组长")
|
||||
private Integer leader;
|
||||
|
||||
/** 工种编码 */
|
||||
@Excel(name = "工种编码")
|
||||
private String workTypeCode;
|
||||
|
||||
/** 工种 */
|
||||
@Excel(name = "工种")
|
||||
private String workTypeName;
|
||||
|
||||
/** 是否特殊工种 */
|
||||
@Excel(name = "是否特殊工种")
|
||||
private Integer specWorkType;
|
||||
|
||||
/** 安全帽编号 */
|
||||
@Excel(name = "安全帽编号")
|
||||
private String hatCode;
|
||||
|
||||
/** 进退场状态0:进场,1:退场 */
|
||||
@Excel(name = "进退场状态0:进场,1:退场")
|
||||
private Long state;
|
||||
|
||||
/** 进场日期 */
|
||||
@Excel(name = "进场日期")
|
||||
private String enterDate;
|
||||
|
||||
/** 退场日期 */
|
||||
@Excel(name = "退场日期")
|
||||
private String exitDate;
|
||||
|
||||
/** 分包商id */
|
||||
@Excel(name = "分包商id")
|
||||
private String companyId;
|
||||
|
||||
/** 分包商名称 */
|
||||
@Excel(name = "分包商名称")
|
||||
private String companyName;
|
||||
|
||||
/** 平台对应分包商ID */
|
||||
@Excel(name = "平台对应分包商ID")
|
||||
private Long vendorId;
|
||||
|
||||
/** 队伍id */
|
||||
@Excel(name = "队伍id")
|
||||
private Integer teamId;
|
||||
|
||||
/** 队伍名称 */
|
||||
@Excel(name = "队伍名称")
|
||||
private String teamName;
|
||||
|
||||
/** 进场方式0:自动,1:手动2:拍照 */
|
||||
@Excel(name = "进场方式0:自动,1:手动2:拍照")
|
||||
private String enterType;
|
||||
|
||||
/** 服务返回的JSON */
|
||||
@Excel(name = "服务返回的JSON")
|
||||
private String other;
|
||||
|
||||
/** 是否有效 */
|
||||
@Excel(name = "是否有效")
|
||||
private Long isDel;
|
||||
|
||||
/** 人员部门类型 */
|
||||
@Excel(name = "人员部门类型")
|
||||
private String companyTypeId;
|
||||
|
||||
/** 重要::yanzhu接口接收base64图片 */
|
||||
private String recentPhotoBase64;
|
||||
|
||||
public String getRecentPhotoBase64() {
|
||||
return recentPhotoBase64;
|
||||
}
|
||||
|
||||
public void setRecentPhotoBase64(String recentPhotoBase64) {
|
||||
this.recentPhotoBase64 = recentPhotoBase64;
|
||||
}
|
||||
|
||||
@Excel(name = "进场时间")
|
||||
private Date inTime;
|
||||
@Excel(name = "离场时间")
|
||||
private Date outTime;
|
||||
|
||||
public static QuartzProjectAttendanceUser createFromHuazhu(JSONObject j) {
|
||||
QuartzProjectAttendanceUser u=new QuartzProjectAttendanceUser();
|
||||
u.workerId=j.getString("id");
|
||||
u.name=j.getString("name");
|
||||
u.ethnic=j.getString("nationalName");
|
||||
u.nativePlace=j.getString("provinceName")+j.getString("cityName");
|
||||
u.gender=j.getLongValue("sex",0)==0l?1l:0l;
|
||||
u.birthDate=j.getLongValue("birthday",0);
|
||||
u.phone=j.getString("phone");
|
||||
u.degreeName=j.getString("levelOfEducation");
|
||||
u.recentPhoto=j.getString("profile");
|
||||
u.groupId=j.getString("teamId");
|
||||
u.groupName=j.getString("teamName");
|
||||
u.workTypeCode=j.getString("workerTypeId");
|
||||
u.workTypeName=j.getString("workerTypeName");
|
||||
u.state=j.getLongValue("status",1)==2l?0l:1l;
|
||||
long enterTime=j.getLong("enterTime");
|
||||
if(enterTime>0){
|
||||
u.enterDate= DateUtil.format(DateUtil.date(enterTime),"yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
long leaveTime=j.getLong("leaveTime");
|
||||
if(leaveTime>0) {
|
||||
u.exitDate = DateUtil.format(DateUtil.date(leaveTime), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
u.vendorId=j.getLongValue("unitProjectId",0);
|
||||
u.companyId=""+j.getLongValue("unitId",0);
|
||||
u.companyName=j.getString("unitName");
|
||||
u.teamName=j.getString("teamName");
|
||||
return u;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceUser createFromJgw(JSONObject j) {
|
||||
QuartzProjectAttendanceUser u=new QuartzProjectAttendanceUser();
|
||||
u.workerId=j.getString("workerId");
|
||||
u.name=j.getString("name");
|
||||
u.ethnic=j.getString("minor");
|
||||
u.phone=j.getString("workPhone");
|
||||
u.nativePlace=j.getString("address");
|
||||
u.gender=j.getLongValue("sex",0)==0l?1l:0l;
|
||||
String tmp=j.getString("birthday");
|
||||
if(StrUtil.isNotEmpty(tmp)) {
|
||||
try {
|
||||
u.birthDate = DateUtil.parse(tmp).getTime();
|
||||
}catch (Exception ex){
|
||||
|
||||
}
|
||||
}
|
||||
u.photo=j.getString("headImage");
|
||||
u.degreeName=j.getString("education");
|
||||
u.recentPhoto=j.getString("vaildPhoto");
|
||||
u.groupId="";
|
||||
u.groupName="";
|
||||
u.workTypeCode="";
|
||||
u.workTypeName=j.getString("jobtype");
|
||||
u.state="01".equals( j.getString("workerStatus"))?0l:1l;
|
||||
String workDate=j.getString("workDate");
|
||||
if(!StrUtil.isEmpty(workDate)){
|
||||
u.enterDate=workDate;
|
||||
}
|
||||
u.vendorId=0l;
|
||||
u.companyId=j.getString("subcontractorId");
|
||||
u.companyName="";
|
||||
u.teamName="";
|
||||
u.isDel=0l;
|
||||
JSONArray ja=j.getJSONArray("corpName");
|
||||
if(ja!=null && ja.size()>0){
|
||||
Object obj=ja.get(0);
|
||||
if(obj!=null){
|
||||
u.companyName=obj.toString();
|
||||
}
|
||||
}
|
||||
|
||||
u.leader=j.getInteger("isAdmin")==1?1:0;
|
||||
return u;
|
||||
}
|
||||
|
||||
public Date getInTime() {
|
||||
return inTime;
|
||||
}
|
||||
|
||||
public void setInTime(Date inTime) {
|
||||
this.inTime = inTime;
|
||||
}
|
||||
|
||||
public Date getOutTime() {
|
||||
return outTime;
|
||||
}
|
||||
|
||||
public void setOutTime(Date outTime) {
|
||||
this.outTime = outTime;
|
||||
}
|
||||
|
||||
private Long projectId;
|
||||
private Long subDeptId;
|
||||
private Long deptId;
|
||||
|
||||
private List<String> workerIds;
|
||||
|
||||
public List<String> getWorkerIds() {
|
||||
return workerIds;
|
||||
}
|
||||
|
||||
public void setWorkerIds(List<String> workerIds) {
|
||||
this.workerIds = workerIds;
|
||||
}
|
||||
|
||||
private int size;
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
private int index;
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getSubDeptId() {
|
||||
return subDeptId;
|
||||
}
|
||||
|
||||
public void setSubDeptId(Long subDeptId) {
|
||||
this.subDeptId = subDeptId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public static QuartzProjectAttendanceUser create(JSONObject json) {
|
||||
QuartzProjectAttendanceUser u=new QuartzProjectAttendanceUser();
|
||||
u.workerId=json.getString("workerId");
|
||||
u.laborWorkerId=json.getLongValue("laborWorkerId",0);
|
||||
u.workerCategory=json.getLongValue("workerCategory",0);
|
||||
u.qrCode=json.getLongValue("qrCode",0);
|
||||
u.name=json.getString("name");
|
||||
u.ethnic=json.getString("ethnic");
|
||||
u.nativePlace=json.getString("nativePlace");
|
||||
u.gender=json.getLongValue("gender",0);
|
||||
u.birthDate=json.getLongValue("birthDate",0);
|
||||
u.phone=json.getString("phone");
|
||||
u.recentPhoto=json.getString("recentPhoto");
|
||||
u.groupId=json.getString("groupId");
|
||||
u.groupName=json.getString("groupName");
|
||||
u.leader=json.getBooleanValue("leader",false)?1:0;
|
||||
u.workTypeCode=json.getString("workTypeCode");
|
||||
u.workTypeName=json.getString("workTypeName");
|
||||
u.specWorkType=json.getBooleanValue("specWorkType",false)?1:0;
|
||||
u.hatCode=json.getString("hatCode");
|
||||
u.state=json.getLongValue("status",0);
|
||||
u.enterDate=json.getString("enterDate");
|
||||
u.exitDate=json.getString("exitDate");
|
||||
u.companyId=""+json.getLongValue("companyId",0);
|
||||
u.companyName=json.getString("companyName");
|
||||
u.vendorId=json.getLongValue("vendorId",0);
|
||||
u.teamId=json.getInteger("teamId");
|
||||
u.teamName=json.getString("teamName");
|
||||
u.enterType=json.getString("enterType");
|
||||
u.isDel=0l;
|
||||
return u;
|
||||
}
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCfgid(Long cfgid)
|
||||
{
|
||||
this.cfgid = cfgid;
|
||||
}
|
||||
|
||||
public Long getCfgid()
|
||||
{
|
||||
return cfgid;
|
||||
}
|
||||
public void setVendorsCode(String vendorsCode)
|
||||
{
|
||||
this.vendorsCode = vendorsCode;
|
||||
}
|
||||
|
||||
public String getVendorsCode()
|
||||
{
|
||||
return vendorsCode;
|
||||
}
|
||||
public void setWorkerId(String workerId)
|
||||
{
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getWorkerId()
|
||||
{
|
||||
return workerId;
|
||||
}
|
||||
public void setLaborWorkerId(Long laborWorkerId)
|
||||
{
|
||||
this.laborWorkerId = laborWorkerId;
|
||||
}
|
||||
|
||||
public Long getLaborWorkerId()
|
||||
{
|
||||
return laborWorkerId;
|
||||
}
|
||||
public void setWorkerCategory(Long workerCategory)
|
||||
{
|
||||
this.workerCategory = workerCategory;
|
||||
}
|
||||
|
||||
public Long getWorkerCategory()
|
||||
{
|
||||
return workerCategory;
|
||||
}
|
||||
public void setQrCode(Long qrCode)
|
||||
{
|
||||
this.qrCode = qrCode;
|
||||
}
|
||||
|
||||
public Long getQrCode()
|
||||
{
|
||||
return qrCode;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setEthnic(String ethnic)
|
||||
{
|
||||
this.ethnic = ethnic;
|
||||
}
|
||||
|
||||
public String getEthnic()
|
||||
{
|
||||
return ethnic;
|
||||
}
|
||||
public void setNativePlace(String nativePlace)
|
||||
{
|
||||
this.nativePlace = nativePlace;
|
||||
}
|
||||
|
||||
public String getNativePlace()
|
||||
{
|
||||
return nativePlace;
|
||||
}
|
||||
public void setGender(Long gender)
|
||||
{
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public Long getGender()
|
||||
{
|
||||
return gender;
|
||||
}
|
||||
public void setBirthDate(Long birthDate)
|
||||
{
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public Long getBirthDate()
|
||||
{
|
||||
return birthDate;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setDegreeName(String degreeName)
|
||||
{
|
||||
this.degreeName = degreeName;
|
||||
}
|
||||
|
||||
public String getDegreeName()
|
||||
{
|
||||
return degreeName;
|
||||
}
|
||||
public void setPhoto(String photo)
|
||||
{
|
||||
this.photo = photo;
|
||||
}
|
||||
|
||||
public String getPhoto()
|
||||
{
|
||||
return photo;
|
||||
}
|
||||
public void setRecentPhoto(String recentPhoto)
|
||||
{
|
||||
this.recentPhoto = recentPhoto;
|
||||
}
|
||||
|
||||
public String getRecentPhoto()
|
||||
{
|
||||
return recentPhoto;
|
||||
}
|
||||
public void setGroupId(String groupId)
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupName(String groupName)
|
||||
{
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return groupName;
|
||||
}
|
||||
public void setLeader(Integer leader)
|
||||
{
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
public Integer getLeader()
|
||||
{
|
||||
return leader;
|
||||
}
|
||||
public void setWorkTypeCode(String workTypeCode)
|
||||
{
|
||||
this.workTypeCode = workTypeCode;
|
||||
}
|
||||
|
||||
public String getWorkTypeCode()
|
||||
{
|
||||
return workTypeCode;
|
||||
}
|
||||
public void setWorkTypeName(String workTypeName)
|
||||
{
|
||||
this.workTypeName = workTypeName;
|
||||
}
|
||||
|
||||
public String getWorkTypeName()
|
||||
{
|
||||
return workTypeName;
|
||||
}
|
||||
public void setSpecWorkType(Integer specWorkType)
|
||||
{
|
||||
this.specWorkType = specWorkType;
|
||||
}
|
||||
|
||||
public Integer getSpecWorkType()
|
||||
{
|
||||
return specWorkType;
|
||||
}
|
||||
public void setHatCode(String hatCode)
|
||||
{
|
||||
this.hatCode = hatCode;
|
||||
}
|
||||
|
||||
public String getHatCode()
|
||||
{
|
||||
return hatCode;
|
||||
}
|
||||
public void setState(Long state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Long getState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
public void setEnterDate(String enterDate)
|
||||
{
|
||||
this.enterDate = enterDate;
|
||||
}
|
||||
|
||||
public String getEnterDate()
|
||||
{
|
||||
return enterDate;
|
||||
}
|
||||
public void setExitDate(String exitDate)
|
||||
{
|
||||
this.exitDate = exitDate;
|
||||
}
|
||||
|
||||
public String getExitDate()
|
||||
{
|
||||
return exitDate;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setCompanyName(String companyName)
|
||||
{
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public String getCompanyName()
|
||||
{
|
||||
return companyName;
|
||||
}
|
||||
public void setVendorId(Long vendorId)
|
||||
{
|
||||
this.vendorId = vendorId;
|
||||
}
|
||||
|
||||
public Long getVendorId()
|
||||
{
|
||||
return vendorId;
|
||||
}
|
||||
public void setTeamId(Integer teamId)
|
||||
{
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
public Integer getTeamId()
|
||||
{
|
||||
return teamId;
|
||||
}
|
||||
public void setTeamName(String teamName)
|
||||
{
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getTeamName()
|
||||
{
|
||||
return teamName;
|
||||
}
|
||||
public void setEnterType(String enterType)
|
||||
{
|
||||
this.enterType = enterType;
|
||||
}
|
||||
|
||||
public String getEnterType()
|
||||
{
|
||||
return enterType;
|
||||
}
|
||||
public void setOther(String other)
|
||||
{
|
||||
this.other = other;
|
||||
}
|
||||
|
||||
public String getOther()
|
||||
{
|
||||
return other;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getCompanyTypeId() {
|
||||
return companyTypeId;
|
||||
}
|
||||
|
||||
public void setCompanyTypeId(String companyTypeId) {
|
||||
this.companyTypeId = companyTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgid", getCfgid())
|
||||
.append("vendorsCode", getVendorsCode())
|
||||
.append("workerId", getWorkerId())
|
||||
.append("laborWorkerId", getLaborWorkerId())
|
||||
.append("workerCategory", getWorkerCategory())
|
||||
.append("qrCode", getQrCode())
|
||||
.append("name", getName())
|
||||
.append("ethnic", getEthnic())
|
||||
.append("nativePlace", getNativePlace())
|
||||
.append("gender", getGender())
|
||||
.append("birthDate", getBirthDate())
|
||||
.append("phone", getPhone())
|
||||
.append("degreeName", getDegreeName())
|
||||
.append("photo", getPhoto())
|
||||
.append("recentPhoto", getRecentPhoto())
|
||||
.append("groupId", getGroupId())
|
||||
.append("groupName", getGroupName())
|
||||
.append("leader", getLeader())
|
||||
.append("workTypeCode", getWorkTypeCode())
|
||||
.append("workTypeName", getWorkTypeName())
|
||||
.append("specWorkType", getSpecWorkType())
|
||||
.append("hatCode", getHatCode())
|
||||
.append("state", getState())
|
||||
.append("enterDate", getEnterDate())
|
||||
.append("exitDate", getExitDate())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("companyName", getCompanyName())
|
||||
.append("vendorId", getVendorId())
|
||||
.append("teamId", getTeamId())
|
||||
.append("teamName", getTeamName())
|
||||
.append("enterType", getEnterType())
|
||||
.append("other", getOther())
|
||||
.append("remark", getRemark())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 系统应用注册对象 sys_apply_config
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
public class SysApplyConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 服务配置主键 */
|
||||
private Long cfgId;
|
||||
|
||||
/** 服务配置类型 */
|
||||
private String cfgType;
|
||||
|
||||
/** 应用主键 */
|
||||
@Excel(name = "应用主键")
|
||||
private String appId;
|
||||
|
||||
/** 公钥 */
|
||||
private String publicKey;
|
||||
|
||||
/** 私钥 */
|
||||
private String privateKey;
|
||||
|
||||
/** 项目主键 */
|
||||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 部门主键 */
|
||||
@Excel(name = "部门主键")
|
||||
private Long deptId;
|
||||
|
||||
/** 部门名称 */
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private String isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAppId(String appId)
|
||||
{
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getAppId()
|
||||
{
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setPublicKey(String publicKey)
|
||||
{
|
||||
this.publicKey = publicKey;
|
||||
}
|
||||
|
||||
public String getPublicKey()
|
||||
{
|
||||
return publicKey;
|
||||
}
|
||||
public void setPrivateKey(String privateKey)
|
||||
{
|
||||
this.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public String getPrivateKey()
|
||||
{
|
||||
return privateKey;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setIsDel(String isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public String getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public Long getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
|
||||
public void setCfgId(Long cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
|
||||
public String getCfgType() {
|
||||
return cfgType;
|
||||
}
|
||||
|
||||
public void setCfgType(String cfgType) {
|
||||
this.cfgType = cfgType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("cfgId", getCfgId())
|
||||
.append("cfgType", getCfgType())
|
||||
.append("appId", getAppId())
|
||||
.append("publicKey", getPublicKey())
|
||||
.append("privateKey", getPrivateKey())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.yanzhu.job.domain;
|
||||
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
|
||||
public class SysNative extends BaseEntity {
|
||||
|
||||
private Long id;
|
||||
private String address;
|
||||
private String provinces;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getProvinces() {
|
||||
return provinces;
|
||||
}
|
||||
|
||||
public void setProvinces(String provinces) {
|
||||
this.provinces = provinces;
|
||||
}
|
||||
|
||||
public String getCitiy() {
|
||||
return citiy;
|
||||
}
|
||||
|
||||
public void setCitiy(String citiy) {
|
||||
this.citiy = citiy;
|
||||
}
|
||||
|
||||
public String getAreas() {
|
||||
return areas;
|
||||
}
|
||||
|
||||
public void setAreas(String areas) {
|
||||
this.areas = areas;
|
||||
}
|
||||
|
||||
private String citiy;
|
||||
private String areas;
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目考勤配置Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface QuartzProjectAttendanceCfgMapper
|
||||
{
|
||||
/**
|
||||
* 查询项目考勤配置列表
|
||||
*
|
||||
* @param quartzProjectAttendanceCfg 项目考勤配置
|
||||
* @return 项目考勤配置集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgList(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
|
||||
|
||||
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgListForAllInfo(QuartzProjectAttendanceCfg where);
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface QuartzProjectAttendanceDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
public QuartzProjectAttendanceData selectSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataList(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 查询考勤信息
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public QuartzProjectAttendanceData findCurrentAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataListEx(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 修改劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 删除劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增劳务实名制考勤管理
|
||||
*
|
||||
* @param quartzProjectAttendanceDataList 劳务实名制考勤管理列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceData(@Param("list") List<QuartzProjectAttendanceData> quartzProjectAttendanceDataList, @Param("year") String year);
|
||||
|
||||
public Long getLastServerId(QuartzProjectAttendanceData where);
|
||||
|
||||
List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where);
|
||||
List<QuartzProjectAttendanceData> groupByComany(QuartzProjectAttendanceData where);
|
||||
|
||||
public Long getHuazhuPage(QuartzProjectAttendanceData where);
|
||||
|
||||
|
||||
public List<Map<String,Object>> initOtherData(Map<String,Object> data);
|
||||
|
||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
|
||||
|
||||
public String findHuaZhuCompanyType(String deptName);
|
||||
|
||||
public List<QuartzProjectAttendanceData> todayAttendance(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByDays(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupDataByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> attendanceDataList(QuartzProjectAttendanceData where);
|
||||
|
||||
public List<QuartzProjectAttendanceData> groupTodayCompanyTypeId(QuartzProjectAttendanceData where);
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广联达班组信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
public interface QuartzProjectAttendanceGroupMapper
|
||||
{
|
||||
/**
|
||||
* 查询广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
public QuartzProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 修改广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 删除广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroupList 广联达班组信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceGroup(List<QuartzProjectAttendanceGroup> quartzProjectAttendanceGroupList);
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface QuartzProjectAttendanceUserMapper
|
||||
{
|
||||
/**
|
||||
* 查询考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser selectSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findYzCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 考勤人员基本属性集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
|
||||
public List<QuartzProjectAttendanceUser> querySurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
/**
|
||||
* 新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 修改考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 删除考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUserList 考勤人员基本属性列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceUser(List<QuartzProjectAttendanceUser> quartzProjectAttendanceUserList);
|
||||
|
||||
/**
|
||||
* 下面三个方法完成考勤记录分页查询
|
||||
* countAttendance 获取总记录条数
|
||||
* queryAttendanceUsers 获取当前页workerIds
|
||||
* queryAttendanceByUserIds 根据workerIds查询一页数据然后组装
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceByUserIds(QuartzProjectAttendanceUser where);
|
||||
public long countAttendance(QuartzProjectAttendanceCfg where);
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceUsers(QuartzProjectAttendanceUser where);
|
||||
|
||||
public long countTodayAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
|
||||
public List<QuartzProjectAttendanceUser> todayAttendance(QuartzProjectAttendanceUser where);
|
||||
public List<QuartzProjectAttendanceUser> todayAttendanceData(List<String> list);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> todayAttendanceOtherData(Map<String,Object> data);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceUser> queryWorkerOnDuty(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> attendanceUserList(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerOnDutyByDept(QuartzProjectAttendanceUser where);
|
||||
/**
|
||||
* 按部门汇总在岗|离岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerByDept(QuartzProjectAttendanceUser where);
|
||||
/**
|
||||
* 在岗|离岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceUser> queryWorkerByState(QuartzProjectAttendanceUser where);
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统应用注册Mapper接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
public interface SysApplyConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
public SysApplyConfig selectSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询系统应用注册列表
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 系统应用注册集合
|
||||
*/
|
||||
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 新增系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 修改系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 删除系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除系统应用注册
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.yanzhu.job.mapper;
|
||||
|
||||
import com.yanzhu.job.domain.SysNative;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SysNativeMapper {
|
||||
|
||||
public List<SysNative> selectSysNativeListById(Long id);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目考勤配置Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceCfgService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询项目考勤配置列表
|
||||
*
|
||||
* @param quartzProjectAttendanceCfg 项目考勤配置
|
||||
* @return 项目考勤配置集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgList(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceDataService
|
||||
{
|
||||
/**
|
||||
* 查询劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
public QuartzProjectAttendanceData selectSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataList(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 查询考勤信息
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
public QuartzProjectAttendanceData findCurrentAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataListEx(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 修改劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param ids 需要删除的劳务实名制管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除劳务实名制管理信息
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceDataByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增劳务实名制考勤管理
|
||||
*
|
||||
* @param quartzProjectAttendanceDataList 劳务实名制管理考勤列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceData(List<QuartzProjectAttendanceData> quartzProjectAttendanceDataList);
|
||||
|
||||
public void add(QuartzProjectAttendanceData sdata);
|
||||
|
||||
public String getLastServerId(QuartzProjectAttendanceData where);
|
||||
|
||||
public List<QuartzProjectAttendanceData> groupByComany(QuartzProjectAttendanceData where);
|
||||
|
||||
public Long getHuazhuPage( QuartzProjectAttendanceData where);
|
||||
|
||||
public List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where);
|
||||
|
||||
public List<Map<String,Object>> initOtherData(Map<String,Object> data);
|
||||
|
||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data);
|
||||
|
||||
List<QuartzProjectAttendanceData> todayAttendance(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupAllByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findGroupAllByDays(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceData> attendanceDataList(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupDataByParams(QuartzProjectAttendanceData where);
|
||||
|
||||
List<QuartzProjectAttendanceData> groupTodayCompanyTypeId(QuartzProjectAttendanceData where);
|
||||
|
||||
/**
|
||||
* 指增加
|
||||
* @param addList
|
||||
*/
|
||||
void addList(List<QuartzProjectAttendanceData> addList);
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广联达班组信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceGroupService
|
||||
{
|
||||
/**
|
||||
* 查询广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
public QuartzProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 修改广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param ids 需要删除的广联达班组信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除广联达班组信息信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceGroupByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroupList 广联达班组信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceGroup(List<QuartzProjectAttendanceGroup> quartzProjectAttendanceGroupList);
|
||||
|
||||
public void add(QuartzProjectAttendanceGroup group);
|
||||
|
||||
/**
|
||||
* 更新济工网的分组类型
|
||||
* @param group
|
||||
*/
|
||||
public void updateJgw(QuartzProjectAttendanceGroup group);
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
public interface IQuartzProjectAttendanceUserService
|
||||
{
|
||||
/**
|
||||
* 查询考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser selectSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findYzCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 考勤人员基本属性集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 修改考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param ids 需要删除的考勤人员基本属性主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除考勤人员基本属性信息
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectAttendanceUserByParams(List<String> list);
|
||||
|
||||
/**
|
||||
* 批量新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUserList 考勤人员基本属性列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchSurProjectAttendanceUser(List<QuartzProjectAttendanceUser> quartzProjectAttendanceUserList);
|
||||
|
||||
public void add(QuartzProjectAttendanceUser user);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceData(QuartzProjectAttendanceUser where);
|
||||
|
||||
public long countTodayAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
public List<QuartzProjectAttendanceUser> todayAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
public long countAttendance(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 济工网人员查询
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> queryWorkerOnDuty(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<QuartzProjectAttendanceUser> attendanceUserList(QuartzProjectAttendanceUser where);
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId);
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerOnDutyByDept(QuartzProjectAttendanceUser where);
|
||||
|
||||
List<QuartzProjectAttendanceUser> querySurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser);
|
||||
/**
|
||||
* 按部门汇总在岗|离岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceData> groupByWorkerByDept(QuartzProjectAttendanceUser where);
|
||||
/**
|
||||
* 在岗|离岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
List<QuartzProjectAttendanceUser> queryWorkerByState(QuartzProjectAttendanceUser where);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统应用注册Service接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
public interface ISysApplyConfigService
|
||||
{
|
||||
/**
|
||||
* 查询系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
public SysApplyConfig selectSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询系统应用注册列表
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 系统应用注册集合
|
||||
*/
|
||||
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 新增系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 修改系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig);
|
||||
|
||||
/**
|
||||
* 批量删除系统应用注册
|
||||
*
|
||||
* @param ids 需要删除的系统应用注册主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除系统应用注册信息
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysApplyConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 加载注册应用
|
||||
*/
|
||||
public void loadingSysApplyConfigCache();
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.yanzhu.job.service;
|
||||
|
||||
|
||||
|
||||
import com.yanzhu.job.domain.SysNative;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISysNativeService {
|
||||
public List<SysNative> selectSysNativeListById(Long id);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yanzhu.common.core.enums.ApplyCfgTypeEnum;
|
||||
import com.yanzhu.common.core.enums.ShiFouEnum;
|
||||
import com.yanzhu.common.core.enums.VendorsCodeEnum;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceCfgMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceCfgService;
|
||||
import com.yanzhu.job.service.ISysApplyConfigService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目考勤配置Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceCfgServiceImpl implements IQuartzProjectAttendanceCfgService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private ISysApplyConfigService sysApplyConfigService;
|
||||
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceCfgMapper quartzProjectAttendanceCfgMapper;
|
||||
|
||||
/**
|
||||
* 查询项目考勤配置列表
|
||||
*
|
||||
* @param quartzProjectAttendanceCfg 项目考勤配置
|
||||
* @return 项目考勤配置
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceCfg> selectSurProjectAttendanceCfgList(QuartzProjectAttendanceCfg quartzProjectAttendanceCfg)
|
||||
{
|
||||
return quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgList(quartzProjectAttendanceCfg);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,521 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceCfgMapper;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceDataMapper;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceGroupMapper;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceUserMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 劳务实名制管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceDataServiceImpl implements IQuartzProjectAttendanceDataService
|
||||
{
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceDataMapper quartzProjectAttendanceDataMapper;
|
||||
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceUserMapper quartzProjectAttendanceUserMapper;
|
||||
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceGroupMapper quartzProjectAttendanceGroupMapper;
|
||||
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceCfgMapper quartzProjectAttendanceCfgMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceData selectSurProjectAttendanceDataById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.selectSurProjectAttendanceDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询劳务实名制管理列表
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataList(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.selectSurProjectAttendanceDataList(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤信息
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 劳务实名制管理集合
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceData findCurrentAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData){
|
||||
return quartzProjectAttendanceDataMapper.findCurrentAttendanceData(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> selectSurProjectAttendanceDataListEx(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.selectSurProjectAttendanceDataListEx(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
String userName= SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceData.setCreateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
quartzProjectAttendanceData.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
return quartzProjectAttendanceDataMapper.insertSurProjectAttendanceData(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改劳务实名制管理
|
||||
*
|
||||
* @param quartzProjectAttendanceData 劳务实名制管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSurProjectAttendanceData(QuartzProjectAttendanceData quartzProjectAttendanceData)
|
||||
{
|
||||
String userName=SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceData.setUpdateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
|
||||
quartzProjectAttendanceData.setUpdateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceDataMapper.updateSurProjectAttendanceData(quartzProjectAttendanceData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param ids 需要删除的劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceDataByIds(Long[] ids)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.deleteSurProjectAttendanceDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除劳务实名制管理信息
|
||||
*
|
||||
* @param id 劳务实名制管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceDataById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceDataMapper.deleteSurProjectAttendanceDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除劳务实名制管理
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceDataByParams(List<String> list) {
|
||||
return quartzProjectAttendanceDataMapper.deleteSurProjectAttendanceDataByParams(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增劳务实名制考勤管理
|
||||
*
|
||||
* @param quartzProjectAttendanceDataList 劳务实名制考勤管理列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchSurProjectAttendanceData(List<QuartzProjectAttendanceData> quartzProjectAttendanceDataList) {
|
||||
return quartzProjectAttendanceDataMapper.batchSurProjectAttendanceData(quartzProjectAttendanceDataList,DateUtils.dateTimeNow(DateUtils.YYYY));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(QuartzProjectAttendanceData sdata) {
|
||||
if(StringUtils.isEmpty(sdata.getWorkerId()) || StringUtils.isEmpty(sdata.getAttendanceTime())){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceData where=new QuartzProjectAttendanceData();
|
||||
where.setVendorsCode(sdata.getVendorsCode());
|
||||
where.setCfgid(sdata.getCfgid());
|
||||
where.setWorkerId(sdata.getWorkerId());
|
||||
where.setAttendanceTime(sdata.getAttendanceTime());
|
||||
List<QuartzProjectAttendanceData> list=selectSurProjectAttendanceDataListEx(where);
|
||||
if(list.size()==0){
|
||||
//设置考勤其它参数
|
||||
//查询人员信息
|
||||
QuartzProjectAttendanceUser userWhere=new QuartzProjectAttendanceUser();
|
||||
userWhere.setWorkerId(sdata.getWorkerId());
|
||||
List<QuartzProjectAttendanceUser> uList= quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(userWhere);
|
||||
if(uList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceUser user=uList.get(0);
|
||||
sdata.setWorkerName(user.getName());
|
||||
String photo=user.getPhoto();
|
||||
if(StrUtil.isEmpty(photo)){
|
||||
photo=user.getRecentPhoto();
|
||||
}
|
||||
|
||||
sdata.setWorkerPhoto(photo);
|
||||
sdata.setWorkerGender(user.getGender());;
|
||||
sdata.setGroupName(user.getGroupName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setEthnic(user.getEthnic());
|
||||
sdata.setNativePlace(user.getNativePlace());
|
||||
sdata.setPhone(user.getPhone());
|
||||
sdata.setSpecWorkType(user.getSpecWorkType());
|
||||
if("jgw".equals(sdata.getVendorsCode())) {
|
||||
sdata.setCompanyId(user.getCompanyId());
|
||||
}
|
||||
//查询分组信息
|
||||
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
|
||||
groupWhere.setCfgid(sdata.getCfgid());
|
||||
groupWhere.setCompanyId(sdata.getCompanyId());
|
||||
List<QuartzProjectAttendanceGroup> gList= quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(groupWhere);
|
||||
if(gList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceGroup group=gList.get(0);
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setCompanyTypeId(group.getCompanyTypeId());
|
||||
//查询华筑的分组信息
|
||||
if("huazhu".equals(sdata.getVendorsCode())){
|
||||
sdata.setWorkerGender(sdata.getWorkerGender());
|
||||
sdata.setCompanyTypeId(getHuazhuCompanyTypeId(group.getCompanyName()));//获取华筑的分包商类型
|
||||
}
|
||||
if("jgw".equals(sdata.getVendorsCode())){
|
||||
//sdata.setWorkTypeName(group.getCompanyCode());
|
||||
//sdata.setCompanyName(user.getCompanyName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setGroupName(group.getTeamName());
|
||||
}
|
||||
//查询项目部门信息
|
||||
QuartzProjectAttendanceCfg cfgWhere=new QuartzProjectAttendanceCfg();
|
||||
cfgWhere.setId(sdata.getCfgid());
|
||||
List<QuartzProjectAttendanceCfg> cfgList= quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgListForAllInfo(cfgWhere);
|
||||
if(cfgList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceCfg cfg=cfgList.get(0);
|
||||
sdata.setProjectId(cfg.getProjectId());
|
||||
sdata.setDeptId(cfg.getDeptId());
|
||||
sdata.setProjectName(cfg.getProjectName());
|
||||
sdata.setDeptName(cfg.getDeptName());
|
||||
if(sdata.getCompanyTypeId()==null){
|
||||
sdata.setCompanyTypeId("0");
|
||||
}
|
||||
insertSurProjectAttendanceData(sdata);
|
||||
}else{
|
||||
sdata.setId(list.get(0).getId());
|
||||
QuartzProjectAttendanceData upData=list.get(0);
|
||||
String dt1=upData.getAttendanceTime(); //
|
||||
String dt2=upData.getAttendanceOutTime();
|
||||
String dt3=sdata.getAttendanceTime();
|
||||
if (StrUtil.isEmpty(dt3)) {
|
||||
return;
|
||||
}
|
||||
long time3=DateUtil.parse(dt3).getTime();
|
||||
if(StrUtil.isEmpty(dt2)){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
//比较 dt1,dt2 进行交换
|
||||
long time2=DateUtil.parse(dt3).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
if(time1>time2){
|
||||
upData.setAttendanceTime(dt3);
|
||||
upData.setAttendanceOutTime(dt1);
|
||||
}
|
||||
}else{
|
||||
long time2=DateUtil.parse(dt2).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
//比较 dt3<dt1 in->dt3
|
||||
if(time3<time1){
|
||||
upData.setAttendanceTime(dt3);
|
||||
}
|
||||
//比较 dt3>dt2 out->dt3
|
||||
if(time3>time2){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
}
|
||||
}
|
||||
//upData.setAttendanceOutTime(sdata.getAttendanceTime());
|
||||
if("jgw".equals(upData.getVendorsCode())){
|
||||
upData.setRemark(sdata.getRemark());
|
||||
}
|
||||
updateSurProjectAttendanceData(upData);
|
||||
}
|
||||
}
|
||||
|
||||
private String getHuazhuCompanyTypeId(String groupName) {
|
||||
return quartzProjectAttendanceDataMapper.findHuaZhuCompanyType(groupName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastServerId(QuartzProjectAttendanceData where) {
|
||||
return ""+ quartzProjectAttendanceDataMapper.getLastServerId(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupByComany(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.groupByComany(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getHuazhuPage( QuartzProjectAttendanceData attWhere) {
|
||||
return quartzProjectAttendanceDataMapper.getHuazhuPage(attWhere);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupAllByComany(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.groupAllByComany(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> initOtherData(Map<String,Object> data) {
|
||||
List<Map<String,Object>> dataList = new ArrayList<>();
|
||||
List<Map<String,Object>> list = quartzProjectAttendanceDataMapper.initOtherData(data);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
List<String> workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList());
|
||||
data.put("list",workerIds);
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceOtherData(data);
|
||||
for (Map<String,Object> map:list) {
|
||||
for(QuartzProjectAttendanceUser sau:datas){
|
||||
if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){
|
||||
map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime()));
|
||||
map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime()));
|
||||
dataList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> initHuaZhuData(Map<String,Object> data) {
|
||||
List<Map<String,Object>> dataList = new ArrayList<>();
|
||||
List<Map<String,Object>> list = quartzProjectAttendanceDataMapper.initHuaZhuData(data);
|
||||
if(StringUtils.isNotEmpty(list)){
|
||||
List<String> workerIds = list.stream().map(Map -> Map.get("workerId").toString()).collect(Collectors.toList());
|
||||
data.put("list",workerIds);
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceOtherData(data);
|
||||
for (Map<String,Object> map:list) {
|
||||
for(QuartzProjectAttendanceUser sau:datas){
|
||||
if(Objects.equals(map.get("workerId").toString(),sau.getWorkerId())){
|
||||
map.put("inTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getInTime()));
|
||||
map.put("outTime",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,sau.getOutTime()));
|
||||
dataList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> todayAttendance(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.todayAttendance(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计所有数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> groupAllByParams(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.findGroupAllByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> findGroupAllByDays(QuartzProjectAttendanceData where){
|
||||
return quartzProjectAttendanceDataMapper.findGroupAllByDays(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计考勤数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> groupDataByParams(QuartzProjectAttendanceData where){
|
||||
return quartzProjectAttendanceDataMapper.groupDataByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 考勤数据列表
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> attendanceDataList(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.attendanceDataList(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupTodayCompanyTypeId(QuartzProjectAttendanceData where) {
|
||||
return quartzProjectAttendanceDataMapper.groupTodayCompanyTypeId(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量增加
|
||||
* @param addList
|
||||
*/
|
||||
@Override
|
||||
public void addList(List<QuartzProjectAttendanceData> addList) {
|
||||
if(addList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceData where=new QuartzProjectAttendanceData();
|
||||
where.setVendorsCode(addList.get(0).getVendorsCode());
|
||||
where.setCfgid(addList.get(0).getCfgid());
|
||||
where.setAttendanceTime(addList.get(0).getAttendanceTime());
|
||||
List<QuartzProjectAttendanceData> oldList=selectSurProjectAttendanceDataListEx(where);
|
||||
for(QuartzProjectAttendanceData sdata:addList){
|
||||
List<QuartzProjectAttendanceData> list=oldList.stream().filter(d->d.getWorkerId().equals(sdata.getWorkerId())).collect(Collectors.toList());
|
||||
if(list.size()==0){
|
||||
//设置考勤其它参数
|
||||
//查询人员信息
|
||||
QuartzProjectAttendanceUser userWhere=new QuartzProjectAttendanceUser();
|
||||
userWhere.setWorkerId(sdata.getWorkerId());
|
||||
List<QuartzProjectAttendanceUser> uList= quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(userWhere);
|
||||
if(uList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceUser user=uList.get(0);
|
||||
sdata.setWorkerName(user.getName());
|
||||
String photo=user.getPhoto();
|
||||
if(StrUtil.isEmpty(photo)){
|
||||
photo=user.getRecentPhoto();
|
||||
}
|
||||
|
||||
sdata.setWorkerPhoto(photo);
|
||||
sdata.setWorkerGender(user.getGender());;
|
||||
sdata.setGroupName(user.getGroupName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setEthnic(user.getEthnic());
|
||||
sdata.setNativePlace(user.getNativePlace());
|
||||
sdata.setPhone(user.getPhone());
|
||||
sdata.setSpecWorkType(user.getSpecWorkType());
|
||||
if("jgw".equals(sdata.getVendorsCode())) {
|
||||
sdata.setCompanyId(user.getCompanyId());
|
||||
}
|
||||
//查询分组信息
|
||||
QuartzProjectAttendanceGroup groupWhere=new QuartzProjectAttendanceGroup();
|
||||
groupWhere.setCfgid(sdata.getCfgid());
|
||||
groupWhere.setCompanyId(sdata.getCompanyId());
|
||||
List<QuartzProjectAttendanceGroup> gList= quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(groupWhere);
|
||||
if(gList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceGroup group=gList.get(0);
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setCompanyTypeId(group.getCompanyTypeId());
|
||||
//查询华筑的分组信息
|
||||
if("huazhu".equals(sdata.getVendorsCode())){
|
||||
sdata.setWorkerGender(sdata.getWorkerGender());
|
||||
sdata.setCompanyTypeId(getHuazhuCompanyTypeId(group.getCompanyName()));//获取华筑的分包商类型
|
||||
}
|
||||
if("jgw".equals(sdata.getVendorsCode())){
|
||||
//sdata.setWorkTypeName(group.getCompanyCode());
|
||||
//sdata.setCompanyName(user.getCompanyName());
|
||||
sdata.setWorkTypeName(user.getWorkTypeName());
|
||||
sdata.setCompanyName(group.getCompanyName());
|
||||
sdata.setGroupName(group.getTeamName());
|
||||
}
|
||||
//查询项目部门信息
|
||||
QuartzProjectAttendanceCfg cfgWhere=new QuartzProjectAttendanceCfg();
|
||||
cfgWhere.setId(sdata.getCfgid());
|
||||
List<QuartzProjectAttendanceCfg> cfgList= quartzProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgListForAllInfo(cfgWhere);
|
||||
if(cfgList.size()==0){
|
||||
return;
|
||||
}
|
||||
QuartzProjectAttendanceCfg cfg=cfgList.get(0);
|
||||
sdata.setProjectId(cfg.getProjectId());
|
||||
sdata.setDeptId(cfg.getDeptId());
|
||||
sdata.setProjectName(cfg.getProjectName());
|
||||
sdata.setDeptName(cfg.getDeptName());
|
||||
if(sdata.getCompanyTypeId()==null){
|
||||
sdata.setCompanyTypeId("0");
|
||||
}
|
||||
insertSurProjectAttendanceData(sdata);
|
||||
}else{
|
||||
sdata.setId(list.get(0).getId());
|
||||
QuartzProjectAttendanceData upData=list.get(0);
|
||||
String dt1=upData.getAttendanceTime(); //
|
||||
String dt2=upData.getAttendanceOutTime();
|
||||
String dt3=sdata.getAttendanceTime();
|
||||
if (StrUtil.isEmpty(dt3)) {
|
||||
return;
|
||||
}
|
||||
long time3=DateUtil.parse(dt3).getTime();
|
||||
if(StrUtil.isEmpty(dt2)){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
//比较 dt1,dt2 进行交换
|
||||
long time2=DateUtil.parse(dt3).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
if(time1>time2){
|
||||
upData.setAttendanceTime(dt3);
|
||||
upData.setAttendanceOutTime(dt1);
|
||||
}
|
||||
}else{
|
||||
long time2=DateUtil.parse(dt2).getTime();
|
||||
long time1=DateUtil.parse(dt1).getTime();
|
||||
//比较 dt3<dt1 in->dt3
|
||||
if(time3<time1){
|
||||
upData.setAttendanceTime(dt3);
|
||||
}
|
||||
//比较 dt3>dt2 out->dt3
|
||||
if(time3>time2){
|
||||
upData.setAttendanceOutTime(dt3);
|
||||
}
|
||||
}
|
||||
//upData.setAttendanceOutTime(sdata.getAttendanceTime());
|
||||
if("jgw".equals(upData.getVendorsCode())){
|
||||
upData.setRemark(sdata.getRemark());
|
||||
}
|
||||
updateSurProjectAttendanceData(upData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceGroupMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广联达班组信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-26
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceGroupServiceImpl implements IQuartzProjectAttendanceGroupService
|
||||
{
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceGroupMapper quartzProjectAttendanceGroupMapper;
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceGroup selectSurProjectAttendanceGroupById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupViewList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupViewList(quartzProjectAttendanceGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询广联达班组信息列表
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 广联达班组信息集合
|
||||
*/
|
||||
public List<QuartzProjectAttendanceGroup> selectSurProjectAttendanceGroupList(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup) {
|
||||
return quartzProjectAttendanceGroupMapper.selectSurProjectAttendanceGroupList(quartzProjectAttendanceGroup);
|
||||
}
|
||||
/**
|
||||
* 新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
|
||||
{
|
||||
String userName= SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceGroup.setCreateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
quartzProjectAttendanceGroup.setCreateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceGroupMapper.insertSurProjectAttendanceGroup(quartzProjectAttendanceGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroup 广联达班组信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSurProjectAttendanceGroup(QuartzProjectAttendanceGroup quartzProjectAttendanceGroup)
|
||||
{
|
||||
String userName= SecurityUtils.getUsername();
|
||||
quartzProjectAttendanceGroup.setUpdateBy(StrUtil.isEmpty(userName)?"task":userName);
|
||||
|
||||
quartzProjectAttendanceGroup.setUpdateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceGroupMapper.updateSurProjectAttendanceGroup(quartzProjectAttendanceGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param ids 需要删除的广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceGroupByIds(Long[] ids)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广联达班组信息信息
|
||||
*
|
||||
* @param id 广联达班组信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceGroupById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除广联达班组信息
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceGroupByParams(List<String> list) {
|
||||
return quartzProjectAttendanceGroupMapper.deleteSurProjectAttendanceGroupByParams(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增广联达班组信息
|
||||
*
|
||||
* @param quartzProjectAttendanceGroupList 广联达班组信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchSurProjectAttendanceGroup(List<QuartzProjectAttendanceGroup> quartzProjectAttendanceGroupList) {
|
||||
return quartzProjectAttendanceGroupMapper.batchSurProjectAttendanceGroup(quartzProjectAttendanceGroupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(QuartzProjectAttendanceGroup group) {
|
||||
QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
|
||||
where.setServerid(group.getServerid());
|
||||
where.setCfgid(group.getCfgid());
|
||||
List<QuartzProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
|
||||
if(list.size()==0){
|
||||
insertSurProjectAttendanceGroup(group);
|
||||
}else{
|
||||
group.setId(list.get(0).getId());
|
||||
updateSurProjectAttendanceGroup(group);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新济工网的分组类型
|
||||
* @param group
|
||||
*/
|
||||
@Override
|
||||
public void updateJgw(QuartzProjectAttendanceGroup group) {
|
||||
QuartzProjectAttendanceGroup where=new QuartzProjectAttendanceGroup();
|
||||
where.setBizLicense(group.getBizLicense());
|
||||
where.setCompanyName(group.getCompanyName());
|
||||
where.setCfgid(group.getCfgid());
|
||||
List<QuartzProjectAttendanceGroup> list=selectSurProjectAttendanceGroupList(where);
|
||||
for(QuartzProjectAttendanceGroup g:list){
|
||||
g.setCompanyTypeId(group.getCompanyTypeId());
|
||||
updateSurProjectAttendanceGroup(g);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,315 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
import com.yanzhu.job.mapper.QuartzProjectAttendanceUserMapper;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤人员基本属性Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2023-09-24
|
||||
*/
|
||||
@Service
|
||||
public class QuartzProjectAttendanceUserServiceImpl implements IQuartzProjectAttendanceUserService
|
||||
{
|
||||
@Autowired
|
||||
private QuartzProjectAttendanceUserMapper quartzProjectAttendanceUserMapper;
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceUser selectSurProjectAttendanceUserById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
@Override
|
||||
public QuartzProjectAttendanceUser findCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser) {
|
||||
return quartzProjectAttendanceUserMapper.findCurrentAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询[研筑]考勤人员信息
|
||||
*
|
||||
* @param quartzProjectAttendanceUser
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
public QuartzProjectAttendanceUser findYzCurrentAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser){
|
||||
return quartzProjectAttendanceUserMapper.findYzCurrentAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤人员基本属性列表
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 考勤人员基本属性
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserList(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser)
|
||||
{
|
||||
if(StringUtils.isEmpty(quartzProjectAttendanceUser.getCreateBy())){
|
||||
quartzProjectAttendanceUser.setCreateBy("task");
|
||||
quartzProjectAttendanceUser.setCreateTime(DateUtils.getNowDate());
|
||||
}
|
||||
return quartzProjectAttendanceUserMapper.insertSurProjectAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUser 考勤人员基本属性
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSurProjectAttendanceUser(QuartzProjectAttendanceUser quartzProjectAttendanceUser)
|
||||
{
|
||||
if(StringUtils.isEmpty(quartzProjectAttendanceUser.getCreateBy())){
|
||||
quartzProjectAttendanceUser.setUpdateBy("task");
|
||||
}
|
||||
quartzProjectAttendanceUser.setUpdateTime(DateUtils.getNowDate());
|
||||
return quartzProjectAttendanceUserMapper.updateSurProjectAttendanceUser(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param ids 需要删除的考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceUserByIds(Long[] ids)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.deleteSurProjectAttendanceUserByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤人员基本属性信息
|
||||
*
|
||||
* @param id 考勤人员基本属性主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceUserById(Long id)
|
||||
{
|
||||
return quartzProjectAttendanceUserMapper.deleteSurProjectAttendanceUserById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除考勤人员基本属性
|
||||
*
|
||||
* @param list 需要删除的数据参数集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSurProjectAttendanceUserByParams(List<String> list) {
|
||||
return quartzProjectAttendanceUserMapper.deleteSurProjectAttendanceUserByParams(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增考勤人员基本属性
|
||||
*
|
||||
* @param quartzProjectAttendanceUserList 考勤人员基本属性列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchSurProjectAttendanceUser(List<QuartzProjectAttendanceUser> quartzProjectAttendanceUserList) {
|
||||
return quartzProjectAttendanceUserMapper.batchSurProjectAttendanceUser(quartzProjectAttendanceUserList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(QuartzProjectAttendanceUser user) {
|
||||
QuartzProjectAttendanceUser where=new QuartzProjectAttendanceUser();
|
||||
where.setWorkerId(user.getWorkerId());
|
||||
where.setCfgid(user.getCfgid());
|
||||
List<QuartzProjectAttendanceUser> list=selectSurProjectAttendanceUserList(where);
|
||||
if(list.size()==0){
|
||||
insertSurProjectAttendanceUser(user);
|
||||
}else{
|
||||
QuartzProjectAttendanceUser old=list.get(0);
|
||||
if(user.getVendorsCode().equals("jgw")){
|
||||
user.setCompanyId(old.getCompanyId());
|
||||
String oldNav=old.getNativePlace();
|
||||
String newNav=user.getNativePlace();
|
||||
if(oldNav==null || !oldNav.equals(newNav)){
|
||||
old.setNativePlace(newNav);
|
||||
}
|
||||
}
|
||||
user.setId(old.getId());
|
||||
updateSurProjectAttendanceUser(user);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> queryAttendanceData(QuartzProjectAttendanceUser where) {
|
||||
List<QuartzProjectAttendanceUser> list= quartzProjectAttendanceUserMapper.queryAttendanceUsers(where);
|
||||
List<String> workerIds=new ArrayList<>();
|
||||
for(QuartzProjectAttendanceUser u: list){
|
||||
workerIds.add(u.getWorkerId());
|
||||
}
|
||||
where.setWorkerIds(workerIds);
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceData(workerIds);
|
||||
for (QuartzProjectAttendanceUser u:list) {
|
||||
u.setInTime(findDate(datas,u,"E"));
|
||||
u.setOutTime(findDate(datas,u,"L"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long countTodayAttendance(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.countTodayAttendance(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> todayAttendance(QuartzProjectAttendanceUser where) {
|
||||
if(where.getIndex()<1){
|
||||
where.setIndex(1);
|
||||
}
|
||||
where.setIndex((where.getIndex()-1)* where.getSize());
|
||||
List<QuartzProjectAttendanceUser> list= quartzProjectAttendanceUserMapper.todayAttendance(where);
|
||||
List<String> workerIds=new ArrayList<>();
|
||||
for(QuartzProjectAttendanceUser u: list){
|
||||
workerIds.add(u.getWorkerId());
|
||||
}
|
||||
List<QuartzProjectAttendanceUser> datas= quartzProjectAttendanceUserMapper.todayAttendanceData(workerIds);
|
||||
for (QuartzProjectAttendanceUser u:list) {
|
||||
u.setInTime(findDate(datas,u,"E"));
|
||||
u.setOutTime(findDate(datas,u,"L"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long countAttendance(QuartzProjectAttendanceUser user) {
|
||||
QuartzProjectAttendanceCfg where=new QuartzProjectAttendanceCfg();
|
||||
where.setCreateBy(user.getCreateBy());
|
||||
where.setDeptId(user.getSubDeptId());
|
||||
where.setProjectId(user.getProjectId());
|
||||
return quartzProjectAttendanceUserMapper.countAttendance(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> selectSurProjectAttendanceUserListJgw(QuartzProjectAttendanceUser quartzProjectAttendanceUser) {
|
||||
return quartzProjectAttendanceUserMapper.selectSurProjectAttendanceUserListJgw(quartzProjectAttendanceUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> queryWorkerOnDuty(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.queryWorkerOnDuty(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> groupUserByParams(QuartzProjectAttendanceUser where){
|
||||
return quartzProjectAttendanceUserMapper.groupUserByParams(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> attendanceUserList(QuartzProjectAttendanceUser where){
|
||||
return quartzProjectAttendanceUserMapper.attendanceUserList(where);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计人员数据
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> findUserAllByDays(Long projectId){
|
||||
return quartzProjectAttendanceUserMapper.findUserAllByDays(projectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按部门汇总在岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupByWorkerOnDutyByDept(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.groupByWorkerOnDutyByDept(where);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> querySurProjectAttendanceUserList(QuartzProjectAttendanceUser quartzProjectAttendanceUser) {
|
||||
return quartzProjectAttendanceUserMapper.querySurProjectAttendanceUserList(quartzProjectAttendanceUser);
|
||||
}
|
||||
/**
|
||||
* 按部门汇总在岗|离岗人数
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceData> groupByWorkerByDept(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.groupByWorkerByDept(where);
|
||||
}
|
||||
/**
|
||||
* 在岗|离岗工人查询
|
||||
* @param where
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<QuartzProjectAttendanceUser> queryWorkerByState(QuartzProjectAttendanceUser where) {
|
||||
return quartzProjectAttendanceUserMapper.queryWorkerByState(where);
|
||||
}
|
||||
|
||||
private Date findDate(List<QuartzProjectAttendanceUser> datas, QuartzProjectAttendanceUser u, String type) {
|
||||
for (QuartzProjectAttendanceUser user:datas) {
|
||||
if(user.getWorkerId().equals(u.getWorkerId()) && user.getName().equals(type)){
|
||||
if(type.equals("L")){
|
||||
return user.getOutTime();
|
||||
}else{
|
||||
return user.getInTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import com.yanzhu.common.core.constant.CacheConstants;
|
||||
import com.yanzhu.common.core.exception.ServiceException;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.core.utils.RSAUtil;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.SysApplyConfig;
|
||||
import com.yanzhu.job.mapper.SysApplyConfigMapper;
|
||||
import com.yanzhu.job.service.ISysApplyConfigService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.security.KeyPair;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统应用注册Service业务层处理
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
@Service
|
||||
public class SysApplyConfigServiceImpl implements ISysApplyConfigService
|
||||
{
|
||||
@Autowired
|
||||
private RedisService redisCache;
|
||||
|
||||
@Autowired
|
||||
private SysApplyConfigMapper sysApplyConfigMapper;
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化注册应用到缓存
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init()
|
||||
{
|
||||
loadingSysApplyConfigCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载注册应用
|
||||
*/
|
||||
@Override
|
||||
public void loadingSysApplyConfigCache()
|
||||
{
|
||||
List<SysApplyConfig> configList = sysApplyConfigMapper.selectSysApplyConfigList(new SysApplyConfig());
|
||||
if(CollectionUtils.isNotEmpty(configList)){
|
||||
for (SysApplyConfig sysApplyConfig : configList) {
|
||||
redisCache.setCacheObject(CacheConstants.YANZHU_SYSTEM_CONFIG + sysApplyConfig.getAppId(), sysApplyConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统应用注册
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
@Override
|
||||
public SysApplyConfig selectSysApplyConfigById(Long id)
|
||||
{
|
||||
return sysApplyConfigMapper.selectSysApplyConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统应用注册列表
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 系统应用注册
|
||||
*/
|
||||
@Override
|
||||
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig)
|
||||
{
|
||||
return sysApplyConfigMapper.selectSysApplyConfigList(sysApplyConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig)
|
||||
{
|
||||
sysApplyConfig.setCreateBy(SecurityUtils.getUsername());
|
||||
sysApplyConfig.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
// 生成密钥对
|
||||
KeyPair keyPair = RSAUtil.getKeyPair();
|
||||
// 公匙
|
||||
String publicKey = RSAUtil.getPublicKeyBase64(keyPair);
|
||||
sysApplyConfig.setPublicKey(publicKey);
|
||||
// 私匙
|
||||
String privateKey = RSAUtil.getPrivateKeyBase64(keyPair);
|
||||
sysApplyConfig.setPrivateKey(privateKey);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException();
|
||||
}
|
||||
int res = sysApplyConfigMapper.insertSysApplyConfig(sysApplyConfig);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统应用注册
|
||||
*
|
||||
* @param sysApplyConfig 系统应用注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig)
|
||||
{
|
||||
sysApplyConfig.setUpdateBy(SecurityUtils.getUsername());
|
||||
sysApplyConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
int res = sysApplyConfigMapper.updateSysApplyConfig(sysApplyConfig);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除系统应用注册
|
||||
*
|
||||
* @param ids 需要删除的系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysApplyConfigByIds(Long[] ids)
|
||||
{
|
||||
int res = sysApplyConfigMapper.deleteSysApplyConfigByIds(ids);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统应用注册信息
|
||||
*
|
||||
* @param id 系统应用注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysApplyConfigById(Long id)
|
||||
{
|
||||
int res = sysApplyConfigMapper.deleteSysApplyConfigById(id);
|
||||
if(res>0){
|
||||
this.loadingSysApplyConfigCache();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.yanzhu.job.service.impl;
|
||||
|
||||
import com.yanzhu.job.domain.SysNative;
|
||||
import com.yanzhu.job.mapper.SysNativeMapper;
|
||||
import com.yanzhu.job.service.ISysNativeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SysNativeServiceImpl implements ISysNativeService {
|
||||
|
||||
@Autowired
|
||||
SysNativeMapper sysNativeMapper;
|
||||
|
||||
@Override
|
||||
public List<SysNative> selectSysNativeListById(Long id) {
|
||||
return sysNativeMapper.selectSysNativeListById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,351 @@
|
|||
package com.yanzhu.job.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceCfg;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceData;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceGroup;
|
||||
import com.yanzhu.job.domain.QuartzProjectAttendanceUser;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceCfgService;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceDataService;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceGroupService;
|
||||
import com.yanzhu.job.service.IQuartzProjectAttendanceUserService;
|
||||
import okhttp3.*;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component("attendanceHuazhuTask")
|
||||
public class AttendanceHuazhuTask {
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceUserService attendanceUserService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceCfgService attendanceCfgService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceDataService attendanceDataService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceGroupService attendanceGroupService;
|
||||
|
||||
public static void main(String[] args) {
|
||||
//String host="http://tapi.huazhukeji.cn:82/hz-labour";
|
||||
String host="http://api.1357.cn/hz-labour";
|
||||
//String path="/api/open/labour/findWorkerTypeByPage";
|
||||
String path="/api/open/labour/findCardRecordByPage";
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path))
|
||||
.newBuilder();
|
||||
|
||||
|
||||
long startTime=DateUtil.date(DateUtil.parse("2024-03-16")).getTime();
|
||||
long endTime=startTime+3600l*1000*24*1;
|
||||
Map<String, String> headerParams=new HashMap<>();
|
||||
headerParams.put("appId","8024283707153666851");
|
||||
headerParams.put("appSecret","2070308b49399d94b401d98adeaa5b342aa81627");
|
||||
headerParams.put("Content-Type","application/json");
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("orgId","1666339529033805825");
|
||||
params.put("tenantId","1666337067184893953");
|
||||
params.put("workerId","7119618933040091136");
|
||||
params.put("size","200");
|
||||
params.put("current","1");
|
||||
params.put("startTime",startTime);
|
||||
params.put("endTime",endTime);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
.post(toFormBody(params)).headers(setHeaderParams(headerParams))
|
||||
.build();
|
||||
String data=AttendanceTask.getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONObject joData= jo.getJSONObject("data");
|
||||
JSONArray arr=joData.getJSONArray("records");
|
||||
long pages=joData.getLong("pages");
|
||||
if(arr!=null && arr.size()>0){
|
||||
for(int i=0;i<arr.size();i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
System.out.println(DateUtil.format(DateUtil.date(json.getLong("recordTime")),"yyyy-MM-dd HH:mm:ss")+"------------"+json.getString("imagePath"));
|
||||
//SurProjectAttendanceData sdata = SurProjectAttendanceData.createFromHuazhu(json);
|
||||
//System.out.println(JSON.toJSONString(sdata));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main3(String[] args) {
|
||||
String path="/api/open/labour/findLabourWorkerByPage";
|
||||
Map<String,String> map=new HashMap<>();
|
||||
|
||||
map.put("appId","8024283707153666851");
|
||||
map.put("secret","2070308b49399d94b401d98adeaa5b342aa81627");
|
||||
map.put("projectId","1666339529033805825");
|
||||
map.put("tenantId","1666337067184893953");
|
||||
JSONObject jo=JSON.parseObject(JSON.toJSONString(map));
|
||||
int page=1;
|
||||
QuartzProjectAttendanceCfg it=new QuartzProjectAttendanceCfg();
|
||||
it.setId(0l);;
|
||||
//new AttendanceHuazhuTask().doSyncWorker(jo,1,it);
|
||||
//long p=jo.getLongValue("page",1);
|
||||
//jo.put("page",1);
|
||||
//System.out.println(p);
|
||||
//System.out.println(jo.toString());
|
||||
new AttendanceHuazhuTask().doSyncGroup(jo,1,it);
|
||||
//new AttendanceHuazhuTask().doSyncWorker(jo,1,it);
|
||||
}
|
||||
private static RequestBody toFormBody(Map<String, Object> params ){
|
||||
String json=JSON.toJSONString(params);
|
||||
return RequestBody.create(
|
||||
MediaType.parse("application/json"),json );
|
||||
}
|
||||
private static Headers setHeaderParams(Map<String, String> headerParams) {
|
||||
Headers headers = null;
|
||||
Headers.Builder headersbuilder = new Headers.Builder();
|
||||
if (headerParams != null && headerParams.size() > 0) {
|
||||
for (String key : headerParams.keySet()) {
|
||||
if (!Strings.isEmpty(key) && !Strings.isEmpty(headerParams.get(key))) {
|
||||
//如果参数不是null并且不是"",就拼接起来
|
||||
headersbuilder.add(key, headerParams.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
headers = headersbuilder.build();
|
||||
return headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步90天之内的数据
|
||||
*/
|
||||
public void syncLast90DayAttendanceData() {
|
||||
long endTime=DateUtil.current();
|
||||
long startTime=endTime-3600l*1000*24*90;
|
||||
syncAttendanceData(startTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步7天之内的数据
|
||||
*/
|
||||
public void syncLastWeekAttendanceData() {
|
||||
long endTime=DateUtil.current();
|
||||
long startTime=endTime-3600l*1000*24*7;
|
||||
syncAttendanceData(startTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步当天数据
|
||||
*/
|
||||
public void syncAttendanceData(){
|
||||
long startTime=DateUtil.date(DateUtil.parse(DateUtil.format(new Date(),"yyyy-MM-dd"))).getTime();
|
||||
syncAttendanceData(startTime);
|
||||
}
|
||||
|
||||
public void syncGroup(){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("huazhu");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
doSyncGroup(jo,1,it);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSyncGroup(JSONObject jdata, long page, QuartzProjectAttendanceCfg it) {
|
||||
String path="/api/open/labour/findUnitProjectByPage";
|
||||
Request request=getRequest(path,jdata,page);
|
||||
String data=AttendanceTask.getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONObject joData= jo.getJSONObject("data");
|
||||
JSONArray arr=joData.getJSONArray("records");
|
||||
long pages=joData.getLong("pages");
|
||||
if(arr!=null && arr.size()>0){
|
||||
for(int i=0;i<arr.size();i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.createHuazhu(json);
|
||||
group.setCfgid(it.getId());
|
||||
group.setAppId(jdata.getString("appId"));
|
||||
attendanceGroupService.add(group);
|
||||
}
|
||||
}
|
||||
if(page<pages){
|
||||
doSyncGroup(jdata,page+1,it);
|
||||
}
|
||||
}
|
||||
|
||||
private void syncAttendanceData(long startTime){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("huazhu");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
long endTime=DateUtil.current();
|
||||
|
||||
//map.put("endTime",endTime);
|
||||
map.put("startTime",startTime);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
doSyncAttendanceData(jo,1,it,map);
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步所有数据
|
||||
*/
|
||||
public void syncAllAttendanceData(){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("huazhu");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
QuartzProjectAttendanceData attWhere=new QuartzProjectAttendanceData();
|
||||
attWhere.setId(it.getId());
|
||||
Long page=attendanceDataService.getHuazhuPage(attWhere);
|
||||
if(null==page){
|
||||
doSyncAttendanceData(jo,1,it,null);
|
||||
}else{
|
||||
doSyncAttendanceData(jo,page,it,null);
|
||||
}
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSyncAttendanceData(JSONObject jdata, long page, QuartzProjectAttendanceCfg it, Map<String,Object> ps){
|
||||
String path="/api/open/labour/findCardRecordByPage";
|
||||
Request request=getRequest(path,jdata,page,ps);
|
||||
String data=AttendanceTask.getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONObject joData= jo.getJSONObject("data");
|
||||
JSONArray arr=joData.getJSONArray("records");
|
||||
long pages=joData.getLong("pages");
|
||||
if(arr!=null && arr.size()>0){
|
||||
for(int i=0;i<arr.size();i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceData sdata = QuartzProjectAttendanceData.createFromHuazhu(json);
|
||||
sdata.setVendorId(page); //VendorId保存华筑的页
|
||||
sdata.setCfgid(it.getId());
|
||||
sdata.setAppId(jdata.getString("appId"));
|
||||
sdata.setVendorsCode(it.getVendorsCode());
|
||||
attendanceDataService.add(sdata);
|
||||
}
|
||||
}
|
||||
if(page<pages){
|
||||
doSyncAttendanceData(jdata,page+1,it,ps);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步人员信息
|
||||
*/
|
||||
public void syncWorker(){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("huazhu");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
|
||||
doSyncWorker(jo,1,it);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Request getRequest(String path,JSONObject jo,long page) {
|
||||
return getRequest(path,jo,page,null);
|
||||
}
|
||||
|
||||
public static Request getRequest(String path,JSONObject jo,long page,Map<String,Object> ps){
|
||||
String appId=jo.getString("appId");
|
||||
String secret=jo.getString("secret");
|
||||
String projectId=jo.getString("projectId");
|
||||
String tenantId=jo.getString("tenantId");
|
||||
String host="http://api.1357.cn/hz-labour";
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path))
|
||||
.newBuilder();
|
||||
|
||||
Map<String, String> headerParams=new HashMap<>();
|
||||
headerParams.put("appId",appId);
|
||||
headerParams.put("appSecret",secret);
|
||||
headerParams.put("Content-Type","application/json");
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("orgId",projectId);
|
||||
params.put("tenantId",tenantId);
|
||||
params.put("size",500);
|
||||
params.put("current",page);
|
||||
if(ps!=null){
|
||||
for(String k :ps.keySet()){
|
||||
params.put(k,ps.get(k));
|
||||
}
|
||||
}
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
.post(toFormBody(params)).headers(setHeaderParams(headerParams))
|
||||
.build();
|
||||
return request;
|
||||
}
|
||||
|
||||
private void doSyncWorker(JSONObject jdata, long page, QuartzProjectAttendanceCfg it){
|
||||
String path="/api/open/labour/findLabourWorkerByPage";
|
||||
Request request=getRequest(path,jdata,page);
|
||||
String data=AttendanceTask.getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONObject joData= jo.getJSONObject("data");
|
||||
JSONArray arr=joData.getJSONArray("records");
|
||||
long pages=joData.getLong("pages");
|
||||
if(arr!=null && arr.size()>0){
|
||||
for(int i=0;i<arr.size();i++){
|
||||
JSONObject json=arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.createFromHuazhu(json);
|
||||
user.setVendorsCode(it.getVendorsCode());
|
||||
user.setCfgid(it.getId());
|
||||
user.setAppId(jdata.getString("appId"));
|
||||
attendanceUserService.add(user);
|
||||
|
||||
}
|
||||
}
|
||||
if(page<pages){
|
||||
doSyncWorker(jdata,page+1,it);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,327 @@
|
|||
package com.yanzhu.job.task;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.job.domain.*;
|
||||
import com.yanzhu.job.service.*;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component("attendanceTask")
|
||||
public class AttendanceTask {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisCache;
|
||||
|
||||
@Autowired
|
||||
private ISysNativeService sysNativeService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceUserService attendanceUserService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceCfgService attendanceCfgService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceDataService attendanceDataService;
|
||||
|
||||
@Autowired
|
||||
IQuartzProjectAttendanceGroupService attendanceGroupService;
|
||||
|
||||
private String getNative(long id){
|
||||
String ckey="attendance_jgw_native_"+id;
|
||||
Object obj=redisCache.getCacheObject(ckey);
|
||||
String tmp="";
|
||||
if(obj!=null){
|
||||
tmp=obj.toString();
|
||||
if(StrUtil.isNotEmpty(tmp)){
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
List<SysNative> list=sysNativeService.selectSysNativeListById(id);
|
||||
if(list.size()==0){
|
||||
id=id/100*100;
|
||||
list=sysNativeService.selectSysNativeListById(id);
|
||||
if(list.size()==0){
|
||||
id=id/10000*10000;
|
||||
list=sysNativeService.selectSysNativeListById(id);
|
||||
}
|
||||
}
|
||||
if(list.size()==0){
|
||||
tmp="";
|
||||
}else{
|
||||
tmp= list.get(0).getAddress();
|
||||
}
|
||||
redisCache.setCacheObject(ckey, tmp, 1L, TimeUnit.DAYS);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void syncWorker(){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("gld");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
String appId=jo.getString("appId");
|
||||
String secret=jo.getString("secret");
|
||||
String projectId=jo.getString("projectId");
|
||||
doSyncWorker(appId,secret,projectId,1,it);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void syncGroup(){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("gld");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
String appId=jo.getString("appId");
|
||||
String secret=jo.getString("secret");
|
||||
String projectId=jo.getString("projectId");
|
||||
doSyncGroup(appId,secret,projectId,it);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSyncGroup(String appId, String secret, String projectId, QuartzProjectAttendanceCfg it) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("projectId", projectId);
|
||||
params.put("appid",appId);
|
||||
String sign = getSign(params,secret);
|
||||
String host="https://glm.glodon.com/api/open";
|
||||
params.put("sign",sign);
|
||||
String path="/worker/allGroup";
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path)).newBuilder();
|
||||
params.forEach((s, o) -> {
|
||||
urlBuilder.addQueryParameter(s, (String) o);
|
||||
});
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
.build();
|
||||
String data=getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONArray arr=jo.getJSONArray("data");
|
||||
if(arr!=null && arr.size()>0) {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json=arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceGroup group= QuartzProjectAttendanceGroup.create(json);
|
||||
group.setAppId(appId);
|
||||
group.setCfgid(it.getId());
|
||||
attendanceGroupService.add(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSyncWorker(String appid, String secret, String projectld, int page, QuartzProjectAttendanceCfg it){
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("projectId", projectld);
|
||||
params.put("start", "2000-01-01 00:00:00");
|
||||
params.put("end", "2099-01-01 00:00:00");
|
||||
params.put("pageNo",""+page);
|
||||
params.put("pageSize", "1000");
|
||||
params.put("appid",appid);
|
||||
String sign = getSign(params,secret);
|
||||
String host="https://glm.glodon.com/api/open";
|
||||
params.put("sign",sign);
|
||||
String path="/worker/new/allWorkerInfo";
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path)).newBuilder();
|
||||
params.forEach((s, o) -> {
|
||||
urlBuilder.addQueryParameter(s, (String) o);
|
||||
});
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
.build();
|
||||
String data=getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONArray arr=jo.getJSONArray("data");
|
||||
if(arr!=null && arr.size()>0){
|
||||
for(int i=0;i<arr.size();i++){
|
||||
JSONObject json=arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceUser user= QuartzProjectAttendanceUser.create(json);
|
||||
String idNumber=json.getString("identification");//身份证
|
||||
if(StrUtil.isNotEmpty(idNumber) && idNumber.length()>6){
|
||||
try {
|
||||
long idStr = Long.parseLong(idNumber.substring(0, 6));
|
||||
String natstr=getNative(idStr);
|
||||
if(StrUtil.isNotEmpty(natstr)){
|
||||
user.setNativePlace(natstr);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
|
||||
}
|
||||
}
|
||||
user.setVendorsCode(it.getVendorsCode());
|
||||
user.setCfgid(it.getId());
|
||||
user.setAppId(appid);
|
||||
attendanceUserService.add(user);
|
||||
}
|
||||
}
|
||||
if(arr.size()==1000){
|
||||
doSyncWorker(appid,secret,projectld,page+1,it);
|
||||
}
|
||||
}
|
||||
|
||||
public void syncAttendanceData(){
|
||||
QuartzProjectAttendanceCfg where =new QuartzProjectAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
where.setVendorsCode("gld");
|
||||
List<QuartzProjectAttendanceCfg> list=attendanceCfgService.selectSurProjectAttendanceCfgList(where);
|
||||
for(QuartzProjectAttendanceCfg it :list){
|
||||
String param= it.getVendorsParameter();
|
||||
if(Strings.isNotEmpty(param)){
|
||||
try{
|
||||
JSONObject jo=JSON.parseObject(param);
|
||||
String appId=jo.getString("appId");
|
||||
String secret=jo.getString("secret");
|
||||
String projectId=jo.getString("projectId");
|
||||
QuartzProjectAttendanceData dwhere=new QuartzProjectAttendanceData();
|
||||
dwhere.setCfgid(it.getId());
|
||||
String startId=attendanceDataService.getLastServerId(dwhere);
|
||||
doSyncAttendanceData(appId,secret,projectId,startId,it);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doSyncAttendanceData(String appid, String secret, String projectId, String id, QuartzProjectAttendanceCfg it){
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("projectId", projectId);
|
||||
params.put("startId",""+id);
|
||||
params.put("pageSize", "500");
|
||||
params.put("appid",appid);
|
||||
String sign = getSign(params,secret);
|
||||
String host="https://glm.glodon.com/api/open";
|
||||
params.put("sign",sign);
|
||||
String path="/attendance/card";
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path)).newBuilder();
|
||||
params.forEach((s, o) -> {
|
||||
urlBuilder.addQueryParameter(s, (String) o);
|
||||
});
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
.build();
|
||||
String data=getResult(request);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONArray arr=jo.getJSONArray("data");
|
||||
String lastId= "0";
|
||||
if(arr!=null && arr.size()>0){
|
||||
for(int i=0;i<arr.size();i++){
|
||||
JSONObject json=arr.getJSONObject(i);
|
||||
QuartzProjectAttendanceData sdata= QuartzProjectAttendanceData.create(json);
|
||||
lastId=sdata.getServerid();
|
||||
sdata.setCfgid(it.getId());
|
||||
sdata.setAppId(appid);
|
||||
sdata.setVendorsCode(it.getVendorsCode());
|
||||
attendanceDataService.add(sdata);
|
||||
}
|
||||
}
|
||||
//System.out.println("-------->"+id+","+lastId);
|
||||
if(arr.size()==500){
|
||||
doSyncAttendanceData(appid,secret,projectId,lastId,it);
|
||||
}
|
||||
}
|
||||
public static void main(String[] args){
|
||||
|
||||
System.out.println("-------1--------->AttendanceUserTask.syncWorker");
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("projectId", "709599705953792");
|
||||
params.put("start", "2000-01-01 00:00:00");
|
||||
params.put("end", "2099-01-01 00:00:00");
|
||||
params.put("pageNo","1");
|
||||
params.put("pageSize", "1000");
|
||||
//params.put("pageNo", "1");
|
||||
params.put("startId", "0");
|
||||
params.put("appid","f24454233c5346fe82df6b8dd35e9d6d");
|
||||
String sign = getSign(params,"754619e2a33491b84a4d47838d2ffc0a");
|
||||
System.out.println("--->"+sign);
|
||||
params.put("sign",sign);
|
||||
String host="https://glm.glodon.com/api/open";
|
||||
String path="/worker/new/allWorkerInfo";
|
||||
HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(host + path)).newBuilder();
|
||||
params.forEach((s, o) -> {
|
||||
urlBuilder.addQueryParameter(s, (String) o);
|
||||
});
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.build())
|
||||
.build();
|
||||
String data=getResult(request);
|
||||
//System.out.println("data:"+data);
|
||||
JSONObject jo= JSON.parseObject(data);
|
||||
JSONArray jsonArray=jo.getJSONArray("data");
|
||||
for(int i=0;i<jsonArray.size();i++){
|
||||
JSONObject o=jsonArray.getJSONObject(i);
|
||||
//if(o.getLong("workerId")==7813018){
|
||||
System.out.println(o.getString("status"));
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
public static String getResult(Request request) {
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), SSLSocketClient.getX509TrustManager())
|
||||
.hostnameVerifier(SSLSocketClient.getHostnameVerifier())
|
||||
.build();
|
||||
Response response;
|
||||
try {
|
||||
response = client.newCall(request).execute();
|
||||
if (response.body() != null) {
|
||||
return response.body().string();
|
||||
} else {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
private static String getSign(Map<String,Object> paramsMap,String appSecret){
|
||||
List<String> paramsList = new ArrayList<>();
|
||||
paramsMap.forEach((s, o) -> {
|
||||
String stringBuilder = s + o;
|
||||
paramsList.add(stringBuilder);
|
||||
});
|
||||
StringBuilder beforeMd5 = new StringBuilder();
|
||||
beforeMd5.append(appSecret);
|
||||
paramsList.stream()
|
||||
.sorted(String::compareTo)
|
||||
.collect(Collectors.toList())
|
||||
.forEach(beforeMd5::append);
|
||||
beforeMd5.append(appSecret);
|
||||
return DigestUtils.md5Hex(beforeMd5.toString()).toUpperCase();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.yanzhu.job.task;
|
||||
|
||||
import javax.net.ssl.*;
|
||||
import java.security.KeyStore;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class SSLSocketClient {
|
||||
//获取这个SSLSocketFactory
|
||||
public static SSLSocketFactory getSSLSocketFactory() {
|
||||
try {
|
||||
SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
sslContext.init(null, getTrustManager(), new SecureRandom());
|
||||
return sslContext.getSocketFactory();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
//获取TrustManager
|
||||
private static TrustManager[] getTrustManager() {
|
||||
return new TrustManager[]{
|
||||
new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[]{};
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//获取HostnameVerifier
|
||||
public static HostnameVerifier getHostnameVerifier() {
|
||||
return (s, sslSession) -> true;
|
||||
}
|
||||
|
||||
public static X509TrustManager getX509TrustManager() {
|
||||
X509TrustManager trustManager = null;
|
||||
try {
|
||||
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||
trustManagerFactory.init((KeyStore) null);
|
||||
TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
|
||||
if (trustManagers.length != 1 || !(trustManagers[0] instanceof X509TrustManager)) {
|
||||
throw new IllegalStateException("Unexpected default trust managers:" + Arrays.toString(trustManagers));
|
||||
}
|
||||
trustManager = (X509TrustManager) trustManagers[0];
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return trustManager;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
<?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.yanzhu.job.mapper.QuartzProjectAttendanceCfgMapper">
|
||||
|
||||
<resultMap type="AttendanceCfg" id="AttendanceCfgResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="comId" column="com_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="vendorsParameter" column="vendors_parameter" />
|
||||
<result property="enabled" column="enabled" />
|
||||
<result property="state" column="state" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="compName" column="comp_name"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="vendorsName" column="vendors_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttendanceCfgVo">
|
||||
SELECT ac.id, ac.com_id, ac.project_id, ac.vendors_code, ac.vendors_parameter, ac.enabled, ac.state, ac.remark, ac.is_del, ac.create_by, ac.create_time, ac.update_by
|
||||
, ac.update_time,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` vendors_name,sd.sub_dept_name dept_name,ac.dept_id
|
||||
FROM attendance_cfg ac
|
||||
LEFT JOIN sys_dept dp ON ac.`com_id`=dp.`dept_id`
|
||||
LEFT JOIN pro_project_info pp ON ac.`project_id`=pp.`id`
|
||||
left join pro_project_info_subdepts sd on ac.dept_id=sd.id
|
||||
LEFT JOIN sys_dict_data dic ON ac.`vendors_code`=dic.`dict_value` AND dic.`dict_type`='attendance_vendors'
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceCfgList" parameterType="QuartzProjectAttendanceCfg" resultMap="AttendanceCfgResult">
|
||||
<include refid="selectAttendanceCfgVo"/>
|
||||
<where>
|
||||
<if test="comId != null "> and ac.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and ac.project_id = #{projectId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and ac.vendors_code = #{vendorsCode}</if>
|
||||
<if test="vendorsParameter != null and vendorsParameter != ''"> and ac.vendors_parameter = #{vendorsParameter}</if>
|
||||
<if test="enabled != null "> and ac.enabled = #{enabled}</if>
|
||||
<if test="state != null "> and ac.state = #{state}</if>
|
||||
<if test="isDel != null "> and ac.is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceCfgListForAllInfo" parameterType="QuartzProjectAttendanceCfg" resultMap="AttendanceCfgResult">
|
||||
<include refid="selectAttendanceCfgVo"/>
|
||||
<where>
|
||||
<if test="id != null "> and ac.id = #{id}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,573 @@
|
|||
<?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.yanzhu.job.mapper.QuartzProjectAttendanceDataMapper">
|
||||
|
||||
<resultMap type="QuartzProjectAttendanceData" id="SurProjectAttendanceDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="projectId" column="projectId" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="deptId" />
|
||||
<result property="deptName" column="deptName" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="serverid" column="serverid" />
|
||||
<result property="workerId" column="workerId" />
|
||||
<result property="workerName" column="workerName" />
|
||||
<result property="identification" column="identification" />
|
||||
<result property="workerPhoto" column="workerPhoto" />
|
||||
<result property="workerGender" column="workerGender" />
|
||||
<result property="birthDate" column="birthDate" />
|
||||
<result property="ethnic" column="ethnic" />
|
||||
<result property="nativePlace" column="nativePlace" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="workTypeName" column="workTypeName" />
|
||||
<result property="specWorkType" column="specWorkType" />
|
||||
<result property="groupName" column="groupName" />
|
||||
<result property="companyTypeId" column="companyTypeId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="attendanceTime" column="attendance_time" />
|
||||
<result property="attendanceOutTime" column="attendance_out_time" />
|
||||
<result property="scanPhoto" column="scanPhoto" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="workTypeCode" column="workTypeCode" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceDataVo">
|
||||
select
|
||||
id,
|
||||
cfgid,
|
||||
app_id,
|
||||
projectId,
|
||||
projectName,
|
||||
deptId,
|
||||
deptName,
|
||||
vendors_code,
|
||||
serverid,
|
||||
workerId,
|
||||
workerName,
|
||||
identification,
|
||||
workerPhoto,
|
||||
workerGender,
|
||||
birthDate,
|
||||
ethnic,
|
||||
nativePlace,
|
||||
phone,
|
||||
workTypeName,
|
||||
specWorkType,
|
||||
groupName,
|
||||
companyTypeId,
|
||||
companyName,
|
||||
attendance_time,
|
||||
attendance_out_time,
|
||||
scanPhoto,
|
||||
teamId,
|
||||
workTypeCode,
|
||||
companyId,
|
||||
vendorId,
|
||||
device_code,
|
||||
is_del,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from sur_project_attendance_data_${year}
|
||||
</sql>
|
||||
|
||||
<select id="findCurrentAttendanceData" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select * from sur_project_attendance_data_${year}
|
||||
<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>
|
||||
</where>
|
||||
order by id desc LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataListEx" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select * from sur_project_attendance_data_${year}
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="projectId != null "> and projectId = #{projectId}</if>
|
||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
|
||||
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto = #{scanPhoto}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) = date(#{attendanceTime})</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
<include refid="selectSurProjectAttendanceDataVo"/>
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="projectId != null ">and cfgid in (select id from sur_project_attendance_cfg where projectId = #{projectId})</if>
|
||||
<if test="deptId != null "> and deptId = #{deptId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="attendanceOutTime!=null and attendanceOutTime!=''">
|
||||
and date(attendance_out_time) <=date(#{attendanceOutTime})
|
||||
</if>
|
||||
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="scanPhoto != null and scanPhoto != ''"> and scanPhoto like concat('%', #{scanPhoto}, '%')</if>
|
||||
<if test="workerName != null and workerName != ''"> and workerName like concat('%', #{workerName}, '%')</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(attendance_time) >= date(#{attendanceTime})</if>
|
||||
<if test="identification != null and identification != ''"> and identification = #{identification}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataById" parameterType="Long" resultMap="SurProjectAttendanceDataResult">
|
||||
<include refid="selectSurProjectAttendanceDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceData" parameterType="QuartzProjectAttendanceData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_data_${year}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="projectId != null">projectId,</if>
|
||||
<if test="projectName != null">projectName,</if>
|
||||
<if test="deptId != null">deptId,</if>
|
||||
<if test="deptName != null">deptName,</if>
|
||||
<if test="vendorsCode != null">vendors_code,</if>
|
||||
<if test="serverid != null">serverid,</if>
|
||||
<if test="workerId != null">workerId,</if>
|
||||
<if test="workerName != null">workerName,</if>
|
||||
<if test="identification != null">identification,</if>
|
||||
<if test="workerPhoto != null">workerPhoto,</if>
|
||||
<if test="workerGender != null">workerGender,</if>
|
||||
<if test="birthDate != null">birthDate,</if>
|
||||
<if test="ethnic != null">ethnic,</if>
|
||||
<if test="nativePlace != null">nativePlace,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="workTypeName != null">workTypeName,</if>
|
||||
<if test="specWorkType != null">specWorkType,</if>
|
||||
<if test="groupName != null">groupName,</if>
|
||||
<if test="companyTypeId != null">companyTypeId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="attendanceTime != null">attendance_time,</if>
|
||||
<if test="attendanceOutTime != null">attendance_out_time,</if>
|
||||
<if test="scanPhoto != null">scanPhoto,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="workTypeCode != null">workTypeCode,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="deviceCode != null">device_code,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="projectName != null">#{projectName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="vendorsCode != null">#{vendorsCode},</if>
|
||||
<if test="serverid != null">#{serverid},</if>
|
||||
<if test="workerId != null">#{workerId},</if>
|
||||
<if test="workerName != null">#{workerName},</if>
|
||||
<if test="identification != null">#{identification},</if>
|
||||
<if test="workerPhoto != null">#{workerPhoto},</if>
|
||||
<if test="workerGender != null">#{workerGender},</if>
|
||||
<if test="birthDate != null">#{birthDate},</if>
|
||||
<if test="ethnic != null">#{ethnic},</if>
|
||||
<if test="nativePlace != null">#{nativePlace},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="workTypeName != null">#{workTypeName},</if>
|
||||
<if test="specWorkType != null">#{specWorkType},</if>
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="companyTypeId != null">#{companyTypeId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="attendanceTime != null">#{attendanceTime},</if>
|
||||
<if test="attendanceOutTime != null">#{attendanceOutTime},</if>
|
||||
<if test="scanPhoto != null">#{scanPhoto},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="workTypeCode != null">#{workTypeCode},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="deviceCode != null">#{deviceCode},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceData" parameterType="QuartzProjectAttendanceData">
|
||||
update sur_project_attendance_data_${year}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="projectId != null">projectId = #{projectId},</if>
|
||||
<if test="projectName != null">projectName = #{projectName},</if>
|
||||
<if test="deptId != null">deptId = #{deptId},</if>
|
||||
<if test="deptName != null">deptName = #{deptName},</if>
|
||||
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||
<if test="serverid != null">serverid = #{serverid},</if>
|
||||
<if test="workerId != null">workerId = #{workerId},</if>
|
||||
<if test="workerName != null">workerName = #{workerName},</if>
|
||||
<if test="identification != null">identification = #{identification},</if>
|
||||
<if test="workerPhoto != null">workerPhoto = #{workerPhoto},</if>
|
||||
<if test="workerGender != null">workerGender = #{workerGender},</if>
|
||||
<if test="birthDate != null">birthDate = #{birthDate},</if>
|
||||
<if test="ethnic != null">ethnic = #{ethnic},</if>
|
||||
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
|
||||
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
|
||||
<if test="groupName != null">groupName = #{groupName},</if>
|
||||
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="attendanceTime != null">attendance_time = #{attendanceTime},</if>
|
||||
<if test="attendanceOutTime != null">attendance_out_time = #{attendanceOutTime},</if>
|
||||
<if test="scanPhoto != null">scanPhoto = #{scanPhoto},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataById" parameterType="Long">
|
||||
delete from sur_project_attendance_data_${year} where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataByIds" parameterType="String">
|
||||
delete from sur_project_attendance_data_${year} where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataByParams" parameterType="String">
|
||||
delete from sur_project_attendance_data_${year} where CONCAT(app_id,'-',serverid,'-',workerId) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceData">
|
||||
insert into sur_project_attendance_data_${year}( id, cfgid, app_id, projectId, projectName, deptId, deptName, vendors_code, serverid, workerId, workerName, identification, workerPhoto, workerGender, birthDate, ethnic, nativePlace, phone, workTypeName, specWorkType, groupName, companyTypeId,
|
||||
companyName, attendance_time, attendance_out_time, scanPhoto, teamId,workTypeCode, companyId, vendorId, device_code, is_del, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.cfgid},#{item.appId}, #{item.projectId}, #{item.projectName}, #{item.deptId}, #{item.deptName}, #{item.vendorsCode}, #{item.serverid}, #{item.workerId}, #{item.workerName}, #{item.identification},#{item.workerPhoto}, #{item.workerGender}, #{item.birthDate},#{item.ethnic}, #{item.nativePlace}, #{item.phone}, #{item.workTypeName}, #{item.specWorkType}, #{item.groupName}, #{item.companyTypeId},
|
||||
#{item.companyName}, #{item.attendanceTime}, #{item.attendanceOutTime}, #{item.scanPhoto},#{item.teamId}, #{item.workTypeCode}, #{item.companyId}, #{item.vendorId}, #{item.deviceCode},#{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getLastServerId" parameterType="QuartzProjectAttendanceData" resultType="Long">
|
||||
SELECT IF(MAX(serverid+0),MAX(serverid+0),0) serverid FROM sur_project_attendance_data_${year} WHERE cfgid=#{cfgid}
|
||||
</select>
|
||||
<select id="groupByComanyOld" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
|
||||
select min(id) from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x1
|
||||
where date(attendance_time)=#{attendanceTime}
|
||||
<if test="subDeptId!=null and subDeptId>0"> and project_id in (
|
||||
SELECT id FROM sur_project WHERE isdel=0 AND deptid = #{subDeptId}
|
||||
)
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0"> and project_id=#{projectId}</if>
|
||||
group by workerId )
|
||||
and companyTypeId in (1,2,3,4,5,6,8) group by companyTypeId
|
||||
</select>
|
||||
<select id="groupByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE()
|
||||
and cfgid in (select id from sur_project_attendance_cfg
|
||||
<where>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and project_id in (SELECT id FROM sur_project WHERE deptid=#{subDeptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
)
|
||||
and g.companyTypeId in (1,2,3,4,5,6,8)
|
||||
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{subDeptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupAllByComany" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select g.companyTypeId,count(1) id
|
||||
from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g,
|
||||
sur_project sp
|
||||
where u.cfgid=c.id and u.companyId=g.companyId and u.state=#{id} and c.project_id = sp.id
|
||||
and sp.isDel=0
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="subDeptId!=null and subDeptId>0">
|
||||
and sp.deptId=#{subDeptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="getHuazhuPage" parameterType="QuartzProjectAttendanceData" resultType="Long">
|
||||
select max(vendorId) vendorId from sur_project_attendance_data_${year} WHERE cfgid=#{id}
|
||||
</select>
|
||||
|
||||
<select id="initOtherData" parameterType="map" resultType="map">
|
||||
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,g.companyTypeId,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del
|
||||
from sur_project_attendance_data d
|
||||
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
|
||||
left join sur_project_attendance_group g on u.companyId = g.companyId and g.cfgid = u.cfgid
|
||||
where d.cfgid=#{cfgid} and date(d.attendance_time) = #{date}
|
||||
GROUP BY d.workerId
|
||||
</select>
|
||||
|
||||
<select id="initHuaZhuData" parameterType="map" resultType="map">
|
||||
select d.workerId,d.app_id,d.serverid,u.companyId,u.companyName,u.`name`,d.identification,u.recentPhoto,u.gender,u.birthDate,u.ethnic,u.nativePlace,u.phone,
|
||||
u.workTypeName,u.specWorkType,u.groupName,d.teamId,u.workTypeCode,d.vendorId,d.device_code,d.scanPhoto,d.is_del,
|
||||
CASE WHEN sd.type_flag = 2 THEN '1' WHEN sd.type_flag = 3 THEN '2' WHEN sd.type_flag = 4 THEN '8' else '0' end as companyTypeId
|
||||
from sur_project_attendance_data d
|
||||
left JOIN sur_project_attendance_user u on d.workerId = u.workerId and d.cfgid = u.cfgid
|
||||
left join sys_dept sd on u.companyName = sd.dept_name
|
||||
where d.cfgid=#{cfgid} and date(d.attendance_time) = #{date}
|
||||
GROUP BY d.workerId
|
||||
</select>
|
||||
|
||||
<select id="findHuaZhuCompanyType" parameterType="string" resultType="string">
|
||||
select CASE WHEN sd.type_flag = 2 THEN '1' WHEN sd.type_flag = 3 THEN '2' WHEN sd.type_flag = 4 THEN '8' else '0' end as companyTypeId
|
||||
from sys_dept sd
|
||||
where sd.dept_name = #{deptName}
|
||||
</select>
|
||||
|
||||
<select id="todayAttendance" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.* from sur_project_attendance_data_${year} ady
|
||||
left join sur_project sp on sp.id = ady.projectId
|
||||
where sp.isDel=0
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and ady.projectId=#{projectId}
|
||||
</if>
|
||||
<if test="id==1">
|
||||
and ady.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and ady.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and ady.companyTypeId =8
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.deptId=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and ady.projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
|
||||
</select>
|
||||
|
||||
<select id="attendanceDataList" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.* from sur_project_attendance_data_${year} ady
|
||||
where ady.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
<if test="companyTypeId==101">
|
||||
and ady.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and ady.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and ady.companyTypeId =8
|
||||
</if>
|
||||
<if test="workerId != null and workerId != ''"> and ady.workerId = #{workerId}</if>
|
||||
<if test="workerName != null and workerName != ''"> and ady.workerName like concat('%', #{workerName}, '%')</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) = date(#{attendanceTime})</if>
|
||||
and ady.is_del=0
|
||||
order by ady.id desc
|
||||
</select>
|
||||
|
||||
<select id="groupTodayCompanyTypeId" parameterType="QuartzProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select ady.companyTypeId,count(1) id from sur_project_attendance_data_${year} ady
|
||||
where ady.cfgid in (select id from sur_project_attendance_cfg where
|
||||
is_del=0
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and projectId=#{projectId}
|
||||
</if>
|
||||
and projectId in (select id from sur_project sp where sp.isDel=0
|
||||
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.deptId=#{deptId}
|
||||
</if>
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(ady.attendance_time) =date(#{attendanceTime})</if>
|
||||
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and ady.projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
group by ady.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findGroupAllByParams" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '2' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=1
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '3' as type, d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
and date(d.attendance_time) = date(now())
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupDataByParams" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||
select d.companyTypeId,count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
<if test="attendanceTime != null and attendanceTime != ''"> and date(d.attendance_time) = date(#{attendanceTime})</if>
|
||||
<if test="workerName != null and workerName != ''"> and d.workerName like concat('%', #{workerName}, '%')</if>
|
||||
group by d.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findGroupAllByDays" parameterType="QuartzProjectAttendanceData" resultType="Map">
|
||||
select '3' as type, DATE_FORMAT(days.attendanceTime, '%m-%d') as attendanceTime,days.total from(
|
||||
select date(d.attendance_time) as attendanceTime, DATE_FORMAT(d.attendance_time, '%m-%d'),count(1) as total from sur_project_attendance_data_${year} d
|
||||
where d.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and d.is_del=0
|
||||
and date(d.attendance_time) between #{attendanceTime} and #{attendanceOutTime}
|
||||
group by date(d.attendance_time)
|
||||
order by date(d.attendance_time)
|
||||
)days
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,233 @@
|
|||
<?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.yanzhu.job.mapper.QuartzProjectAttendanceGroupMapper">
|
||||
|
||||
<resultMap type="QuartzProjectAttendanceGroup" id="SurProjectAttendanceGroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="serverid" column="serverid" />
|
||||
<result property="bizLicense" column="bizLicense" />
|
||||
<result property="companyCode" column="companyCode" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="companyTypeId" column="companyTypeId" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="name" column="name" />
|
||||
<result property="leaderName" column="leaderName" />
|
||||
<result property="leaderPhone" column="leaderPhone" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="teamName" column="teamName" />
|
||||
<result property="type" column="type" />
|
||||
<result property="leaderId" column="leaderId" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="createTimestamp" column="createTimestamp" />
|
||||
<result property="platformGroupId" column="platformGroupId" />
|
||||
<result property="platformTeamId" column="platformTeamId" />
|
||||
<result property="enterDate" column="enterDate" />
|
||||
<result property="exitDate" column="exitDate" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceGroupVo">
|
||||
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from view_sur_project_attendance_group
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupViewList" parameterType="QuartzProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
|
||||
<include refid="selectSurProjectAttendanceGroupVo"/>
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="bizLicense != null and bizLicense != ''"> and bizLicense = #{bizLicense}</if>
|
||||
<if test="companyCode != null and companyCode != ''"> and companyCode = #{companyCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="companyTypeId != null and companyTypeId != ''"> and companyTypeId = #{companyTypeId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="leaderName != null and leaderName != ''"> and leaderName like concat('%', #{leaderName}, '%')</if>
|
||||
<if test="leaderPhone != null and leaderPhone != ''"> and leaderPhone = #{leaderPhone}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
<if test="createTime != null "> and createTime = #{createTime}</if>
|
||||
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
||||
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
||||
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null "> and exitDate = #{exitDate}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupList" parameterType="QuartzProjectAttendanceGroup" resultMap="SurProjectAttendanceGroupResult">
|
||||
select id, cfgid, app_id, serverid, bizLicense, companyCode, companyId, companyName, companyTypeId, vendorId, name, leaderName, leaderPhone, teamId, teamName, type, leaderId, deleted, createTimestamp, platformGroupId, platformTeamId, enterDate, exitDate, remark, is_del, create_by, create_time, update_by, update_time
|
||||
from sur_project_attendance_group
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="serverid != null "> and serverid = #{serverid}</if>
|
||||
<if test="bizLicense != null and bizLicense != ''"> and bizLicense = #{bizLicense}</if>
|
||||
<if test="companyCode != null and companyCode != ''"> and companyCode = #{companyCode}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="companyTypeId != null and companyTypeId != ''"> and companyTypeId = #{companyTypeId}</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="leaderName != null and leaderName != ''"> and leaderName like concat('%', #{leaderName}, '%')</if>
|
||||
<if test="leaderPhone != null and leaderPhone != ''"> and leaderPhone = #{leaderPhone}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="leaderId != null "> and leaderId = #{leaderId}</if>
|
||||
<if test="deleted != null "> and deleted = #{deleted}</if>
|
||||
<if test="createTime != null "> and createTime = #{createTime}</if>
|
||||
<if test="platformGroupId != null "> and platformGroupId = #{platformGroupId}</if>
|
||||
<if test="platformTeamId != null "> and platformTeamId = #{platformTeamId}</if>
|
||||
<if test="enterDate != null "> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null "> and exitDate = #{exitDate}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectAttendanceGroupById" parameterType="Long" resultMap="SurProjectAttendanceGroupResult">
|
||||
<include refid="selectSurProjectAttendanceGroupVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceGroup" parameterType="QuartzProjectAttendanceGroup" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="serverid != null">serverid,</if>
|
||||
<if test="bizLicense != null">bizLicense,</if>
|
||||
<if test="companyCode != null">companyCode,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="companyTypeId != null">companyTypeId,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="leaderName != null">leaderName,</if>
|
||||
<if test="leaderPhone != null">leaderPhone,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="teamName != null">teamName,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="leaderId != null">leaderId,</if>
|
||||
<if test="deleted != null">deleted,</if>
|
||||
<if test="createTimestamp != null">createTimestamp,</if>
|
||||
<if test="platformGroupId != null">platformGroupId,</if>
|
||||
<if test="platformTeamId != null">platformTeamId,</if>
|
||||
<if test="enterDate != null">enterDate,</if>
|
||||
<if test="exitDate != null">exitDate,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="serverid != null">#{serverid},</if>
|
||||
<if test="bizLicense != null">#{bizLicense},</if>
|
||||
<if test="companyCode != null">#{companyCode},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="companyTypeId != null">#{companyTypeId},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="leaderName != null">#{leaderName},</if>
|
||||
<if test="leaderPhone != null">#{leaderPhone},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="teamName != null">#{teamName},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="leaderId != null">#{leaderId},</if>
|
||||
<if test="deleted != null">#{deleted},</if>
|
||||
<if test="createTimestamp != null">#{createTimestamp},</if>
|
||||
<if test="platformGroupId != null">#{platformGroupId},</if>
|
||||
<if test="platformTeamId != null">#{platformTeamId},</if>
|
||||
<if test="enterDate != null">#{enterDate},</if>
|
||||
<if test="exitDate != null">#{exitDate},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceGroup" parameterType="QuartzProjectAttendanceGroup">
|
||||
update sur_project_attendance_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="serverid != null">serverid = #{serverid},</if>
|
||||
<if test="bizLicense != null">bizLicense = #{bizLicense},</if>
|
||||
<if test="companyCode != null">companyCode = #{companyCode},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="leaderName != null">leaderName = #{leaderName},</if>
|
||||
<if test="leaderPhone != null">leaderPhone = #{leaderPhone},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="teamName != null">teamName = #{teamName},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="leaderId != null">leaderId = #{leaderId},</if>
|
||||
<if test="deleted != null">deleted = #{deleted},</if>
|
||||
<if test="createTimestamp != null">createTimestamp = #{createTimestamp},</if>
|
||||
<if test="platformGroupId != null">platformGroupId = #{platformGroupId},</if>
|
||||
<if test="platformTeamId != null">platformTeamId = #{platformTeamId},</if>
|
||||
<if test="enterDate != null">enterDate = #{enterDate},</if>
|
||||
<if test="exitDate != null">exitDate = #{exitDate},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceGroupById" parameterType="Long">
|
||||
delete from sur_project_attendance_group where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceGroupByIds" parameterType="String">
|
||||
delete from sur_project_attendance_group where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceGroupByParams" parameterType="String">
|
||||
delete from sur_project_attendance_group where CONCAT(app_id,'-',serverid) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceGroup">
|
||||
insert into sur_project_attendance_group(id,cfgid,app_id,serverid,bizLicense,companyCode,companyId,companyName,companyTypeId,vendorId,name,leaderName,leaderPhone,teamId,teamName,type,leaderId,deleted,createTimestamp,platformGroupId,platformTeamId,enterDate,exitDate,remark,create_by,create_time,update_by,update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.id}, #{item.cfgid}, #{item.appId}, #{item.serverid}, #{item.bizLicense}, #{item.companyCode}, #{item.companyId}, #{item.companyName},#{item.companyTypeId}, #{item.vendorId}, #{item.name}, #{item.leaderName}, #{item.leaderPhone}, #{item.teamId}, #{item.teamName}, #{item.type}, #{item.leaderId}, #{item.deleted}, #{item.createTimestamp}, #{item.platformGroupId}, #{item.platformTeamId}, #{item.enterDate},
|
||||
#{item.exitDate}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,812 @@
|
|||
<?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.yanzhu.job.mapper.QuartzProjectAttendanceUserMapper">
|
||||
|
||||
<resultMap type="QuartzProjectAttendanceUser" id="SurProjectAttendanceUserResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="workerId" column="workerId" />
|
||||
<result property="laborWorkerId" column="laborWorkerId" />
|
||||
<result property="workerCategory" column="workerCategory" />
|
||||
<result property="qrCode" column="qrCode" />
|
||||
<result property="name" column="name" />
|
||||
<result property="ethnic" column="ethnic" />
|
||||
<result property="nativePlace" column="nativePlace" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="birthDate" column="birthDate" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="degreeName" column="degreeName" />
|
||||
<result property="photo" column="photo" />
|
||||
<result property="recentPhoto" column="recentPhoto" />
|
||||
<result property="groupId" column="groupId" />
|
||||
<result property="groupName" column="groupName" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="workTypeCode" column="workTypeCode" />
|
||||
<result property="workTypeName" column="workTypeName" />
|
||||
<result property="specWorkType" column="specWorkType" />
|
||||
<result property="hatCode" column="hatCode" />
|
||||
<result property="state" column="state" />
|
||||
<result property="enterDate" column="enterDate" />
|
||||
<result property="exitDate" column="exitDate" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="teamName" column="teamName" />
|
||||
<result property="enterType" column="enterType" />
|
||||
<result property="other" column="other" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="subDeptId" column="sub_dept_id"/>
|
||||
<result property="companyTypeId" column="companyTypeId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceUserVo">
|
||||
SELECT * FROM (
|
||||
SELECT a.*,b.project_id,b.sub_dept_id
|
||||
FROM sur_project_attendance_user a,sur_project_attendance_cfg b
|
||||
WHERE a.cfgid=b.id )
|
||||
sur_project_attendance_user
|
||||
</sql>
|
||||
<select id="selectSurProjectAttendanceUserListJgw" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.degreeName,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
c.project_id,c.sub_dept_id,u.companyName,u.workTypeName,g.teamname groupName,g.companyName remark
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg c,sur_project_attendance_group g
|
||||
WHERE u.cfgid=c.id AND g.companyid=u.companyid AND u.vendors_code='jgw'
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and g.companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="cfgid != null "> and u.cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and u.app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and u.vendors_code = #{vendorsCode}</if>
|
||||
<if test="workerId != null "> and u.workerId = #{workerId}</if>
|
||||
<if test="laborWorkerId != null "> and u.laborWorkerId = #{laborWorkerId}</if>
|
||||
<if test="workerCategory != null "> and u.workerCategory = #{workerCategory}</if>
|
||||
<if test="qrCode != null "> and u.qrCode = #{qrCode}</if>
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
<if test="ethnic != null and ethnic != ''"> and u.ethnic = #{ethnic}</if>
|
||||
<if test="nativePlace != null and nativePlace != ''"> and u.nativePlace = #{nativePlace}</if>
|
||||
<if test="gender != null "> and u.gender = #{gender}</if>
|
||||
<if test="birthDate != null "> and u.birthDate = #{birthDate}</if>
|
||||
<if test="phone != null and phone != ''"> and u.phone = #{phone}</if>
|
||||
<if test="degreeName != null and degreeName != ''"> and u.degreeName like concat('%', #{degreeName}, '%')</if>
|
||||
<if test="photo != null and photo != ''"> and u.photo = #{photo}</if>
|
||||
<if test="recentPhoto != null and recentPhoto != ''"> and u.recentPhoto = #{recentPhoto}</if>
|
||||
<if test="groupId != null "> and u.groupId = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and u.groupName like concat('%', #{groupName}, '%')</if>
|
||||
<if test="leader != null "> and u.leader = #{leader}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and u.workTypeCode = #{workTypeCode}</if>
|
||||
<if test="workTypeName != null and workTypeName != ''"> and u.workTypeName like concat('%', #{workTypeName}, '%')</if>
|
||||
<if test="specWorkType != null "> and u.specWorkType = #{specWorkType}</if>
|
||||
<if test="hatCode != null and hatCode != ''"> and u.hatCode = #{hatCode}</if>
|
||||
<if test="state != null "> and u.state = #{state}</if>
|
||||
<if test="enterDate != null and enterDate != ''"> and u.enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null and exitDate != ''"> and u.exitDate = #{exitDate}</if>
|
||||
<if test="companyId != null "> and u.companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and u.companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="vendorId != null "> and u.vendorId = #{vendorId}</if>
|
||||
<if test="teamId != null "> and u.teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and u.teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="enterType != null and enterType != ''"> and u.enterType = #{enterType}</if>
|
||||
<if test="other != null and other != ''"> and u.other = #{other}</if>
|
||||
<if test="projectId != null and projectId > 0 "> and c.project_id = #{projectId}</if>
|
||||
<if test="subDeptId != null and subDeptId >0 "> and c.sub_dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and u.is_del = #{isDel}</if>
|
||||
</select>
|
||||
|
||||
<select id="querySurProjectAttendanceUserList" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT * FROM (
|
||||
SELECT a.id,
|
||||
a.cfgid,
|
||||
a.app_id,
|
||||
a.vendors_code,
|
||||
a.workerId,
|
||||
a.laborWorkerId,
|
||||
a.workerCategory,
|
||||
a.qrCode,
|
||||
a.name,
|
||||
a.ethnic,
|
||||
a.nativePlace,
|
||||
a.gender,
|
||||
a.birthDate,
|
||||
a.phone,
|
||||
a.degreeName,
|
||||
a.photo,
|
||||
a.recentPhoto,
|
||||
a.groupId,
|
||||
a.groupName,
|
||||
a.leader,
|
||||
a.workTypeCode,
|
||||
a.workTypeName,
|
||||
a.specWorkType,
|
||||
a.hatCode,
|
||||
a.state,
|
||||
a.enterDate,
|
||||
a.exitDate,
|
||||
a.companyId,
|
||||
a.companyName,
|
||||
a.vendorId,
|
||||
a.teamId,
|
||||
a.teamName,
|
||||
a.enterType,
|
||||
a.other,
|
||||
a.is_del,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,b.project_id,b.sub_dept_id,g.companyTypeId,g.companyName as remark
|
||||
FROM sur_project_attendance_user a,sur_project_attendance_cfg b,view_sur_project_attendance_group g
|
||||
WHERE a.cfgid=b.id and a.companyId=g.companyId and g.id in(select min(id) from view_sur_project_attendance_group group by companyid)
|
||||
)
|
||||
sur_project_attendance_user
|
||||
<where>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="laborWorkerId != null "> and laborWorkerId = #{laborWorkerId}</if>
|
||||
<if test="workerCategory != null "> and workerCategory = #{workerCategory}</if>
|
||||
<if test="qrCode != null "> and qrCode = #{qrCode}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="ethnic != null and ethnic != ''"> and ethnic = #{ethnic}</if>
|
||||
<if test="nativePlace != null and nativePlace != ''"> and nativePlace = #{nativePlace}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthDate != null "> and birthDate = #{birthDate}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="degreeName != null and degreeName != ''"> and degreeName like concat('%', #{degreeName}, '%')</if>
|
||||
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
|
||||
<if test="recentPhoto != null and recentPhoto != ''"> and recentPhoto = #{recentPhoto}</if>
|
||||
<if test="groupId != null "> and groupId = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and groupName like concat('%', #{groupName}, '%')</if>
|
||||
<if test="leader != null "> and leader = #{leader}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="workTypeName != null and workTypeName != ''"> and workTypeName like concat('%', #{workTypeName}, '%')</if>
|
||||
<if test="specWorkType != null "> and specWorkType = #{specWorkType}</if>
|
||||
<if test="hatCode != null and hatCode != ''"> and hatCode = #{hatCode}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="enterDate != null and enterDate != ''"> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null and exitDate != ''"> and exitDate = #{exitDate}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
||||
<if test="subDeptId != null and subDeptId >0 "> and sub_dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSurProjectAttendanceUserList" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
<include refid="selectSurProjectAttendanceUserVo"/>
|
||||
<where>
|
||||
<if test="companyTypeId!=null">
|
||||
<if test="companyTypeId>100">
|
||||
<if test="companyTypeId==101">
|
||||
and companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
</if>
|
||||
<if test="companyTypeId <100">
|
||||
and companyTypeId=#{companyTypeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
<if test="vendorsCode != null and vendorsCode != ''"> and vendors_code = #{vendorsCode}</if>
|
||||
<if test="workerId != null "> and workerId = #{workerId}</if>
|
||||
<if test="laborWorkerId != null "> and laborWorkerId = #{laborWorkerId}</if>
|
||||
<if test="workerCategory != null "> and workerCategory = #{workerCategory}</if>
|
||||
<if test="qrCode != null "> and qrCode = #{qrCode}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="ethnic != null and ethnic != ''"> and ethnic = #{ethnic}</if>
|
||||
<if test="nativePlace != null and nativePlace != ''"> and nativePlace = #{nativePlace}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthDate != null "> and birthDate = #{birthDate}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="degreeName != null and degreeName != ''"> and degreeName like concat('%', #{degreeName}, '%')</if>
|
||||
<if test="photo != null and photo != ''"> and photo = #{photo}</if>
|
||||
<if test="recentPhoto != null and recentPhoto != ''"> and recentPhoto = #{recentPhoto}</if>
|
||||
<if test="groupId != null "> and groupId = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and groupName like concat('%', #{groupName}, '%')</if>
|
||||
<if test="leader != null "> and leader = #{leader}</if>
|
||||
<if test="workTypeCode != null and workTypeCode != ''"> and workTypeCode = #{workTypeCode}</if>
|
||||
<if test="workTypeName != null and workTypeName != ''"> and workTypeName like concat('%', #{workTypeName}, '%')</if>
|
||||
<if test="specWorkType != null "> and specWorkType = #{specWorkType}</if>
|
||||
<if test="hatCode != null and hatCode != ''"> and hatCode = #{hatCode}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="enterDate != null and enterDate != ''"> and enterDate = #{enterDate}</if>
|
||||
<if test="exitDate != null and exitDate != ''"> and exitDate = #{exitDate}</if>
|
||||
<if test="companyId != null "> and companyId = #{companyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and companyName like concat('%', #{companyName}, '%')</if>
|
||||
<if test="vendorId != null "> and vendorId = #{vendorId}</if>
|
||||
<if test="teamId != null "> and teamId = #{teamId}</if>
|
||||
<if test="teamName != null and teamName != ''"> and teamName like concat('%', #{teamName}, '%')</if>
|
||||
<if test="enterType != null and enterType != ''"> and enterType = #{enterType}</if>
|
||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||
<if test="projectId != null and projectId > 0 "> and project_id = #{projectId}</if>
|
||||
<if test="subDeptId != null and subDeptId >0 "> and sub_dept_id = #{subDeptId}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSurProjectAttendanceUserById" parameterType="Long" resultMap="SurProjectAttendanceUserResult">
|
||||
<include refid="selectSurProjectAttendanceUserVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findCurrentAttendanceUser" parameterType="QuartzProjectAttendanceUser" 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.companyId = g.companyId and g.cfgid = u.cfgid
|
||||
where u.cfgid=#{cfgid} and u.workerId=#{workerId}
|
||||
</select>
|
||||
|
||||
<select id="findYzCurrentAttendanceUser" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select u.companyId,g.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="QuartzProjectAttendanceUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="vendorsCode != null">vendors_code,</if>
|
||||
<if test="workerId != null">workerId,</if>
|
||||
<if test="laborWorkerId != null">laborWorkerId,</if>
|
||||
<if test="workerCategory != null">workerCategory,</if>
|
||||
<if test="qrCode != null">qrCode,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="ethnic != null">ethnic,</if>
|
||||
<if test="nativePlace != null">nativePlace,</if>
|
||||
<if test="gender != null">gender,</if>
|
||||
<if test="birthDate != null">birthDate,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="degreeName != null">degreeName,</if>
|
||||
<if test="photo != null">photo,</if>
|
||||
<if test="recentPhoto != null">recentPhoto,</if>
|
||||
<if test="groupId != null">groupId,</if>
|
||||
<if test="groupName != null">groupName,</if>
|
||||
<if test="leader != null">leader,</if>
|
||||
<if test="workTypeCode != null">workTypeCode,</if>
|
||||
<if test="workTypeName != null">workTypeName,</if>
|
||||
<if test="specWorkType != null">specWorkType,</if>
|
||||
<if test="hatCode != null">hatCode,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="enterDate != null">enterDate,</if>
|
||||
<if test="exitDate != null">exitDate,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="teamName != null">teamName,</if>
|
||||
<if test="enterType != null">enterType,</if>
|
||||
<if test="other != null and other != ''">other,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="vendorsCode != null">#{vendorsCode},</if>
|
||||
<if test="workerId != null">#{workerId},</if>
|
||||
<if test="laborWorkerId != null">#{laborWorkerId},</if>
|
||||
<if test="workerCategory != null">#{workerCategory},</if>
|
||||
<if test="qrCode != null">#{qrCode},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="ethnic != null">#{ethnic},</if>
|
||||
<if test="nativePlace != null">#{nativePlace},</if>
|
||||
<if test="gender != null">#{gender},</if>
|
||||
<if test="birthDate != null">#{birthDate},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="degreeName != null">#{degreeName},</if>
|
||||
<if test="photo != null">#{photo},</if>
|
||||
<if test="recentPhoto != null">#{recentPhoto},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="leader != null">#{leader},</if>
|
||||
<if test="workTypeCode != null">#{workTypeCode},</if>
|
||||
<if test="workTypeName != null">#{workTypeName},</if>
|
||||
<if test="specWorkType != null">#{specWorkType},</if>
|
||||
<if test="hatCode != null">#{hatCode},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="enterDate != null">#{enterDate},</if>
|
||||
<if test="exitDate != null">#{exitDate},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="teamName != null">#{teamName},</if>
|
||||
<if test="enterType != null">#{enterType},</if>
|
||||
<if test="other != null and other != ''">#{other},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceUser" parameterType="QuartzProjectAttendanceUser">
|
||||
update sur_project_attendance_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||
<if test="workerId != null">workerId = #{workerId},</if>
|
||||
<if test="laborWorkerId != null">laborWorkerId = #{laborWorkerId},</if>
|
||||
<if test="workerCategory != null">workerCategory = #{workerCategory},</if>
|
||||
<if test="qrCode != null">qrCode = #{qrCode},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="ethnic != null">ethnic = #{ethnic},</if>
|
||||
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
|
||||
<if test="gender != null">gender = #{gender},</if>
|
||||
<if test="birthDate != null">birthDate = #{birthDate},</if>
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
<if test="degreeName != null">degreeName = #{degreeName},</if>
|
||||
<if test="photo != null">photo = #{photo},</if>
|
||||
<if test="recentPhoto != null">recentPhoto = #{recentPhoto},</if>
|
||||
<if test="groupId != null">groupId = #{groupId},</if>
|
||||
<if test="groupName != null">groupName = #{groupName},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
|
||||
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
|
||||
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
|
||||
<if test="hatCode != null">hatCode = #{hatCode},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
<if test="enterDate != null">enterDate = #{enterDate},</if>
|
||||
<if test="exitDate != null">exitDate = #{exitDate},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="teamName != null">teamName = #{teamName},</if>
|
||||
<if test="enterType != null">enterType = #{enterType},</if>
|
||||
<if test="other != null and other != ''">other = #{other},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceUserById" parameterType="Long">
|
||||
delete from sur_project_attendance_user where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceUserByIds" parameterType="String">
|
||||
delete from sur_project_attendance_user where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceUserByParams" parameterType="String">
|
||||
delete from sur_project_attendance_user where CONCAT(app_id,'-',workerId) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceUser">
|
||||
insert into sur_project_attendance_user( id, cfgid, vendors_code, workerId, laborWorkerId, workerCategory, qrCode, name, ethnic, nativePlace, gender, birthDate, phone, degreeName, photo, recentPhoto, groupId, groupName, leader, workTypeCode, workTypeName, specWorkType, hatCode, state, enterDate, exitDate, companyId, companyName, vendorId, teamId, teamName, enterType, other, remark, is_del, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.cfgid}, #{item.vendorsCode}, #{item.workerId}, #{item.laborWorkerId}, #{item.workerCategory}, #{item.qrCode}, #{item.name}, #{item.ethnic}, #{item.nativePlace}, #{item.gender}, #{item.birthDate}, #{item.phone}, #{item.degreeName}, #{item.photo}, #{item.recentPhoto}, #{item.groupId}, #{item.groupName}, #{item.leader}, #{item.workTypeCode}, #{item.workTypeName}, #{item.specWorkType}, #{item.hatCode}, #{item.state}, #{item.enterDate}, #{item.exitDate}, #{item.companyId}, #{item.companyName}, #{item.vendorId}, #{item.teamId}, #{item.teamName}, #{item.enterType}, #{item.other}, #{item.remark}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<sql id="sqlAttendanceData">
|
||||
(
|
||||
SELECT * FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
|
||||
) ) xx
|
||||
</sql>
|
||||
<select id="queryAttendanceData" parameterType="SurProjectAttendanceCfg" resultMap="SurProjectAttendanceUserResult">
|
||||
select * from (
|
||||
select n.*,m.inTime,m.outTime from (
|
||||
|
||||
SELECT * FROM (
|
||||
SELECT workerId,attendance_time inTime,null outtime FROM sur_project_attendance_data WHERE id IN (
|
||||
SELECT min(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )) X WHERE workerId NOT IN (
|
||||
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId
|
||||
)
|
||||
|
||||
union
|
||||
|
||||
select * from (
|
||||
select workerId,null inTime,attendance_time outTime from sur_project_attendance_data where id in (
|
||||
select max(id) id from <include refid="sqlAttendanceData"/> where attendance_type='l' group by workerId )) x where workerId not in (
|
||||
SELECT workerId FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId
|
||||
)
|
||||
|
||||
union
|
||||
|
||||
select x.workerId,y.attendance_time inTime,x.attendance_time outTime from (
|
||||
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
|
||||
SELECT MAX(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='l' GROUP BY workerId )
|
||||
) x cross join (
|
||||
|
||||
SELECT id,workerId,attendance_time FROM sur_project_attendance_data WHERE id IN (
|
||||
SELECT MIN(id) id FROM <include refid="sqlAttendanceData"/> WHERE attendance_type='e' GROUP BY workerId )
|
||||
) y on x.workerId=y.workerId
|
||||
|
||||
) m left join sur_project_attendance_user n on m.workerId=n.workerId
|
||||
) oo
|
||||
</select>
|
||||
|
||||
<select id="countAttendance" resultType="Long" parameterType="SurProjectAttendanceCfg">
|
||||
select count(1) cnt from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{deptId}
|
||||
) group by workerid
|
||||
)
|
||||
</select>
|
||||
<select id="queryAttendanceByUserIds" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data
|
||||
where DATE(attendance_time)=date(#{createBy})
|
||||
<if test="workerIds !=null and workerIds.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="workerIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by workerid,attendance_type
|
||||
</select>
|
||||
<select id="queryAttendanceUsers" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
|
||||
select u.* from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=date(#{createBy}) AND cfgid IN (
|
||||
SELECT id FROM sur_project_attendance_cfg WHERE project_id=#{projectId} AND sub_dept_id=#{subDeptId}
|
||||
) group by workerid
|
||||
)
|
||||
order by u.id limit #{index},#{size}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countTodayAttendance" resultType="Long" parameterType="QuartzProjectAttendanceUser">
|
||||
select count(1) cnt from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||
)
|
||||
<if test="id==1">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="todayAttendanceOld" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
select a.* ,
|
||||
(select min(attendance_time) from sur_project_attendance_data b where b.workerId=a.workerId and date(b.attendance_time)=CURDATE() and b.attendance_type='e') inTime,
|
||||
(SELECT Max(attendance_time) FROM sur_project_attendance_data b WHERE b.workerId=a.workerId AND DATE(b.attendance_time)=CURDATE() AND b.attendance_type='l') outTime
|
||||
from (
|
||||
select u.* from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE()
|
||||
)
|
||||
|
||||
<if test="id==1">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by u.id limit #{index},#{size} ) a
|
||||
</select>
|
||||
<select id="todayAttendance" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
|
||||
select u.* from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
|
||||
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId
|
||||
and u.workerid in(
|
||||
SELECT workerid FROM sur_project_attendance_data WHERE DATE(attendance_time)=CURDATE() group by workerid
|
||||
)
|
||||
|
||||
<if test="id==1">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==2">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="id==8">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and c.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and c.project_id in (SELECT id FROM sur_project WHERE deptid=#{deptId})
|
||||
</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and c.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
order by u.id limit #{index},#{size}
|
||||
</select>
|
||||
<select id="todayAttendanceData" parameterType="java.util.List" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,attendance_type name,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where DATE(attendance_time)=CURDATE()
|
||||
<if test="list !=null and list.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by workerid,attendance_type
|
||||
</select>
|
||||
|
||||
<select id="todayAttendanceOtherData" parameterType="map" resultMap="SurProjectAttendanceUserResult">
|
||||
select workerid,min(attendance_time) inTime,max(attendance_time) outTime from sur_project_attendance_data where cfgid=#{cfgid} and DATE(attendance_time)=#{date}
|
||||
<if test="list !=null and list.size()>0">
|
||||
and workerid in
|
||||
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by workerid
|
||||
</select>
|
||||
|
||||
<select id="queryWorkerOnDuty" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
||||
WHERE u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
||||
<if test="id==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="id==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.deptId=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="attendanceUserList" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName,g.companyTypeId
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
||||
WHERE u.cfgid=b.id and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
||||
<if test="companyTypeId==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="companyTypeId==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="companyTypeId==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="id != null"> and u.id = #{id}</if>
|
||||
<if test="state != null "> and u.state = #{state}</if>
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="groupByWorkerOnDutyByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
|
||||
where u.cfgid=b.id and u.state=0 and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
|
||||
and p.isDel=0
|
||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and p.deptId=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by p.projectName,c.dept_name,g.companyTypeId,p.id
|
||||
order by p.id
|
||||
</select>
|
||||
|
||||
<select id="groupUserByParams" parameterType="QuartzProjectAttendanceUser" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
group by g.companyTypeId
|
||||
UNION ALL
|
||||
select '2' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=1
|
||||
<if test="name != null and name != ''"> and u.name like concat('%', #{name}, '%')</if>
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="findUserAllByDays" parameterType="Long" resultType="Map">
|
||||
select '1' as type,g.companyTypeId,count(1) as total
|
||||
from sur_project_attendance_user u
|
||||
left join view_sur_project_attendance_group g on g.cfgid = u.cfgid and u.companyId=g.companyId
|
||||
where u.cfgid in (select cfg.id from sur_project_attendance_cfg cfg where cfg.project_id=#{projectId} and cfg.is_del=0)
|
||||
and g.companyTypeId in (0,1,2,3,4,5,6,8)
|
||||
and u.state=0
|
||||
group by g.companyTypeId
|
||||
</select>
|
||||
|
||||
<select id="groupByWorkerByDept" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT p.id, p.projectName NAME,c.dept_name groupName,g.companyTypeId companyId,COUNT(1) cfgid
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project p,sys_dept c
|
||||
where u.cfgid=b.id and u.state= #{state} and u.companyId=g.companyId and b.project_id=p.id and c.dept_id=b.sub_dept_id
|
||||
and p.isDel=0
|
||||
and g.companyTypeId in (1,6,0,2,3,4,5,8)
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and p.deptId=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and p.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by p.projectName,c.dept_name,g.companyTypeId,p.id
|
||||
order by p.id
|
||||
</select>
|
||||
|
||||
<select id="queryWorkerByState" parameterType="QuartzProjectAttendanceUser" resultMap="SurProjectAttendanceUserResult">
|
||||
SELECT u.id,u.cfgid,u.app_id,u.vendors_code,u.workerId,u.laborWorkerId,u.workerCategory,u.qrCode,u.name,
|
||||
u.ethnic,u.nativePlace,u.gender,u.birthDate,u.phone,u.photo,u.recentPhoto,
|
||||
u.groupId,u.leader,u.workTypeCode,u.specWorkType,
|
||||
u.hatCode,u.state,u.enterDate,u.exitDate,u.companyId,u.vendorId,
|
||||
u.teamId,u.teamName,u.enterType,u.is_del,u.create_by,u.create_time,u.update_by,u.update_time,
|
||||
b.project_id,b.sub_dept_id,u.companyName,u.workTypeName,u.groupName,
|
||||
b.project_id,b.sub_dept_id, g.teamname remark,g.companyName degreeName
|
||||
FROM sur_project_attendance_user u,sur_project_attendance_cfg b,view_sur_project_attendance_group g,sur_project sp
|
||||
WHERE u.cfgid=b.id and u.state=#{state} and u.companyId=g.companyId and sp.isDel=0 and b.project_id = sp.id
|
||||
<if test="id==101">
|
||||
and g.companyTypeId in (1,6)
|
||||
</if>
|
||||
<if test="id==102">
|
||||
and g.companyTypeId =8
|
||||
</if>
|
||||
<if test="id==103">
|
||||
and g.companyTypeId in (0,2,3,4,5)
|
||||
</if>
|
||||
<if test="projectId!=null and projectId>0">
|
||||
and b.project_id=#{projectId}
|
||||
</if>
|
||||
<if test="deptId!=null and deptId>0">
|
||||
and sp.deptId=#{deptId}
|
||||
</if>
|
||||
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and b.project_id in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,117 @@
|
|||
<?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.yanzhu.job.mapper.SysApplyConfigMapper">
|
||||
|
||||
<resultMap type="SysApplyConfig" id="SysApplyConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cfgType" column="cfg_type" />
|
||||
<result property="cfgId" column="cfg_id" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="publicKey" column="public_key" />
|
||||
<result property="privateKey" column="private_key" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="deptName" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysApplyConfigVo">
|
||||
select sac.id, sac.cfg_type, sac.cfg_id, sac.app_id, sac.public_key, sac.private_key, sac.project_id, sp.projectName, sac.dept_id, sd.dept_name as deptName, sac.is_del, sac.create_by, sac.create_time, sac.update_by, sac.update_time, sac.remark from sys_apply_config sac
|
||||
left join sur_project sp on sac.project_id = sp.id
|
||||
left join sys_dept sd on sac.dept_id = sd.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysApplyConfigList" parameterType="SysApplyConfig" resultMap="SysApplyConfigResult">
|
||||
<include refid="selectSysApplyConfigVo"/>
|
||||
<where>
|
||||
<if test="cfgId != null "> and sac.cfg_id = #{cfgId}</if>
|
||||
<if test="cfgType != null "> and sac.cfg_type = #{cfgType}</if>
|
||||
<if test="appId != null "> and sac.app_id like concat('%', #{appId}, '%')</if>
|
||||
<if test="projectName != null "> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
||||
<if test="deptName != null "> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="isDel != null and isDel != ''"> and sac.is_del = #{isDel}</if>
|
||||
</where>
|
||||
order by sac.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysApplyConfigById" parameterType="Long" resultMap="SysApplyConfigResult">
|
||||
<include refid="selectSysApplyConfigVo"/>
|
||||
where sac.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysApplyConfig" parameterType="SysApplyConfig">
|
||||
insert into sys_apply_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="cfgType != null">cfg_type,</if>
|
||||
<if test="cfgId != null">cfg_id,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="publicKey != null">public_key,</if>
|
||||
<if test="privateKey != null">private_key,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="cfgType != null">#{cfgType},</if>
|
||||
<if test="cfgId != null">#{cfgId},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="publicKey != null">#{publicKey},</if>
|
||||
<if test="privateKey != null">#{privateKey},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysApplyConfig" parameterType="SysApplyConfig">
|
||||
update sys_apply_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgType != null">cfg_type = #{cfgType},</if>
|
||||
<if test="cfgId != null">cfg_id = #{cfgId},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="publicKey != null">public_key = #{publicKey},</if>
|
||||
<if test="privateKey != null">private_key = #{privateKey},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysApplyConfigById" parameterType="Long">
|
||||
delete from sys_apply_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysApplyConfigByIds" parameterType="String">
|
||||
delete from sys_apply_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,19 @@
|
|||
<?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.yanzhu.job.mapper.SysNativeMapper">
|
||||
|
||||
<resultMap type="SysNative" id="SysNativeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="address" column="address" />
|
||||
<result property="provinces" column="provinces" />
|
||||
<result property="citiy" column="citiy" />
|
||||
<result property="areas" column="areas" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSysNativeListById" parameterType="Long" resultMap="SysNativeResult">
|
||||
SELECT * FROM sys_native WHERE id=#{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue