api加解密,金额字段类型
This commit is contained in:
@ -48,7 +48,8 @@ public class AppBgtProjectRecruitApplyController extends BaseController {
|
||||
*
|
||||
*/
|
||||
@ApiOperation(value = "App务工者列表(分页)"
|
||||
,notes = "务工者申请列表 状态 为报名-未选择(0)和通过-已选择(1)")
|
||||
,notes = "务工者申请列表 状态 为报名-未选择(0)和通过-已选择(1) " +
|
||||
"总体考勤情况-进退场 状态为 进场(5)和退场(6) ")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BgtProjectRecruitApplyVO> listPage(@Validated BgtProjectRecruitApplyQueryDTO dto) {
|
||||
return iBgtProjectRecruitApplyService.appQueryPageList(dto);
|
||||
@ -83,10 +84,10 @@ public class AppBgtProjectRecruitApplyController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("人员出勤情况")
|
||||
@ApiOperation("总体考勤情况-人员出勤情况")
|
||||
@GetMapping("/todayAttendanceList")
|
||||
public AjaxResult<List<BgtProjectRecruitApplyVO>> todayAttendanceList(@Validated BgtAttendanceDayDTO req) {
|
||||
return AjaxResult.success(iBgtProjectRecruitApplyService.todayAttendanceList(req));
|
||||
public TableDataInfo<BgtProjectRecruitApplyVO> todayAttendanceList(@Validated BgtAttendanceDayDTO req) {
|
||||
return iBgtProjectRecruitApplyService.dayAttendanceList(req);
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,4 +53,16 @@ public class AppBgtUserController extends BaseController {
|
||||
return AjaxResult.success(iBgtUserService.queryById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改后台管理包工头
|
||||
*/
|
||||
@ApiOperation("修改后台管理包工头")
|
||||
@Log(title = "后台管理包工头", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping("/edit")
|
||||
public AjaxResult<Boolean> edit(@Validated @RequestBody BgtUser bo) {
|
||||
return AjaxResult.success(iBgtUserService.update(bo));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.BgtLoginBody;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.util.DataUtil;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.framework.web.service.AppLoginService;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
@ -38,7 +39,7 @@ import java.util.Map;
|
||||
@Api(value = "App登录验证", tags = {"App登录验证"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
public class AppLoginController
|
||||
public class AppLoginController
|
||||
{
|
||||
@Autowired
|
||||
private AppLoginService loginService;
|
||||
@ -95,6 +96,7 @@ public class AppLoginController
|
||||
switch (userType){
|
||||
case Constants.BGT:
|
||||
BgtUser bgtUser = iBgtUserService.selectUserByPhone(user.getPhonenumber());
|
||||
bgtUser.setAge(DataUtil.calculateAge(bgtUser.getBirthdate()));
|
||||
ajax.put("user", bgtUser);
|
||||
break;
|
||||
case Constants.WGZ:
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.web.controller.common;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
public class TestController {
|
||||
|
||||
@PostMapping("/test")
|
||||
public String test(@RequestBody String data) {
|
||||
System.out.println(data);
|
||||
return "Received: " + data;
|
||||
}
|
||||
|
||||
@GetMapping("/testGet")
|
||||
public String testGet(String data,Long taskId) {
|
||||
System.out.println("data:"+data);
|
||||
System.out.println("taskId:"+taskId);
|
||||
return "Received GET data: " + data;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -323,3 +323,12 @@ management:
|
||||
endpoint:
|
||||
logfile:
|
||||
external-file: ./logs/sys-console.log
|
||||
|
||||
|
||||
aes:
|
||||
enabled: false
|
||||
secret-key: gwk0ghayjw7vnmru
|
||||
exclude-paths:
|
||||
- /ruoyi/actuator/**
|
||||
- /ruoyi/system/**
|
||||
- /ruoyi/admin/**
|
||||
|
@ -151,4 +151,8 @@ public class BgtUser implements Serializable {
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("年龄")
|
||||
@TableField(exist = false)
|
||||
private Integer age;
|
||||
|
||||
}
|
||||
|
@ -67,6 +67,17 @@
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -101,7 +101,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||
// 过滤请求
|
||||
.authorizeRequests()
|
||||
// 对于登录login 验证码captchaImage 允许匿名访问
|
||||
.antMatchers("/login", "/app/login", "/captchaImage","/demo/tress/all").anonymous()
|
||||
.antMatchers("/login", "/app/login", "/captchaImage","/demo/tress/all","/test","/testGet").anonymous()
|
||||
.antMatchers("/app/login","/wgz/app/wgzRegister").permitAll()
|
||||
.antMatchers(
|
||||
HttpMethod.GET,
|
||||
|
@ -0,0 +1,49 @@
|
||||
package com.ruoyi.framework.encrypt;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class AESUtil {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AESUtil.class);
|
||||
private static final String ALGORITHM = "AES";
|
||||
private static final String TRANSFORMATION = "AES/ECB/PKCS5Padding";
|
||||
|
||||
public static String encrypt(String data, String key) {
|
||||
try {
|
||||
logger.info("AES加密开始,加密内容:{}", data);
|
||||
logger.info("AES加密开始,加密密钥:{}", key);
|
||||
Cipher cipher = Cipher.getInstance(TRANSFORMATION);
|
||||
SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), ALGORITHM);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
|
||||
byte[] encryptedBytes = cipher.doFinal(data.getBytes(StandardCharsets.UTF_8));
|
||||
return Base64.encodeBase64String(encryptedBytes);
|
||||
} catch (Exception e) {
|
||||
logger.error("Encryption error: ", e);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public static String decrypt(String encryptedData, String key) {
|
||||
try {
|
||||
logger.info("AES解密开始,解密内容:{}", encryptedData);
|
||||
logger.info("AES解密开始,解密密钥:{}", key);
|
||||
Cipher cipher = Cipher.getInstance(TRANSFORMATION);
|
||||
SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), ALGORITHM);
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
|
||||
byte[] decryptedBytes = cipher.doFinal(Base64.decodeBase64(encryptedData));
|
||||
return new String(decryptedBytes, StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
logger.error("Decryption error: ", e);
|
||||
return encryptedData;
|
||||
}
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
System.out.println(RandomUtil.randomString(16));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.framework.encrypt;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "aes")
|
||||
@Data
|
||||
public class AesConfig {
|
||||
private boolean enabled;
|
||||
private String secretKey;
|
||||
private List<String> excludePaths;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.ruoyi.framework.encrypt;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class DecryptRequestWrapper extends HttpServletRequestWrapper {
|
||||
private final String decryptedBody;
|
||||
|
||||
public DecryptRequestWrapper(HttpServletRequest request, String decryptedBody) {
|
||||
super(request);
|
||||
this.decryptedBody = decryptedBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletInputStream getInputStream() throws IOException {
|
||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(decryptedBody.getBytes(StandardCharsets.UTF_8));
|
||||
return new ServletInputStream() {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return byteArrayInputStream.available() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
return byteArrayInputStream.read();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getReader() throws IOException {
|
||||
return new BufferedReader(new InputStreamReader(this.getInputStream(), StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package com.ruoyi.framework.encrypt;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class EncryptDecryptFilter implements Filter {
|
||||
private static final Logger logger = LoggerFactory.getLogger(EncryptDecryptFilter.class);
|
||||
@Autowired
|
||||
private AesConfig aesConfig;
|
||||
|
||||
private final AntPathMatcher pathMatcher = new AntPathMatcher();
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
if (!aesConfig.isEnabled()) {
|
||||
logger.info("Encryption/Decryption is disabled. Skipping.");
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
HttpServletRequest httpRequest = (HttpServletRequest) request;
|
||||
HttpServletResponse httpResponse = (HttpServletResponse) response;
|
||||
|
||||
if (isExcludedPath(httpRequest.getRequestURI())) {
|
||||
logger.info("Request URI {} is excluded. Skipping encryption/decryption.", httpRequest.getRequestURI());
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
if ("GET".equalsIgnoreCase(httpRequest.getMethod())) {
|
||||
Map<String, String[]> parameterMap = new HashMap<>(httpRequest.getParameterMap());
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
String[] values = entry.getValue();
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
logger.info("Received encoded parameter: {}", values[i]);
|
||||
String decodedValue = URLDecoder.decode(values[i], StandardCharsets.UTF_8.name());
|
||||
decodedValue = decodedValue.replace(" ", "+");
|
||||
logger.info("Decoded parameter: {}", decodedValue);
|
||||
values[i] = decryptRequestBody(decodedValue);
|
||||
}
|
||||
}
|
||||
HttpServletRequestWrapper requestWrapper = new CustomHttpServletRequestWrapper(httpRequest, parameterMap);
|
||||
EncryptResponseWrapper responseWrapper = new EncryptResponseWrapper(httpResponse);
|
||||
chain.doFilter(requestWrapper, responseWrapper);
|
||||
byte[] content = responseWrapper.getContent();
|
||||
String responseBody = new String(content, responseWrapper.getCharacterEncoding());
|
||||
String encryptedResponse = encryptResponseBody(responseBody);
|
||||
httpResponse.setContentLength(encryptedResponse.getBytes().length);
|
||||
httpResponse.getOutputStream().write(encryptedResponse.getBytes());
|
||||
} else {
|
||||
String requestBody = IOUtils.toString(httpRequest.getInputStream(), httpRequest.getCharacterEncoding());
|
||||
logger.info("Received request body: {}", requestBody);
|
||||
String decryptedBody = decryptRequestBody(requestBody);
|
||||
logger.info("Decrypted request body: {}", decryptedBody);
|
||||
DecryptRequestWrapper requestWrapper = new DecryptRequestWrapper(httpRequest, decryptedBody);
|
||||
|
||||
EncryptResponseWrapper responseWrapper = new EncryptResponseWrapper(httpResponse);
|
||||
|
||||
chain.doFilter(requestWrapper, responseWrapper);
|
||||
|
||||
byte[] content = responseWrapper.getContent();
|
||||
String responseBody = new String(content, responseWrapper.getCharacterEncoding());
|
||||
logger.info("Received response body: {}", responseBody);
|
||||
String encryptedResponse = encryptResponseBody(responseBody);
|
||||
logger.info("Encrypted response body: {}", encryptedResponse);
|
||||
httpResponse.setContentLength(encryptedResponse.getBytes().length);
|
||||
httpResponse.getOutputStream().write(encryptedResponse.getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isExcludedPath(String path) {
|
||||
for (String pattern : aesConfig.getExcludePaths()) {
|
||||
if (pathMatcher.match(pattern, path)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String decryptRequestBody(String requestBody) {
|
||||
try {
|
||||
return AESUtil.decrypt(requestBody, aesConfig.getSecretKey());
|
||||
} catch (Exception e) {
|
||||
logger.error("Decryption error: ", e);
|
||||
return requestBody;
|
||||
}
|
||||
}
|
||||
|
||||
private String encryptResponseBody(String responseBody) {
|
||||
try {
|
||||
return AESUtil.encrypt(responseBody, aesConfig.getSecretKey());
|
||||
} catch (Exception e) {
|
||||
logger.error("Encryption error: ", e);
|
||||
return responseBody;
|
||||
}
|
||||
}
|
||||
|
||||
private static class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
private final Map<String, String[]> parameterMap;
|
||||
|
||||
public CustomHttpServletRequestWrapper(HttpServletRequest request, Map<String, String[]> parameterMap) {
|
||||
super(request);
|
||||
this.parameterMap = parameterMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String name) {
|
||||
String[] values = parameterMap.get(name);
|
||||
return values != null && values.length > 0 ? values[0] : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
return parameterMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getParameterNames() {
|
||||
return Collections.enumeration(parameterMap.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
return parameterMap.get(name);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.framework.encrypt;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class EncryptFilterConfig {
|
||||
private static final Logger logger = LoggerFactory.getLogger(EncryptFilterConfig.class);
|
||||
|
||||
@Autowired
|
||||
private EncryptDecryptFilter encryptDecryptFilter;
|
||||
|
||||
public EncryptFilterConfig() {
|
||||
logger.info("FilterConfig initialized");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean<EncryptDecryptFilter> encryptDecryptFilterRegistration() {
|
||||
logger.info("Registering encryptDecryptFilter");
|
||||
FilterRegistrationBean<EncryptDecryptFilter> registration = new FilterRegistrationBean<>();
|
||||
registration.setFilter(encryptDecryptFilter);
|
||||
registration.addUrlPatterns("/*");
|
||||
registration.setName("encryptDecryptFilter");
|
||||
registration.setOrder(1);
|
||||
return registration;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.framework.encrypt;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.WriteListener;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletResponseWrapper;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
public class EncryptResponseWrapper extends HttpServletResponseWrapper {
|
||||
private final ByteArrayOutputStream outputStream;
|
||||
private ServletOutputStream servletOutputStream;
|
||||
private PrintWriter writer;
|
||||
|
||||
public EncryptResponseWrapper(HttpServletResponse response) {
|
||||
super(response);
|
||||
outputStream = new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletOutputStream getOutputStream() throws IOException {
|
||||
if (servletOutputStream == null) {
|
||||
servletOutputStream = new ServletOutputStream() {
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWriteListener(WriteListener writeListener) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
outputStream.write(b);
|
||||
}
|
||||
};
|
||||
}
|
||||
return servletOutputStream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrintWriter getWriter() throws IOException {
|
||||
if (writer == null) {
|
||||
writer = new PrintWriter(new OutputStreamWriter(outputStream, getCharacterEncoding()));
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
public byte[] getContent() throws IOException {
|
||||
if (writer != null) {
|
||||
writer.flush();
|
||||
} else if (servletOutputStream != null) {
|
||||
servletOutputStream.flush();
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
}
|
@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 包工头招工分页查询对象 bgt_project_recruit
|
||||
*
|
||||
@ -52,7 +54,7 @@ public class BgtProjectRecruitQueryBo extends BaseEntity {
|
||||
private String recruitAddress;
|
||||
/** 招工金额 */
|
||||
@ApiModelProperty("招工金额")
|
||||
private Integer recruitAmount;
|
||||
private BigDecimal recruitAmount;
|
||||
/** 招工数量 */
|
||||
@ApiModelProperty("招工数量")
|
||||
private Integer recruitStaffNum;
|
||||
|
@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 包工头工资申请分页查询对象 bgt_wage_application
|
||||
*
|
||||
@ -49,7 +51,7 @@ public class BgtWageApplicationQueryBo extends BaseEntity {
|
||||
private Long userId;
|
||||
/** 申请金额 */
|
||||
@ApiModelProperty("申请金额")
|
||||
private Integer applicantAmount;
|
||||
private BigDecimal applicantAmount;
|
||||
/** 用工情况 */
|
||||
@ApiModelProperty("用工情况")
|
||||
private String employmentSituation;
|
||||
|
@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@ -89,7 +90,7 @@ public class BgtWageApplication implements Serializable {
|
||||
/** 申请金额 */
|
||||
@Excel(name = "申请金额")
|
||||
@ApiModelProperty("申请金额")
|
||||
private Integer applicantAmount;
|
||||
private BigDecimal applicantAmount;
|
||||
|
||||
/** 用工情况 */
|
||||
@Excel(name = "用工情况")
|
||||
|
@ -16,6 +16,11 @@ import java.time.LocalDate;
|
||||
@ApiModel("App包工头总体考勤查询对象")
|
||||
public class BgtAttendanceDayDTO {
|
||||
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
|
@ -11,7 +11,7 @@ import java.util.List;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("App包工头总体考勤视图对象")
|
||||
@ApiModel("App包工头总体考勤统计视图对象")
|
||||
public class BgtAttendanceVO {
|
||||
|
||||
@ApiModelProperty("任务ID")
|
||||
@ -38,6 +38,9 @@ public class BgtAttendanceVO {
|
||||
@ApiModelProperty("外勤人数")
|
||||
private Integer outDutyNum = 0;
|
||||
|
||||
@ApiModelProperty("早退人数")
|
||||
private Integer earlyLeaveNum = 0;
|
||||
|
||||
@ApiModelProperty("考勤列表")
|
||||
List<BgtAttendanceCountVO> countVOs;
|
||||
|
||||
|
@ -62,5 +62,7 @@ public class BgtProjectRecruitApplyVO implements Serializable {
|
||||
@ApiModelProperty("0报名 1包工同意 2包工头拒绝(截止时间)3务工者同意 4务工者拒绝 5进场 6离场")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("打卡状态")
|
||||
private String attendanceStatus;
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
@ -58,7 +59,7 @@ public class BgtProjectRecruitDetailVO implements Serializable {
|
||||
private String recruitAddress;
|
||||
|
||||
@ApiModelProperty("招工金额")
|
||||
private Integer recruitAmount;
|
||||
private BigDecimal recruitAmount;
|
||||
|
||||
@ApiModelProperty("招工数量")
|
||||
private Integer recruitStaffNum;
|
||||
|
@ -8,6 +8,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -39,7 +40,7 @@ public class BgtProjectRecruitVO implements Serializable {
|
||||
private String recruitAddress;
|
||||
|
||||
@ApiModelProperty("招工金额")
|
||||
private Integer recruitAmount;
|
||||
private BigDecimal recruitAmount;
|
||||
|
||||
@ApiModelProperty("招工数量")
|
||||
private Integer recruitStaffNum;
|
||||
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@ -38,7 +39,7 @@ public class BgtWageApplicationDetailVO {
|
||||
private Integer taskStaffNum;
|
||||
|
||||
@ApiModelProperty("申请金额")
|
||||
private Integer applicantAmount;
|
||||
private BigDecimal applicantAmount;
|
||||
|
||||
@ApiModelProperty("申请人")
|
||||
private String username;
|
||||
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 包工头工资申请分页查询对象 bgt_wage_application
|
||||
*
|
||||
@ -26,7 +28,7 @@ public class BgtWageApplicationListVO {
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("申请金额")
|
||||
private Integer applicantAmount;
|
||||
private BigDecimal applicantAmount;
|
||||
|
||||
@ApiModelProperty("审核状态(1审核中 2已审核 3未审核)")
|
||||
private String auditStatus;
|
||||
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@ -32,7 +33,7 @@ public class BgtWageApplicationVO {
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty("申请金额")
|
||||
private Integer applicantAmount;
|
||||
private BigDecimal applicantAmount;
|
||||
|
||||
@ApiModelProperty("申请时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -28,7 +28,7 @@ public interface BgtProjectRecruitApplyMapper extends BaseMapperPlus<BgtProjectR
|
||||
|
||||
List<BgtProjectRecruitApplyVO> appQueryList(@Param("dto") BgtProjectRecruitApplyQueryDTO dto);
|
||||
|
||||
List<BgtProjectRecruitApplyVO> todayAttendanceList(@Param("dto") BgtAttendanceDayDTO dto);
|
||||
Page<BgtProjectRecruitApplyVO> dayAttendanceList(@Param("page")Page<BgtAttendanceDayDTO> queryDTOPage,@Param("dto") BgtAttendanceDayDTO dto);
|
||||
|
||||
// 获取指定项目下的所有成员(分页)
|
||||
Page<WgzAppUnderwayRes> underwayPage (@Param("page") Page<WgzAppUnderwayReq> page,@Param("req") WgzAppUnderwayReq req);
|
||||
|
@ -98,7 +98,7 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
|
||||
/**
|
||||
* 指定日期打卡记录
|
||||
*/
|
||||
List<BgtProjectRecruitApplyVO> todayAttendanceList(BgtAttendanceDayDTO dto);
|
||||
TableDataInfo<BgtProjectRecruitApplyVO> dayAttendanceList(BgtAttendanceDayDTO dto);
|
||||
|
||||
/**
|
||||
* 退场
|
||||
|
@ -305,8 +305,12 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<BgtProjectRecruitApplyVO> todayAttendanceList(BgtAttendanceDayDTO dto) {
|
||||
return baseMapper.todayAttendanceList(dto);
|
||||
public TableDataInfo<BgtProjectRecruitApplyVO> dayAttendanceList(BgtAttendanceDayDTO dto) {
|
||||
Page<BgtAttendanceDayDTO> queryDTOPage = new Page<>();
|
||||
queryDTOPage.setCurrent(dto.getPageNum());
|
||||
queryDTOPage.setSize(dto.getPageSize());
|
||||
Page<BgtProjectRecruitApplyVO> queryVOPage = baseMapper.dayAttendanceList(queryDTOPage, dto);
|
||||
return PageUtils.buildDataInfo(queryVOPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bgt.domain.vo.BgtAttendanceCountVO;
|
||||
|
||||
import java.time.*;
|
||||
@ -95,7 +96,10 @@ public class DataUtil {
|
||||
/**
|
||||
* 计算年龄
|
||||
*/
|
||||
public static int calculateAge(String birthdate) {
|
||||
public static Integer calculateAge(String birthdate) {
|
||||
if(StrUtil.isBlank(birthdate)){
|
||||
return null;
|
||||
}
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
// 将字符串解析为 LocalDate 对象
|
||||
LocalDate birth = LocalDate.parse(birthdate, dateTimeFormatter);
|
||||
|
@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 分包商项目任务分页查询对象 fbs_project_task
|
||||
*
|
||||
@ -49,7 +51,7 @@ public class FbsProjectTaskQueryBo extends BaseEntity {
|
||||
private String taskAddress;
|
||||
/** 任务金额 */
|
||||
@ApiModelProperty("任务金额")
|
||||
private Integer taskAmount;
|
||||
private BigDecimal taskAmount;
|
||||
/** 用工数量 */
|
||||
@ApiModelProperty("用工数量")
|
||||
private Integer taskStaffNum;
|
||||
|
@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@ -59,7 +60,7 @@ public class FbsProjectTask implements Serializable {
|
||||
/** 任务金额 */
|
||||
@Excel(name = "任务金额")
|
||||
@ApiModelProperty("任务金额")
|
||||
private Integer taskAmount;
|
||||
private BigDecimal taskAmount;
|
||||
|
||||
/** 用工数量 */
|
||||
@Excel(name = "用工数量")
|
||||
|
@ -46,7 +46,7 @@ public class AppTaskDetailVO {
|
||||
|
||||
/** 任务金额 */
|
||||
@ApiModelProperty("任务金额")
|
||||
private Integer taskAmount;
|
||||
private BigDecimal taskAmount;
|
||||
|
||||
/** 用工数量 */
|
||||
@ApiModelProperty("用工数量")
|
||||
|
@ -26,6 +26,6 @@ public class AppTaskDetailWageVO {
|
||||
private BgtWageApplicationListVO wageApplication;
|
||||
|
||||
@ApiModelProperty("任务金额")
|
||||
private Integer taskAmount;
|
||||
private BigDecimal taskAmount;
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@ -41,7 +42,7 @@ public class AppTaskVO {
|
||||
private String taskDescribe;
|
||||
/** 任务金额 */
|
||||
@ApiModelProperty("任务金额")
|
||||
private Integer taskAmount;
|
||||
private BigDecimal taskAmount;
|
||||
/** 用工数量 */
|
||||
@ApiModelProperty("用工数量")
|
||||
private Integer taskStaffNum;
|
||||
|
@ -31,7 +31,6 @@ import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
import com.ruoyi.fbs.domain.dto.AppTaskDTO;
|
||||
import com.ruoyi.fbs.domain.vo.*;
|
||||
import com.ruoyi.fbs.mapper.FbsProjectTaskMapper;
|
||||
import com.ruoyi.fbs.service.IFbsProjectTaskApplyService;
|
||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
||||
import com.ruoyi.wgz.service.IWgzAttendanceService;
|
||||
import com.ruoyi.wgz.service.IWgzPayCalculationService;
|
||||
@ -43,7 +42,10 @@ import org.springframework.stereotype.Service;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -58,8 +60,6 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
|
||||
@Autowired
|
||||
private IZbfProjectService zbfProjectService;
|
||||
@Autowired
|
||||
private IFbsProjectTaskApplyService taskApplyService;
|
||||
@Autowired
|
||||
private IBgtProjectRecruitService recruitService;
|
||||
@Autowired
|
||||
private IBgtProjectRecruitApplyService recruitApplyService;
|
||||
@ -182,8 +182,8 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
|
||||
appTaskDetailVO.setWageApplication(CollectionUtil.isEmpty(wageList)?null:wageList.get(0));
|
||||
//收款金额
|
||||
Integer taskReceiveAmount = wageList.stream().filter(wage -> AuditStatus.PASS.getCode().equals(wage.getAuditStatus()))
|
||||
.mapToInt(BgtWageApplicationListVO::getApplicantAmount)
|
||||
.sum();
|
||||
.map(BgtWageApplicationListVO::getApplicantAmount)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).intValue();
|
||||
appTaskDetailVO.setTaskReceiveAmount(taskReceiveAmount);
|
||||
//付款金额
|
||||
BigDecimal payByTaskAndBgt = payCalculationService.getPayByTaskAndBgt(byId.getId(), byId.getUserId());
|
||||
@ -249,8 +249,8 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
|
||||
appTaskDetailVO.setWageApplication(CollectionUtil.isEmpty(wageList)?null:wageList.get(0));
|
||||
//收款金额
|
||||
Integer taskReceiveAmount = wageList.stream().filter(wage -> AuditStatus.PASS.getCode().equals(wage.getAuditStatus()))
|
||||
.mapToInt(BgtWageApplicationListVO::getApplicantAmount)
|
||||
.sum();
|
||||
.map(BgtWageApplicationListVO::getApplicantAmount)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).intValue();
|
||||
appTaskDetailVO.setTaskReceiveAmount(taskReceiveAmount);
|
||||
//付款金额
|
||||
BigDecimal payByTaskAndBgt = payCalculationService.getPayByTaskAndBgt(id, SecurityUtils.getAppUserId());
|
||||
|
@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -31,7 +32,7 @@ public class WgzAppJobListingRes implements Serializable {
|
||||
private String recruitAddress;
|
||||
|
||||
@ApiModelProperty("招工金额")
|
||||
private Long recruitAmount;
|
||||
private BigDecimal recruitAmount;
|
||||
|
||||
@ApiModelProperty("招工数量")
|
||||
private Long recruitStaffNum;
|
||||
|
@ -10,7 +10,6 @@ import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.BgtAttendanceDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtAttendanceDetailDTO;
|
||||
import com.ruoyi.bgt.domain.dto.BgtPayCalculationDetailListVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtAttendanceCountVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtAttendanceDetailVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtAttendanceVO;
|
||||
@ -34,7 +33,6 @@ import com.ruoyi.wgz.bo.rests.WgzAppCardReplacementApplicationTwo;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordThree;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordTwo;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.domain.WgzPayCalculation;
|
||||
import com.ruoyi.wgz.domain.WgzUser;
|
||||
import com.ruoyi.wgz.mapper.WgzAttendanceMapper;
|
||||
import com.ruoyi.wgz.service.IWgzAttendanceService;
|
||||
@ -418,29 +416,33 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
endData = date;
|
||||
|
||||
List<BgtAttendanceCountVO> countVOS = countByTaskId(dto.getTaskId(), startData, endData);
|
||||
bgtAttendanceVO.setCountVOs(DataUtil.fillMissingDates(countVOS, startData, endData));
|
||||
if(CollectionUtil.isNotEmpty(countVOS)){
|
||||
bgtAttendanceVO.setCountVOs(DataUtil.fillMissingDates(countVOS, startData, endData));
|
||||
BgtAttendanceCountVO countVO = countVOS.stream()
|
||||
.filter(vo -> vo.getDate().isEqual(date))
|
||||
.findFirst().orElse(null);
|
||||
bgtAttendanceVO.setReportToDutyNum(countVO.getReportToDutyNum());
|
||||
bgtAttendanceVO.setTotalNum(countVO.getTotalNum());
|
||||
bgtAttendanceVO.setAbsenceDutyNum(countVO.getTotalNum()-countVO.getReportToDutyNum());
|
||||
if (countVO != null) {
|
||||
bgtAttendanceVO.setReportToDutyNum(countVO.getReportToDutyNum());
|
||||
bgtAttendanceVO.setTotalNum(countVO.getTotalNum());
|
||||
bgtAttendanceVO.setAbsenceDutyNum(countVO.getTotalNum()-countVO.getReportToDutyNum());
|
||||
}
|
||||
|
||||
}
|
||||
}else if(dto.getDateType().equals(DateUtils.MONTH)){
|
||||
// 获取本年开始日期
|
||||
startData = date.with(TemporalAdjusters.firstDayOfYear());
|
||||
endData = date.with(TemporalAdjusters.lastDayOfMonth());
|
||||
List<BgtAttendanceCountVO> countVOS = countByTaskId(dto.getTaskId(), startData, endData);
|
||||
if(CollectionUtil.isNotEmpty(countVOS)){
|
||||
bgtAttendanceVO.setCountVOs(DataUtil.statisticsByMonth(countVOS,startData, endData));
|
||||
}
|
||||
bgtAttendanceVO.setCountVOs(DataUtil.statisticsByMonth(countVOS,startData, endData));
|
||||
BgtAttendanceCountVO countVO = countVOS.stream()
|
||||
.filter(vo -> YearMonth.from(vo.getDate()).equals(YearMonth.from(date)))
|
||||
.findFirst().orElse(null);
|
||||
bgtAttendanceVO.setReportToDutyNum(countVO.getReportToDutyNum());
|
||||
bgtAttendanceVO.setTotalNum(countVO.getTotalNum());
|
||||
bgtAttendanceVO.setAbsenceDutyNum(countVO.getAbsenceDutyNum());
|
||||
if (countVO != null) {
|
||||
bgtAttendanceVO.setReportToDutyNum(countVO.getReportToDutyNum());
|
||||
bgtAttendanceVO.setTotalNum(countVO.getTotalNum());
|
||||
bgtAttendanceVO.setAbsenceDutyNum(countVO.getAbsenceDutyNum());
|
||||
}
|
||||
|
||||
}
|
||||
getLateAndLeave(bgtAttendanceVO, startData, endData);
|
||||
return bgtAttendanceVO;
|
||||
@ -450,12 +452,14 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
List<BgtProjectRecruit> bgtProjectRecruits = iBgtProjectRecruitService.getBaseMapper().selectList(Wrappers.<BgtProjectRecruit>lambdaQuery()
|
||||
.eq(BgtProjectRecruit::getTaskId, vo.getTaskId()));
|
||||
List<Long> recruitIds = bgtProjectRecruits.stream().map(BgtProjectRecruit::getId).collect(Collectors.toList());
|
||||
Integer late = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().eq(WgzAttendance::getLate, 1)
|
||||
.in(WgzAttendance::getRecruitId, recruitIds).between(WgzAttendance::getDate, startDate, endDate));
|
||||
Integer leave = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().isNotNull(WgzAttendance::getLeaveMarkId)
|
||||
.in(WgzAttendance::getRecruitId, recruitIds).between(WgzAttendance::getDate, startDate, endDate));
|
||||
vo.setLateNum(late);
|
||||
vo.setLeaveNum(leave);
|
||||
if(CollectionUtil.isNotEmpty(recruitIds)){
|
||||
Integer late = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().eq(WgzAttendance::getLate, 1)
|
||||
.in(WgzAttendance::getRecruitId, recruitIds).between(WgzAttendance::getDate, startDate, endDate));
|
||||
Integer leave = baseMapper.selectCount(Wrappers.<WgzAttendance>lambdaQuery().isNotNull(WgzAttendance::getLeaveMarkId)
|
||||
.in(WgzAttendance::getRecruitId, recruitIds).between(WgzAttendance::getDate, startDate, endDate));
|
||||
vo.setLateNum(late);
|
||||
vo.setLeaveNum(leave);
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 总包方项目分包分页查询对象 zbf_project_subcontracting
|
||||
*
|
||||
@ -46,7 +48,7 @@ public class ZbfProjectSubcontractingQueryBo extends BaseEntity {
|
||||
private String subDescribe;
|
||||
/** 分包金额 */
|
||||
@ApiModelProperty("分包金额")
|
||||
private Integer subAmount;
|
||||
private BigDecimal subAmount;
|
||||
/** 资质要求 */
|
||||
@ApiModelProperty("资质要求")
|
||||
private String qualification;
|
||||
|
@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@ -54,7 +55,7 @@ public class ZbfProjectSubcontracting implements Serializable {
|
||||
/** 分包金额 */
|
||||
@Excel(name = "分包金额")
|
||||
@ApiModelProperty("分包金额")
|
||||
private Integer subAmount;
|
||||
private BigDecimal subAmount;
|
||||
|
||||
/** 资质要求 */
|
||||
@Excel(name = "资质要求")
|
||||
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by bpra.create_time desc,bpra.status asc
|
||||
</select>
|
||||
|
||||
<select id="todayAttendanceList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
||||
<select id="dayAttendanceList" resultType="com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO">
|
||||
select bpra.id,
|
||||
bpra.entry_time,
|
||||
wu.user_id,
|
||||
@ -63,7 +63,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wu.username,
|
||||
wu.type_of_work,
|
||||
bpr.recruit_name,
|
||||
fpt.task_name
|
||||
fpt.task_name,
|
||||
CASE
|
||||
WHEN wa.leave_mark_id is not null THEN '请假'
|
||||
WHEN wa.late =1 THEN '迟到'
|
||||
WHEN wa.early_leave =1 THEN '早退'
|
||||
WHEN wa.missed_in = 0 OR wa.missed_out = 0 THEN '出勤'
|
||||
WHEN wa.missed_in =1 and missed_out = 1 THEN '缺勤'
|
||||
ELSE '未知状态'
|
||||
END AS attendance_status
|
||||
from wgz_attendance wa
|
||||
left join wgz_user wu on wa.user_id = wu.user_id
|
||||
left join bgt_project_recruit_apply bpra on wa.recruit_id = bpra.recruit_id and bpra.user_id = wa.user_id
|
||||
@ -71,10 +79,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join fbs_project_task fpt on fpt.id = bpr.task_id
|
||||
where wa.date = #{dto.date}
|
||||
<if test="dto.attendanceType !=null and dto.attendanceType ==1 ">
|
||||
and (wa.missed_in =0 or missed_out = 0 )
|
||||
and (wa.missed_in =0 or wa.missed_out = 0 )
|
||||
</if>
|
||||
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
||||
and (wa.missed_in =1 and missed_out = 1 )
|
||||
and (wa.missed_in =1 and wa.missed_out = 1)
|
||||
</if>
|
||||
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
||||
and wa.late =1
|
||||
|
Reference in New Issue
Block a user