员工修改工时接口添加租户id参数

master
hshansha 7 months ago
parent 892e5a07fc
commit 2a9fc63837

@ -48,6 +48,14 @@ public class PayEmployeeInfoController extends BaseController {
public TableDataInfo<PayEmployeeInfoVo> list(PayEmployeeInfoBo bo, PageQuery pageQuery) { public TableDataInfo<PayEmployeeInfoVo> list(PayEmployeeInfoBo bo, PageQuery pageQuery) {
return iPayEmployeeInfoService.queryPageList(bo, pageQuery); return iPayEmployeeInfoService.queryPageList(bo, pageQuery);
} }
/**
*
*/
@SaCheckPermission("pay:employeeInfo:list")
@GetMapping("/salesman")
public List<PayEmployeeInfoVo> getSalesmanList(PayEmployeeInfoBo bo) {
return iPayEmployeeInfoService.getSalesmanList(bo);
}
/** /**
* *
@ -112,9 +120,9 @@ public class PayEmployeeInfoController extends BaseController {
@SaCheckPermission("pay:empinfo:edithour") @SaCheckPermission("pay:empinfo:edithour")
@Log(title = "员工信息", businessType = BusinessType.UPDATE) @Log(title = "员工信息", businessType = BusinessType.UPDATE)
@PutMapping("/edithour") @PutMapping("/edithour")
public R<Void> edit(@RequestParam("oldHour") String oldHour, @RequestParam("newHour") String newHour) public R<Void> edit(@RequestParam("oldHour") String oldHour, @RequestParam("newHour") String newHour,@RequestParam("tenantId") Long tenantId)
{ {
return toAjax(iPayEmployeeInfoService.updateSgrEmployeeHour(oldHour,newHour)); return toAjax(iPayEmployeeInfoService.updateSgrEmployeeHour(oldHour,newHour,tenantId));
} }
/** /**

@ -4,8 +4,11 @@ import com.ruoyi.pay.domain.PayEmployeeInfo;
import com.ruoyi.pay.domain.vo.PayEmployeeInfoVo; import com.ruoyi.pay.domain.vo.PayEmployeeInfoVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus; import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import java.util.List;
/** /**
* Mapper * Mapper
* *
@ -13,6 +16,9 @@ import org.apache.ibatis.annotations.Update;
* @date 2025-05-12 * @date 2025-05-12
*/ */
public interface PayEmployeeInfoMapper extends BaseMapperPlus<PayEmployeeInfoMapper, PayEmployeeInfo, PayEmployeeInfoVo> { public interface PayEmployeeInfoMapper extends BaseMapperPlus<PayEmployeeInfoMapper, PayEmployeeInfo, PayEmployeeInfoVo> {
@Update("update pay_employee_info e set e.hours_per_day = #{newHour} where e.hours_per_day = #{oldHour}") @Update("update pay_employee_info e set e.hours_per_day = #{newHour} where e.hours_per_day = #{oldHour} and tenant_id = #{tenantId}")
int updateSgrEmployeeHour(@Param("oldHour") String oldHour, @Param("newHour")String newHour); int updateSgrEmployeeHour(@Param("oldHour") String oldHour, @Param("newHour")String newHour,@Param("tenantId") Long tenantId);
@Select("select * from pay_employee_info e ,sys_dept d where e.dept_id=d.dept_id and deleted = 0 and (d.dept_name='外贸' or d.dept_name='内贸') and tenant_id = #{tenantId}")
List<PayEmployeeInfoVo> getSalesmanList(@Param("tenantId") Long tenantId);
} }

@ -47,5 +47,7 @@ public interface IPayEmployeeInfoService {
*/ */
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
int updateSgrEmployeeHour(String oldHour, String newHour); int updateSgrEmployeeHour(String oldHour, String newHour,Long tenantId);
List<PayEmployeeInfoVo> getSalesmanList(PayEmployeeInfoBo bo);
} }

@ -50,7 +50,7 @@ public class PayDayWorkHoursServiceImpl implements IPayDayWorkHoursService {
*/ */
@Override @Override
public PayDayWorkHoursVo queryById(Long id){ public PayDayWorkHoursVo queryById(Long id){
return baseMapper.selectVoById(id); return baseMapper.selectDetailById(id);
} }
/** /**
@ -157,7 +157,7 @@ public class PayDayWorkHoursServiceImpl implements IPayDayWorkHoursService {
if (result > 0) { if (result > 0) {
List<PayDwHoursContrast> sgrDwHoursContrasts = sgrDayWorkHoursQuery.getDwHoursContrasts(); List<PayDwHoursContrast> sgrDwHoursContrasts = sgrDayWorkHoursQuery.getDwHoursContrasts();
sgrDwHoursContrasts.parallelStream().forEachOrdered(sgrDwHoursContrast -> { sgrDwHoursContrasts.parallelStream().forEachOrdered(sgrDwHoursContrast -> {
sgrDwHoursContrast.setDwHoursId(sgrDayWorkHoursQuery.getId()); sgrDwHoursContrast.setDwHoursId(payDayWorkHour.getId());
if (sgrDwHoursContrast.getIsHelper() == 0) {//当不是帮工时 直接存员工的部门 if (sgrDwHoursContrast.getIsHelper() == 0) {//当不是帮工时 直接存员工的部门
sgrDwHoursContrast.setDeptId(sgrDayWorkHoursQuery.getDeptId()); sgrDwHoursContrast.setDeptId(sgrDayWorkHoursQuery.getDeptId());
sgrDwHoursContrast.setDeptName(sgrDayWorkHoursQuery.getDeptName()); sgrDwHoursContrast.setDeptName(sgrDayWorkHoursQuery.getDeptName());
@ -217,7 +217,7 @@ public class PayDayWorkHoursServiceImpl implements IPayDayWorkHoursService {
//重新插入时间段 //重新插入时间段
List<PayDwHoursContrast> sgrDwHoursContrasts = sgrDayWorkHoursQuery.getDwHoursContrasts(); List<PayDwHoursContrast> sgrDwHoursContrasts = sgrDayWorkHoursQuery.getDwHoursContrasts();
sgrDwHoursContrasts.parallelStream().forEachOrdered(sgrDwHoursContrast -> { sgrDwHoursContrasts.parallelStream().forEachOrdered(sgrDwHoursContrast -> {
sgrDwHoursContrast.setDwHoursId(sgrDayWorkHoursQuery.getId()); sgrDwHoursContrast.setDwHoursId(payDayWorkHour.getId());
if (sgrDwHoursContrast.getIsHelper() == 0) {//当不是帮工时 直接存员工的部门 if (sgrDwHoursContrast.getIsHelper() == 0) {//当不是帮工时 直接存员工的部门
sgrDwHoursContrast.setDeptId(sgrDayWorkHoursQuery.getDeptId()); sgrDwHoursContrast.setDeptId(sgrDayWorkHoursQuery.getDeptId());
sgrDwHoursContrast.setDeptName(sgrDayWorkHoursQuery.getDeptName()); sgrDwHoursContrast.setDeptName(sgrDayWorkHoursQuery.getDeptName());

@ -176,7 +176,12 @@ public class PayEmployeeInfoServiceImpl implements IPayEmployeeInfoService {
} }
@Override @Override
public int updateSgrEmployeeHour(String oldHour, String newHour) { public int updateSgrEmployeeHour(String oldHour, String newHour,Long tenantId) {
return baseMapper.updateSgrEmployeeHour(oldHour,newHour); return baseMapper.updateSgrEmployeeHour(oldHour,newHour,tenantId);
}
@Override
public List<PayEmployeeInfoVo> getSalesmanList(PayEmployeeInfoBo bo) {
return baseMapper.getSalesmanList(bo.getTenantId());
} }
} }

Loading…
Cancel
Save