优化
This commit is contained in:
@ -2,15 +2,10 @@ package com.ruoyi.wgz.bo.req;
|
||||
|
||||
import com.ruoyi.common.bo.PageReq;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.wgz.bo.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("已报名项目·项目详情请求对象")
|
||||
public class WgzAppUserCancelRegistrationProjectDetailsReq implements Serializable {
|
||||
@ApiModelProperty("招工主键ID")
|
||||
@NotNull
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("招工申请主键ID")
|
||||
@NotNull
|
||||
private Long recruitApplyId;
|
||||
}
|
||||
@ -101,4 +101,16 @@ public class WgzAppCancelRegistrationProjectDetailsRes implements Serializable {
|
||||
|
||||
@ApiModelProperty("招工地址")
|
||||
private String recruitAddress;
|
||||
|
||||
//-----------
|
||||
//-----------
|
||||
//-----------
|
||||
@ApiModelProperty("是否需要操作(0不需要 1需要 2已操作)")
|
||||
private String isOperation;
|
||||
|
||||
@ApiModelProperty("招工是否正常(0正常 1已招满 2已失效)")
|
||||
private String full;
|
||||
|
||||
@ApiModelProperty("务工者同意拒绝状态:3务工者同意 4务工者拒绝")
|
||||
private String status;
|
||||
}
|
||||
|
||||
@ -68,6 +68,12 @@ public class WgzAppProjectDetailsRes implements Serializable {
|
||||
@ApiModelProperty("联系电话")
|
||||
private String recruitContactPhone;
|
||||
|
||||
@ApiModelProperty("创建者")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("招工状态(1-进行中,2-已招满,3-已过期)")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@ -20,12 +20,9 @@ import java.time.LocalTime;
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("已报名项目返回对象")
|
||||
public class WgzAppRegisteredProjectRes implements Serializable {
|
||||
@ApiModelProperty("招工ID")
|
||||
@ApiModelProperty("招工主键ID")
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("招工ID")
|
||||
// private Long projectId;
|
||||
|
||||
@ApiModelProperty("招工申请ID")
|
||||
private Long recruitApplyId;
|
||||
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("补卡记录·详情")
|
||||
public class WgzAppUserReplacementCardRecordDetailsRes implements Serializable {
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("申请人ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("申请人姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("打卡ID")
|
||||
private Long attendanceId;
|
||||
|
||||
@ApiModelProperty("状态(0上班补卡 1下班补卡)")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String recruitName;
|
||||
|
||||
@ApiModelProperty("原打卡时间")
|
||||
private String rawTime;
|
||||
|
||||
@ApiModelProperty("现补卡时间")
|
||||
private LocalDateTime nowTime;
|
||||
|
||||
@ApiModelProperty("补卡理由")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long auditorUserId;
|
||||
|
||||
@ApiModelProperty("审核人头像")
|
||||
private String auditorHead;
|
||||
|
||||
@ApiModelProperty("审核人名称")
|
||||
private String auditorname;
|
||||
|
||||
@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝)")
|
||||
private String auditorType;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditorOpinion;
|
||||
|
||||
/** 同意|拒绝时间 */
|
||||
@Excel(name = "同意|拒绝时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("同意|拒绝时间")
|
||||
private LocalDateTime auditorTime;
|
||||
|
||||
|
||||
@ApiModelProperty("创建时间|申请时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.wgz.mapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.bgt.domain.dto.BgtReissueacardListDTO;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppReplacementCardRecordReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
@ -28,4 +29,6 @@ public interface WgzReissueacardMapper extends BaseMapperPlus<WgzReissueacard> {
|
||||
|
||||
Page<WgzReplacementCardRecordRes> appQueryPageList(@Param("page") Page<BgtReissueacardListDTO> page,@Param("dto") BgtReissueacardListDTO dto);
|
||||
|
||||
WgzAppUserReplacementCardRecordDetailsRes userReplacementCardRecordDetails(@Param("userId") Long id);
|
||||
|
||||
}
|
||||
|
||||
@ -7,11 +7,14 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.bo.WgzReissueacardQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppCardReplacementApplicationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppReplacementCardRecordReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -87,4 +90,6 @@ public interface IWgzReissueacardService extends IServicePlus<WgzReissueacard> {
|
||||
*/
|
||||
Boolean appUpdate(BgtReissueacardUpdateDTO dto);
|
||||
|
||||
WgzAppUserReplacementCardRecordDetailsRes userReplacementCardRecordDetails(Long id);
|
||||
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.exception.BaseException;
|
||||
import com.ruoyi.common.util.DataUtil;
|
||||
import com.ruoyi.common.util.LocalDateToChineseWeekday;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
@ -333,17 +334,17 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
|
||||
@Override
|
||||
public WgzAppCardReplacementApplicationRes userCardReplacementApplication() {
|
||||
WgzAppCardReplacementApplicationRes wgzAppCardReplacementApplicationRes = new WgzAppCardReplacementApplicationRes();
|
||||
//1、获取当前用户信息
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
//2、获取当前用户所在的工地id
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
//3、根据工地id得到完整的工地信息
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
|
||||
//4、查询所有缺卡、迟到、早退的打卡记录
|
||||
LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
|
||||
eq(WgzAttendance::getUserId, appUserId).
|
||||
eq(WgzAttendance::getRecruitId, by.getId()).
|
||||
eq(WgzAttendance::getRecruitId, by.getId())
|
||||
eq(WgzAttendance::getRecruitId, appById.getId())
|
||||
.and(wrapper -> wrapper
|
||||
.eq(WgzAttendance::getLate, 1)
|
||||
.or()
|
||||
@ -371,7 +372,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
addRecord(wgzAttendance, 4, LocalDateTime.from(appById.getEndWorkTime()), list);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return wgzAppCardReplacementApplicationRes.setList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -587,13 +588,12 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
*/
|
||||
private void addRecord(WgzAttendance wgzAttendance, int type, LocalDateTime fillingDataTime, List<WgzAppCardReplacementApplicationTwo> list) {
|
||||
LocalDate date = wgzAttendance.getDate();
|
||||
DayOfWeek dayOfWeek = date.getDayOfWeek();
|
||||
String week = dayOfWeek.toString();
|
||||
String chineseWeekday = LocalDateToChineseWeekday.getChineseWeekday(date);
|
||||
WgzAppCardReplacementApplicationTwo two = new WgzAppCardReplacementApplicationTwo()
|
||||
.setId(wgzAttendance.getId())
|
||||
.setType(type)
|
||||
.setFillingData(date)
|
||||
.setWeek(week)
|
||||
.setWeek(chineseWeekday)
|
||||
.setFillingDataTime(fillingDataTime);
|
||||
list.add(two);
|
||||
}
|
||||
|
||||
@ -235,10 +235,10 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
|
||||
//使用数据库行级锁
|
||||
int count = baseMapper.countRecruitApply(recruitId);
|
||||
if(count == num){
|
||||
return "1";
|
||||
return "1"; //已招满
|
||||
}
|
||||
if (recruitEndTime.isAfter(LocalDate.now())){
|
||||
return "2";
|
||||
return "2"; //已失效
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.wgz.bo.WgzReissueacardQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppCardReplacementApplicationReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppReplacementCardRecordReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
@ -286,4 +287,9 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
|
||||
wgzMessageService.sendAMessage(wgzMessage);
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgzAppUserReplacementCardRecordDetailsRes userReplacementCardRecordDetails(Long id) {
|
||||
return baseMapper.userReplacementCardRecordDetails(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user