Merge remote-tracking branch 'origin/master'

master
wanglei 7 months ago
commit f3dd411937

@ -48,6 +48,14 @@ public class PayEmployeeInfoController extends BaseController {
public TableDataInfo<PayEmployeeInfoVo> list(PayEmployeeInfoBo bo, PageQuery 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")
@Log(title = "员工信息", businessType = BusinessType.UPDATE)
@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));
}
/**

@ -2,14 +2,14 @@ package com.ruoyi.pay.controller;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Arrays;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.pay.domain.PaySalaryReport;
import com.ruoyi.pay.domain.vo.ExportBaohuoVo;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
@ -69,7 +69,7 @@ public class PayWorkOrderBaohuoController extends BaseController {
@GetMapping("/sum")
public R<List<PaySalaryReport>> sum(@RequestParam(name = "date")String date,
@RequestParam(name = "deptId", required = false) Long deptId,
@RequestParam(name = "tenantId", required = true) Long tenantId
@RequestParam(name = "tenantId") Long tenantId
) {
return iPayWorkOrderBaohuoService.baohuoSum(date, deptId,tenantId);
}
@ -80,13 +80,16 @@ public class PayWorkOrderBaohuoController extends BaseController {
@SaCheckPermission("pay:workOrderBaohuo:export")
@Log(title = "包活派工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(PayWorkOrderBaohuoBo bo, HttpServletResponse response) {
List<PayWorkOrderBaohuoVo> list = iPayWorkOrderBaohuoService.getWorkOrderListByDate(bo.getExportDate());
public void export(@RequestParam(name = "exportDate") String exportDate,
@RequestParam(name = "tenantId") Long tenantId, HttpServletResponse response) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Date exportDate1 = sdf.parse(exportDate);
List<ExportBaohuoVo> list = iPayWorkOrderBaohuoService.getWorkOrderListByDate(tenantId,exportDate1);
list.stream().parallel().forEach(vo -> {
vo.setAvgAmount(vo.getAmount().divide(new BigDecimal(vo.getWorkerNum()), 2, RoundingMode.HALF_UP));
vo.setWorkTime(vo.getWorkTime().divide(new BigDecimal(vo.getWorkerNum()), 2,RoundingMode.HALF_UP));
});
ExcelUtil.exportExcel(list, "包活派工单", PayWorkOrderBaohuoVo.class, response);
ExcelUtil.exportExcel(list, "包活派工单", ExportBaohuoVo.class, response);
}
/**

@ -181,6 +181,7 @@ public class PayWorkOrderBaohuoBo extends BaseEntity {
private String workDate;
// 导出日期
@JsonFormat(pattern = "yyyy-MM")
private Date exportDate;
private ArrayList<Long> woids; // 待查询的工单ID集合

@ -1,5 +1,7 @@
package com.ruoyi.pay.domain.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.converters.localdate.LocalDateDateConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.util.Date;

@ -1,13 +1,15 @@
package com.ruoyi.pay.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
public class PayDayWorkHoursExport {
@ExcelIgnoreUnannotated
public class PayDayWorkHoursExport {
/** 主键 */
private Long id;
@ -65,7 +67,7 @@ public class PayDayWorkHoursExport {
private String isHelper;
/** 工时部门 */
//@ExcelProperty(value= "工时部门")
@ExcelProperty(value= "工时部门")
private String deptName2;
public String getDeptName2() {

@ -165,8 +165,8 @@ public class PayWorkOrderBaohuoVo {
/**
* 0- 1-
*/
@ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=-可用,1=-删除")
// @ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
// @ExcelDictFormat(readConverterExp = "0=-可用,1=-删除")
private Integer deleted;
/**

@ -22,4 +22,6 @@ public interface PayDayWorkHoursMapper extends BaseMapperPlus<PayDayWorkHoursMap
List<PayDayWorkHoursQuery> selectPayDayWorkHoursList2(PayDayWorkHoursQuery sgrDayWorkHoursQuery);
Page<PayDayWorkHoursVo> selectVoPage2(@Param("page") Page<Object> page, @Param(Constants.WRAPPER)LambdaQueryWrapper<PayDayWorkHours> ew);
PayDayWorkHoursVo selectDetailById(Long id);
}

@ -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<PayEmployeeInfoMapper, PayEmployeeInfo, PayEmployeeInfoVo> {
@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<PayEmployeeInfoVo> getSalesmanList(@Param("tenantId") Long tenantId);
}

@ -1,6 +1,7 @@
package com.ruoyi.pay.mapper;
import com.ruoyi.pay.domain.PayWorkOrderBaohuo;
import com.ruoyi.pay.domain.vo.ExportBaohuoVo;
import com.ruoyi.pay.domain.vo.PayWorkOrderBaohuoVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Delete;
@ -27,7 +28,7 @@ public interface PayWorkOrderBaohuoMapper extends BaseMapperPlus<PayWorkOrderBao
@Delete("delete from pay_baohuo_worktime where wo_id = #{woid}")
void deleteAllWorkTimeByWoId(Long id);
List<PayWorkOrderBaohuoVo> getWorkOrderListByDate(Date exportDate);
List<ExportBaohuoVo> getWorkOrderListByDate(@Param("tenantId")Long tenantId, @Param("exportDate")Date exportDate);
HashSet<Long> getWoIdSet(@Param("workDate")String workDate, @Param("empId") Long empId);
}

@ -47,5 +47,7 @@ public interface IPayEmployeeInfoService {
*/
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);
}

@ -3,6 +3,7 @@ package com.ruoyi.pay.service;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.pay.domain.PaySalaryReport;
import com.ruoyi.pay.domain.PayWorkOrderBaohuo;
import com.ruoyi.pay.domain.vo.ExportBaohuoVo;
import com.ruoyi.pay.domain.vo.PayWorkOrderBaohuoVo;
import com.ruoyi.pay.domain.bo.PayWorkOrderBaohuoBo;
import com.ruoyi.common.core.page.TableDataInfo;
@ -53,7 +54,7 @@ public interface IPayWorkOrderBaohuoService {
R<List<PaySalaryReport>> baohuoSum(String date, Long deptId,Long tenantId);
List<PayWorkOrderBaohuoVo> getWorkOrderListByDate(Date exportDate);
List<ExportBaohuoVo> getWorkOrderListByDate(Long tenantId, Date exportDate);
HashSet<Long> getWoIdSet(String workDate, Long empId);
}

@ -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<PayDwHoursContrast> 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<PayDwHoursContrast> 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());

@ -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<PayEmployeeInfoVo> getSalesmanList(PayEmployeeInfoBo bo) {
return baseMapper.getSalesmanList(bo.getTenantId());
}
}

@ -611,8 +611,8 @@ public class PayWorkOrderBaohuoServiceImpl implements IPayWorkOrderBaohuoService
}
@Override
public List<PayWorkOrderBaohuoVo> getWorkOrderListByDate(Date exportDate) {
return sgrWorkOrderBaohuoMapper.getWorkOrderListByDate(exportDate);
public List<ExportBaohuoVo> getWorkOrderListByDate(Long tenantId,Date exportDate) {
return sgrWorkOrderBaohuoMapper.getWorkOrderListByDate(tenantId,exportDate);
}
@Override

@ -61,4 +61,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectDetailById" parameterType="Long" resultMap="PayDayWorkHoursQueryResult">
select d.*,c.start_time con_start,c.end_time con_end,c.is_helper con_helper, c.dept_id con_dept_id,c.dept_name con_dept_name ,c.hours con_hours,c.salesman con_salesman from pay_day_work_hours d , pay_dw_hours_contrast c
where d.id=c.dw_hours_id and d.id = #{id}
</select>
</mapper>

@ -48,14 +48,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workTime" column="work_time" />
<result property="worksName" column="works_name" />
</resultMap>
<select id="getWorkOrderListByDate" parameterType="date" resultMap="ExportBaohuoVoResult">
<select id="getWorkOrderListByDate" resultMap="ExportBaohuoVoResult">
SELECT b.instorage_time, b.`name`, a.product_name,b.content,a.unit,a.product_num,a.price,a.amount,a.wo_id,
(SELECT count(*) FROM pay_baohuo_employee WHERE wo_id = b.id) as worker_num,
(SELECT sum(valid_hours) FROM pay_baohuo_worktime WHERE wo_id = b.id) AS work_time,
(SELECT GROUP_CONCAT(emp_name) FROM pay_baohuo_employee WHERE wo_id = b.id) AS works_name
FROM pay_baohuo_product a
LEFT JOIN pay_work_order_baohuo b ON a.wo_id = b.id
WHERE date_format(#{exportDate},'%y%m') = date_format(b.instorage_time,'%y%m')
<where >
<if test="exportDate!=null">
date_format(#{exportDate},'%y-%m') = date_format(b.instorage_time,'%y-%m')
</if>
and b.tenant_id=#{tenantId}
</where>
ORDER BY a.wo_id ASC
</select>

Loading…
Cancel
Save