修改消息xml的req请求参数

This commit is contained in:
2025-02-27 16:58:57 +08:00
parent 0c36f27726
commit c3b8f5bf89
9 changed files with 75 additions and 17 deletions

View File

@ -56,7 +56,7 @@ public class WgzApplyForPayrollSettlementAddReq implements Serializable {
private BigDecimal recruitAmount; private BigDecimal recruitAmount;
@ApiModelProperty("出勤天数") @ApiModelProperty("出勤天数")
private Long num; private Integer num;
@ApiModelProperty("务工状态") @ApiModelProperty("务工状态")
private String workingState; private String workingState;

View File

@ -163,4 +163,7 @@ public class WgzPayCalculation implements Serializable {
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@ApiModelProperty("结算截止时间(后端用来判断最后一次结算的终止时间)")
private LocalDate cutOffTime;
} }

View File

@ -25,7 +25,7 @@ import java.util.Map;
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) @CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
public interface WgzMessageMapper extends BaseMapperPlus<WgzMessage> { 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获取到招工的信息+附件 // //根据招工id获取到招工的信息+附件
WgzAppRegistrationInformationRes findByRecruitIdData(@Param("recruitId") Long recruitId); WgzAppRegistrationInformationRes findByRecruitIdData(@Param("recruitId") Long recruitId);

View File

@ -128,4 +128,10 @@ public interface IWgzAttendanceService extends IServicePlus<WgzAttendance> {
*/ */
Boolean addAMissingCardRecord (List<WgzAttendance> list); Boolean addAMissingCardRecord (List<WgzAttendance> list);
/**
* 获取对应用户指定天数的工资结算日期
*/
LocalDate findByNumGetDate(Long userId, Long recruitId,Integer num);
} }

View File

@ -10,6 +10,7 @@ import com.ruoyi.bgt.domain.BgtProjectRecruit;
import com.ruoyi.bgt.domain.BgtProjectRecruitApply; import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.bgt.domain.dto.BgtAttendanceDTO; import com.ruoyi.bgt.domain.dto.BgtAttendanceDTO;
import com.ruoyi.bgt.domain.dto.BgtAttendanceDetailDTO; 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.BgtAttendanceCountVO;
import com.ruoyi.bgt.domain.vo.BgtAttendanceDetailVO; import com.ruoyi.bgt.domain.vo.BgtAttendanceDetailVO;
import com.ruoyi.bgt.domain.vo.BgtAttendanceVO; 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.WgzAppPunchTheCalendarRecordThree;
import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordTwo; import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordTwo;
import com.ruoyi.wgz.domain.WgzAttendance; import com.ruoyi.wgz.domain.WgzAttendance;
import com.ruoyi.wgz.domain.WgzPayCalculation;
import com.ruoyi.wgz.domain.WgzUser; import com.ruoyi.wgz.domain.WgzUser;
import com.ruoyi.wgz.mapper.WgzAttendanceMapper; import com.ruoyi.wgz.mapper.WgzAttendanceMapper;
import com.ruoyi.wgz.service.IWgzAttendanceService; import com.ruoyi.wgz.service.IWgzAttendanceService;
@ -666,4 +668,27 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
public Boolean addAMissingCardRecord(List<WgzAttendance> list) { public Boolean addAMissingCardRecord(List<WgzAttendance> list) {
return super.saveBatch(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;
}
} }

View File

@ -157,7 +157,7 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
Page<WgzAppGetMessageListReq> queryDTOPage = new Page<>(); Page<WgzAppGetMessageListReq> queryDTOPage = new Page<>();
queryDTOPage.setCurrent(req.getPageNum()); queryDTOPage.setCurrent(req.getPageNum());
queryDTOPage.setSize(req.getPageSize()); queryDTOPage.setSize(req.getPageSize());
return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage)); return PageUtils.buildDataInfo(baseMapper.userGetMessageList(queryDTOPage,req));
} }

View File

@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
@ -86,6 +87,9 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
@Autowired @Autowired
private IBgtMessageService iBgtMessageService; private IBgtMessageService iBgtMessageService;
@Autowired
private IWgzAttendanceService iWgzAttendanceService;
@Override @Override
public WgzPayCalculation queryById(Long id){ public WgzPayCalculation queryById(Long id){
return getById(id); return getById(id);
@ -171,13 +175,33 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = SecurityUtils.getLoginUser().getUser();
BgtProjectRecruitApply recruitApply = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(user.getUserId()); BgtProjectRecruitApply recruitApply = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(user.getUserId());
BgtProjectRecruit recruit = iBgtProjectRecruitService.getAppById(recruitApply.getId()); 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、组装数据 //2、组装数据
WgzPayCalculation wgzPayCalculation = new WgzPayCalculation(); WgzPayCalculation wgzPayCalculation = new WgzPayCalculation();
BeanUtils.copyProperties(req,wgzPayCalculation); BeanUtils.copyProperties(req,wgzPayCalculation);
wgzPayCalculation. wgzPayCalculation.
setUserId(user.getUserId()). setUserId(user.getUserId()).
setUserName(user.getUserName()). setUserName(user.getUserName()).
setAuditorUserId(recruit.getUserId()); setAuditorUserId(recruit.getUserId()).
setCutOffTime(byNumGetDate);
//3、获取附件信息并插入 //3、获取附件信息并插入
iWgzPayCalculationFilesService.saveBatch(req.getPayCalculation()); iWgzPayCalculationFilesService.saveBatch(req.getPayCalculation());
//4、插入工资结算信息 //4、插入工资结算信息

View File

@ -35,15 +35,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.table_name as tableName, a.table_name as tableName,
a.read_status as readStatus, a.read_status as readStatus,
a.create_time as createTime a.create_time as createTime
<if test="page.largeType == '1'"> <if test="req.largeType == '1'">
,c.recruit_name as recruitName ,c.recruit_name as recruitName
,c.id as recruitId ,c.id as recruitId
</if> </if>
<if test="page.largeType == '2'"> <if test="req.largeType == '2'">
,d.id as jsId ,d.id as jsId
,d.recruit_name as jsName ,d.recruit_name as jsName
</if> </if>
<if test="page.largeType == '3' and page.smallType == '0'"> <if test="req.largeType == '3' and req.smallType == '0'">
,e.id as otherId ,e.id as otherId
,e.now_time as otherFillingTime ,e.now_time as otherFillingTime
,e.reason as otherReason ,e.reason as otherReason
@ -52,41 +52,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
FROM FROM
wgz_message as a 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_apply as b ON b.id = a.table_id
LEFT JOIN bgt_project_recruit as c ON c.id = b.recruit_id LEFT JOIN bgt_project_recruit as c ON c.id = b.recruit_id
</if> </if>
<if test="page.largeType == '2'"> <if test="req.largeType == '2'">
LEFT JOIN wgz_pay_calculation as d ON d.id = a.table_id LEFT JOIN wgz_pay_calculation as d ON d.id = a.table_id
</if> </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_reissueacard as e ON e.id = a.table_id
LEFT JOIN wgz_user as f ON f.id = e.user_id LEFT JOIN wgz_user as f ON f.id = e.user_id
</if> </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_reissueacard as e ON e.id = a.table_id
LEFT JOIN wgz_user as f ON f.id = e.user_id LEFT JOIN wgz_user as f ON f.id = e.user_id
</if> </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_reissueacard as e ON e.id = a.table_id
LEFT JOIN wgz_user as f ON f.id = e.user_id LEFT JOIN wgz_user as f ON f.id = e.user_id
</if> </if>
<where> <where>
a.recipient_type = "1" AND a.recipient_type = "1" AND
a.recipient_id = #{page.recipientId} AND a.recipient_id = #{req.recipientId} AND
a.del_flag = "0" a.del_flag = "0"
<if test="page.largeType == '1'"> <if test="req.largeType == '1'">
AND b.del_flag = "0" AND b.del_flag = "0"
AND c.del_flag = "0" AND c.del_flag = "0"
</if> </if>
<if test="page.largeType == '2'"> <if test="req.largeType == '2'">
AND d.del_flag = "0" AND d.del_flag = "0"
</if> </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 e.del_flag = "0"
AND f.del_flag = "0" AND f.del_flag = "0"
</if> </if>
<if test="page.largeType == '3' and page.smallType == '1'"> <if test="req.largeType == '3' and req.smallType == '1'">
AND a.sender_type = "0" AND a.sender_type = "0"
</if> </if>
</where> </where>

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB