| | |
| | | * @param productionProductMainDto |
| | | * @return |
| | | */ |
| | | @ApiOperation("报工台账汇总分页(当前登录人)") |
| | | @ApiOperation("报工台账汇总分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "current", value = "页码", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "size", value = "每页数量", dataType = "long", paramType = "query"), |
| | |
| | | /** |
| | | * 报工明细查询(每条报工记录) |
| | | */ |
| | | @ApiOperation("报工明细分页(每条报工记录, 当前登录人)") |
| | | @ApiOperation("报工明细分页(每条报工记录)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "current", value = "页码", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "size", value = "每页数量", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "workOrderId", value = "工单ID(建议必传)", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "workOrderId", value = "工单ID", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "startDate", value = "开始日期(按结束时间过滤, yyyy-MM-dd)", dataType = "string", paramType = "query"), |
| | | @ApiImplicitParam(name = "endDate", value = "结束日期(按结束时间过滤, yyyy-MM-dd)", dataType = "string", paramType = "query") |
| | | }) |
| | |
| | | return R.ok(productionProductMainService.listPageProductionProductMainDetailDto(page, productionProductMainDto)); |
| | | } |
| | | |
| | | /** |
| | | * 报工明细汇总(每个人员每天) |
| | | */ |
| | | @ApiOperation("报工每日汇总分页(每人每天, 当前登录人)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "current", value = "页码", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "size", value = "每页数量", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "workOrderId", value = "工单ID(建议必传)", dataType = "long", paramType = "query"), |
| | | @ApiImplicitParam(name = "startDate", value = "开始日期(report_date, yyyy-MM-dd)", dataType = "string", paramType = "query"), |
| | | @ApiImplicitParam(name = "endDate", value = "结束日期(report_date, yyyy-MM-dd)", dataType = "string", paramType = "query") |
| | | }) |
| | | @GetMapping("listPageDaily") |
| | | public R<?> pageDaily(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto) { |
| | | return R.ok(productionProductMainService.listPageProductionProductMainDailyDto(page, productionProductMainDto)); |
| | | } |
| | | |
| | | /** |
| | | * 报工新增更新 |
| | |
| | | |
| | | IPage<ProductionProductMainDto> listPageProductionProductMainDetailDto(Page<ProductionProductMainDto> page, @Param("c") ProductionProductMainDto productionProductMainDto); |
| | | |
| | | IPage<ProductionProductMainDto> listPageProductionProductMainDailyDto(Page<ProductionProductMainDto> page, @Param("c") ProductionProductMainDto productionProductMainDto); |
| | | |
| | | /** |
| | | * 根据工单ID批量删除生产主表数据 |
| | | */ |
| | |
| | | |
| | | IPage<ProductionProductMainDto> listPageProductionProductMainDetailDto(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto); |
| | | |
| | | IPage<ProductionProductMainDto> listPageProductionProductMainDailyDto(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto); |
| | | |
| | | Boolean addProductMain(ProductionProductMainDto productionProductMainDto); |
| | | |
| | | /** |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProductionProductMainDto> listPageProductionProductMainDailyDto(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto) { |
| | | if (productionProductMainDto == null) { |
| | | productionProductMainDto = new ProductionProductMainDto(); |
| | | } |
| | | IPage<ProductionProductMainDto> result = productionProductMainMapper.listPageProductionProductMainDailyDto(page, productionProductMainDto); |
| | | fillHourDefaults(result.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | private void fillHourDefaults(List<ProductionProductMainDto> records) { |
| | | if (records == null || records.isEmpty()) { |
| | | return; |
| | |
| | | order by max(ppm.id) desc |
| | | </select> |
| | | |
| | | <select id="listPageProductionProductMainDailyDto" resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | select |
| | | min(ppm.id) as id, |
| | | min(ppm.product_no) as productNo, |
| | | d.user_id as userId, |
| | | d.work_order_id as workOrderId, |
| | | max(pwo.work_order_no) as workOrderNo, |
| | | max(po.nps_no) as productOrderNpsNo, |
| | | max(pwo.status) as workOrderStatus, |
| | | max(u.nick_name) as nickName, |
| | | max(p.product_name) as productName, |
| | | max(CASE pp.type |
| | | WHEN 1 THEN '加工' |
| | | WHEN 2 THEN '刮板冷芯制作' |
| | | WHEN 3 THEN '管路组对' |
| | | WHEN 4 THEN '罐体连接及调试' |
| | | WHEN 5 THEN '测试打压' |
| | | WHEN 6 THEN '其他' |
| | | ELSE pp.name |
| | | END) as process, |
| | | max(pm.model) as productModelName, |
| | | max(pm.unit) as unit, |
| | | max(sl.sales_contract_no) as salesContractNo, |
| | | d.report_date as schedulingDate, |
| | | sum(d.duration_minutes) as reportDurationMinutes, |
| | | round(sum(d.duration_minutes) / 60, 2) as dailyPersonHours, |
| | | round(sum(d.duration_minutes) / 60, 2) as actualReportHours, |
| | | sum(ifnull(ppo.quantity, 0)) as quantity, |
| | | sum(ifnull(ppo.scrap_qty, 0)) as scrapQty, |
| | | sum(ifnull(ppo.quantity, 0)) as outputTotalQuantity, |
| | | sum(ifnull(ppo.scrap_qty, 0)) as scrapTotalQuantity, |
| | | round(ifnull(( |
| | | select sum(ifnull(pri.planned_work_hours, 0)) |
| | | from product_process_route_item pri |
| | | where pri.product_order_id = po.id |
| | | ), 0), 2) as projectTotalHours, |
| | | ifnull(max(pp.salary_quota), 0) as processStandardHours |
| | | from production_product_report_daily d |
| | | left join production_product_main ppm on ppm.id = d.product_main_id |
| | | left join product_work_order pwo on pwo.id = d.work_order_id |
| | | left join product_process_route_item ppri on ppri.id = pwo.product_process_route_item_id |
| | | left join product_process pp on pp.id = ppri.process_id |
| | | left join product_order po on po.id = pwo.product_order_id |
| | | left join production_product_output ppo |
| | | on ppm.id = ppo.product_main_id |
| | | and date(ppm.report_end_time) = d.report_date |
| | | left join product_model pm on pm.id = ppo.product_model_id |
| | | left join product p on p.id = pm.product_id |
| | | left join sales_ledger sl on sl.id = po.sales_ledger_id |
| | | left join sys_user u on u.user_id = d.user_id |
| | | <where> |
| | | <if test="c.workOrderId != null"> |
| | | and d.work_order_id = #{c.workOrderId} |
| | | </if> |
| | | <if test="c.nickName != null and c.nickName != ''"> |
| | | and u.nick_name like concat('%',#{c.nickName},'%') |
| | | </if> |
| | | <if test="c.workOrderNo != null and c.workOrderNo != ''"> |
| | | and pwo.work_order_no like concat('%',#{c.workOrderNo},'%') |
| | | </if> |
| | | <if test="c.workOrderStatus != null and c.workOrderStatus != ''"> |
| | | and pwo.status = #{c.workOrderStatus} |
| | | </if> |
| | | <if test="c.userId != null"> |
| | | and d.user_id = #{c.userId} |
| | | </if> |
| | | <if test="c.startDate != null"> |
| | | and d.report_date <![CDATA[ >= ]]> #{c.startDate} |
| | | </if> |
| | | <if test="c.endDate != null"> |
| | | and d.report_date <![CDATA[ <= ]]> #{c.endDate} |
| | | </if> |
| | | </where> |
| | | group by d.work_order_id, d.user_id, d.report_date, po.sales_ledger_id, po.sale_ledger_product_id |
| | | order by d.report_date desc, d.user_id |
| | | </select> |
| | | |
| | | <select id="listPageProductionProductMainDetailDto" resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | select |
| | | ppm.*, |