【员工工资明细】 查询

dev
siontion 3 months ago
parent 260f4528bf
commit 4e846829b9

@ -155,7 +155,13 @@ public class TaskReportController {
@Operation(summary = "获得员工报工明细列表")
@PreAuthorize("@ss.hasPermission('biz:task-report:query')")
public CommonResult<List<TaskReportDO>> getUserReportDetail(@RequestParam("userid") String userid,@RequestParam("yearMonth") String yearMonth) {
return success(taskReportService.getUserReportDetail(userid,yearMonth));
List<TaskReportDO> result= taskReportService.getUserReportDetail(userid,yearMonth);
List<TaskReportDO> assembleResult = taskReportService.getUserReportDetailAssemble(userid,yearMonth);
assembleResult.forEach(vo->{
result.add(vo);
});
return success(result);
}
@GetMapping("/export-salary-detail-excel")

@ -160,14 +160,31 @@ public interface TaskReportMapper extends BaseMapperX<TaskReportDO> {
.leftJoin("base_material as e on e.id=c.material_id")
.leftJoin("system_users as f on f.id=t.owner")
.leftJoin("base_procedure as g on g.id=t.procedure_id")
.leftJoin("system_dept as h on h.id=f.dept_id")
.leftJoin("system_dept as h on h.id=d.business_dept_id")
.groupBy("d.code,h.name,e.code,e.name,e.spec,t.owner,DATE_FORMAT(t.report_time,'%Y-%m-%d'),t.procedure_id")
.eq(TaskReportDO::getOwner,userId)
.eq("DATE_FORMAT(t.report_time,'%Y%m')",yearMonth)
.eq("isnull(t.dispatch_id)",0)
.disableSubLogicDel()
;
return selectList(query);
}
default List<TaskReportDO> selectUserReportAssembleDetail(String userId,String yearMonth) {
MPJLambdaWrapperX<TaskReportDO> query = new MPJLambdaWrapperX<>();
query.distinct()
.select("d.code project_code,h.name dept_name,e.code material_code,e.name material_name,e.spec,f.nickname as ownerName,DATE_FORMAT(t.report_time,'%Y-%m-%d') as report_time")
.select("g.name procedure_name,sum(t.work_time) work_time,sum(t.amount) amount")
.leftJoin("project_sale_order as d on d.id=SUBSTRING_INDEX(t.assemble_code,'-',1)")
.leftJoin("base_material as e on e.id=t.material_id")
.leftJoin("system_users as f on f.id=t.owner")
.leftJoin("base_procedure as g on g.id=t.procedure_id")
.leftJoin("system_dept as h on h.id=d.business_dept_id")
.groupBy("d.code,h.name,e.code,e.name,e.spec,t.owner,DATE_FORMAT(t.report_time,'%Y-%m-%d'),t.procedure_id")
.eq(TaskReportDO::getOwner,userId)
.eq("DATE_FORMAT(t.report_time,'%Y%m')",yearMonth)
.eq("isnull(t.dispatch_id)",1)
.disableSubLogicDel()
;
return selectList(query);
}

@ -57,6 +57,7 @@ public interface TaskReportService {
PageResult<TaskReportDO> getAssembleReportPageForApp(TaskReportPageReqVO pageReqVO);
List<TaskReportDO> getUserReportDetail(String userId,String yearMonth);
List<TaskReportDO> getUserReportDetailAssemble(String userId,String yearMonth);
TaskReportAssembleVO generateAssembleReportByCode(String assembleCode);

@ -130,6 +130,11 @@ public class TaskReportServiceImpl implements TaskReportService {
return taskReportMapper.selectUserReportDetail(userId,yearMonth);
}
@Override
public List<TaskReportDO> getUserReportDetailAssemble(String userId,String yearMonth){
return taskReportMapper.selectUserReportAssembleDetail(userId,yearMonth);
}
@Override
public TaskReportAssembleVO generateAssembleReportByCode(String assembleCode) {
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();

Loading…
Cancel
Save