修改消息xml的req请求参数
This commit is contained in:
@ -56,7 +56,7 @@ public class WgzApplyForPayrollSettlementAddReq implements Serializable {
|
||||
private BigDecimal recruitAmount;
|
||||
|
||||
@ApiModelProperty("出勤天数")
|
||||
private Long num;
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty("务工状态")
|
||||
private String workingState;
|
||||
|
@ -163,4 +163,7 @@ public class WgzPayCalculation implements Serializable {
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@ApiModelProperty("结算截止时间(后端用来判断最后一次结算的终止时间)")
|
||||
private LocalDate cutOffTime;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import java.util.Map;
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzMessageMapper extends BaseMapperPlus<WgzMessage> {
|
||||
|
||||
Page<WgzAppGetMessageListRes> userGetMessageList(@Param("page") Page<WgzAppGetMessageListReq> page);
|
||||
Page<WgzAppGetMessageListRes> userGetMessageList(@Param("page") Page<WgzAppGetMessageListReq> page,@Param("req") WgzAppGetMessageListReq req);
|
||||
|
||||
// //根据招工id获取到招工的信息+附件
|
||||
WgzAppRegistrationInformationRes findByRecruitIdData(@Param("recruitId") Long recruitId);
|
||||
|
@ -128,4 +128,10 @@ public interface IWgzAttendanceService extends IServicePlus<WgzAttendance> {
|
||||
*/
|
||||
Boolean addAMissingCardRecord (List<WgzAttendance> list);
|
||||
|
||||
|
||||
/**
|
||||
* 获取对应用户指定天数的工资结算日期
|
||||
*/
|
||||
LocalDate findByNumGetDate(Long userId, Long recruitId,Integer num);
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ 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;
|
||||
@ -33,6 +34,7 @@ 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;
|
||||
@ -666,4 +668,27 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
public Boolean addAMissingCardRecord(List<WgzAttendance> list) {
|
||||
return super.saveBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应用户指定天数的工资结算日期
|
||||
* @param userId
|
||||
* @param recruitId
|
||||
* @param num 结算天数
|
||||
* @return
|
||||
*/
|
||||
public LocalDate findByNumGetDate(Long userId, Long recruitId,Integer num) {
|
||||
LambdaQueryWrapper<WgzAttendance> wra = new LambdaQueryWrapper<>();
|
||||
wra.eq(WgzAttendance::getRecruitId, recruitId);
|
||||
wra.eq(WgzAttendance::getUserId, userId);
|
||||
wra.orderByAsc(WgzAttendance::getDate);
|
||||
// 使用 last 方法添加 limit 语句
|
||||
// 注意:num - 1 是因为 SQL 中的 limit 偏移量从 0 开始
|
||||
wra.last("LIMIT " + (num - 1) + ", 1");
|
||||
|
||||
WgzAttendance attendance = baseMapper.selectOne(wra);
|
||||
if (attendance != null) {
|
||||
return attendance.getDate();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
|
||||
Page<WgzAppGetMessageListReq> queryDTOPage = new Page<>();
|
||||
queryDTOPage.setCurrent(req.getPageNum());
|
||||
queryDTOPage.setSize(req.getPageSize());
|
||||
return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage));
|
||||
return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage,req));
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@ -86,6 +87,9 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
@Autowired
|
||||
private IBgtMessageService iBgtMessageService;
|
||||
|
||||
@Autowired
|
||||
private IWgzAttendanceService iWgzAttendanceService;
|
||||
|
||||
@Override
|
||||
public WgzPayCalculation queryById(Long id){
|
||||
return getById(id);
|
||||
@ -171,13 +175,33 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
BgtProjectRecruitApply recruitApply = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(user.getUserId());
|
||||
BgtProjectRecruit recruit = iBgtProjectRecruitService.getAppById(recruitApply.getId());
|
||||
// //2、结算数据之前,需要先获取以往结算的数据,然后得到剩余结算天数,再从剩余天数重新进行数据结算
|
||||
// //2.1、获取以往结算的数据
|
||||
// WgzPayCalculation wgzts = baseMapper.selectOne(Wrappers.<WgzPayCalculation>lambdaQuery().
|
||||
// eq(WgzPayCalculation::getUserId, user.getUserId()).
|
||||
// eq(WgzPayCalculation::getRecruitId, recruitApply.getId()).
|
||||
// orderByDesc(WgzPayCalculation::getCreateTime).
|
||||
// last("LIMIT 1")
|
||||
// );
|
||||
// if (wgzts != null) {
|
||||
// LocalDate cutOffTime = wgzts.getCutOffTime();
|
||||
// Integer num = iWgzAttendanceService.attendanceDetail(user.getUserId(), recruitApply.getRecruitId(), null);
|
||||
// }
|
||||
|
||||
//2、获取当前人一共考勤打卡了多少天,然后计算当前结算的天数得到具体是考勤打卡对应的哪一天
|
||||
Integer num = iWgzAttendanceService.attendanceDetail(user.getUserId(), recruitApply.getRecruitId(), null);
|
||||
if (num < req.getNum()) {
|
||||
throw new RuntimeException("你的剩余考勤天数不满足你当前想要结算的天数!");
|
||||
}
|
||||
LocalDate byNumGetDate = iWgzAttendanceService.findByNumGetDate(user.getUserId(), recruitApply.getRecruitId(), req.getNum());
|
||||
//2、组装数据
|
||||
WgzPayCalculation wgzPayCalculation = new WgzPayCalculation();
|
||||
BeanUtils.copyProperties(req,wgzPayCalculation);
|
||||
wgzPayCalculation.
|
||||
setUserId(user.getUserId()).
|
||||
setUserName(user.getUserName()).
|
||||
setAuditorUserId(recruit.getUserId());
|
||||
setAuditorUserId(recruit.getUserId()).
|
||||
setCutOffTime(byNumGetDate);
|
||||
//3、获取附件信息并插入
|
||||
iWgzPayCalculationFilesService.saveBatch(req.getPayCalculation());
|
||||
//4、插入工资结算信息
|
||||
|
@ -35,15 +35,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.table_name as tableName,
|
||||
a.read_status as readStatus,
|
||||
a.create_time as createTime
|
||||
<if test="page.largeType == '1'">
|
||||
<if test="req.largeType == '1'">
|
||||
,c.recruit_name as recruitName
|
||||
,c.id as recruitId
|
||||
</if>
|
||||
<if test="page.largeType == '2'">
|
||||
<if test="req.largeType == '2'">
|
||||
,d.id as jsId
|
||||
,d.recruit_name as jsName
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '0'">
|
||||
<if test="req.largeType == '3' and req.smallType == '0'">
|
||||
,e.id as otherId
|
||||
,e.now_time as otherFillingTime
|
||||
,e.reason as otherReason
|
||||
@ -52,41 +52,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
FROM
|
||||
wgz_message as a
|
||||
<if test="page.largeType == '1'">
|
||||
<if test="req.largeType == '1'">
|
||||
LEFT JOIN bgt_project_recruit_apply as b ON b.id = a.table_id
|
||||
LEFT JOIN bgt_project_recruit as c ON c.id = b.recruit_id
|
||||
</if>
|
||||
<if test="page.largeType == '2'">
|
||||
<if test="req.largeType == '2'">
|
||||
LEFT JOIN wgz_pay_calculation as d ON d.id = a.table_id
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '0'">
|
||||
<if test="req.largeType == '3' and req.smallType == '0'">
|
||||
LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id
|
||||
LEFT JOIN wgz_user as f ON f.id = e.user_id
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '1'">
|
||||
<if test="req.largeType == '3' and req.smallType == '1'">
|
||||
LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id
|
||||
LEFT JOIN wgz_user as f ON f.id = e.user_id
|
||||
</if>
|
||||
<if test="page.largeType == '3'">
|
||||
<if test="req.largeType == '3'">
|
||||
LEFT JOIN wgz_reissueacard as e ON e.id = a.table_id
|
||||
LEFT JOIN wgz_user as f ON f.id = e.user_id
|
||||
</if>
|
||||
<where>
|
||||
a.recipient_type = "1" AND
|
||||
a.recipient_id = #{page.recipientId} AND
|
||||
a.recipient_id = #{req.recipientId} AND
|
||||
a.del_flag = "0"
|
||||
<if test="page.largeType == '1'">
|
||||
<if test="req.largeType == '1'">
|
||||
AND b.del_flag = "0"
|
||||
AND c.del_flag = "0"
|
||||
</if>
|
||||
<if test="page.largeType == '2'">
|
||||
<if test="req.largeType == '2'">
|
||||
AND d.del_flag = "0"
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '0'">
|
||||
<if test="req.largeType == '3' and req.smallType == '0'">
|
||||
AND e.del_flag = "0"
|
||||
AND f.del_flag = "0"
|
||||
</if>
|
||||
<if test="page.largeType == '3' and page.smallType == '1'">
|
||||
<if test="req.largeType == '3' and req.smallType == '1'">
|
||||
AND a.sender_type = "0"
|
||||
</if>
|
||||
</where>
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 538 KiB |
Reference in New Issue
Block a user