| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | public AjaxResult importProduct(MultipartFile file) { |
| | | return AjaxResult.success(productModelService.importProduct(file)); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢ææäº§ååå·") |
| | | @GetMapping("/pageModel") |
| | | public IPage<ProductModel> listPageProductModel(Page<ProductModel> page, ProductModel productModel) { |
| | | return productService.listPageProductModel(page, productModel); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | | /** |
| | |
| | | * @date 2025-05-19 |
| | | */ |
| | | public interface ProductModelMapper extends BaseMapper<ProductModel> { |
| | | |
| | | IPage<ProductModel> listPageProductModel(Page<ProductModel> page, @Param("c") ProductModel productModel); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | 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.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | List<ProductTreeDto> selectProductList(ProductDto productDto); |
| | | |
| | | IPage<ProductModel> listPageProductModel(Page<ProductModel> page, ProductModel productModel); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | |
| | | return tree; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<ProductModel> listPageProductModel(Page<ProductModel> page, ProductModel productModel) { |
| | | return productModelMapper.listPageProductModel(page, productModel); |
| | | } |
| | | |
| | | // éå½æå»ºåèç¹ |
| | | private List<ProductTreeDto> buildChildrenNodes(Long parentId) { |
| | |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | List<ProcurementPageDtoCopy> listCopy(); |
| | | |
| | | List<ProcurementPageDto> list(); |
| | | |
| | | BigDecimal getSumQuantity(@Param("productModelId") Long productModelId); |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | IPage<ProcurementRecordOutPageDto> listPage(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | List<ProcurementRecordOutPageDto> list(); |
| | | BigDecimal getSumQuantity(@Param("productModelId") Long productModelId); |
| | | |
| | | ProcurementRecordOut selectCode(@Param("format") String format); |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | private Integer type; |
| | | |
| | | private Long productModelId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.utils; |
| | | |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class StockUtils { |
| | | private final ProcurementRecordOutMapper procurementRecordOutMapper; |
| | | private final ProcurementRecordMapper procurementRecordMapper; |
| | | |
| | | // è·åååå
¥åºæ°é,åºåºæ°é,å©ä½åºå |
| | | public Map<String, BigDecimal> getStockQuantity(Long productModelId) { |
| | | // å
¥åºæ°é |
| | | BigDecimal sumQuantity = procurementRecordMapper.getSumQuantity(productModelId); |
| | | // åºåºæ°é |
| | | BigDecimal outQuantity = procurementRecordOutMapper.getSumQuantity(productModelId); |
| | | // å©ä½åºå |
| | | BigDecimal stockQuantity = outQuantity.compareTo(sumQuantity) > 0 ? BigDecimal.ZERO : sumQuantity.subtract(outQuantity); |
| | | Map<String, BigDecimal> stockMap = new HashMap<>(); |
| | | stockMap.put("inboundNum", sumQuantity); |
| | | stockMap.put("outboundNum", outQuantity); |
| | | stockMap.put("stockQuantity", stockQuantity); |
| | | return stockMap; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | 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.service.ProcessRouteService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | @RestController |
| | | @RequestMapping("processRoute") |
| | | @Api(tags = "å·¥èºè·¯çº¿") |
| | | public class ProcessRouteController { |
| | | |
| | | @Autowired |
| | | private ProcessRouteService processRouteService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public R page(Page<ProcessRouteDto> page, ProcessRouteDto processRouteDto) { |
| | | return R.ok(processRouteService.pageProcessRouteDto(page, processRouteDto)); |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢å·¥èºè·¯çº¿") |
| | | @PostMapping () |
| | | public R add(@RequestBody ProcessRoute processRoute) { |
| | | return R.ok(processRouteService.saveProcessRoute(processRoute)); |
| | | } |
| | | @ApiOperation("ä¿®æ¹å·¥èºè·¯çº¿") |
| | | @PutMapping () |
| | | public R update(@RequestBody ProcessRoute processRoute) { |
| | | return R.ok(processRouteService.updateById(processRoute)); |
| | | } |
| | | @ApiOperation("å é¤å·¥èºè·¯çº¿") |
| | | @DeleteMapping("/{ids}") |
| | | public R delete(@PathVariable("ids") Long[] ids) { |
| | | return R.ok(processRouteService.batchDelete(Arrays.asList(ids))); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProcessRouteItemDto; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.service.ProcessRouteItemService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("processRouteItem") |
| | | @Api(tags = "å·¥èºè·¯çº¿æç»") |
| | | public class ProcessRouteItemController { |
| | | @Autowired |
| | | private ProcessRouteItemService processRouteItemService; |
| | | |
| | | @GetMapping("list") |
| | | public R listProcessRouteItemDto(ProcessRouteItemDto processRouteItemDto) { |
| | | return R.ok(processRouteItemService.listProcessRouteItemDto(processRouteItemDto)); |
| | | } |
| | | |
| | | @PostMapping () |
| | | @ApiOperation("æ°å¢ä¿®æ¹") |
| | | public R addOrUpdate(@RequestBody ProcessRouteItem processRouteItem) { |
| | | return R.ok(processRouteItemService.saveOrUpdate(processRouteItem)); |
| | | } |
| | | |
| | | @PostMapping ("/sort") |
| | | @ApiOperation("æåº") |
| | | public R sort(@RequestBody ProcessRouteItem processRouteItem) { |
| | | return R.ok(processRouteItemService.sort(processRouteItem)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤å·¥èºè·¯çº¿æç»") |
| | | @DeleteMapping("/batchDelete/{id}") |
| | | @Log(title = "å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult batchDelete(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(processRouteItemService.batchDelete(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import com.ruoyi.production.service.ProcessRouteService; |
| | | import com.ruoyi.production.service.ProductBomService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * BOM主表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-15 09:59:27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/productBom") |
| | | public class ProductBomController { |
| | | |
| | | @Autowired |
| | | private ProductBomService productBomService; |
| | | |
| | | @Autowired |
| | | private ProcessRouteService processRouteService; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "BOM-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("BOM-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProductBomDto productBomDto) { |
| | | IPage<ProductBomDto> listPage = productBomService.listPage(page, productBomDto); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @ApiModelProperty("æ°å¢BOM") |
| | | @PostMapping("/add") |
| | | @Log(title = "æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add( @RequestBody ProductBom productBom) { |
| | | return productBomService.add(productBom); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°BOM") |
| | | @Log(title = "ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody ProductBom productBom) { |
| | | return AjaxResult.success(productBomService.updateById(productBom)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤BOM") |
| | | @DeleteMapping("/batchDelete") |
| | | @Log(title = "å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult batchDelete(@RequestBody List<Integer> ids) { |
| | | // List<ProcessRoute> list = processRouteService.list(Wrappers.<ProcessRoute>lambdaQuery().in(ProcessRoute::getBomId, ids)); |
| | | // List<ProductProcessRoute> list2 = productProcessRouteService.list(Wrappers.<ProductProcessRoute>lambdaQuery().in(ProductProcessRoute::getBomId, ids)); |
| | | // if (list.size()>0 || list2.size()>0){ |
| | | // return AjaxResult.error("该BOMå·²ç»åå¨å¯¹åºçå·¥èºè·¯çº¿,æ æ³è¿è¡å é¤"); |
| | | // } |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(productBomService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @GetMapping("/getByModel") |
| | | @Log(title = "BOM-æ ¹æ®éæ©çè§æ ¼åå·idæ¥è¯¢åå¨çbom", businessType = BusinessType.OTHER) |
| | | @ApiOperation("BOM-æ ¹æ®éæ©çè§æ ¼åå·idæ¥è¯¢åå¨çbom") |
| | | public AjaxResult getByModel(Long productModelId) { |
| | | List<ProductBom> productBoms = productBomService.list(Wrappers.<ProductBom>lambdaQuery().eq(ProductBom::getProductModelId, productModelId)); |
| | | return AjaxResult.success(productBoms); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import com.ruoyi.production.service.impl.ProductProcessServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "å·¥åº") |
| | | @RequestMapping("/productProcess") |
| | | public class ProductProcessController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | private ProductProcessServiceImpl productProcessService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å·¥åº-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å·¥åº-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProductProcessDto productProcessDto) { |
| | | IPage<ProductProcessDto> listPage = productProcessService.listPage(page, productProcessDto); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @ApiModelProperty("æ°å¢å·¥åº") |
| | | @PostMapping() |
| | | @Log(title = "æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add( @RequestBody ProductProcessDto productProcessDto) { |
| | | return productProcessService.add(productProcessDto); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°å·¥åº") |
| | | @Log(title = "ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody ProductProcess productProcess) { |
| | | return AjaxResult.success(productProcessService.updateById(productProcess)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤å·¥åº") |
| | | @DeleteMapping("/batchDelete") |
| | | @Log(title = "å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult batchDelete(@RequestBody List<Integer> ids) { |
| | | return AjaxResult.success(productProcessService.batchDelete(ids)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ææå·¥åº") |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(productProcessService.list()); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥å·¥åº |
| | | */ |
| | | @Log(title = "å·¥åº", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | return productProcessService.importData(file); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | | @Log(title = "å·¥åº-ä¸è½½æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<ProductProcess> util = new ExcelUtil<ProductProcess>(ProductProcess.class); |
| | | util.importTemplateExcel(response, "å·¥åºæ¨¡æ¿"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.service.ProductStructureService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RequestMapping("productStructure") |
| | | @RestController |
| | | @Api(tags = "BOM") |
| | | public class ProductStructureController { |
| | | @Autowired |
| | | private ProductStructureService productStructureService; |
| | | |
| | | |
| | | @ApiOperation("æ°å¢BOM") |
| | | @PostMapping() |
| | | public R addOrUpdate(@RequestBody ProductStructureDto productStructureDto){ |
| | | return R.ok(productStructureService.addProductStructureDto(productStructureDto)); |
| | | } |
| | | |
| | | @ApiOperation("BOMæ¥ç详æ
") |
| | | @GetMapping("/listBybomId/{bomId}") |
| | | public R listBybomId( @PathVariable("bomId") Long bomId){ |
| | | return R.ok(productStructureService.listBybomId(bomId)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProcessSchedulingDto; |
| | | import com.ruoyi.production.dto.ProductionReportDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto; |
| | | import com.ruoyi.production.dto.SalesLedgerWorkDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerWork; |
| | | import com.ruoyi.production.service.SalesLedgerWorkService; |
| | | import com.ruoyi.production.service.impl.SalesLedgerWorkServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProcessRouteDto extends ProcessRoute { |
| | | |
| | | private Long productId; |
| | | |
| | | private String productName; |
| | | |
| | | @ApiModelProperty("è§æ ¼") |
| | | private String model; |
| | | |
| | | private String bomNo; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProcessRouteItemDto extends ProcessRouteItem { |
| | | |
| | | @ApiModelProperty(value = "å·¥åºåç§°") |
| | | private String processName; |
| | | |
| | | @ApiModelProperty(value = "å·¥èºè·¯çº¿åç§°") |
| | | private String routeName; |
| | | |
| | | @ApiModelProperty(value = "çäº§çæº") |
| | | private String speculativeTradingName; |
| | | |
| | | @ApiModelProperty(value = "产ååç§°") |
| | | private String productName; |
| | | |
| | | @ApiModelProperty(value = "åä½") |
| | | private String unit; |
| | | |
| | | private Long productId; |
| | | |
| | | |
| | | private String model; |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | @ApiModelProperty(value = "æäº§æ°é") |
| | | private BigDecimal schedulingNum; |
| | | |
| | | |
| | | /** |
| | | * å·¥æ¶å®é¢ |
| | | */ |
| | |
| | | private BigDecimal workHours; |
| | | |
| | | /** |
| | | * 产线 |
| | | */ |
| | | @ApiModelProperty(value = "产线") |
| | | private String productionLine; |
| | | |
| | | /** |
| | | * å·¥åº |
| | | */ |
| | | @ApiModelProperty(value = "å·¥åº") |
| | | private String process; |
| | | |
| | | |
| | | /** |
| | | * æäº§æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "æäº§æ¥æ") |
| | | private String schedulingDate; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * æè |
| | | */ |
| | | @ApiModelProperty(value = "æè") |
| | | private String loss; |
| | | |
| | | /** |
| | | * å£å³åç±» |
| | | */ |
| | | @ApiModelProperty(value = "å£å³åç±»") |
| | | private String type; |
| | | |
| | | /** |
| | | * é¢ç¨ |
| | | */ |
| | | @ApiModelProperty(value = "é¢ç¨") |
| | | private String receive; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import lombok.Data; |
| | | |
| | | //å页æ¥è¯¢åæ¾æ°æ® |
| | | @Data |
| | | public class ProductBomDto extends ProductBom { |
| | | |
| | | //产ååç§° |
| | | private String productName; |
| | | |
| | | //产åè§æ ¼åå· |
| | | private String productModelName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class ProductProcessDto extends ProductProcess { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ProductStructureDto extends ProductStructure { |
| | | |
| | | @ApiModelProperty(value = "å·¥èºåç§°") |
| | | private String processName; |
| | | @ApiModelProperty(value = "产ååç§°") |
| | | private String productName; |
| | | @ApiModelProperty(value = "产åid") |
| | | private Long productId; |
| | | |
| | | private String model; |
| | | |
| | | private List<ProductStructure> productStructureList; |
| | | } |
| | |
| | | @ApiModelProperty(value = "æäº§æ¥æ") |
| | | private String schedulingDate; |
| | | |
| | | /** |
| | | * çäº§çæº |
| | | */ |
| | | private String speculativeTradingName; |
| | | /** |
| | | * 产线 |
| | | */ |
| | | @ApiModelProperty(value = "产线") |
| | | private String productionLine; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | private String specificationModel; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "çäº§æ¥æ") |
| | | private String schedulingDate; |
| | | |
| | | |
| | | /** |
| | | * å
¥åºåä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºåä»·") |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * å
¥åºæ»ä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºæ»ä»·") |
| | | private BigDecimal totalPrice; |
| | | } |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @ExcelIgnoreUnannotated |
| | | public class SalesLedgerProductionAccountingDto extends SalesLedgerProductDto{ |
| | | |
| | | /** |
| | |
| | | * æäº§äººåç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç产人åç§°") |
| | | @Excel(name = "ç产人") |
| | | private String schedulingUserName; |
| | | |
| | | |
| | |
| | | * å·¥èµ |
| | | */ |
| | | @ApiModelProperty(value = "å·¥èµ") |
| | | @Excel(name = "å·¥èµ") |
| | | private BigDecimal wages; |
| | | |
| | | /** |
| | | * ç产æ°é |
| | | */ |
| | | @ApiModelProperty(value = "ç产æ°é") |
| | | @Excel(name = "ç产æ°é") |
| | | private BigDecimal finishedNum; |
| | | |
| | | /** |
| | | * å·¥æ¶å®é¢ |
| | | */ |
| | | @ApiModelProperty(value = "å·¥æ¶å®é¢") |
| | | @Excel(name = "å·¥æ¶å®é¢") |
| | | private BigDecimal workHours; |
| | | |
| | | /** |
| | | * å·¥åº |
| | | */ |
| | | @ApiModelProperty(value = "å·¥åº") |
| | | @Excel(name = "å·¥åº") |
| | | private String process; |
| | | /** |
| | | * æäº§æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "æäº§æ¥æ") |
| | | @Excel(name = "çäº§æ¥æ") |
| | | private String schedulingDate; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.production.dto.ProcessRouteItemDto; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ProcessRouteItemMapper extends BaseMapper<ProcessRouteItem> { |
| | | |
| | | |
| | | List<ProcessRouteItemDto> listProcessRouteItemDto(@Param("c") ProcessRouteItemDto processRouteItemDto); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.production.dto.ProcessRouteDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface ProcessRouteMapper extends BaseMapper<ProcessRoute> { |
| | | |
| | | IPage<ProcessRouteDto> pageProcessRouteDto(Page<ProcessRouteDto> page,@Param("c") ProcessRouteDto processRouteDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * BOM主表 Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-15 09:59:27 |
| | | */ |
| | | @Mapper |
| | | public interface ProductBomMapper extends BaseMapper<ProductBom> { |
| | | |
| | | IPage<ProductBomDto> listPage(Page page, @Param("c") ProductBomDto productBomDto); |
| | | |
| | | ProductBomDto getById(@Param("bomId") Long bomId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface ProductProcessMapper extends BaseMapper<ProductProcess> { |
| | | IPage<ProductProcessDto> listPage(Page page,@Param("productProcessDto") ProductProcessDto productProcessDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ProductStructureMapper extends BaseMapper<ProductStructure> { |
| | | |
| | | List<ProductStructureDto> listBybomId(@Param("bomId") Long bomId); |
| | | |
| | | List<ProductStructureDto> listBybomAndProcess(@Param("bomId") Long bomId, @Param("processId") Long processId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @TableName("process_route") |
| | | @Data |
| | | @ApiModel(value = "processRoute", description = "å·¥èºè·¯çº¿ä¸»è¡¨") |
| | | public class ProcessRoute { |
| | | |
| | | @ApiModelProperty(value = "åºå·") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "产åID") |
| | | //product_model |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty(value = "æè¿°") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "å·¥èºè·¯çº¿ç¼ç ") |
| | | private String processRouteCode; |
| | | |
| | | @ApiModelProperty(value = "BOMçID") |
| | | private Long bomId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("process_route_item") |
| | | @ApiModel(value = "processRouteItem", description = "å·¥èºè·¯çº¿å表") |
| | | public class ProcessRouteItem { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "å·¥èºè·¯çº¿id") |
| | | private Long routeId; |
| | | |
| | | @ApiModelProperty(value = "å·¥åºid") |
| | | private Long processId; |
| | | |
| | | @ApiModelProperty(value ="产åid") |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value ="æå¨æåº") |
| | | private Integer dragSort; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * BOM主表 |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-15 09:59:27 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("product_bom") |
| | | @ApiModel(value = "ProductBom对象", description = "BOM主表") |
| | | public class ProductBom implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("bomç¼å·") |
| | | private String bomNo; |
| | | |
| | | @ApiModelProperty("产åè§æ ¼id") |
| | | private Long productModelId; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("çæ¬å·") |
| | | private String version; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建è
") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | @ApiModelProperty("æ´æ°è
") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | @ApiModelProperty("ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @TableName("product_process") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @ApiModel(value = "productProcess", description = "å·¥åºè¡¨") |
| | | public class ProductProcess implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * å·¥åºåç§° |
| | | */ |
| | | @Excel(name = "å·¥åºåç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * å·¥åºç¼å· |
| | | */ |
| | | @Excel(name = "å·¥åºç¼å·") |
| | | private String no; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | /** |
| | | * å·¥èµå®é¢ |
| | | */ |
| | | @Excel(name = "å·¥èµå®é¢") |
| | | private BigDecimal salaryQuota; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @TableName("product_structure") |
| | | @Data |
| | | @ApiModel(value = "ProductStructure", description = "BOMå表") |
| | | public class ProductStructure { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 产ååç§° |
| | | */ |
| | | private Long productModelId; |
| | | |
| | | /** |
| | | * å·¥åºid |
| | | */ |
| | | private Long processId; |
| | | |
| | | /** |
| | | * åä½äº§åºéè¦æ°é |
| | | */ |
| | | private BigDecimal unitQuantity; |
| | | |
| | | /** |
| | | * éæ±æ°é |
| | | */ |
| | | private BigDecimal demandedQuantity; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * å
³èBOMid |
| | | */ |
| | | private Long bomId; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.production.dto.ProcessRouteItemDto; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProcessRouteItemService extends IService<ProcessRouteItem> { |
| | | List<ProcessRouteItemDto> listProcessRouteItemDto( ProcessRouteItemDto processRouteItemDto); |
| | | |
| | | int sort(ProcessRouteItem processRouteItem); |
| | | |
| | | String batchDelete(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service; |
| | | |
| | | 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.ProcessRouteDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProcessRouteService extends IService<ProcessRoute> { |
| | | |
| | | IPage<ProcessRouteDto> pageProcessRouteDto(Page<ProcessRouteDto> page, ProcessRouteDto processRouteDto); |
| | | |
| | | Integer saveProcessRoute(ProcessRoute processRoute); |
| | | |
| | | int batchDelete(List<Long> ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service; |
| | | |
| | | 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.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | |
| | | /** |
| | | * <p> |
| | | * BOM主表 æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-15 09:59:27 |
| | | */ |
| | | public interface ProductBomService extends IService<ProductBom> { |
| | | |
| | | IPage<ProductBomDto> listPage(Page page, ProductBomDto productBomDto); |
| | | |
| | | AjaxResult add(ProductBom productBom); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service; |
| | | |
| | | 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.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/7/21 14:39 |
| | | */ |
| | | public interface ProductProcessService extends IService<ProductProcess> { |
| | | IPage<ProductProcessDto> listPage(Page page, ProductProcessDto productProcessDto); |
| | | |
| | | AjaxResult add(ProductProcessDto productProcessDto); |
| | | |
| | | AjaxResult importData(MultipartFile file); |
| | | |
| | | String batchDelete(List<Integer> ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProductStructureService extends IService<ProductStructure> { |
| | | |
| | | |
| | | Boolean addProductStructureDto(ProductStructureDto productStructureDto); |
| | | |
| | | List<ProductStructureDto> listBybomId(Long bomId); |
| | | |
| | | } |
| | |
| | | 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.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductionReportDto; |
| | | import com.ruoyi.production.dto.SalesLedgerWorkDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerWork; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.production.dto.ProcessRouteItemDto; |
| | | import com.ruoyi.production.mapper.ProcessRouteItemMapper; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.service.ProcessRouteItemService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class ProcessRouteItemServiceImpl extends ServiceImpl<ProcessRouteItemMapper, ProcessRouteItem> implements ProcessRouteItemService { |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemMapper processRouteItemMapper; |
| | | |
| | | @Override |
| | | public List<ProcessRouteItemDto> listProcessRouteItemDto(ProcessRouteItemDto processRouteItemDto) { |
| | | return processRouteItemMapper.listProcessRouteItemDto( processRouteItemDto); |
| | | } |
| | | |
| | | //æåº |
| | | @Override |
| | | public int sort(ProcessRouteItem processRouteItem) { |
| | | //æ¥è¯¢è¢«æ¹å¨çè¿æ¡æ°æ® |
| | | ProcessRouteItem oldProcessRouteItem = processRouteItemMapper.selectById(processRouteItem.getId()); |
| | | //æ¥è¯¢è¯¥å·¥èºè·¯çº¿çææå·¥åºå¹¶æç
§é¡ºåºæåº |
| | | List<ProcessRouteItem> processRouteItems = processRouteItemMapper.selectList(Wrappers.<ProcessRouteItem>lambdaQuery() |
| | | .eq(ProcessRouteItem::getRouteId, oldProcessRouteItem.getRouteId()) |
| | | .orderByAsc(ProcessRouteItem::getDragSort)); |
| | | // è·åç®æ ä½ç½®ï¼ç§»å¨å°ç¬¬å 个ä¹åï¼ |
| | | Integer targetPosition = processRouteItem.getDragSort(); |
| | | if (targetPosition != null && targetPosition >= 0) { |
| | | // ç§»å¨å
ç´ å°æ°çä½ç½® |
| | | processRouteItems.remove(oldProcessRouteItem); |
| | | processRouteItems.add(targetPosition-1, oldProcessRouteItem); |
| | | // æ´æ°ææåå½±åçæåºå段 |
| | | for (int i = 0; i < processRouteItems.size(); i++) { |
| | | ProcessRouteItem item = processRouteItems.get(i); |
| | | if (!item.getId().equals(oldProcessRouteItem.getId())) { |
| | | // æ£æ¥æ¯å¦éè¦æ´æ°æåºå¼ |
| | | if (item.getDragSort() != i+1) { |
| | | item.setDragSort(i+1); |
| | | processRouteItemMapper.updateById(item); |
| | | } |
| | | } else { |
| | | // æ´æ°åè®°å½çæ°æåºä½ç½® |
| | | oldProcessRouteItem.setDragSort(targetPosition); |
| | | processRouteItemMapper.updateById(oldProcessRouteItem); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String batchDelete(Long id) { |
| | | // æ¥è¯¢è¦å é¤çæ°æ® |
| | | ProcessRouteItem deleteProcessRouteItem = processRouteItemMapper.selectById(id); |
| | | if (deleteProcessRouteItem == null) { |
| | | return "å é¤å¤±è´¥ï¼æªæ¾å°å¯¹åºæ°æ®"; |
| | | } |
| | | Long routeId = deleteProcessRouteItem.getRouteId(); |
| | | // å 餿宿°æ® |
| | | processRouteItemMapper.deleteById(id); |
| | | // æ¥è¯¢è¯¥å·¥èºè·¯çº¿çææå·¥åºå¹¶æç
§é¡ºåºæåº |
| | | List<ProcessRouteItem> processRouteItems = processRouteItemMapper.selectList(Wrappers.<ProcessRouteItem>lambdaQuery() |
| | | .eq(ProcessRouteItem::getRouteId, routeId) |
| | | .orderByAsc(ProcessRouteItem::getDragSort)); |
| | | // éæ°è®¾ç½®æåºå¼ï¼ä½¿åºå·è¿ç» |
| | | for (int i = 0; i < processRouteItems.size(); i++) { |
| | | ProcessRouteItem item = processRouteItems.get(i); |
| | | if (!item.getDragSort().equals(i+1)) { |
| | | item.setDragSort(i+1); |
| | | processRouteItemMapper.updateById(item); |
| | | } |
| | | } |
| | | return "å 餿å"; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | 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.production.dto.ProcessRouteDto; |
| | | import com.ruoyi.production.mapper.ProcessRouteItemMapper; |
| | | import com.ruoyi.production.mapper.ProcessRouteMapper; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.service.ProcessRouteService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class ProcessRouteServiceImpl extends ServiceImpl<ProcessRouteMapper, ProcessRoute> implements ProcessRouteService { |
| | | |
| | | @Autowired |
| | | private ProcessRouteMapper processRouteMapper; |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemMapper processRouteItemMapper; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IPage<ProcessRouteDto> pageProcessRouteDto(Page<ProcessRouteDto> page, ProcessRouteDto processRouteDto) { |
| | | |
| | | return processRouteMapper.pageProcessRouteDto(page, processRouteDto); |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveProcessRoute(ProcessRoute processRoute) { |
| | | this.save(processRoute); |
| | | String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String idStr = String.format("%06d", processRoute.getId()); |
| | | String newProductCode = "GYLX" + dateStr + idStr; |
| | | // æ´æ°æ°æ®åºä¸çproductCode |
| | | processRoute.setProcessRouteCode(newProductCode); |
| | | return processRouteMapper.updateById(processRoute); |
| | | } |
| | | |
| | | @Override |
| | | public int batchDelete(List<Long> ids) { |
| | | // //å
夿æ¯å¦å·²ç»å¼ç¨äº |
| | | // List<ProductOrder> productOrders = productOrderMapper.selectList(Wrappers.<ProductOrder>lambdaQuery().in(ProductOrder::getRouteId, ids)); |
| | | // if (productOrders.size()>0){ |
| | | // throw new RuntimeException("该工èºè·¯çº¿ç产已å¼ç¨ï¼ä¸è½å é¤"); |
| | | // } |
| | | //å é¤å·¥èºè·¯çº¿è¯¦æ
|
| | | processRouteItemMapper.delete(Wrappers.<ProcessRouteItem>lambdaQuery().in(ProcessRouteItem::getRouteId, ids)); |
| | | return processRouteMapper.deleteBatchIds(ids); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | 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.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductBomDto; |
| | | import com.ruoyi.production.mapper.ProductBomMapper; |
| | | import com.ruoyi.production.pojo.ProductBom; |
| | | import com.ruoyi.production.service.ProductBomService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * BOM主表 æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-01-15 09:59:27 |
| | | */ |
| | | @Service |
| | | public class ProductBomServiceImpl extends ServiceImpl<ProductBomMapper, ProductBom> implements ProductBomService { |
| | | |
| | | @Autowired |
| | | private ProductBomMapper productBomMapper; |
| | | |
| | | @Override |
| | | public IPage<ProductBomDto> listPage(Page page, ProductBomDto productBomDto) { |
| | | return productBomMapper.listPage(page,productBomDto); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(ProductBom productBom) { |
| | | boolean save = productBomMapper.insert(productBom) > 0; |
| | | if (save) { |
| | | // æ ¹æ®idçænoåæ®µï¼GX + 8使°åï¼ä¸è¶³8ä½åé¢è¡¥0ï¼ |
| | | String no = "BM." + String.format("%05d", productBom.getId()); |
| | | productBom.setBomNo(no); |
| | | productBomMapper.updateById(productBom); |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | 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.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.mapper.ProcessRouteItemMapper; |
| | | import com.ruoyi.production.mapper.ProductProcessMapper; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import com.ruoyi.production.service.ProductProcessService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ProductProcessServiceImpl extends ServiceImpl<ProductProcessMapper, ProductProcess> implements ProductProcessService { |
| | | @Autowired |
| | | private ProductProcessMapper productProcessMapper; |
| | | @Autowired |
| | | private ProcessRouteItemMapper processRouteItemMapper; |
| | | // @Autowired |
| | | // private ProductProcessRouteItemMapper productProcessRouteItemMapper; |
| | | |
| | | @Override |
| | | public IPage<ProductProcessDto> listPage(Page page, ProductProcessDto productProcessDto) { |
| | | return productProcessMapper.listPage(page, productProcessDto); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(ProductProcessDto productProcessDto) { |
| | | ProductProcess productProcess = new ProductProcess(); |
| | | BeanUtils.copyProperties(productProcessDto,productProcess); |
| | | boolean save = productProcessMapper.insert(productProcess) > 0; |
| | | if (save && ObjectUtils.isNull(productProcessDto.getNo())) { |
| | | // æ ¹æ®idçænoåæ®µï¼GX + 8使°åï¼ä¸è¶³8ä½åé¢è¡¥0ï¼ |
| | | String no = "GX" + String.format("%08d", productProcess.getId()); |
| | | productProcess.setNo(no); |
| | | |
| | | productProcessMapper.updateById(productProcess); |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult importData(MultipartFile file) { |
| | | try { |
| | | ExcelUtil<ProductProcess> util = new ExcelUtil<ProductProcess>(ProductProcess.class); |
| | | List<ProductProcess> productProcessList = util.importExcel(file.getInputStream()); |
| | | if(CollectionUtils.isEmpty(productProcessList)){ |
| | | return AjaxResult.warn("模æ¿é误æå¯¼å
¥æ°æ®ä¸ºç©º"); |
| | | } |
| | | this.saveOrUpdateBatch(productProcessList); |
| | | return AjaxResult.success(true); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String batchDelete(List<Integer> ids) { |
| | | //æ¥è¯¢æ¯å¦ç产ä¸å·²ç»å¼ç¨äºè¿äºå·¥åº |
| | | List<ProcessRouteItem> processRouteItems = processRouteItemMapper.selectList(Wrappers.<ProcessRouteItem>lambdaQuery().in(ProcessRouteItem::getProcessId, ids)); |
| | | // List<ProductProcessRouteItem> productProcessRouteItems = productProcessRouteItemMapper.selectList(Wrappers.<ProductProcessRouteItem>lambdaQuery().in(ProductProcessRouteItem::getProcessId, ids)); |
| | | // if (!CollectionUtils.isEmpty(processRouteItems) || !CollectionUtils.isEmpty(productProcessRouteItems)){ |
| | | // throw new RuntimeException("该工åºå·²ç»è¢«ä½¿ç¨ï¼æ æ³å é¤"); |
| | | // } |
| | | productProcessMapper.deleteBatchIds(ids); |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.mapper.ProductStructureMapper; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import com.ruoyi.production.service.ProductStructureService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Slf4j |
| | | public class ProductStructureServiceImpl extends ServiceImpl<ProductStructureMapper, ProductStructure> implements ProductStructureService { |
| | | |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Boolean addProductStructureDto(ProductStructureDto productStructureDto) { |
| | | this.remove(new QueryWrapper<ProductStructure>().lambda().eq(ProductStructure::getBomId, productStructureDto.getBomId())); |
| | | productStructureDto.getProductStructureList().forEach(productStructure -> { |
| | | productStructure.setBomId(productStructureDto.getBomId()); |
| | | }); |
| | | return this.saveBatch(productStructureDto.getProductStructureList()); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductStructureDto> listBybomId(Long bomId) { |
| | | List<ProductStructureDto> tree = productStructureMapper.listBybomId(bomId); |
| | | return tree; |
| | | |
| | | } |
| | | } |
| | |
| | | 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.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProductionReportDto; |
| | | import com.ruoyi.production.dto.SalesLedgerWorkDto; |
| | | import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerWorkMapper; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import com.ruoyi.production.pojo.SalesLedgerWork; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | | import com.ruoyi.production.service.SalesLedgerWorkService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | |
| | | * ç±»å«(0:æªæäº¤;1:å·²æäº¤) |
| | | */ |
| | | private Integer inspectState; |
| | | private Long purchaseLedgerId; |
| | | |
| | | /** |
| | | * æ¥å·¥id |
| | | */ |
| | | private Long productMainId; |
| | | |
| | | private Long productModelId; |
| | | //ä¸åæ ¼ç°è±¡ |
| | | private String defectivePhenomena; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.basic.mapper.ProductModelMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.ProductModel"> |
| | | <id column="id" property="id" /> |
| | | <result column="product_id" property="productId" /> |
| | | <result column="model" property="model" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="product_name" property="productName" /> |
| | | <result column="product_id" property="productId" /> |
| | | </resultMap> |
| | | <select id="listPageProductModel" resultType="com.ruoyi.basic.pojo.ProductModel"> |
| | | select pm.*,p.product_name |
| | | from product_model pm |
| | | left join product p on pm.product_id = p.id |
| | | <where> |
| | | <if test="c.model != null and c.model != ''"> |
| | | and pm.model like concat('%',#{c.model},'%') |
| | | </if> |
| | | <if test="c.productName != null and c.productName != ''"> |
| | | and p.product_name like concat('%',#{c.productName},'%') |
| | | </if> |
| | | </where> |
| | | order by pm.id |
| | | </select> |
| | | <select id="selectLatestRecord" resultType="com.ruoyi.basic.pojo.ProductModel"> |
| | | SELECT * FROM product_model |
| | | ORDER BY create_time DESC, id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | </select> |
| | | <select id="getSumQuantity" resultType="BigDecimal"> |
| | | select COALESCE(sum(inbound_num), 0) |
| | | from procurement_record_storage |
| | | where product_model_id = #{productModelId} |
| | | </select> |
| | | </mapper> |
| | |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | </select> |
| | | <select id="getSumQuantity" resultType="BigDecimal"> |
| | | select COALESCE(sum(inbound_num), 0) |
| | | from procurement_record_out |
| | | where |
| | | product_model_id = #{productModelId} |
| | | </select> |
| | | <select id="selectCode" resultType="com.ruoyi.procurementrecord.pojo.ProcurementRecordOut"> |
| | | select * |
| | | from procurement_record_out |
| | | where code like concat('%', #{format}) |
| | | order by id desc |
| | | limit 1 |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.production.mapper.ProcessRouteItemMapper"> |
| | | |
| | | <resultMap id="basicMap" type="com.ruoyi.production.pojo.ProcessRouteItem"> |
| | | <id property="id" column="id"/> |
| | | <result property="routeId" column="route_id"/> |
| | | <result property="processId" column="process_id"/> |
| | | <result property="productModelId" column="product_model_id"/> |
| | | <result property="tenantId" column="tenant_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="dragSort" column="drag_sort"/> |
| | | </resultMap> |
| | | |
| | | <select id="listProcessRouteItemDto" resultType="com.ruoyi.production.dto.ProcessRouteItemDto"> |
| | | select pri.*, |
| | | pr.description , |
| | | pp.name as process_name, |
| | | pm.product_id, |
| | | pm.model, |
| | | p.product_name, |
| | | pm.unit |
| | | from |
| | | process_route_item pri |
| | | left join product_model pm on pri.product_model_id = pm.id |
| | | left join product_process pp on pp.id = pri.process_id |
| | | left join product p on p.id = pm.product_id |
| | | left join process_route pr on pr.id = pri.route_id |
| | | where |
| | | pri.route_id = #{c.routeId} |
| | | order by pri.drag_sort |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.production.mapper.ProcessRouteMapper"> |
| | | |
| | | |
| | | <resultMap id="basicMap" type="com.ruoyi.production.pojo.ProcessRoute"> |
| | | <id property="id" column="id"/> |
| | | <result property="productModelId" column="product_model_id"/> |
| | | <result property="description" column="description"/> |
| | | <result property="tenantId" column="tenant_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <select id="pageProcessRouteDto" resultType="com.ruoyi.production.dto.ProcessRouteDto"> |
| | | select ps.*, p.product_name,pm.product_id,pm.model,pb.bom_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 |
| | | left join product p on pm.product_id = p.id |
| | | <where> |
| | | <if test="c.model != null and c.model != ''"> |
| | | and pm.model like concat('%',#{c.model},'%') |
| | | </if> |
| | | </where> |
| | | order by ps.id asc |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.production.mapper.ProductBomMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.production.pojo.ProductBom"> |
| | | <id column="id" property="id"/> |
| | | <result column="product_model_id" property="productModelId"/> |
| | | <result column="bom_no" property="bomNo"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="version" property="version"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | <select id="listPage" resultType="com.ruoyi.production.dto.ProductBomDto"> |
| | | select * from (select pb.*, |
| | | pm.model productModelName, |
| | | p.product_name productName |
| | | 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 |
| | | where 1=1 |
| | | <if test="c.productModelName != null"> |
| | | and productModelName = #{c.productModelName} |
| | | </if> |
| | | <if test="c.productName != null"> |
| | | and productName = #{c.productName} |
| | | </if> |
| | | <if test="c.bomNo != null"> |
| | | and bom_no = #{c.bomNo} |
| | | </if> |
| | | <if test="c.version != null"> |
| | | and version = #{c.version} |
| | | </if> |
| | | </select> |
| | | <select id="getById" resultType="com.ruoyi.production.dto.ProductBomDto"> |
| | | select pb.*, |
| | | pm.model productModelName, |
| | | p.product_name productName |
| | | 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 |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.production.mapper.ProductProcessMapper"> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.production.dto.ProductProcessDto"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | product_process p |
| | | <where> |
| | | <if test="productProcessDto.name != null and productProcessDto.name != '' "> |
| | | AND p.name LIKE CONCAT('%',#{productProcessDto.name},'%') |
| | | </if> |
| | | <if test="productProcessDto.no != null and productProcessDto.no != '' "> |
| | | AND p.no LIKE CONCAT('%',#{productProcessDto.no},'%') |
| | | </if> |
| | | </where> |
| | | order by p.id asc |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.production.mapper.ProductStructureMapper"> |
| | | |
| | | <resultMap id="basicMap" type="com.ruoyi.production.pojo.ProductStructure"> |
| | | <id property="id" column="id"/> |
| | | <result property="productModelId" column="product_model_id"/> |
| | | <result property="processId" column="process_id"/> |
| | | <result property="unitQuantity" column="unit_quantity"/> |
| | | <result property="demandedQuantity" column="demanded_quantity"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="tenantId" column="tenant_id"/> |
| | | </resultMap> |
| | | <select id="listBybomId" resultType="com.ruoyi.production.dto.ProductStructureDto"> |
| | | select ps.*, |
| | | p.product_name, |
| | | pp.name as process_name, |
| | | pm.product_id, |
| | | pm.model |
| | | from |
| | | product_structure ps |
| | | left join product_model pm on ps.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join product_process pp on ps.process_id = pp.id |
| | | where ps.bom_id = #{bomId} |
| | | order by ps.id |
| | | </select> |
| | | <select id="listByproductModelId" resultType="com.ruoyi.production.dto.ProductStructureDto"> |
| | | select ps.*, |
| | | p.product_name, |
| | | pp.name as process_name, |
| | | pm.product_id, |
| | | pm.model |
| | | from |
| | | product_structure ps |
| | | left join product_bom pb on ps.bom_id = pb.id |
| | | left join product_model pm on ps.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join product_process pp on ps.process_id = pp.id |
| | | where pb.product_model_id = #{productModelId} |
| | | order by ps.id |
| | | </select> |
| | | </mapper> |