优化
This commit is contained in:
@ -69,8 +69,8 @@ public class AppBgtPayCalculationController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("总体考勤情况-工资结算-基础信息")
|
@ApiOperation("总体考勤情况-工资结算-基础信息")
|
||||||
@GetMapping("/baseInfo")
|
@GetMapping("/baseInfo")
|
||||||
public AjaxResult<BgtPayCalculationDetailBaseVO> baseInfo(Long id, Long recruitId) {
|
public AjaxResult<BgtPayCalculationDetailBaseVO> baseInfo(Long userId, Long recruitId) {
|
||||||
return AjaxResult.success(iWgzPayCalculationService.baseInfo(id,recruitId));
|
return AjaxResult.success(iWgzPayCalculationService.baseInfo(userId,recruitId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("总体考勤情况-工资结算-结算记录")
|
@ApiOperation("总体考勤情况-工资结算-结算记录")
|
||||||
|
@ -8,8 +8,8 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
|
||||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
|
||||||
import com.ruoyi.wgz.service.IWgzReissueacardService;
|
import com.ruoyi.wgz.service.IWgzReissueacardService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@ -19,6 +19,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.DayOfWeek;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补卡申请Controller
|
* 补卡申请Controller
|
||||||
@ -46,9 +48,13 @@ public class AppBgtReissueacardController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("获取补卡申请详细信息")
|
@ApiOperation("获取补卡申请详细信息")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public AjaxResult<WgzReissueacard> getInfo(@NotNull(message = "主键不能为空")
|
public AjaxResult<WgzAppUserReplacementCardRecordDetailsRes> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable("id") Long id) {
|
@PathVariable("id") Long id) {
|
||||||
return AjaxResult.success(iWgzReissueacardService.queryById(id));
|
WgzAppUserReplacementCardRecordDetailsRes res = iWgzReissueacardService.userReplacementCardRecordDetails(id);
|
||||||
|
DayOfWeek dayOfWeek = res.getNowTime().getDayOfWeek();
|
||||||
|
String localizedWeekday = dayOfWeek.getDisplayName(java.time.format.TextStyle.FULL, Locale.CHINA);
|
||||||
|
res.setWeekday(localizedWeekday);
|
||||||
|
return AjaxResult.success(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("补卡审核")
|
@ApiOperation("补卡审核")
|
||||||
|
@ -9,6 +9,7 @@ import com.ruoyi.bgt.bo.BgtMessageQueryBo;
|
|||||||
import com.ruoyi.bgt.domain.BgtMessage;
|
import com.ruoyi.bgt.domain.BgtMessage;
|
||||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||||
|
import com.ruoyi.bgt.domain.BgtWageApplication;
|
||||||
import com.ruoyi.bgt.domain.dto.BgtMessageDetailDTO;
|
import com.ruoyi.bgt.domain.dto.BgtMessageDetailDTO;
|
||||||
import com.ruoyi.bgt.domain.dto.BgtMessageMyListDTO;
|
import com.ruoyi.bgt.domain.dto.BgtMessageMyListDTO;
|
||||||
import com.ruoyi.bgt.domain.vo.BgtMessageCountVO;
|
import com.ruoyi.bgt.domain.vo.BgtMessageCountVO;
|
||||||
@ -18,6 +19,7 @@ import com.ruoyi.bgt.mapper.BgtMessageMapper;
|
|||||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||||
|
import com.ruoyi.bgt.service.IBgtWageApplicationService;
|
||||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BgtMessageType;
|
import com.ruoyi.common.enums.BgtMessageType;
|
||||||
@ -76,6 +78,9 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWgzDailyClockService dailyClockService;
|
private IWgzDailyClockService dailyClockService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBgtWageApplicationService wageApplicationService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BgtMessage queryById(Long id) {
|
public BgtMessage queryById(Long id) {
|
||||||
return getById(id);
|
return getById(id);
|
||||||
@ -201,7 +206,8 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
|||||||
FbsProjectTask task = taskService.getById(message.getTableId());
|
FbsProjectTask task = taskService.getById(message.getTableId());
|
||||||
bgtMessageDetailVO.setTaskName(task.getTaskName());
|
bgtMessageDetailVO.setTaskName(task.getTaskName());
|
||||||
} else if (BGT_LARGE_SETTLEMENT.equals(message.getMessageLargeType())) {
|
} else if (BGT_LARGE_SETTLEMENT.equals(message.getMessageLargeType())) {
|
||||||
FbsProjectTask task = taskService.getById(message.getTableId());
|
BgtWageApplication wageApplication = wageApplicationService.getById(message.getTableId());
|
||||||
|
FbsProjectTask task = taskService.getById(wageApplication.getTaskId());
|
||||||
bgtMessageDetailVO.setTaskName(task.getTaskName());
|
bgtMessageDetailVO.setTaskName(task.getTaskName());
|
||||||
} else if (BGT_LARGE_OTHER.equals(message.getMessageLargeType())) {
|
} else if (BGT_LARGE_OTHER.equals(message.getMessageLargeType())) {
|
||||||
switch (message.getMessageSmallType()) {
|
switch (message.getMessageSmallType()) {
|
||||||
@ -218,27 +224,27 @@ public class BgtMessageServiceImpl extends ServicePlusImpl<BgtMessageMapper, Bgt
|
|||||||
case BGT_SMALL_LEAVE:
|
case BGT_SMALL_LEAVE:
|
||||||
WgzLeave wgzLeave = leaveService.getById(message.getTableId());
|
WgzLeave wgzLeave = leaveService.getById(message.getTableId());
|
||||||
bgtMessageDetailVO.setReason(wgzLeave.getReason());
|
bgtMessageDetailVO.setReason(wgzLeave.getReason());
|
||||||
bgtMessageDetailVO.setUsername(wgzUserService.getById(wgzLeave.getUserId()).getUsername());
|
bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(wgzLeave.getUserId()).getUsername());
|
||||||
bgtMessageDetailVO.setStartTime(wgzLeave.getStartTime());
|
bgtMessageDetailVO.setStartTime(wgzLeave.getStartTime());
|
||||||
bgtMessageDetailVO.setEndTime(wgzLeave.getEndTime());
|
bgtMessageDetailVO.setEndTime(wgzLeave.getEndTime());
|
||||||
break;
|
break;
|
||||||
case BGT_SMALL_MAKE_UP:
|
case BGT_SMALL_MAKE_UP:
|
||||||
WgzReissueacard reissueCard = reissueacardService.getById(message.getTableId());
|
WgzReissueacard reissueCard = reissueacardService.getById(message.getTableId());
|
||||||
bgtMessageDetailVO.setReason(reissueCard.getReason());
|
bgtMessageDetailVO.setReason(reissueCard.getReason());
|
||||||
bgtMessageDetailVO.setUsername(wgzUserService.getById(reissueCard.getUserId()).getUsername());
|
bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(reissueCard.getUserId()).getUsername());
|
||||||
bgtMessageDetailVO.setNowTime(reissueCard.getNowTime());
|
bgtMessageDetailVO.setNowTime(reissueCard.getNowTime());
|
||||||
break;
|
break;
|
||||||
case BGT_SMALL_REPORT_MAKE_UP:
|
case BGT_SMALL_REPORT_MAKE_UP:
|
||||||
WgzDailyClock dailyClock = dailyClockService.getById(message.getTableId());
|
WgzDailyClock dailyClock = dailyClockService.getById(message.getTableId());
|
||||||
BgtProjectRecruit recruitClock = recruitService.getById(dailyClock.getRecruitId());
|
BgtProjectRecruit recruitClock = recruitService.getById(dailyClock.getRecruitId());
|
||||||
bgtMessageDetailVO.setUsername(wgzUserService.getById(dailyClock.getUserId()).getUsername());
|
bgtMessageDetailVO.setUsername(wgzUserService.findByUserId(dailyClock.getUserId()).getUsername());
|
||||||
bgtMessageDetailVO.setRecruitName(recruitClock.getRecruitName());
|
bgtMessageDetailVO.setRecruitName(recruitClock.getRecruitName());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
bgtMessageVOS.add(bgtMessageDetailVO);
|
|
||||||
}
|
}
|
||||||
|
bgtMessageVOS.add(bgtMessageDetailVO);
|
||||||
}
|
}
|
||||||
bgtMessageVOPage.setRecords(bgtMessageVOS);
|
bgtMessageVOPage.setRecords(bgtMessageVOS);
|
||||||
return PageUtils.buildDataInfo(bgtMessageVOPage);
|
return PageUtils.buildDataInfo(bgtMessageVOPage);
|
||||||
|
@ -102,7 +102,7 @@ public class BgtWageApplicationServiceImpl extends ServicePlusImpl<BgtWageApplic
|
|||||||
.setHeadline(map.get(HEADLINE))
|
.setHeadline(map.get(HEADLINE))
|
||||||
.setSubheading(map.get(SUBHEADING))
|
.setSubheading(map.get(SUBHEADING))
|
||||||
.setTableId(add.getId())
|
.setTableId(add.getId())
|
||||||
.setTableName(SqlHelper.table(FbsProjectTask.class).getTableName())
|
.setTableName(SqlHelper.table(BgtWageApplication.class).getTableName())
|
||||||
.setMessageLargeType(BGT_LARGE_SETTLEMENT);
|
.setMessageLargeType(BGT_LARGE_SETTLEMENT);
|
||||||
bgtMessageService.sendAMessage(bgtMessage);
|
bgtMessageService.sendAMessage(bgtMessage);
|
||||||
return save;
|
return save;
|
||||||
|
@ -28,6 +28,9 @@ public class WgzAppUserReplacementCardRecordDetailsRes implements Serializable {
|
|||||||
@ApiModelProperty("申请人姓名")
|
@ApiModelProperty("申请人姓名")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人头像")
|
||||||
|
private String avatarName;
|
||||||
|
|
||||||
@ApiModelProperty("打卡ID")
|
@ApiModelProperty("打卡ID")
|
||||||
private Long attendanceId;
|
private Long attendanceId;
|
||||||
|
|
||||||
@ -70,4 +73,6 @@ public class WgzAppUserReplacementCardRecordDetailsRes implements Serializable {
|
|||||||
@ApiModelProperty("创建时间|申请时间")
|
@ApiModelProperty("创建时间|申请时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("周几")
|
||||||
|
private String weekday;
|
||||||
}
|
}
|
||||||
|
@ -356,7 +356,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
|||||||
@Override
|
@Override
|
||||||
public BgtPayCalculationDetailBaseVO baseInfo(Long userId, Long recruitId) {
|
public BgtPayCalculationDetailBaseVO baseInfo(Long userId, Long recruitId) {
|
||||||
BgtPayCalculationDetailBaseVO vo = new BgtPayCalculationDetailBaseVO();
|
BgtPayCalculationDetailBaseVO vo = new BgtPayCalculationDetailBaseVO();
|
||||||
WgzUser wgzUser = wgzUserService.getById(userId);
|
WgzUser wgzUser = wgzUserService.findByUserId(userId);
|
||||||
vo.setScore(wgzUser.getScore());
|
vo.setScore(wgzUser.getScore());
|
||||||
vo.setUsername(wgzUser.getUsername());
|
vo.setUsername(wgzUser.getUsername());
|
||||||
vo.setAvatarName(wgzUser.getAvatarName());
|
vo.setAvatarName(wgzUser.getAvatarName());
|
||||||
@ -372,7 +372,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
|||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
vo.setEntryTime(apply.getEntryTime());
|
vo.setEntryTime(apply.getEntryTime());
|
||||||
|
|
||||||
Integer i = attendanceService.attendanceDetail(userId, apply.getId(), null);
|
Integer i = attendanceService.attendanceDetail(userId, recruitId, null);
|
||||||
BigDecimal totalAmount = recruit.getRecruitAmount().multiply(BigDecimal.valueOf(i));
|
BigDecimal totalAmount = recruit.getRecruitAmount().multiply(BigDecimal.valueOf(i));
|
||||||
vo.setAllAmount(totalAmount);
|
vo.setAllAmount(totalAmount);
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
|||||||
BigDecimal multiply = gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum()));
|
BigDecimal multiply = gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum()));
|
||||||
addSum = addSum.add(multiply);
|
addSum = addSum.add(multiply);
|
||||||
}
|
}
|
||||||
vo.setPayAmount(totalAmount);
|
vo.setPayAmount(addSum);
|
||||||
|
|
||||||
vo.setResidueAmount(vo.getAllAmount().subtract(vo.getPayAmount()));
|
vo.setResidueAmount(vo.getAllAmount().subtract(vo.getPayAmount()));
|
||||||
return vo;
|
return vo;
|
||||||
|
@ -109,8 +109,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
wu.avatar_name,
|
wu.avatar_name,
|
||||||
wu.username,
|
wu.username,
|
||||||
wu.type_of_work,
|
wu.type_of_work,
|
||||||
|
wu.identity_card,
|
||||||
bpr.recruit_name,
|
bpr.recruit_name,
|
||||||
fpt.task_name,
|
fpt.task_name,
|
||||||
|
bpra.task_id,
|
||||||
|
bpra.recruit_id,
|
||||||
CASE
|
CASE
|
||||||
WHEN wa.leave_mark_id = 1 THEN '请假'
|
WHEN wa.leave_mark_id = 1 THEN '请假'
|
||||||
WHEN wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0 THEN '正常'
|
WHEN wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0 THEN '正常'
|
||||||
@ -123,12 +126,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
LEFT JOIN wgz_user wu ON bpra.user_id = wu.user_id
|
LEFT JOIN wgz_user wu ON bpra.user_id = wu.user_id
|
||||||
LEFT JOIN wgz_attendance wa ON wa.user_id = wu.user_id AND wa.recruit_id = bpra.recruit_id AND wa.date = #{dto.date}
|
LEFT JOIN wgz_attendance wa ON wa.user_id = wu.user_id AND wa.recruit_id = bpra.recruit_id AND wa.date = #{dto.date}
|
||||||
WHERE bpra.entry_time <= #{dto.date} and ((bpra.leave_time is null and bpra.status = '5')or leave_time>=#{dto.date})
|
WHERE bpra.entry_time <= #{dto.date} and ((bpra.leave_time is null and bpra.status = '5')or leave_time>=#{dto.date})
|
||||||
and bpra.recruit_id IN (SELECT id FROM bgt_project_recruit WHERE task_id = #{dto.taskId})
|
and bpra.task_id = #{dto.taskId}
|
||||||
<if test="dto.attendanceType !=null and dto.attendanceType ==1 ">
|
<if test="dto.attendanceType !=null and dto.attendanceType ==1 ">
|
||||||
and (wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0) and leave_mark_id is null
|
and (wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0) and leave_mark_id is null
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
||||||
(wa.late = 1 or wa.early_leave = 1 or wa.missed_in = 1 or wa.missed_out = 1) and leave_mark_id is null
|
and (wa.late = 1 or wa.early_leave = 1 or wa.missed_in = 1 or wa.missed_out = 1) and leave_mark_id is null
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
||||||
and wa.leave_mark_id = 1
|
and wa.leave_mark_id = 1
|
||||||
|
@ -45,9 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="userReplacementCardRecordDetails" resultType="com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes">
|
<select id="userReplacementCardRecordDetails" resultType="com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes">
|
||||||
SELECT
|
SELECT
|
||||||
a.*,
|
a.*,
|
||||||
b.username,
|
b.username as auditorname,
|
||||||
b.avatar_name,
|
b.avatar_name as auditorHead,
|
||||||
c.username as userName
|
c.username as userName,
|
||||||
|
c.avatar_name
|
||||||
FROM
|
FROM
|
||||||
wgz_reissueacard a
|
wgz_reissueacard a
|
||||||
LEFT JOIN bgt_user b ON (a.auditor_user_id = b.user_id and b.del_flag = 0)
|
LEFT JOIN bgt_user b ON (a.auditor_user_id = b.user_id and b.del_flag = 0)
|
||||||
@ -73,10 +74,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.auditor_user_id = #{dto.auditorUserId}
|
a.auditor_user_id = #{dto.auditorUserId}
|
||||||
and a.recruit_id in (select id from bgt_project_recruit where task_id = #{dto.taskId})
|
and a.recruit_id in (select id from bgt_project_recruit where task_id = #{dto.taskId})
|
||||||
<if test="dto.auditorType != null and dto.auditorType != ''">
|
<if test="dto.auditorType != null and dto.auditorType != ''">
|
||||||
and w.auditor_type = #{dto.auditorType}
|
and a.auditor_type = #{dto.auditorType}
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.nowTime != null">
|
<if test="dto.nowTime != null">
|
||||||
and w.now_time = #{dto.nowTime}
|
and date(a.create_time) = #{dto.nowTime}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
a.id DESC
|
a.id DESC
|
||||||
|
Reference in New Issue
Block a user