diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/PayEmployeeInfoController.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/PayEmployeeInfoController.java index 4460ef4..ddb5000 100644 --- a/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/PayEmployeeInfoController.java +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/controller/PayEmployeeInfoController.java @@ -48,6 +48,14 @@ public class PayEmployeeInfoController extends BaseController { public TableDataInfo list(PayEmployeeInfoBo bo, PageQuery pageQuery) { return iPayEmployeeInfoService.queryPageList(bo, pageQuery); } + /** + * 获取内外贸人员列表 + */ + @SaCheckPermission("pay:employeeInfo:list") + @GetMapping("/salesman") + public List getSalesmanList(PayEmployeeInfoBo bo) { + return iPayEmployeeInfoService.getSalesmanList(bo); + } /** * 导出员工信息列表 @@ -112,9 +120,9 @@ public class PayEmployeeInfoController extends BaseController { @SaCheckPermission("pay:empinfo:edithour") @Log(title = "员工信息", businessType = BusinessType.UPDATE) @PutMapping("/edithour") - public R edit(@RequestParam("oldHour") String oldHour, @RequestParam("newHour") String newHour) + public R 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)); } /** diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/PayEmployeeInfoMapper.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/PayEmployeeInfoMapper.java index abc1445..014865e 100644 --- a/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/PayEmployeeInfoMapper.java +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/mapper/PayEmployeeInfoMapper.java @@ -4,8 +4,11 @@ import com.ruoyi.pay.domain.PayEmployeeInfo; import com.ruoyi.pay.domain.vo.PayEmployeeInfoVo; import com.ruoyi.common.core.mapper.BaseMapperPlus; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; +import java.util.List; + /** * 员工信息Mapper接口 * @@ -13,6 +16,9 @@ import org.apache.ibatis.annotations.Update; * @date 2025-05-12 */ public interface PayEmployeeInfoMapper extends BaseMapperPlus { - @Update("update pay_employee_info e set e.hours_per_day = #{newHour} where e.hours_per_day = #{oldHour}") - int updateSgrEmployeeHour(@Param("oldHour") String oldHour, @Param("newHour")String newHour); + @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,@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 getSalesmanList(@Param("tenantId") Long tenantId); } diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/IPayEmployeeInfoService.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/IPayEmployeeInfoService.java index fc268c0..f88352a 100644 --- a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/IPayEmployeeInfoService.java +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/IPayEmployeeInfoService.java @@ -47,5 +47,7 @@ public interface IPayEmployeeInfoService { */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); - int updateSgrEmployeeHour(String oldHour, String newHour); + int updateSgrEmployeeHour(String oldHour, String newHour,Long tenantId); + + List getSalesmanList(PayEmployeeInfoBo bo); } diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayDayWorkHoursServiceImpl.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayDayWorkHoursServiceImpl.java index 1a68a51..47fa799 100644 --- a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayDayWorkHoursServiceImpl.java +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayDayWorkHoursServiceImpl.java @@ -50,7 +50,7 @@ public class PayDayWorkHoursServiceImpl implements IPayDayWorkHoursService { */ @Override 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) { List sgrDwHoursContrasts = sgrDayWorkHoursQuery.getDwHoursContrasts(); sgrDwHoursContrasts.parallelStream().forEachOrdered(sgrDwHoursContrast -> { - sgrDwHoursContrast.setDwHoursId(sgrDayWorkHoursQuery.getId()); + sgrDwHoursContrast.setDwHoursId(payDayWorkHour.getId()); if (sgrDwHoursContrast.getIsHelper() == 0) {//当不是帮工时 直接存员工的部门 sgrDwHoursContrast.setDeptId(sgrDayWorkHoursQuery.getDeptId()); sgrDwHoursContrast.setDeptName(sgrDayWorkHoursQuery.getDeptName()); @@ -217,7 +217,7 @@ public class PayDayWorkHoursServiceImpl implements IPayDayWorkHoursService { //重新插入时间段 List sgrDwHoursContrasts = sgrDayWorkHoursQuery.getDwHoursContrasts(); sgrDwHoursContrasts.parallelStream().forEachOrdered(sgrDwHoursContrast -> { - sgrDwHoursContrast.setDwHoursId(sgrDayWorkHoursQuery.getId()); + sgrDwHoursContrast.setDwHoursId(payDayWorkHour.getId()); if (sgrDwHoursContrast.getIsHelper() == 0) {//当不是帮工时 直接存员工的部门 sgrDwHoursContrast.setDeptId(sgrDayWorkHoursQuery.getDeptId()); sgrDwHoursContrast.setDeptName(sgrDayWorkHoursQuery.getDeptName()); diff --git a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayEmployeeInfoServiceImpl.java b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayEmployeeInfoServiceImpl.java index e7318bb..1b7101d 100644 --- a/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayEmployeeInfoServiceImpl.java +++ b/ruoyi-pay/src/main/java/com/ruoyi/pay/service/impl/PayEmployeeInfoServiceImpl.java @@ -176,7 +176,12 @@ public class PayEmployeeInfoServiceImpl implements IPayEmployeeInfoService { } @Override - public int updateSgrEmployeeHour(String oldHour, String newHour) { - return baseMapper.updateSgrEmployeeHour(oldHour,newHour); + public int updateSgrEmployeeHour(String oldHour, String newHour,Long tenantId) { + return baseMapper.updateSgrEmployeeHour(oldHour,newHour,tenantId); + } + + @Override + public List getSalesmanList(PayEmployeeInfoBo bo) { + return baseMapper.getSalesmanList(bo.getTenantId()); } }