diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java index 0f51d82..61f3494 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java @@ -9,6 +9,7 @@ import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; import com.ruoyi.bgt.service.IBgtProjectRecruitService; import com.ruoyi.common.bo.AnnexQueryBo; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.domain.Annex; @@ -21,6 +22,7 @@ import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperTwo; import com.ruoyi.wgz.bo.rests.WgzAutonymAnnex; import com.ruoyi.wgz.bo.req.*; import com.ruoyi.wgz.domain.WgzDailyClock; +import com.ruoyi.wgz.domain.WgzPayCalculation; import com.ruoyi.wgz.domain.WgzQuestionsConfiguration; import com.ruoyi.wgz.service.*; import io.swagger.annotations.Api; @@ -90,6 +92,9 @@ public class WgzAppController { @Autowired private IWgzReissueacardService iWgzReissueacardService; + @Autowired + private IWgzPayCalculationService iWgzPayCalculationService; + /** * 【注册】务工者注册 @@ -370,30 +375,46 @@ public class WgzAppController { } /** - * 【首页】【项目进行中】 项目进行中·申请工资结算(查询) + * 【首页】【项目进行中】 项目进行中·详情 */ - @ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(查询)") - @PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementFind')") - @GetMapping("/WgzAppUserApplyForPayrollSettlementFind") - public AjaxResult userApplyForPayrollSettlementFind(@Validated WgzApplyForPayrollSettlementFindReq req) { + @ApiOperation("【首页】【项目进行中】 项目进行中·详情") + @PreAuthorize("@ss.hasPermi('wgzApp:user:userProjectInProgressDetails')") + @GetMapping("/WgzAppUserProjectInProgressDetails/{id}") + public AjaxResult userProjectInProgressDetails(@NotNull(message = "主键不能为空") @PathVariable("id") Long id) { + WgzApplyForPayrollSettlementAddRes res = new WgzApplyForPayrollSettlementAddRes(); Long appUserId = SecurityUtils.getAppUserId(); BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId); BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId()); - //1、查询入场时间、退场时间、单天金额 + //1、先获取项目详情基本信息 + WgzAppProjectDetailsRes wgzAppProjectDetailsRes = iBgtProjectRecruitService.userProjectDetails(id); + BeanUtils.copyProperties(wgzAppProjectDetailsRes, res); + //2、获取当前人员的打卡天数*单天金额=实际总工资金额 BigDecimal recruitAmount = appById.getRecruitAmount(); - //2、查询实际考勤时间(只要有打卡就算出勤一条,异常也视为正常出勤,也就是说只要有上班or下班至少有一个有数据,那就证明出勤ok) - Integer i = iWgzAttendanceService.attendanceDetail(appUserId, appById.getId(), 1); - if (i == 0){ - throw new RuntimeException("您还未打卡"); + //查询实际考勤时间(只要有打卡就算出勤一条,异常也视为正常出勤,也就是说只要有上班or下班至少有一个有数据,那就证明出勤ok) + Integer i = iWgzAttendanceService.attendanceDetail(appUserId, appById.getId(), null); + if (i==0){ + res.setNum(0); + res.setTotalAmount(BigDecimal.valueOf(0)); + }else{ + BigDecimal totalAmount = recruitAmount.multiply(BigDecimal.valueOf(i)); + res.setNum(i); + res.setTotalAmount(totalAmount); } - //3、单天金额*实际考勤总天数=实际工资 - BigDecimal totalAmount = recruitAmount.multiply(BigDecimal.valueOf(i)); - WgzApplyForPayrollSettlementFindRes res = new WgzApplyForPayrollSettlementFindRes(). - setEntryTime(by.getEntryTime()). + res.setEntryTime(by.getEntryTime()). setLeaveTime(by.getLeaveTime()). - setAmount(recruitAmount). - setNum(i). - setTotalAmount(totalAmount); + setAmount(recruitAmount); + //3、查询当前进行中的项目是否有工资结算 + WgzPayCalculation gz = iWgzPayCalculationService.findByUserIdRecruitIdNewestData(appUserId, appById.getId()); + if (gz != null){ + //金额*天数=实际工资 + res.setAppliedAmount(gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum()))); + res.setNameOfApplicant(gz.getUserName()); + } + if(i!=0){ + //总的金额/结算的金额=百分比 + BigDecimal divide = res.getTotalAmount().divide(res.getAmount(), 2, BigDecimal.ROUND_HALF_UP); + res.setPercentage(divide.doubleValue()); + } return AjaxResult.success(res); } @@ -402,12 +423,25 @@ public class WgzAppController { */ @ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(新增)") @PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementAdd')") - @GetMapping("/WgzAppUserApplyForPayrollSettlementAdd") - public AjaxResult userApplyForPayrollSettlementAdd(@Validated WgzApplyForPayrollSettlementFindReq req) { - - return null; + @PostMapping("/WgzAppUserApplyForPayrollSettlementAdd") + public AjaxResult userApplyForPayrollSettlementAdd(@Validated @RequestBody WgzApplyForPayrollSettlementAddReq req) { + return AjaxResult.success(iWgzPayCalculationService.userApplyForPayrollSettlementAdd(req)); } + /** + * 【首页】【项目进行中】 项目进行中·申请工资结算(列表) + */ + @ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(列表)") + @PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementList')") + @GetMapping("/WgzAppUserApplyForPayrollSettlementList") + public TableDataInfo userApplyForPayrollSettlementList(@Validated WgzAppApplyForPayrollSettlementListReq req) { + return iWgzPayCalculationService.userApplyForPayrollSettlementList(req); + } + + + + + /** * 通用接口 @@ -422,7 +456,7 @@ public class WgzAppController { * 【我的】【签协议】协议列表 1-劳动合同 */ - @ApiOperation("通用·附件获取") + @ApiOperation("通用·附件获取(仅限和务工者直接关联的)") @PreAuthorize("@ss.hasPermi('wgzApp:user:userAttachmentAcquisition')") @GetMapping("/wgzUserAttachmentAcquisition") public AjaxResult userAttachmentAcquisition(@Validated WgzAppAttachmentAcquisitionReq req) { @@ -504,9 +538,9 @@ public class WgzAppController { return section; } - // /** -// * 【我的】【实名认证】实名认证·删除附件 -// */ + /** + * 【我的】【实名认证】实名认证·删除附件 + */ // @ApiOperation("APP务工者-实名认证·删除附件") // @PreAuthorize("@ss.hasPermi('wgzApp:user:userDeleteAttachment')") // @DeleteMapping("/WgzUserDeleteAttachment/{attachmentId}") @@ -515,4 +549,32 @@ public class WgzAppController { // } + /** + * 【首页】【项目进行中】 项目进行中·申请工资结算(查询) + */ +// @ApiOperation("【首页】【项目进行中】 项目进行中·申请工资结算(查询)") +// @PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementFind')") +// @GetMapping("/WgzAppUserApplyForPayrollSettlementFind") +// public AjaxResult userApplyForPayrollSettlementFind(@Validated WgzApplyForPayrollSettlementFindReq req) { +// Long appUserId = SecurityUtils.getAppUserId(); +// BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId); +// BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId()); +// //1、查询入场时间、退场时间、单天金额 +// BigDecimal recruitAmount = appById.getRecruitAmount(); +// //2、查询实际考勤时间(只要有打卡就算出勤一条,异常也视为正常出勤,也就是说只要有上班or下班至少有一个有数据,那就证明出勤ok) +// Integer i = iWgzAttendanceService.attendanceDetail(appUserId, appById.getId(), req.getNum()); +// if (i == 0){ +// throw new RuntimeException("您还未打卡"); +// } +// //3、单天金额*实际考勤总天数=实际工资 +// BigDecimal totalAmount = recruitAmount.multiply(BigDecimal.valueOf(i)); +// WgzApplyForPayrollSettlementFindRes res = new WgzApplyForPayrollSettlementFindRes(). +// setEntryTime(by.getEntryTime()). +// setLeaveTime(by.getLeaveTime()). +// setAmount(recruitAmount). +// setNum(i). +// setTotalAmount(totalAmount); +// return AjaxResult.success(res); +// } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzPayCalculationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzPayCalculationController.java new file mode 100644 index 0000000..d6e1e2b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzPayCalculationController.java @@ -0,0 +1,108 @@ +package com.ruoyi.web.controller.wgz.controller; + +import java.util.List; +import java.util.Arrays; + +import com.ruoyi.wgz.domain.WgzPayCalculation; +import lombok.RequiredArgsConstructor; +import javax.validation.constraints.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.wgz.bo.WgzPayCalculationQueryBo; +import com.ruoyi.wgz.service.IWgzPayCalculationService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +/** + * 工资结算Controller + * + * @author ruoyi + * @date 2025-02-21 + */ +@Api(value = "工资结算控制器", tags = {"工资结算管理"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/wgz/calculation") +public class WgzPayCalculationController extends BaseController { + + private final IWgzPayCalculationService iWgzPayCalculationService; + + /** + * 查询工资结算列表 + */ + @ApiOperation("查询工资结算列表") + @PreAuthorize("@ss.hasPermi('wgz:calculation:list')") + @GetMapping("/list") + public TableDataInfo list(@Validated WgzPayCalculationQueryBo bo) { + return iWgzPayCalculationService.queryPageList(bo); + } + + /** + * 导出工资结算列表 + */ + @ApiOperation("导出工资结算列表") + @PreAuthorize("@ss.hasPermi('wgz:calculation:export')") + @Log(title = "工资结算", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(@Validated WgzPayCalculationQueryBo bo) { + List list = iWgzPayCalculationService.queryList(bo); + ExcelUtil util = new ExcelUtil(WgzPayCalculation.class); + return util.exportExcel(list, "工资结算"); + } + + /** + * 获取工资结算详细信息 + */ + @ApiOperation("获取工资结算详细信息") + @PreAuthorize("@ss.hasPermi('wgz:calculation:query')") + @GetMapping("/{id}") + public AjaxResult getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return AjaxResult.success(iWgzPayCalculationService.queryById(id)); + } + + /** + * 新增工资结算 + */ + @ApiOperation("新增工资结算") + @PreAuthorize("@ss.hasPermi('wgz:calculation:add')") + @Log(title = "工资结算", businessType = BusinessType.INSERT) + @RepeatSubmit + @PostMapping() + public AjaxResult add(@Validated @RequestBody WgzPayCalculation bo) { + return toAjax(iWgzPayCalculationService.insert(bo) ? 1 : 0); + } + + /** + * 修改工资结算 + */ + @ApiOperation("修改工资结算") + @PreAuthorize("@ss.hasPermi('wgz:calculation:edit')") + @Log(title = "工资结算", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public AjaxResult edit(@Validated @RequestBody WgzPayCalculation bo) { + return toAjax(iWgzPayCalculationService.update(bo) ? 1 : 0); + } + + /** + * 删除工资结算 + */ + @ApiOperation("删除工资结算") + @PreAuthorize("@ss.hasPermi('wgz:calculation:remove')") + @Log(title = "工资结算" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(iWgzPayCalculationService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzPayCalculationFilesController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzPayCalculationFilesController.java new file mode 100644 index 0000000..f5c2226 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzPayCalculationFilesController.java @@ -0,0 +1,108 @@ +package com.ruoyi.web.controller.wgz.controller; + +import java.util.List; +import java.util.Arrays; + +import com.ruoyi.wgz.domain.WgzPayCalculationFiles; +import lombok.RequiredArgsConstructor; +import javax.validation.constraints.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.wgz.bo.WgzPayCalculationFilesQueryBo; +import com.ruoyi.wgz.service.IWgzPayCalculationFilesService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +/** + * 工资结算附件Controller + * + * @author ruoyi + * @date 2025-02-22 + */ +@Api(value = "工资结算附件控制器", tags = {"工资结算附件管理"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/wgz/files") +public class WgzPayCalculationFilesController extends BaseController { + + private final IWgzPayCalculationFilesService iWgzPayCalculationFilesService; + + /** + * 查询工资结算附件列表 + */ + @ApiOperation("查询工资结算附件列表") + @PreAuthorize("@ss.hasPermi('wgz:files:list')") + @GetMapping("/list") + public TableDataInfo list(@Validated WgzPayCalculationFilesQueryBo bo) { + return iWgzPayCalculationFilesService.queryPageList(bo); + } + + /** + * 导出工资结算附件列表 + */ + @ApiOperation("导出工资结算附件列表") + @PreAuthorize("@ss.hasPermi('wgz:files:export')") + @Log(title = "工资结算附件", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(@Validated WgzPayCalculationFilesQueryBo bo) { + List list = iWgzPayCalculationFilesService.queryList(bo); + ExcelUtil util = new ExcelUtil(WgzPayCalculationFiles.class); + return util.exportExcel(list, "工资结算附件"); + } + + /** + * 获取工资结算附件详细信息 + */ + @ApiOperation("获取工资结算附件详细信息") + @PreAuthorize("@ss.hasPermi('wgz:files:query')") + @GetMapping("/{id}") + public AjaxResult getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return AjaxResult.success(iWgzPayCalculationFilesService.queryById(id)); + } + + /** + * 新增工资结算附件 + */ + @ApiOperation("新增工资结算附件") + @PreAuthorize("@ss.hasPermi('wgz:files:add')") + @Log(title = "工资结算附件", businessType = BusinessType.INSERT) + @RepeatSubmit + @PostMapping() + public AjaxResult add(@Validated @RequestBody WgzPayCalculationFiles bo) { + return toAjax(iWgzPayCalculationFilesService.insert(bo) ? 1 : 0); + } + + /** + * 修改工资结算附件 + */ + @ApiOperation("修改工资结算附件") + @PreAuthorize("@ss.hasPermi('wgz:files:edit')") + @Log(title = "工资结算附件", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PutMapping() + public AjaxResult edit(@Validated @RequestBody WgzPayCalculationFiles bo) { + return toAjax(iWgzPayCalculationFilesService.update(bo) ? 1 : 0); + } + + /** + * 删除工资结算附件 + */ + @ApiOperation("删除工资结算附件") + @PreAuthorize("@ss.hasPermi('wgz:files:remove')") + @Log(title = "工资结算附件" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(iWgzPayCalculationFilesService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java index 09fd575..486edff 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java @@ -88,7 +88,8 @@ public interface IBgtProjectRecruitService extends IServicePlus payCalculation; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppApplyForPayrollSettlementListRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppApplyForPayrollSettlementListRes.java new file mode 100644 index 0000000..a38091d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppApplyForPayrollSettlementListRes.java @@ -0,0 +1,95 @@ +package com.ruoyi.wgz.bo.res; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.wgz.domain.WgzPayCalculationFiles; +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.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("申请工资结算(列表)返回请求对象") +public class WgzAppApplyForPayrollSettlementListRes implements Serializable { + + @ApiModelProperty("主键自增ID") + private Long id; + + @ApiModelProperty("任务ID") + private Long taskId; + + @ApiModelProperty("招工ID") + private Long recruitId; + + @ApiModelProperty("务工者ID") + private Long userId; + + @ApiModelProperty("任务名称") + private String taskName; + + @ApiModelProperty("任务地址") + private String taskAddress; + + @ApiModelProperty("招工名称") + private String recruitName; + + @ApiModelProperty("申请人名称") + private String userName; + + @ApiModelProperty("进场时间") + private LocalDate entryTime; + + @ApiModelProperty("工资金额") + private BigDecimal recruitAmount; + + @ApiModelProperty("出勤天数") + private Long num; + + @ApiModelProperty("务工状态") + private String workingState; + + @ApiModelProperty("联系电话") + private String phone; + + @ApiModelProperty("银行") + private String bank; + + @ApiModelProperty("银行卡号") + private String cardNo; + + @ApiModelProperty("审核人ID") + private Long auditorUserId; + + @ApiModelProperty("审核状态(0未读 1待审核 2已同意 3已拒绝)") + private String auditorType; + + @ApiModelProperty("审核意见") + private String auditorOpinion; + + @ApiModelProperty("同意|拒绝时间") + private LocalDateTime auditorTime; + + @ApiModelProperty("创建者") + private String createBy; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("附件实体数据") + private List payCalculation; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppProjectInProgressDetailsRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppProjectInProgressDetailsRes.java new file mode 100644 index 0000000..6962640 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzAppProjectInProgressDetailsRes.java @@ -0,0 +1,94 @@ +package com.ruoyi.wgz.bo.res; + +import com.ruoyi.wgz.bo.rests.WgzAppCancelRegistrationProjectDetailsTwo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.List; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("项目进行中·详情返回对象") +public class WgzAppProjectInProgressDetailsRes implements Serializable { + @ApiModelProperty("主键ID") + private Long id; + + @ApiModelProperty("项目ID") + private Long projectId; + + //============== + @ApiModelProperty("封面图(多个逗号分隔)") + private String coverPlan; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("招工名称") + private String recruitName; + + @ApiModelProperty("招工金额") + private BigDecimal recruitAmount; + + @ApiModelProperty("招工数量") + private Integer recruitStaffNum; + + @ApiModelProperty("任务ID") + private Long taskId; + + @ApiModelProperty("任务名称") + private String taskName; + + @ApiModelProperty("任务地址") + private String taskAddress; + + @ApiModelProperty("招工描述") + private String subDescribe; + + @ApiModelProperty("招工开始时间") + private String recruitBeginTime; + + @ApiModelProperty("联系人") + private String recruitContactPerson; + + @ApiModelProperty("联系电话") + private String recruitContactPhone; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("招工要求") + private String recruitRequirement; + + @ApiModelProperty("已报名数量") + private Integer numberOfRegistered; + + @ApiModelProperty("已报名务工者") + private List userList; + + //--------- + //--------- + //--------- + @ApiModelProperty("上班时间") + private LocalTime beginWorkTime; + + @ApiModelProperty("下班时间") + private LocalTime endWorkTime; + + @ApiModelProperty("标段ID") + private Long sectionId; + + @ApiModelProperty("分包ID") + private Long subId; + + @ApiModelProperty("招工地址") + private String recruitAddress; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzApplyForPayrollSettlementAddRes.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzApplyForPayrollSettlementAddRes.java new file mode 100644 index 0000000..8cb85ae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/bo/res/WgzApplyForPayrollSettlementAddRes.java @@ -0,0 +1,118 @@ +package com.ruoyi.wgz.bo.res; + +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.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; + +@Data +@NoArgsConstructor +@Accessors(chain = true) +@ApiModel("申请工资结算(新增)返回对象") +public class WgzApplyForPayrollSettlementAddRes implements Serializable { + @ApiModelProperty("主键ID") + private Long id; + + @ApiModelProperty("项目ID") + private Long projectId; + + //============== + @ApiModelProperty("封面图(多个逗号分隔)") + private String coverPlan; + + @ApiModelProperty("创建时间") + private LocalDateTime createTime; + + @ApiModelProperty("招工名称") + private String recruitName; + + @ApiModelProperty("招工金额") + private BigDecimal recruitAmount; + + @ApiModelProperty("招工数量") + private Integer recruitStaffNum; + + @ApiModelProperty("任务ID") + private Long taskId; + + @ApiModelProperty("任务名称") + private String taskName; + + @ApiModelProperty("任务地址") + private String taskAddress; + + @ApiModelProperty("招工描述") + private String subDescribe; + + @ApiModelProperty("招工开始时间") + private String recruitBeginTime; + + @ApiModelProperty("联系人") + private String recruitContactPerson; + + @ApiModelProperty("联系电话") + private String recruitContactPhone; + + @ApiModelProperty("备注") + private String remark; + + @ApiModelProperty("招工要求") + private String recruitRequirement; + + //--------- + //--------- + //--------- + @ApiModelProperty("上班时间") + private LocalTime beginWorkTime; + + @ApiModelProperty("下班时间") + private LocalTime endWorkTime; + + @ApiModelProperty("标段ID") + private Long sectionId; + + @ApiModelProperty("分包ID") + private Long subId; + + @ApiModelProperty("招工地址") + private String recruitAddress; + + //--------- + //--------- + //--------- + + @ApiModelProperty("进场时间") + private LocalDate entryTime; + + @ApiModelProperty("离场时间") + private LocalDate leaveTime; + + @ApiModelProperty("单天金额") + private BigDecimal amount; + + @ApiModelProperty("出勤天数") + private Integer num; + + @ApiModelProperty("总的金额") + private BigDecimal TotalAmount; + + //--------- + //--------- + //--------- + + @ApiModelProperty("申请金额") + private BigDecimal appliedAmount; + + @ApiModelProperty("申请人名称") + private String nameOfApplicant; + + @ApiModelProperty("百分比") + private Double percentage; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java new file mode 100644 index 0000000..7110ac7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculation.java @@ -0,0 +1,164 @@ +package com.ruoyi.wgz.domain; + +import com.ruoyi.common.annotation.Excel; + +import java.math.BigDecimal; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import java.io.Serializable; +import java.util.Date; +import java.math.BigDecimal; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.LocalDate; + +/** + * 工资结算对象 wgz_pay_calculation + * + * @author ruoyi + * @date 2025-02-21 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +@TableName("wgz_pay_calculation") +@ApiModel("工资结算视图对象") +public class WgzPayCalculation implements Serializable { + + private static final long serialVersionUID=1L; + + /** 主键自增ID */ + @ApiModelProperty("主键自增ID") + @TableId(value = "id") + private Long id; + + /** 任务ID */ + @Excel(name = "任务ID") + @ApiModelProperty("任务ID") + private Long taskId; + + /** 招工ID */ + @Excel(name = "招工ID") + @ApiModelProperty("招工ID") + private Long recruitId; + + /** 务工者ID */ + @Excel(name = "务工者ID") + @ApiModelProperty("务工者ID") + private Long userId; + + /** 任务名称 */ + @Excel(name = "任务名称") + @ApiModelProperty("任务名称") + private String taskName; + + /** 任务地址 */ + @Excel(name = "任务地址") + @ApiModelProperty("任务地址") + private String taskAddress; + + /** 招工名称 */ + @Excel(name = "招工名称") + @ApiModelProperty("招工名称") + private String recruitName; + + /** 申请人名称 */ + @Excel(name = "申请人名称") + @ApiModelProperty("申请人名称") + private String userName; + + /** 进场时间 */ + @Excel(name = "进场时间") + @ApiModelProperty("进场时间") + private LocalDate entryTime; + + /** 工资金额 */ + @Excel(name = "工资金额") + @ApiModelProperty("工资金额") + private BigDecimal recruitAmount; + + /** 出勤天数 */ + @Excel(name = "出勤天数") + @ApiModelProperty("出勤天数") + private Long num; + + /** 务工状态 */ + @Excel(name = "务工状态") + @ApiModelProperty("务工状态") + private String workingState; + + /** 联系电话 */ + @Excel(name = "联系电话") + @ApiModelProperty("联系电话") + private String phone; + + /** 银行 */ + @Excel(name = "银行") + @ApiModelProperty("银行") + private String bank; + + /** 银行卡号 */ + @Excel(name = "银行卡号") + @ApiModelProperty("银行卡号") + private String cardNo; + + /** 审核人ID */ + @Excel(name = "审核人ID") + @ApiModelProperty("审核人ID") + private Long auditorUserId; + + /** 审核状态(0未读 1待审核 2已同意 3已拒绝) */ + @Excel(name = "审核状态" , readConverterExp = "0=未读,1=待审核,2=已同意,3=已拒绝") + @ApiModelProperty("审核状态(0未读 1待审核 2已同意 3已拒绝)") + private String auditorType; + + /** 审核意见 */ + @Excel(name = "审核意见") + @ApiModelProperty("审核意见") + private String auditorOpinion; + + /** 同意|拒绝时间 */ + @Excel(name = "同意|拒绝时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("同意|拒绝时间") + private LocalDateTime auditorTime; + + /** 删除标志(0代表存在 2代表删除) */ + @Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除") + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; + + /** 创建者 */ + @Excel(name = "创建者") + @ApiModelProperty("创建者") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** 创建时间 */ + @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** 更新者 */ + @Excel(name = "更新者") + @ApiModelProperty("更新者") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** 更新时间 */ + @Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** 备注 */ + @Excel(name = "备注") + @ApiModelProperty("备注") + private String remark; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculationFiles.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculationFiles.java new file mode 100644 index 0000000..933fa30 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/domain/WgzPayCalculationFiles.java @@ -0,0 +1,98 @@ +package com.ruoyi.wgz.domain; + +import com.ruoyi.common.annotation.Excel; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import java.io.Serializable; +import java.util.Date; +import java.math.BigDecimal; + +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.LocalDate; + +/** + * 工资结算附件对象 wgz_pay_calculation_files + * + * @author ruoyi + * @date 2025-02-22 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +@TableName("wgz_pay_calculation_files") +@ApiModel("工资结算附件视图对象") +public class WgzPayCalculationFiles implements Serializable { + + private static final long serialVersionUID=1L; + + /** 主键自增ID */ + @ApiModelProperty("主键自增ID") + @TableId(value = "id") + private Long id; + + /** 工资结算主键自增ID */ + @Excel(name = "工资结算主键自增ID") + @ApiModelProperty("工资结算主键自增ID") + private Long calculationId; + + /** 附件类型 */ + @Excel(name = "附件类型") + @ApiModelProperty("附件类型") + private String typeOfAttachment; + + /** 文件名称 */ + @Excel(name = "文件名称") + @ApiModelProperty("文件名称") + private String name; + + /** 文件类型 */ + @Excel(name = "文件类型") + @ApiModelProperty("文件类型") + private String type; + + /** 文件地址 */ + @Excel(name = "文件地址") + @ApiModelProperty("文件地址") + private String address; + + /** 删除标志(0代表存在 2代表删除) */ + @Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除") + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; + + /** 创建者 */ + @Excel(name = "创建者") + @ApiModelProperty("创建者") + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** 创建时间 */ + @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("创建时间") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** 更新者 */ + @Excel(name = "更新者") + @ApiModelProperty("更新者") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** 更新时间 */ + @Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** 备注 */ + @Excel(name = "备注") + @ApiModelProperty("备注") + private String remark; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzPayCalculationFilesMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzPayCalculationFilesMapper.java new file mode 100644 index 0000000..eca4144 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzPayCalculationFilesMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.wgz.mapper; + +import com.ruoyi.wgz.domain.WgzPayCalculationFiles; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; +import org.apache.ibatis.annotations.CacheNamespace; + +/** + * 工资结算附件Mapper接口 + * + * @author ruoyi + * @date 2025-02-22 + */ +// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象 +@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) +public interface WgzPayCalculationFilesMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzPayCalculationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzPayCalculationMapper.java new file mode 100644 index 0000000..916a835 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzPayCalculationMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.wgz.mapper; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.wgz.bo.req.WgzAppApplyForPayrollSettlementListReq; +import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; +import com.ruoyi.wgz.bo.res.WgzAppApplyForPayrollSettlementListRes; +import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes; +import com.ruoyi.wgz.domain.WgzPayCalculation; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; +import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; +import org.apache.ibatis.annotations.CacheNamespace; +import org.apache.ibatis.annotations.Param; + +/** + * 工资结算Mapper接口 + * + * @author ruoyi + * @date 2025-02-21 + */ +// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象 +@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) +public interface WgzPayCalculationMapper extends BaseMapperPlus { + Page userApplyForPayrollSettlementList (@Param("page") Page page); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzReissueacardMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzReissueacardMapper.java index 7ccf777..ab73864 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzReissueacardMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/mapper/WgzReissueacardMapper.java @@ -7,6 +7,7 @@ import com.ruoyi.wgz.domain.WgzReissueacard; import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache; import org.apache.ibatis.annotations.CacheNamespace; +import org.apache.ibatis.annotations.Param; /** * 补卡申请Mapper接口 @@ -22,5 +23,5 @@ public interface WgzReissueacardMapper extends BaseMapperPlus { * @param page 分页对象 * @return 分页查询结果 */ - Page userReplacementCardRecordListPage(Page page); + Page userReplacementCardRecordListPage(@Param("page") Page page,@Param("userId") Long userId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java index 626dcf0..4ea5808 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzAttendanceService.java @@ -115,7 +115,8 @@ public interface IWgzAttendanceService extends IServicePlus { BgtAttendanceVO attendanceDetail(BgtAttendanceDTO dto); /** - * 考勤详情,查询指定用户指定项目的指定天数考勤情况统计(如若用户输入20,但实际只有2天出勤) + * 考勤详情,查询指定用户指定项目的指定天数考勤情况统计(如若用户输入20,但实际只有2天出勤); + * 如若num为0,那么表示查询所有天数的考勤情况统计; */ Integer attendanceDetail(Long userId,Long recruitId, Integer num); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzPayCalculationFilesService.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzPayCalculationFilesService.java new file mode 100644 index 0000000..e0398b4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzPayCalculationFilesService.java @@ -0,0 +1,55 @@ +package com.ruoyi.wgz.service; + +import com.ruoyi.wgz.domain.WgzPayCalculationFiles; +import com.ruoyi.wgz.bo.WgzPayCalculationFilesQueryBo; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.common.core.page.TableDataInfo; + +import java.util.Collection; +import java.util.List; + +/** + * 工资结算附件Service接口 + * + * @author ruoyi + * @date 2025-02-22 + */ +public interface IWgzPayCalculationFilesService extends IServicePlus { + /** + * 查询单个 + * @return + */ + WgzPayCalculationFiles queryById(Long id); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(WgzPayCalculationFilesQueryBo bo); + + /** + * 查询列表 + */ + List queryList(WgzPayCalculationFilesQueryBo bo); + + /** + * 根据新增业务对象插入工资结算附件 + * @param bo 工资结算附件新增业务对象 + * @return + */ + Boolean insert(WgzPayCalculationFiles bo); + + /** + * 根据编辑业务对象修改工资结算附件 + * @param bo 工资结算附件编辑业务对象 + * @return + */ + Boolean update(WgzPayCalculationFiles bo); + + /** + * 校验并删除数据 + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzPayCalculationService.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzPayCalculationService.java new file mode 100644 index 0000000..6ddc7e5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzPayCalculationService.java @@ -0,0 +1,82 @@ +package com.ruoyi.wgz.service; + +import com.ruoyi.wgz.bo.req.WgzAppApplyForPayrollSettlementListReq; +import com.ruoyi.wgz.bo.req.WgzApplyForPayrollSettlementAddReq; +import com.ruoyi.wgz.bo.res.WgzAppApplyForPayrollSettlementListRes; +import com.ruoyi.wgz.domain.WgzPayCalculation; +import com.ruoyi.wgz.bo.WgzPayCalculationQueryBo; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.validation.annotation.Validated; + +import java.util.Collection; +import java.util.List; + +/** + * 工资结算Service接口 + * + * @author ruoyi + * @date 2025-02-21 + */ +public interface IWgzPayCalculationService extends IServicePlus { + /** + * 查询单个 + * @return + */ + WgzPayCalculation queryById(Long id); + + /** + * 查询列表 + */ + TableDataInfo queryPageList(WgzPayCalculationQueryBo bo); + + /** + * 查询列表 + */ + List queryList(WgzPayCalculationQueryBo bo); + + /** + * 根据新增业务对象插入工资结算 + * @param bo 工资结算新增业务对象 + * @return + */ + Boolean insert(WgzPayCalculation bo); + + /** + * 根据编辑业务对象修改工资结算 + * @param bo 工资结算编辑业务对象 + * @return + */ + Boolean update(WgzPayCalculation bo); + + /** + * 校验并删除数据 + * @param ids 主键集合 + * @param isValid 是否校验,true-删除前校验,false-不校验 + * @return + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * APP相关 + * ================================================================================================================= + * ================================================================================================================= + * ================================================================================================================= + */ + + + /** + * 用户申请结算(新增) + */ + Boolean userApplyForPayrollSettlementAdd(@Validated WgzApplyForPayrollSettlementAddReq req); + + /** + * 申请工资结算(列表·分页) + */ + TableDataInfo userApplyForPayrollSettlementList(@Validated WgzAppApplyForPayrollSettlementListReq req); + + /** + * 根据务工者id和招工id,得到最新的数据 + */ + WgzPayCalculation findByUserIdRecruitIdNewestData(Long userId, Long recruitId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java index 4941ffa..9e3709a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzAttendanceServiceImpl.java @@ -319,7 +319,9 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl0) { //表示查询指定天数的打卡记录,否则查询所有 + apply.last("LIMIT " + num); + } return baseMapper.selectCount(apply); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationFilesServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationFilesServiceImpl.java new file mode 100644 index 0000000..372f630 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationFilesServiceImpl.java @@ -0,0 +1,88 @@ +package com.ruoyi.wgz.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.core.page.PagePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.wgz.bo.WgzPayCalculationFilesQueryBo; +import com.ruoyi.wgz.domain.WgzPayCalculationFiles; +import com.ruoyi.wgz.mapper.WgzPayCalculationFilesMapper; +import com.ruoyi.wgz.service.IWgzPayCalculationFilesService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 工资结算附件Service业务层处理 + * + * @author ruoyi + * @date 2025-02-22 + */ +@Service +public class WgzPayCalculationFilesServiceImpl extends ServicePlusImpl implements IWgzPayCalculationFilesService { + + @Override + public WgzPayCalculationFiles queryById(Long id){ + return getById(id); + } + + @Override + public TableDataInfo queryPageList(WgzPayCalculationFilesQueryBo bo) { + Page result = page(PageUtils.buildPage(), buildQueryWrapper(bo)); + return PageUtils.buildDataInfo(result); + } + + @Override + public List queryList(WgzPayCalculationFilesQueryBo bo) { + return list(buildQueryWrapper(bo)); + } + + private LambdaQueryWrapper buildQueryWrapper(WgzPayCalculationFilesQueryBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getCalculationId() != null, WgzPayCalculationFiles::getCalculationId, bo.getCalculationId()); + lqw.eq(StrUtil.isNotBlank(bo.getTypeOfAttachment()), WgzPayCalculationFiles::getTypeOfAttachment, bo.getTypeOfAttachment()); + lqw.like(StrUtil.isNotBlank(bo.getName()), WgzPayCalculationFiles::getName, bo.getName()); + lqw.eq(StrUtil.isNotBlank(bo.getType()), WgzPayCalculationFiles::getType, bo.getType()); + lqw.eq(StrUtil.isNotBlank(bo.getAddress()), WgzPayCalculationFiles::getAddress, bo.getAddress()); + return lqw; + } + + @Override + public Boolean insert(WgzPayCalculationFiles bo) { + WgzPayCalculationFiles add = BeanUtil.toBean(bo, WgzPayCalculationFiles.class); + validEntityBeforeSave(add); + return save(add); + } + + @Override + public Boolean update(WgzPayCalculationFiles bo) { + WgzPayCalculationFiles update = BeanUtil.toBean(bo, WgzPayCalculationFiles.class); + validEntityBeforeSave(update); + return updateById(update); + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(WgzPayCalculationFiles entity){ + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return removeByIds(ids); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java new file mode 100644 index 0000000..a22980e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java @@ -0,0 +1,175 @@ +package com.ruoyi.wgz.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.bgt.domain.BgtProjectRecruit; +import com.ruoyi.bgt.domain.BgtProjectRecruitApply; +import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService; +import com.ruoyi.bgt.service.IBgtProjectRecruitService; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.domain.Annex; +import com.ruoyi.common.domain.dto.AnnexDTO; +import com.ruoyi.common.service.IAnnexService; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.core.page.PagePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.wgz.bo.req.WgzAppApplyForPayrollSettlementListReq; +import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; +import com.ruoyi.wgz.bo.req.WgzApplyForPayrollSettlementAddReq; +import com.ruoyi.wgz.bo.res.WgzAppApplyForPayrollSettlementListRes; +import com.ruoyi.wgz.service.IWgzPayCalculationFilesService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.wgz.bo.WgzPayCalculationQueryBo; +import com.ruoyi.wgz.domain.WgzPayCalculation; +import com.ruoyi.wgz.mapper.WgzPayCalculationMapper; +import com.ruoyi.wgz.service.IWgzPayCalculationService; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.reactive.TransactionalOperator; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 工资结算Service业务层处理 + * + * @author ruoyi + * @date 2025-02-21 + */ +@Service +public class WgzPayCalculationServiceImpl extends ServicePlusImpl implements IWgzPayCalculationService { + + @Autowired + private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService; + + @Autowired + private IBgtProjectRecruitService iBgtProjectRecruitService; + + @Autowired + private IWgzPayCalculationFilesService iWgzPayCalculationFilesService; + + + @Override + public WgzPayCalculation queryById(Long id){ + return getById(id); + } + + @Override + public TableDataInfo queryPageList(WgzPayCalculationQueryBo bo) { + Page result = page(PageUtils.buildPage(), buildQueryWrapper(bo)); + return PageUtils.buildDataInfo(result); + } + + @Override + public List queryList(WgzPayCalculationQueryBo bo) { + return list(buildQueryWrapper(bo)); + } + + private LambdaQueryWrapper buildQueryWrapper(WgzPayCalculationQueryBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getTaskId() != null, WgzPayCalculation::getTaskId, bo.getTaskId()); + lqw.eq(bo.getRecruitId() != null, WgzPayCalculation::getRecruitId, bo.getRecruitId()); + lqw.eq(bo.getUserId() != null, WgzPayCalculation::getUserId, bo.getUserId()); + lqw.like(StrUtil.isNotBlank(bo.getTaskName()), WgzPayCalculation::getTaskName, bo.getTaskName()); + lqw.eq(StrUtil.isNotBlank(bo.getTaskAddress()), WgzPayCalculation::getTaskAddress, bo.getTaskAddress()); + lqw.like(StrUtil.isNotBlank(bo.getRecruitName()), WgzPayCalculation::getRecruitName, bo.getRecruitName()); + lqw.like(StrUtil.isNotBlank(bo.getUserName()), WgzPayCalculation::getUserName, bo.getUserName()); + lqw.eq(bo.getEntryTime() != null, WgzPayCalculation::getEntryTime, bo.getEntryTime()); + lqw.eq(bo.getRecruitAmount() != null, WgzPayCalculation::getRecruitAmount, bo.getRecruitAmount()); + lqw.eq(bo.getNum() != null, WgzPayCalculation::getNum, bo.getNum()); + lqw.eq(StrUtil.isNotBlank(bo.getWorkingState()), WgzPayCalculation::getWorkingState, bo.getWorkingState()); + lqw.eq(StrUtil.isNotBlank(bo.getPhone()), WgzPayCalculation::getPhone, bo.getPhone()); + lqw.eq(StrUtil.isNotBlank(bo.getBank()), WgzPayCalculation::getBank, bo.getBank()); + lqw.eq(StrUtil.isNotBlank(bo.getCardNo()), WgzPayCalculation::getCardNo, bo.getCardNo()); + lqw.eq(bo.getAuditorUserId() != null, WgzPayCalculation::getAuditorUserId, bo.getAuditorUserId()); + lqw.eq(StrUtil.isNotBlank(bo.getAuditorType()), WgzPayCalculation::getAuditorType, bo.getAuditorType()); + lqw.eq(StrUtil.isNotBlank(bo.getAuditorOpinion()), WgzPayCalculation::getAuditorOpinion, bo.getAuditorOpinion()); + lqw.eq(bo.getAuditorTime() != null, WgzPayCalculation::getAuditorTime, bo.getAuditorTime()); + return lqw; + } + + @Override + public Boolean insert(WgzPayCalculation bo) { + WgzPayCalculation add = BeanUtil.toBean(bo, WgzPayCalculation.class); + validEntityBeforeSave(add); + return save(add); + } + + @Override + public Boolean update(WgzPayCalculation bo) { + WgzPayCalculation update = BeanUtil.toBean(bo, WgzPayCalculation.class); + validEntityBeforeSave(update); + return updateById(update); + } + + /** + * 保存前的数据校验 + * + * @param entity 实体类数据 + */ + private void validEntityBeforeSave(WgzPayCalculation entity){ + //TODO 做一些数据校验,如唯一约束 + } + + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return removeByIds(ids); + } + + /** + * APP相关 + * ================================================================================================================= + * ================================================================================================================= + * ================================================================================================================= + */ + + @Override + @Transactional + public Boolean userApplyForPayrollSettlementAdd(WgzApplyForPayrollSettlementAddReq req) { + //1、获取当前人 + SysUser user = SecurityUtils.getLoginUser().getUser(); + BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(user.getUserId()); + BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId()); + //2、组装数据 + WgzPayCalculation wgzPayCalculation = new WgzPayCalculation(); + BeanUtils.copyProperties(req,wgzPayCalculation); + wgzPayCalculation. + setUserId(user.getUserId()). + setUserName(user.getUserName()). + setAuditorUserId(appById.getUserId()); + //3、获取附件信息并插入 + iWgzPayCalculationFilesService.saveBatch(req.getPayCalculation()); + return save(wgzPayCalculation); + } + + @Override + public TableDataInfo userApplyForPayrollSettlementList(WgzAppApplyForPayrollSettlementListReq req) { + Page pe = new Page<>(); + pe.setCurrent(req.getPageNum()); + pe.setSize(req.getPageSize()); + return PageUtils.buildDataInfo(baseMapper.userApplyForPayrollSettlementList(pe)); + } + + @Override + public WgzPayCalculation findByUserIdRecruitIdNewestData(Long userId, Long recruitId) { + LambdaQueryWrapper eq = new LambdaQueryWrapper(). + eq(WgzPayCalculation::getUserId, userId). + eq(WgzPayCalculation::getRecruitId, recruitId). + orderByDesc(WgzPayCalculation::getCreateTime). + last("limit 1"); + return baseMapper.selectOne(eq); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java index 3436c08..0745042 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzReissueacardServiceImpl.java @@ -163,10 +163,11 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl userReplacementCardRecord(WgzAppReplacementCardRecordReq req) { + Long userId = SecurityUtils.getAppUserId(); Page queryDTOPage = new Page<>(); queryDTOPage.setCurrent(req.getPageNum()); queryDTOPage.setSize(req.getPageSize()); - return PageUtils.buildDataInfo(baseMapper.userReplacementCardRecordListPage(queryDTOPage)); + return PageUtils.buildDataInfo(baseMapper.userReplacementCardRecordListPage(queryDTOPage,userId)); } } diff --git a/ruoyi-system/src/main/resources/mapper/wgz/WgzPayCalculationFilesMapper.xml b/ruoyi-system/src/main/resources/mapper/wgz/WgzPayCalculationFilesMapper.xml new file mode 100644 index 0000000..ba2ec66 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wgz/WgzPayCalculationFilesMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wgz/WgzPayCalculationMapper.xml b/ruoyi-system/src/main/resources/mapper/wgz/WgzPayCalculationMapper.xml new file mode 100644 index 0000000..55f6afd --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wgz/WgzPayCalculationMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/wgz/WgzReissueacardMapper.xml b/ruoyi-system/src/main/resources/mapper/wgz/WgzReissueacardMapper.xml index ef3737b..da68de2 100644 --- a/ruoyi-system/src/main/resources/mapper/wgz/WgzReissueacardMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wgz/WgzReissueacardMapper.xml @@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bgt_user b ON (a.auditor_user_id = b.user_id and b.del_flag = 0) LEFT JOIN wgz_user c ON (a.user_id = c.user_id and c.del_flag = 0) WHERE - a.del_flag = 0 + a.user_id = #{userId} and a.del_flag = 0 ORDER BY a.id DESC