diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/domain/UserProdStatisticsVO.java b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/domain/UserProdStatisticsVO.java new file mode 100644 index 0000000..32bc7dd --- /dev/null +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/domain/UserProdStatisticsVO.java @@ -0,0 +1,20 @@ +package com.ruoyi.yh.dashboard.domain; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author wjh + * 2025/1/14 + */ +@Data +public class UserProdStatisticsVO { + + @ApiModelProperty("总产量") + private BigDecimal totalNum; + + @ApiModelProperty("总工资") + private BigDecimal totalPrice; +} diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/mapper/DashboardMapper.java b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/mapper/DashboardMapper.java new file mode 100644 index 0000000..1a77252 --- /dev/null +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/mapper/DashboardMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.yh.dashboard.mapper; + +import com.ruoyi.yh.dashboard.domain.UserProdStatisticsVO; +import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery; +import org.apache.ibatis.annotations.Param; + +/** + * @author wjh + * 2025/1/14 + */ +public interface DashboardMapper { + UserProdStatisticsVO selectUserProd(@Param("query") ReportUserProdQuery query); +} diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/mapper/DashboardMapper.xml b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/mapper/DashboardMapper.xml new file mode 100644 index 0000000..38c39bd --- /dev/null +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/mapper/DashboardMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/service/DashboardService.java b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/service/DashboardService.java new file mode 100644 index 0000000..6836c0b --- /dev/null +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/dashboard/service/DashboardService.java @@ -0,0 +1,22 @@ +package com.ruoyi.yh.dashboard.service; + +import com.ruoyi.yh.dashboard.domain.UserProdStatisticsVO; +import com.ruoyi.yh.dashboard.mapper.DashboardMapper; +import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author wjh + * 2025/1/14 + */ +@Service +public class DashboardService { + + @Autowired + private DashboardMapper dashboardMapper; + + public UserProdStatisticsVO selectUserProd(ReportUserProdQuery query) { + return dashboardMapper.selectUserProd(query); + } +} diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/price/service/impl/PriceServiceImpl.java b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/price/service/impl/PriceServiceImpl.java index 5894be8..7d6df74 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/price/service/impl/PriceServiceImpl.java +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/price/service/impl/PriceServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.yh.price.service.impl; +import com.github.pagehelper.PageHelper; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.validate.ValidGroup; @@ -436,10 +437,13 @@ public class PriceServiceImpl implements PriceService @Override public PriceSearchConditionVO selectSearchCondition(PriceQuery query) { PriceSearchConditionVO vo = new PriceSearchConditionVO(); - + PageHelper.startPage(1, 20); vo.setCategoryList(priceMapper.selectColumnCount(query, PriceColumn.category.name())); + PageHelper.startPage(1, 20); vo.setSizeList(priceMapper.selectColumnCount(query, PriceColumn.size.name())); + PageHelper.startPage(1, 20); vo.setSurfaceList(priceMapper.selectColumnCount(query, PriceColumn.surface.name())); + PageHelper.startPage(1, 20); vo.setPatternList(priceMapper.selectColumnCount(query, PriceColumn.pattern.name())); return vo; diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/domain/ReportUserProdVO.java b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/domain/ReportUserProdVO.java index 2d25afa..875e865 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/domain/ReportUserProdVO.java +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/domain/ReportUserProdVO.java @@ -50,6 +50,9 @@ public class ReportUserProdVO extends ReportUserProd { @ApiModelProperty("部门名称") private String deptName; + @ApiModelProperty("部门ID") + private String deptId; + @Excel(name = "工序代码") @ApiModelProperty("工序代码") private String priceCode; diff --git a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/mapper/ReportUserProdMapper.xml b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/mapper/ReportUserProdMapper.xml index d963528..819663a 100644 --- a/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/mapper/ReportUserProdMapper.xml +++ b/common-ruoyi/ruoyi-system/src/main/java/com/ruoyi/yh/reportUserProd/mapper/ReportUserProdMapper.xml @@ -20,11 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" brp.price_unit as price_unit, brp.price_price as price_price, brp.report_id as report_id, - br.report_date as report_date, - br.status as report_status, brp.price_price * brup.num as total_price, brp.price_code as price_code, + br.report_date as report_date, + br.status as report_status, + br.dept_id as dept_id, sd.dept_name as dept_name + + + + from bst_report_user_prod brup left join sys_user su on su.user_id = brup.user_id left join bst_report_prod brp on brp.id = brup.prod_id @@ -44,6 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and month(br.report_date) = #{query.month} and date(br.report_date) >= #{query.startDate} and date(br.report_date) <= #{query.endDate} + and su.nick_name like concat('%', #{query.userName}, '%') + and brp.price_name like concat('%', #{query.priceName}, '%') + and brp.price_code like concat('%', #{query.priceCode}, '%') + and br.status = #{query.reportStatus} + and br.dept_id = #{query.deptId} and brup.prod_id in diff --git a/ruoyi-web/src/main/java/com/ruoyi/web/yh/DashboardController.java b/ruoyi-web/src/main/java/com/ruoyi/web/yh/DashboardController.java new file mode 100644 index 0000000..f195feb --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/web/yh/DashboardController.java @@ -0,0 +1,34 @@ +package com.ruoyi.web.yh; + +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.yh.dashboard.service.DashboardService; +import com.ruoyi.yh.reportUserProd.domain.ReportUserProdQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wjh + * 2025/1/14 + */ +@RestController +@RequestMapping("/yh/dashboard") +public class DashboardController extends BaseController { + + @Autowired + private DashboardService dashboardService; + + /** + * 查询员工产量统计 + */ + @PreAuthorize("@ss.hasPermi('yh:reportUserProd:list')") + @GetMapping("/userProd") + @DataScope(deptAlias = "sd") + public AjaxResult getUserProd(ReportUserProdQuery query) { + return success(dashboardService.selectUserProd(query)); + } +}