| | |
| | | productWorkOrderservice.down(response, productWorkOrder); |
| | | } |
| | | |
| | | @ApiOperation("根据生产订单id查询数据") |
| | | @GetMapping("/getByProductOrderId/{productOrderId}") |
| | | public R getProductWorkOrderListByProductOrderId(@PathVariable Long productOrderId) { |
| | | return R.ok(productWorkOrderservice.getByProductOrderId(productOrderId)); |
| | | } |
| | | } |
| | |
| | | ExcelUtil<ProductionProductMainDto> util = new ExcelUtil<ProductionProductMainDto>(ProductionProductMainDto.class); |
| | | util.exportExcel(response, list, "生产报工数据"); |
| | | } |
| | | |
| | | @GetMapping("/getByProductWorkOrderId/{productWorkOrderId}") |
| | | public R getByProductWorkOrderId(@PathVariable Long productWorkOrderId) { |
| | | return R.ok(productionProductMainService.getByProductWorkOrderId(productWorkOrderId)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private Long processId; |
| | | |
| | | @ApiModelProperty(value = "工序编号") |
| | | private String processNo; |
| | | |
| | | //单位 |
| | | @ApiModelProperty(value = "单位") |
| | | private String unit; |
| | |
| | | |
| | | @ApiModelProperty(value = "是否可以报工") |
| | | private Boolean isCanReport; |
| | | |
| | | // 合格数量 |
| | | @ApiModelProperty(value = "合格数量") |
| | | private BigDecimal completeQty; |
| | | |
| | | @ApiModelProperty(value = "不良率") |
| | | private BigDecimal scrapRate; |
| | | } |
| | |
| | | |
| | | IPage<ProductWorkOrderDto> pageProductWorkOrder(Page<ProductWorkOrderDto> page, @Param("c") ProductWorkOrderDto productWorkOrder); |
| | | |
| | | List<ProductWorkOrderDto> getByProductOrderId(@Param("productOrderId") Long productOrderId); |
| | | |
| | | ProductWorkOrderDto getProductWorkOrderFlowCard(@Param("id") Long id); |
| | | |
| | | List<ProductWorkOrderDto> selectWorkOrderStartStats(@Param("startDate") String startDate, @Param("endDate") String endDate); |
| | |
| | | IPage<ProductionProductMainDto> listProductionDetails(@Param("ew") SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page); |
| | | |
| | | ArrayList<Long> listMain(List<Long> idList); |
| | | |
| | | List<ProductionProductMainDto> getByProductWorkOrderId(Long productWorkOrderId); |
| | | } |
| | |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | public interface ProductWorkOrderService extends IService<ProductWorkOrder>{ |
| | | |
| | |
| | | int updateProductWorkOrder(ProductWorkOrderDto productWorkOrderDto); |
| | | |
| | | void down(HttpServletResponse response, ProductWorkOrder productWorkOrder); |
| | | |
| | | List<ProductWorkOrderDto> getByProductOrderId(Long productOrderId); |
| | | } |
| | |
| | | Boolean removeProductMain(Long id); |
| | | |
| | | ArrayList<Long> listMain(List<Long> idList); |
| | | |
| | | List<ProductionProductMainDto> getByProductWorkOrderId(Long productWorkOrderId); |
| | | } |
| | |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductWorkOrderDto> getByProductOrderId(Long productOrderId) { |
| | | return productWorkOrdermapper.getByProductOrderId(productOrderId); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | public ArrayList<Long> listMain(List<Long> idList) { |
| | | return productionProductMainMapper.listMain(idList); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductionProductMainDto> getByProductWorkOrderId(Long productWorkOrderId) { |
| | | return productionProductMainMapper.getByProductWorkOrderId(productWorkOrderId); |
| | | } |
| | | } |
| | |
| | | </if> |
| | | order by pwo.priority |
| | | </select> |
| | | |
| | | <select id="getByProductOrderId" resultType="com.ruoyi.production.dto.ProductWorkOrderDto"> |
| | | SELECT |
| | | pwo.*, |
| | | pp.id as processId, |
| | | pp.NAME as processName, |
| | | pp.no as processNo, |
| | | pm.model, |
| | | pm.unit, |
| | | p.product_name AS productName, |
| | | po.nps_no AS productOrderNpsNo, |
| | | ppri.drag_sort, |
| | | ppri.product_route_id, |
| | | sum(ppo.scrap_qty) scrapQty, |
| | | ROUND(pwo.complete_quantity / pwo.plan_quantity * 100, 2) AS completionStatus, |
| | | ROUND(sum(ppo.scrap_qty) / pwo.complete_quantity * 100, 2) AS scrapRate, |
| | | (pwo.complete_quantity - sum(ppo.scrap_qty)) AS completeQty, |
| | | CASE |
| | | WHEN pwo.work_order_no LIKE 'FG%' THEN '返工返修' |
| | | ELSE '正常' |
| | | END AS work_order_type |
| | | FROM |
| | | product_work_order pwo |
| | | LEFT JOIN product_process_route_item ppri ON ppri.id = pwo.product_process_route_item_id |
| | | LEFT JOIN product_order po ON po.id = pwo.product_order_id |
| | | LEFT JOIN product_process pp ON pp.id = ppri.process_id |
| | | LEFT JOIN product_model pm ON pm.id = ppri.product_model_id |
| | | LEFT JOIN product p ON p.id = pm.product_id |
| | | LEFT JOIN production_product_main ppm ON ppm.work_order_id = pwo.id |
| | | LEFT JOIN production_product_output ppo ON ppo.product_main_id = ppm.id |
| | | where po.id=#{productOrderId} |
| | | order by ppri.drag_sort |
| | | </select> |
| | | <select id="getProductWorkOrderFlowCard" resultType="com.ruoyi.production.dto.ProductWorkOrderDto"> |
| | | SELECT |
| | | pwo.*, |
| | |
| | | order by ppm.id |
| | | |
| | | </select> |
| | | <select id="getByProductWorkOrderId" resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | select ppm.*, |
| | | pwo.work_order_no as workOrderNo, |
| | | pwo.status as workOrderStatus, |
| | | u.nick_name as nickName, |
| | | p.product_name as productName, |
| | | pp.name as process, |
| | | pm.model as productModelName, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | | ppo.other_data, |
| | | pm.unit, |
| | | sl.sales_contract_no salesContractNo |
| | | from |
| | | production_product_main ppm |
| | | left join product_work_order pwo on pwo.id = ppm.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 |
| | | 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 = ppm.user_id |
| | | where pwo.id = #{productWorkOrderId} |
| | | order by ppm.id |
| | | </select> |
| | | |
| | | <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductOrder"> |
| | | select po.* |
| | | from product_order po |