| | |
| | | |
| | | @TableField(exist = false) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 有效期 |
| | | */ |
| | | private BigDecimal validityPeriod; |
| | | |
| | | /** |
| | | * 备案凭证号 |
| | | */ |
| | | private String filingCertificateNo; |
| | | |
| | | /** |
| | | * UID码 |
| | | */ |
| | | private String uidNo; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("设备类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("设备编号") |
| | | private String deviceCode; |
| | | |
| | | @ApiModelProperty("转数(转/min)") |
| | | private BigDecimal rpm; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("设备类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("设备编号") |
| | | private String deviceCode; |
| | | |
| | | @ApiModelProperty("转数(转/min)") |
| | | private BigDecimal rpm; |
| | | } |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProcessRouteDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.service.ProcessRouteItemService; |
| | | import com.ruoyi.production.service.ProcessRouteService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import java.util.Arrays; |
| | | |
| | | @RestController |
| | | @RequestMapping("processRoute") |
| | | @RequestMapping("/processRoute") |
| | | @Api(tags = "工艺路线") |
| | | public class ProcessRouteController { |
| | | |
| | | @Autowired |
| | | private ProcessRouteService processRouteService; |
| | | |
| | | @GetMapping("page") |
| | | @GetMapping("/page") |
| | | @ApiOperation("分页查询") |
| | | public R page(Page<ProcessRouteDto> page, ProcessRouteDto processRouteDto) { |
| | | return R.ok(processRouteService.pageProcessRouteDto(page, processRouteDto)); |
| | | } |
| | | |
| | | @ApiOperation("新增工艺路线") |
| | | @ApiOperation("/新增工艺路线") |
| | | @PostMapping () |
| | | public R add(@RequestBody ProcessRoute processRoute) { |
| | | return R.ok(processRouteService.saveProcessRoute(processRoute)); |
| | | } |
| | | @ApiOperation("修改工艺路线") |
| | | @ApiOperation("/修改工艺路线") |
| | | @PutMapping () |
| | | public R update(@RequestBody ProcessRoute processRoute) { |
| | | return R.ok(processRouteService.updateById(processRoute)); |
| | | } |
| | | @ApiOperation("删除工艺路线") |
| | | @ApiOperation("/删除工艺路线") |
| | | @DeleteMapping("/{ids}") |
| | | public R delete(@PathVariable("ids") Long[] ids) { |
| | | return R.ok(processRouteService.batchDelete(Arrays.asList(ids))); |
| | |
| | | public R delete(@PathVariable("ids") Long[] ids) { |
| | | return R.ok(productOrderService.delete(ids)); |
| | | } |
| | | |
| | | @PatchMapping("/{id}") |
| | | public R finishOrder(@PathVariable Long id) { |
| | | return R.ok(productOrderService.finishOrder(id)); |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RequestMapping("productionProductInput") |
| | | @RequestMapping("/productionProductInput") |
| | | @RestController |
| | | @Api(value = "生产投入") |
| | | public class ProductionProductInputController { |
| | |
| | | @Autowired |
| | | private ProductionProductInputService productionProductInputService; |
| | | |
| | | @GetMapping("listPage") |
| | | @GetMapping("/listPage") |
| | | public R page(Page<ProductionProductInputDto> page, ProductionProductInputDto productionProductInputDto) { |
| | | return R.ok(productionProductInputService.listPageProductionProductInputDto(page, productionProductInputDto)); |
| | | } |
| | |
| | | private String model; |
| | | |
| | | private String bomNo; |
| | | private String uidNo; |
| | | } |
| | |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | //分页查询回显数据 |
| | | @Data |
| | | public class ProductBomDto extends ProductBom { |
| | |
| | | //产品规格型号 |
| | | private String productModelName; |
| | | |
| | | private String uidNo; |
| | | } |
| | |
| | | |
| | | //是否发货(台账页面颜色控制) |
| | | private Boolean isFh; |
| | | |
| | | private String uidNo; |
| | | } |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | import com.ruoyi.production.pojo.ProductWorkOrderFile; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | |
| | | @ApiModelProperty(value = "工序") |
| | | private String processName; |
| | | |
| | | private Long processId; |
| | | |
| | | //单位 |
| | | @ApiModelProperty(value = "单位") |
| | | private String unit; |
| | |
| | | //生产订单号 |
| | | @ApiModelProperty(value = "生产订单号") |
| | | private String productOrderNpsNo; |
| | | private Boolean productOrderIsEnd; |
| | | |
| | | @ApiModelProperty(value = "完成进度") |
| | | private BigDecimal completionStatus; |
| | |
| | | |
| | | @ApiModelProperty(value = "工单类型 正常 /返工返修") |
| | | private String workOrderType; |
| | | |
| | | private String uidNo; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "单位") |
| | | private String unit; |
| | | private String uidNo; |
| | | } |
| | |
| | | //产品规格型号 |
| | | @Excel(name = "产品规格型号") |
| | | private String productModelName; |
| | | private String uidNo; |
| | | |
| | | //单位 |
| | | @Excel(name = "单位") |
| | |
| | | private BigDecimal totalInvestment; |
| | | |
| | | private BigDecimal inspectedQuantity; |
| | | |
| | | // 其他数据 |
| | | private String otherData; |
| | | // 工序id |
| | | private Long processId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "批号") |
| | | private String batchNo; |
| | | |
| | | private Boolean isEnd; |
| | | } |
| | |
| | | @ApiModelProperty(value = "租户ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty(value = "设备id") |
| | | private Long deviceId; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "报废数量") |
| | | private BigDecimal scrapQty; |
| | | |
| | | @ApiModelProperty(value = "其他数据") |
| | | private String otherData; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.dto.ProductOrderDto; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | |
| | | Boolean addProductOrder(ProductOrder productOrder); |
| | | |
| | | Boolean delete(Long[] id); |
| | | |
| | | int finishOrder(Long orderId); |
| | | } |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import cn.hutool.core.util.BooleanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.dto.ProductOrderDto; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.production.service.ProductOrderService; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder) { |
| | | return productOrderMapper.pageProductOrder(page, productOrder); |
| | | IPage<ProductOrderDto> productOrderDtoIPage = productOrderMapper.pageProductOrder(page, productOrder); |
| | | List<ProductOrderDto> productOrderDtos = productOrderDtoIPage.getRecords(); |
| | | for (int i = 0; i < productOrderDtos.size(); i++) { |
| | | ProductOrderDto productOrderDto = productOrderDtos.get(i); |
| | | if (BooleanUtil.isTrue(productOrderDto.getIsEnd())) { |
| | | // 如果生产订单被结束,则将完成进度设置为100% |
| | | productOrderDto.setCompletionStatus(BigDecimal.valueOf(100)); |
| | | } |
| | | } |
| | | |
| | | return productOrderDtoIPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int finishOrder(Long orderId) { |
| | | ProductOrder productOrder = new ProductOrder(); |
| | | productOrder.setId(orderId); |
| | | productOrder.setIsEnd(true); |
| | | return productOrderMapper.updateById(productOrder); |
| | | } |
| | | } |
| | |
| | | productionProductMain.setProductProcessRouteItemId(dto.getProductProcessRouteItemId()); |
| | | productionProductMain.setWorkOrderId(dto.getWorkOrderId()); |
| | | productionProductMain.setStatus(0); |
| | | productionProductMain.setDeviceId(dto.getDeviceId()); |
| | | productionProductMainMapper.insert(productionProductMain); |
| | | /*新增报工投入表*/ |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listBybomAndProcess(productProcessRoute.getBomId(), productProcess.getId()); |
| | |
| | | productionProductOutput.setProductModelId(productProcessRouteItem.getProductModelId()); |
| | | productionProductOutput.setQuantity(dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO); |
| | | productionProductOutput.setScrapQty(dto.getScrapQty() != null ? dto.getScrapQty() : BigDecimal.ZERO); |
| | | productionProductOutput.setOtherData(dto.getOtherData() != null ? dto.getOtherData() : ""); |
| | | productionProductOutputMapper.insert(productionProductOutput); |
| | | //合格数量=报工数量 |
| | | BigDecimal productQty = productionProductOutput.getQuantity(); |
| | |
| | | private String BatchNo; |
| | | private BigDecimal inspectedQuantity; |
| | | private String manufacturingTeam; |
| | | @TableField(exist = false) |
| | | private String uidNo; |
| | | } |
| | |
| | | @ApiModelProperty("是否不合格处理自己新增") |
| | | @TableField(exist = false) |
| | | private Boolean method; |
| | | private String uidNo; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | |
| | | private ProcurementRecordService procurementRecordService; |
| | | |
| | | private ProductModelMapper productModelMapper; |
| | | |
| | | @Override |
| | | public int add(QualityInspectDto qualityInspectDto) { |
| | |
| | | |
| | | @Override |
| | | public IPage<QualityInspect> qualityInspectListPage(Page page, QualityInspect qualityInspect) { |
| | | IPage<QualityInspect> qualityInspectIPage = qualityInspectMapper.qualityInspectListPage(page, qualityInspect); |
| | | List<QualityInspect> records = qualityInspectIPage.getRecords(); |
| | | for (int i = 0; i < records.size(); i++) { |
| | | QualityInspect item = records.get(i); |
| | | ProductModel productModel = productModelMapper.selectById(item.getProductModelId()); |
| | | if (productModel == null) { |
| | | continue; |
| | | } |
| | | item.setUidNo(productModel.getUidNo()); |
| | | } |
| | | |
| | | return qualityInspectMapper.qualityInspectListPage(page, qualityInspect); |
| | | } |
| | | |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Integer hasSufficientStock; |
| | | |
| | | @TableField(exist = false) |
| | | private String uidNo; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; |
| | | import com.ruoyi.framework.web.domain.R; |
| | |
| | | private ShippingInfoServiceImpl shippingInfoService; |
| | | |
| | | private StockUtils stockUtils; |
| | | private ProductModelMapper productModelMapper; |
| | | |
| | | |
| | | |
| | |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectSalesLedgerProductList(salesLedgerProduct); |
| | | if(!CollectionUtils.isEmpty(salesLedgerProducts)){ |
| | | salesLedgerProducts.forEach(item -> { |
| | | ProductModel productModel = productModelMapper.selectById(item.getProductModelId()); |
| | | item.setUidNo(productModel != null ? productModel.getUidNo() : ""); |
| | | |
| | | // 发货信息 |
| | | ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getSalesLedgerProductId, item.getId()) |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("importStockInventory") |
| | | @PostMapping("/importStockInventory") |
| | | @ApiOperation("导入库存") |
| | | public R importStockInventory(MultipartFile file) { |
| | | return stockInventoryService.importStockInventory(file); |
| | |
| | | stockInventoryService.exportStockInventory(response, stockInventoryDto); |
| | | } |
| | | |
| | | @GetMapping("stockInventoryPage") |
| | | @GetMapping("/stockInventoryPage") |
| | | @ApiOperation("库存报表查询") |
| | | public R stockInventoryPage(Page page, StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.stockInventoryPage(stockInventoryDto,page)); |
| | | } |
| | | |
| | | @GetMapping("stockInAndOutRecord") |
| | | @GetMapping("/stockInAndOutRecord") |
| | | @ApiOperation("统计各个产品的入库和出库记录") |
| | | public R stockInAndOutRecord(StockInventoryDto stockInventoryDto,Page page) { |
| | | return R.ok(stockInventoryService.stockInAndOutRecord(stockInventoryDto,page)); |
| | |
| | | * 产品单位 |
| | | */ |
| | | private String unit; |
| | | private String uidNo; |
| | | |
| | | private String timeStr; |
| | | |
| | |
| | | |
| | | private String productName; |
| | | private String model; |
| | | private String uidNo; |
| | | private String unit; |
| | | |
| | | |
| | |
| | | * 产品规格 |
| | | */ |
| | | private String model; |
| | | private String uidNo; |
| | | /** |
| | | * 产品单位 |
| | | */ |
| | |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="product_name" property="productName" /> |
| | | <result column="product_id" property="productId" /> |
| | | <result column="validity_period" property="validityPeriod" /> |
| | | <result column="filing_certificate_no" property="filingCertificateNo" /> |
| | | <result column="uid_no" property="uidNo" /> |
| | | </resultMap> |
| | | <select id="listPageProductModel" resultType="com.ruoyi.basic.pojo.ProductModel"> |
| | | select pm.*,p.product_name |
| | |
| | | dl.tenant_id, |
| | | dl.is_depr, |
| | | dl.annual_depreciation_amount, |
| | | dl.type |
| | | dl.type, |
| | | dl.device_code, |
| | | dl.rpm |
| | | FROM device_ledger dl |
| | | left join sys_user su on dl.create_user = su.user_id |
| | | <where> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="pageProcessRouteDto" resultType="com.ruoyi.production.dto.ProcessRouteDto"> |
| | | select ps.*, p.product_name,pm.product_id,pm.model,pb.bom_no |
| | | select ps.*, p.product_name,pm.product_id,pm.model,pb.bom_no, pm.uid_no |
| | | from process_route ps |
| | | left join product_bom pb on ps.bom_id = pb.id |
| | | left join product_model pm on ps.product_model_id = pm.id |
| | |
| | | <select id="listPage" resultType="com.ruoyi.production.dto.ProductBomDto"> |
| | | select * from (select pb.*, |
| | | pm.model productModelName, |
| | | p.product_name productName |
| | | p.product_name productName, |
| | | pm.uid_no |
| | | from product_bom pb |
| | | left join product_model pm on pb.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id)A |
| | |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="expectedSchedule" column="expected_schedule"/> |
| | | <result property="manufacturingTeam" column="manufacturing_team"/> |
| | | <result property="isEnd" column="is_end"/> |
| | | </resultMap> |
| | | <select id="pageProductOrder" resultType="com.ruoyi.production.dto.ProductOrderDto"> |
| | | select po.*, |
| | |
| | | p.product_name as product_category, |
| | | pm.model as specification_model, |
| | | pm.unit, |
| | | pm.uid_no, |
| | | ppr.process_route_code, |
| | | pb.bom_no, |
| | | ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus, |
| | |
| | | <select id="pageProductWorkOrder" resultType="com.ruoyi.production.dto.ProductWorkOrderDto"> |
| | | SELECT |
| | | pwo.*, |
| | | pp.id as processId, |
| | | pp.NAME as processName, |
| | | pm.model, |
| | | pm.unit, |
| | | pm.uid_no, |
| | | p.product_name AS productName, |
| | | po.nps_no AS productOrderNpsNo, |
| | | po.is_end as productOrderIsEnd, |
| | | ROUND(pwo.complete_quantity / pwo.plan_quantity * 100, 2) AS completionStatus, |
| | | CASE |
| | | WHEN pwo.work_order_no LIKE 'FG%' THEN '返工返修' |
| | |
| | | pm.model as model, |
| | | ppm.product_no as productNo, |
| | | p.product_name, |
| | | pm.unit |
| | | pm.unit, |
| | | pm.uid_no |
| | | from |
| | | production_product_input ppi |
| | | left join production_product_main ppm on ppm.id = ppi.product_main_id |
| | |
| | | u.nick_name as nickName, |
| | | p.product_name as productName, |
| | | pp.name as process, |
| | | pp.id as processId, |
| | | pm.model as productModelName, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | | pm.unit, |
| | | pm.uid_no, |
| | | sl.sales_contract_no salesContractNo |
| | | from |
| | | production_product_main ppm |
| | |
| | | qu.deal_result, |
| | | qu.deal_name, |
| | | qu.deal_time, |
| | | pm.uid_no, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN pm.model |
| | | ELSE qu.model |
| | |
| | | p.product_name as product_name, |
| | | pm.model, |
| | | pm.unit, |
| | | pm.uid_no |
| | | u.nick_name as createBy |
| | | FROM stock_in_record as sir |
| | | LEFT JOIN product_model as pm on sir.product_model_id = pm.id |
| | |
| | | pm.model, |
| | | si.remark, |
| | | pm.unit, |
| | | pm.uidNo, |
| | | p.product_name |
| | | from stock_inventory si |
| | | left join product_model pm on si.product_model_id = pm.id |
| | |
| | | select sir.*,si.qualitity as current_stock, |
| | | pm.model, |
| | | pm.unit, |
| | | pm.uidNo, |
| | | p.product_name, |
| | | su.nick_name as create_by |
| | | from |
| | |
| | | p.product_name as productName, |
| | | pm.model, |
| | | pm.unit, |
| | | pm.uidNo, |
| | | u.nick_name as createBy |
| | | FROM stock_out_record as sor |
| | | LEFT JOIN product_model as pm on sor.product_model_id = pm.id |