parent
fabcece74c
commit
daf70022eb
@ -0,0 +1,35 @@
|
|||||||
|
package com.ruoyi.pay.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.pay.service.IPayWorkOrderCheckService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pay/wocheck")
|
||||||
|
public class PayWorkOrderCheckController extends BaseController {
|
||||||
|
|
||||||
|
private final IPayWorkOrderCheckService wocheckService;
|
||||||
|
|
||||||
|
@GetMapping("/getbaohuo")
|
||||||
|
public Map<String, Object> getBaoHuoList(@RequestParam(name = "tenantId")Long tenantId,
|
||||||
|
@RequestParam(name = "empName")String empName,
|
||||||
|
@RequestParam(name = "date") String date) {
|
||||||
|
return wocheckService.getBaoHuoList(tenantId,empName,date);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getbanggong")
|
||||||
|
public Map<String, Object> getBangGongList(@RequestParam(name = "tenantId")Long tenantId,@RequestParam(name = "empName")String empName,@RequestParam(name = "date")String date) {
|
||||||
|
return wocheckService.getBangGongList(tenantId,empName,date);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.ruoyi.pay.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface IPayWorkOrderCheckService {
|
||||||
|
Map<String, Object> getBaoHuoList(Long tenantId, String empName, String date);
|
||||||
|
|
||||||
|
Map<String, Object> getBangGongList(Long tenantId, String empName, String date);
|
||||||
|
}
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
package com.ruoyi.pay.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.pay.domain.*;
|
||||||
|
import com.ruoyi.pay.domain.bo.PayBaohuoEmployeeBo;
|
||||||
|
import com.ruoyi.pay.domain.bo.PayBaohuoWorktimeBo;
|
||||||
|
import com.ruoyi.pay.domain.vo.PayBaohuoEmployeeVo;
|
||||||
|
import com.ruoyi.pay.domain.vo.PayBaohuoWorktimeVo;
|
||||||
|
import com.ruoyi.pay.domain.vo.PayDwHoursContrastVo;
|
||||||
|
import com.ruoyi.pay.mapper.PayBaohuoWorktimeMapper;
|
||||||
|
import com.ruoyi.pay.mapper.PayEmployeeInfoMapper;
|
||||||
|
import com.ruoyi.pay.mapper.PayWorkOrderBaohuoMapper;
|
||||||
|
import com.ruoyi.pay.service.IPayBaohuoEmployeeService;
|
||||||
|
import com.ruoyi.pay.service.IPayBaohuoProductService;
|
||||||
|
import com.ruoyi.pay.service.IPayWorkOrderCheckService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class PayWorkOrderCheckServiceImpl implements IPayWorkOrderCheckService {
|
||||||
|
|
||||||
|
private final PayWorkOrderBaohuoMapper payWorkOrderBaohuoMapper;
|
||||||
|
private final PayEmployeeInfoServiceImpl payEmployeeInfoService;
|
||||||
|
private final PayEmployeeInfoMapper payEmployeeInfoMapper;
|
||||||
|
private final PayBaohuoWorktimeMapper worktimeMapper;
|
||||||
|
private final PayWorkTimeServiceImpl workTimeService;
|
||||||
|
private final PayBaohuoWorktimeServiceImpl bhworktimeService;
|
||||||
|
private final PayAttendanceServiceImpl attendanceService;
|
||||||
|
private final PayWorkOrderBaohuoMapper sgrWorkOrderBaohuoMapper;
|
||||||
|
private final PayDayWorkHoursServiceImpl dayWorkHoursService;
|
||||||
|
private final IPayBaohuoProductService bhproductService;
|
||||||
|
private final IPayBaohuoEmployeeService bhemployeeService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getBaoHuoList(Long tenantId, String empName, String date) {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
//获取到员工信息
|
||||||
|
PayEmployeeInfo employeeInfo = payEmployeeInfoMapper.selectSgrEmployeeInfoByName(tenantId,empName);
|
||||||
|
//年月拆分
|
||||||
|
String year = date.split("-")[0];
|
||||||
|
String month = date.split("-")[1];
|
||||||
|
Date yearMonth=null;
|
||||||
|
try {
|
||||||
|
yearMonth = new SimpleDateFormat("yyyy-MM").parse(date);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
//包活工时
|
||||||
|
PayBaohuoWorktimeBo bhtime = new PayBaohuoWorktimeBo();
|
||||||
|
bhtime.setEmpId(employeeInfo.getId());
|
||||||
|
bhtime.setDate(yearMonth);
|
||||||
|
List<PayBaohuoWorktimeVo> bhtimes = bhworktimeService.queryList(bhtime);
|
||||||
|
|
||||||
|
Collections.sort(bhtimes, new Comparator<PayBaohuoWorktimeVo>() {
|
||||||
|
//按照工作日期排序
|
||||||
|
@Override
|
||||||
|
public int compare(PayBaohuoWorktimeVo o1, PayBaohuoWorktimeVo o2) {
|
||||||
|
if (o1.getDate().compareTo(o2.getDate())==1){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (o1.getDate().compareTo(o2.getDate())==0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*if(bhtimes!=null&&bhtimes.size()>0){
|
||||||
|
for(SgrBaohuoWorktime btime:bhtimes){
|
||||||
|
baohuogongshi = baohuogongshi.add(btime.getValidHours());
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
result.put("bhtimes",bhtimes);
|
||||||
|
|
||||||
|
//包活工资
|
||||||
|
PayBaohuoEmployeeBo bhEmployee = new PayBaohuoEmployeeBo() ;
|
||||||
|
bhEmployee.setEmpName(empName);
|
||||||
|
bhEmployee.setIntime(yearMonth);
|
||||||
|
bhEmployee.setTenantId(tenantId);
|
||||||
|
List<PayBaohuoEmployeeVo> bhEmployees = bhemployeeService.queryList(bhEmployee);
|
||||||
|
/*for(SgrBaohuoEmployee bhe:bhEmployees){
|
||||||
|
if(bhe.getHelper()==0){
|
||||||
|
baohuogongzi = baohuogongzi.add(bhe.getAmount());
|
||||||
|
}else{
|
||||||
|
baohuobanggongGZ = baohuobanggongGZ.add(bhe.getAmount());
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
result.put("bhEmployees",bhEmployees);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getBangGongList(Long tenantId, String empName, String date) {
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
//获取到员工信息
|
||||||
|
PayEmployeeInfo employeeInfo = payEmployeeInfoMapper.selectSgrEmployeeInfoByName(tenantId,empName);
|
||||||
|
String year = date.split("-")[0];
|
||||||
|
String month = date.split("-")[1];
|
||||||
|
Date yearMonth=null;
|
||||||
|
try {
|
||||||
|
yearMonth = new SimpleDateFormat("yyyy-MM").parse(date);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
//return AjaxResult.success("系统日期格式转换错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
//包活帮工信息获取
|
||||||
|
List<PayBaohuoEmployeeVo> bhHelper = new ArrayList<>();
|
||||||
|
PayBaohuoEmployeeBo bhEmployee = new PayBaohuoEmployeeBo() ;
|
||||||
|
bhEmployee.setEmpName(empName);
|
||||||
|
bhEmployee.setIntime(yearMonth);
|
||||||
|
bhEmployee.setTenantId(tenantId);
|
||||||
|
List<PayBaohuoEmployeeVo> bhEmployees = bhemployeeService.queryList(bhEmployee);
|
||||||
|
for(PayBaohuoEmployeeVo bhe:bhEmployees){
|
||||||
|
if(bhe.getHelper()==0){
|
||||||
|
// baohuogongzi = baohuogongzi.add(bhe.getAmount());
|
||||||
|
}else{
|
||||||
|
bhHelper.add(bhe);
|
||||||
|
// baohuobanggongGZ = baohuobanggongGZ.add(bhe.getAmount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.put("bhHelper",bhHelper);
|
||||||
|
|
||||||
|
//1.2获取员工日工工时信息
|
||||||
|
List<PayDwHoursContrast> rigongHelper = new ArrayList<>();
|
||||||
|
PayDayWorkHoursQuery sgrdayworkHoursQuery = new PayDayWorkHoursQuery();
|
||||||
|
BigDecimal rigongbanggong = BigDecimal.ZERO; //日工帮工小时数
|
||||||
|
sgrdayworkHoursQuery.setDwYearMonth(date);
|
||||||
|
sgrdayworkHoursQuery.setEmpName(employeeInfo.getName());
|
||||||
|
List<PayDayWorkHoursQuery> sgrDayWorkHoursQueryList =dayWorkHoursService.selectPayDayWorkHoursList2(sgrdayworkHoursQuery);
|
||||||
|
if(sgrDayWorkHoursQueryList!=null&&sgrDayWorkHoursQueryList.size()>0){
|
||||||
|
for(PayDayWorkHoursQuery dayWorkHour:sgrDayWorkHoursQueryList){
|
||||||
|
for(PayDwHoursContrast dwHoursContrast:dayWorkHour.getDwHoursContrasts()) {
|
||||||
|
if(dwHoursContrast.getIsHelper()==1){
|
||||||
|
/* BigDecimal datePoor =dwHoursContrast.getHours();
|
||||||
|
rigongbanggong = rigongbanggong.add(datePoor);*/
|
||||||
|
rigongHelper.add(dwHoursContrast);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.put("rigongHelper",rigongHelper);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in new issue