| | |
| | | ALTER TABLE `product-inventory-management-zsjc`.`customer` |
| | | ADD COLUMN `form_instance_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'å®æè¡¨åå®ä¾ID' AFTER `customer_type`, |
| | | ADD COLUMN `form_modified_time` datetime(0) NULL DEFAULT NULL COMMENT 'å®æä¿®æ¹æ¶é´' AFTER `form_instance_id`; |
| | | |
| | | ALTER TABLE `process_route` |
| | | ADD COLUMN `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'ç¶æï¼0-è稿ï¼1-å·²æ¹å' AFTER `bom_id`; |
| | | |
| | | CREATE TABLE `process_route_item_param` |
| | | ( |
| | | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | `route_item_id` bigint NOT NULL COMMENT 'å
³èå·¥èºè·¯çº¿æç»ID (process_route_item.id)', |
| | | `param_id` bigint NOT NULL COMMENT 'å
³èåºç¡åæ°å®ä¹ID (base_param.id)', |
| | | `process_param_id` bigint DEFAULT NULL COMMENT 'æ¥æºå·¥åºåæ°ID', |
| | | |
| | | `standard_value` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'æ¤è·¯çº¿èç¹è®¾å®çæ åå¼', |
| | | `min_value` decimal(10, 2) DEFAULT NULL COMMENT 'æ¤è·¯çº¿èç¹è®¾å®çæ åæå°å¼', |
| | | `max_value` decimal(10, 2) DEFAULT NULL COMMENT 'æ¤è·¯çº¿èç¹è®¾å®çæ åæå¤§å¼', |
| | | `is_required` tinyint NOT NULL DEFAULT '0' COMMENT 'æ¯å¦å¿
å¡«', |
| | | |
| | | `sort` int NOT NULL DEFAULT '0' COMMENT 'æåº', |
| | | `tenant_id` bigint DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `create_time` datetime DEFAULT CURRENT_TIMESTAMP, |
| | | `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| | | PRIMARY KEY (`id`) USING BTREE, |
| | | KEY `idx_route_item_id` (`route_item_id`) USING BTREE, |
| | | KEY `idx_param_id` (`param_id`) USING BTREE |
| | | ) ENGINE = InnoDB |
| | | DEFAULT CHARSET = utf8mb4 |
| | | COLLATE = utf8mb4_0900_ai_ci COMMENT ='å·¥èºè·¯çº¿å·¥åºåæ°è¡¨'; |
| | | |
| | | |
| | | ALTER TABLE `product-inventory-management-zsjc`.`quality_inspect` |
| | | ADD COLUMN `inspect_nature` varchar(255) NULL COMMENT 'æ£æµæ§è´¨' AFTER `test_standard_id`, |
| | | ADD COLUMN `sample_code` varchar(255) NULL COMMENT 'è¯æ ·ç¼å·' AFTER `inspect_nature`, |
| | | ADD COLUMN `sample_state` varchar(255) NULL COMMENT 'è¯æ ·ç¶æ' AFTER `sample_code`, |
| | | ADD COLUMN `sample_time` date NULL COMMENT 'åæ ·æ¥æ' AFTER `sample_state`, |
| | | ADD COLUMN `license_plate_number` varchar(255) NULL COMMENT '车çå·' AFTER `sample_time`; |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.BaseParam; |
| | | import com.ruoyi.basic.service.BaseParamService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | |
| | | @GetMapping("list") |
| | | @Log(title = "åºç¡åæ°æ°æ®éå", businessType = BusinessType.OTHER) |
| | | @ApiOperation("åºç¡åæ°æ°æ®éå") |
| | | public AjaxResult baseParamList(BaseParam baseParam) { |
| | | List<BaseParam> list = baseParamService.baseParamList(baseParam); |
| | | return AjaxResult.success(list); |
| | | public AjaxResult baseParamList(Page<BaseParam> page, BaseParam baseParam) { |
| | | IPage<BaseParam> paramList = baseParamService.baseParamList(page, baseParam); |
| | | return AjaxResult.success(paramList); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | |
| | | 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.pojo.BaseParam; |
| | | |
| | |
| | | * @since 2026/03/13 16:40 |
| | | */ |
| | | public interface BaseParamService extends IService<BaseParam> { |
| | | List<BaseParam> baseParamList(BaseParam baseParam); |
| | | IPage<BaseParam> baseParamList(Page<BaseParam> page, BaseParam baseParam); |
| | | |
| | | int addBaseParam(BaseParam baseParam); |
| | | |
| | |
| | | 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.mapper.BaseParamMapper; |
| | | import com.ruoyi.basic.pojo.BaseParam; |
| | |
| | | public class BaseParamServiceImpl extends ServiceImpl<BaseParamMapper, BaseParam> implements BaseParamService { |
| | | |
| | | @Override |
| | | public List<BaseParam> baseParamList(BaseParam baseParam) { |
| | | public IPage<BaseParam> baseParamList(Page<BaseParam> page, BaseParam baseParam) { |
| | | LambdaQueryWrapper<BaseParam> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (StringUtils.isNotEmpty(baseParam.getParamName())) { |
| | | queryWrapper.like(BaseParam::getParamName, baseParam.getParamName()); |
| | | } |
| | | List<BaseParam> list = list(queryWrapper); |
| | | if (list == null || list.isEmpty()) { |
| | | return new ArrayList<>(0); |
| | | Page<BaseParam> paramPage = page(page, queryWrapper); |
| | | if (paramPage == null || paramPage.getRecords().isEmpty()) { |
| | | return new Page<>(); |
| | | } |
| | | |
| | | // å¤çæ¥ææ ¼å¼å±ç¤º |
| | | list.forEach(item -> { |
| | | paramPage.getRecords().forEach(item -> { |
| | | if (Integer.valueOf(4).equals(item.getParamType()) && StringUtils.isNotEmpty(item.getParamFormat())) { |
| | | item.setParamFormat(toUpperCasePattern(item.getParamFormat())); |
| | | } |
| | | }); |
| | | |
| | | return list; |
| | | return paramPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | return R.ok(processRouteItemService.listProcessRouteItemDto(processRouteItemDto)); |
| | | } |
| | | |
| | | @PostMapping () |
| | | @ApiOperation("æ°å¢ä¿®æ¹") |
| | | @PostMapping() |
| | | @ApiOperation("æ°å¢ä¿®æ¹å·¥åº") |
| | | public R addOrUpdate(@RequestBody ProcessRouteItem processRouteItem) { |
| | | return R.ok(processRouteItemService.saveOrUpdate(processRouteItem)); |
| | | return R.ok(processRouteItemService.saveOrUpdateProcess(processRouteItem)); |
| | | } |
| | | |
| | | @PostMapping ("/sort") |
| | | @PostMapping("/sort") |
| | | @ApiOperation("æåº") |
| | | public R sort(@RequestBody ProcessRouteItem processRouteItem) { |
| | | return R.ok(processRouteItemService.sort(processRouteItem)); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.ProcessRouteItemParamDto; |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | import com.ruoyi.production.service.ProcessRouteItemParamService; |
| | | 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; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾æ§å¶å± |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/16 11:15 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/ProcessRouteItemParam") |
| | | @Api("å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾æ§å¶å±") |
| | | public class ProcessRouteItemParamController { |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemParamService processRouteItemParamService; |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @ApiOperation("å·¥èºç»å®çå·¥åºåæ°å页æ¥è¯¢") |
| | | @Log(title = "å·¥èºç»å®çå·¥åºåæ°å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page<ProcessRouteItemParam> page, ProcessRouteItemParam param) { |
| | | IPage<ProcessRouteItemParamDto> paramIPage = processRouteItemParamService.pageList(page, param); |
| | | return AjaxResult.success(paramIPage); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹åæ°å®ä¾å¼") |
| | | @PutMapping("/edit") |
| | | @Log(title = "ä¿®æ¹åæ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult edit(@RequestBody ProcessRouteItemParam param) { |
| | | return AjaxResult.success(processRouteItemParamService.updateById(param)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤åæ°") |
| | | @DeleteMapping("/remove/{ids}") |
| | | @Log(title = "å é¤åæ°", businessType = BusinessType.DELETE) |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return AjaxResult.success(processRouteItemParamService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @ApiOperation("åå§åå·¥åºåæ°") |
| | | @PostMapping("/init") |
| | | @Log(title = "åå§ååæ°", businessType = BusinessType.INSERT) |
| | | public AjaxResult init(Long routeItemId, Long processId) { |
| | | return AjaxResult.success(processRouteItemParamService.initParams(routeItemId, processId)); |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢åä¸ªåæ°å®ä¾") |
| | | @PostMapping("/save") |
| | | @Log(title = "æ°å¢åæ°", businessType = BusinessType.INSERT) |
| | | public AjaxResult save(@RequestBody ProcessRouteItemParam param) { |
| | | processRouteItemParamService.saveParam(param); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @GetMapping("page") |
| | | public R page(ProductOrderDto productOrder, Page page) { |
| | | public R page(ProductOrderDto productOrder, Page<ProductOrder> page) { |
| | | return R.ok(productOrderService.pageProductOrder(page, productOrder)); |
| | | } |
| | | |
| | |
| | | @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; |
| | | |
| | | @ApiModelProperty(value = "产åID") |
| | | private Long productId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "产åè§æ ¼") |
| | | private String model; |
| | | |
| | | @ApiModelProperty("å·¥åºåæ°ä¸ªæ°") |
| | | private Integer paramCount; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾Dto |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/16 11:23 |
| | | */ |
| | | @Data |
| | | public class ProcessRouteItemParamDto extends ProcessRouteItemParam { |
| | | @ApiModelProperty("åæ°åç§°") |
| | | private String paramName; |
| | | |
| | | @ApiModelProperty("åæ°å¯ä¸æ è¯") |
| | | private String paramKey; |
| | | |
| | | @ApiModelProperty("åä½") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty("åæ°ç±»å(1æ°å 2ææ¬ 3䏿鿩 4æ¶é´)") |
| | | private Integer paramType; |
| | | |
| | | @ApiModelProperty("åæ°æ ¼å¼") |
| | | private String paramFormat; |
| | | |
| | | @ApiModelProperty("弿¨¡å¼(1åå¼ 2åºé´)") |
| | | private Integer valueMode; |
| | | } |
| | |
| | | //产åè§æ ¼åå· |
| | | private String productModelName; |
| | | |
| | | //产åç¼ç |
| | | private String productCode; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "å·¥èºåç§°") |
| | | private String processName; |
| | | |
| | | @ApiModelProperty(value = "产åç¼ç ") |
| | | private String productCode; |
| | | |
| | | @ApiModelProperty(value = "产ååç§°") |
| | | private String productName; |
| | | |
| | | @ApiModelProperty(value = "产åid") |
| | | //å®å¤-ä¸ç建æä½¿ç¨æ°ç产å表å
³èproduct_material |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | private String model; |
| | | |
| | | @TableField(exist = false) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.ProcessRouteItemParamDto; |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾ Mapper |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/16 11:11 |
| | | */ |
| | | public interface ProcessRouteItemParamMapper extends BaseMapper<ProcessRouteItemParam> { |
| | | |
| | | IPage<ProcessRouteItemParamDto> selectParamPage(@Param("page") Page<ProcessRouteItemParam> page, @Param("p") ProcessRouteItemParam param); |
| | | |
| | | /** |
| | | * æ ¹æ®å·¥åº ID åå§ååæ°å°å·¥èºè·¯çº¿æç»å®ä¾ |
| | | * |
| | | * @param routeItemId å·¥èºè·¯çº¿æç»ID |
| | | * @param processId å·¥åºID |
| | | * @param tenantId ç§æ·ID |
| | | */ |
| | | int insertFromProcessTemplate(@Param("routeItemId") Long routeItemId, @Param("processId") Long processId, @Param("tenantId") Long tenantId); |
| | | |
| | | Integer selectMaxSortByRouteItemId(Long routeItemId); |
| | | } |
| | |
| | | @Mapper |
| | | public interface ProductOrderMapper extends BaseMapper<ProductOrder> { |
| | | |
| | | IPage<ProductOrderDto> pageProductOrder(Page page, @Param("c") ProductOrderDto productOrder); |
| | | IPage<ProductOrderDto> pageProductOrder(Page<ProductOrder> page, @Param("c") ProductOrderDto productOrder); |
| | | |
| | | List<ProcessRoute> listProcessRoute(@Param("productModelId") Long productModelId); |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "BOMçID") |
| | | private Integer bomId; |
| | | |
| | | @ApiModelProperty(value = "ç¶æï¼0-è稿ï¼1-å·²æ¹å") |
| | | private Boolean status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾ |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/16 11:07 |
| | | */ |
| | | @Data |
| | | @TableName("process_route_item_param") |
| | | @ApiModel("å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾è¡¨") |
| | | public class ProcessRouteItemParam { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty("主é®ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("å
³èå·¥èºè·¯çº¿æç»ID (process_route_item.id)") |
| | | private Long routeItemId; |
| | | |
| | | @ApiModelProperty("å
³èåºç¡åæ°å®ä¹ID (base_param.id)") |
| | | private Long paramId; |
| | | |
| | | @ApiModelProperty("æ¥æºå·¥åºåæ°ID") |
| | | private Long processParamId; |
| | | |
| | | @ApiModelProperty("æ¤è·¯çº¿èç¹è®¾å®çæ åå¼") |
| | | private String standardValue; |
| | | |
| | | @ApiModelProperty("æ¤è·¯çº¿èç¹è®¾å®çæ åæå°å¼") |
| | | private BigDecimal minValue; |
| | | |
| | | @ApiModelProperty("æ¤è·¯çº¿èç¹è®¾å®çæ åæå¤§å¼") |
| | | private BigDecimal maxValue; |
| | | |
| | | @ApiModelProperty("æ¯å¦å¿
å¡«") |
| | | private Integer isRequired; |
| | | |
| | | @ApiModelProperty("æåº") |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty("ç§æ·ID") |
| | | private Long tenantId; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | private LocalDateTime updateTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.ProcessRouteItemParamDto; |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾ Service |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/16 11:11 |
| | | */ |
| | | public interface ProcessRouteItemParamService extends IService<ProcessRouteItemParam> { |
| | | |
| | | IPage<ProcessRouteItemParamDto> pageList(Page<ProcessRouteItemParam> page, ProcessRouteItemParam param); |
| | | |
| | | boolean initParams(Long routeItemId, Long processId); |
| | | |
| | | void saveParam(ProcessRouteItemParam param); |
| | | } |
| | |
| | | int sort(ProcessRouteItem processRouteItem); |
| | | |
| | | String batchDelete(Long id); |
| | | |
| | | boolean saveOrUpdateProcess(ProcessRouteItem processRouteItem); |
| | | } |
| | |
| | | |
| | | public interface ProductOrderService extends IService<ProductOrder> { |
| | | |
| | | IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder); |
| | | IPage<ProductOrderDto> pageProductOrder(Page<ProductOrder> page, ProductOrderDto productOrder); |
| | | |
| | | int bindingRoute(ProductOrder productOrder); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.basic.pojo.BaseParam; |
| | | import com.ruoyi.basic.service.BaseParamService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.production.dto.ProcessRouteItemParamDto; |
| | | import com.ruoyi.production.mapper.ProcessRouteItemParamMapper; |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | import com.ruoyi.production.service.ProcessRouteItemParamService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <br> |
| | | * å·¥èºè·¯çº¿å·¥åºåæ°å®ä¾ ServiceImpl |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/03/16 11:11 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ProcessRouteItemParamServiceImpl extends ServiceImpl<ProcessRouteItemParamMapper, ProcessRouteItemParam> implements ProcessRouteItemParamService { |
| | | |
| | | @Autowired |
| | | private BaseParamService baseParamService; |
| | | |
| | | @Override |
| | | public IPage<ProcessRouteItemParamDto> pageList(Page<ProcessRouteItemParam> page, ProcessRouteItemParam param) { |
| | | return baseMapper.selectParamPage(page, param); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean initParams(Long routeItemId, Long processId) { |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | if (tenantId == null) { |
| | | tenantId = 208L; |
| | | } |
| | | |
| | | return baseMapper.insertFromProcessTemplate(routeItemId, processId, tenantId) > 0; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveParam(ProcessRouteItemParam param) { |
| | | if (param == null) { |
| | | throw new ServiceException("æ°å¢å¤±è´¥,åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (param.getRouteItemId() == null || param.getParamId() == null) { |
| | | throw new ServiceException("å
³èå·¥åºIDå忰项IDä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | Long count = baseMapper.selectCount(Wrappers.<ProcessRouteItemParam>lambdaQuery() |
| | | .eq(ProcessRouteItemParam::getRouteItemId, param.getRouteItemId()) |
| | | .eq(ProcessRouteItemParam::getParamId, param.getParamId()) |
| | | .eq(ProcessRouteItemParam::getTenantId, tenantId)); |
| | | if (count > 0) { |
| | | throw new ServiceException("该工åºå·²å卿¤åæ°é¡¹ï¼è¯·å¿é夿·»å "); |
| | | } |
| | | |
| | | BaseParam baseParam = baseParamService.getById(param.getParamId()); |
| | | if (baseParam == null) { |
| | | throw new ServiceException("æ°å¢å¤±è´¥,æ¹åºç¡åæ°ä¸åå¨"); |
| | | } |
| | | |
| | | Integer maxSort = baseMapper.selectMaxSortByRouteItemId(param.getRouteItemId()); |
| | | param.setId(null); |
| | | param.setProcessParamId(null); |
| | | param.setSort(maxSort); |
| | | param.setCreateTime(LocalDateTime.now()); |
| | | param.setTenantId(tenantId); |
| | | |
| | | this.save(param); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.production.dto.ProcessRouteItemDto; |
| | | import com.ruoyi.production.mapper.ProcessRouteItemMapper; |
| | | import com.ruoyi.production.mapper.ProcessRouteItemParamMapper; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | import com.ruoyi.production.service.ProcessRouteItemService; |
| | | import com.ruoyi.production.service.ProductMaterialSkuService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemMapper processRouteItemMapper; |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemParamMapper processRouteItemParamMapper; |
| | | |
| | | @Autowired |
| | | private ProductMaterialSkuService productMaterialSkuService; |
| | | |
| | | @Override |
| | | public List<ProcessRouteItemDto> listProcessRouteItemDto(ProcessRouteItemDto processRouteItemDto) { |
| | |
| | | Long routeId = deleteProcessRouteItem.getRouteId(); |
| | | // å 餿宿°æ® |
| | | processRouteItemMapper.deleteById(id); |
| | | // å é¤å¯¹åºçåæ°å表 |
| | | processRouteItemParamMapper.delete(new LambdaQueryWrapper<ProcessRouteItemParam>().eq(ProcessRouteItemParam::getRouteItemId,id)); |
| | | |
| | | // æ¥è¯¢è¯¥å·¥èºè·¯çº¿çææå·¥åºå¹¶æç
§é¡ºåºæåº |
| | | List<ProcessRouteItem> processRouteItems = processRouteItemMapper.selectList(Wrappers.<ProcessRouteItem>lambdaQuery() |
| | | .eq(ProcessRouteItem::getRouteId, routeId) |
| | |
| | | } |
| | | return "å 餿å"; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveOrUpdateProcess(ProcessRouteItem processRouteItem) { |
| | | if (processRouteItem == null) { |
| | | throw new ServiceException("æ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (processRouteItem.getProductModelId() != null) { |
| | | Object product = productMaterialSkuService.getById(processRouteItem.getProductModelId()); |
| | | if (product == null) { |
| | | throw new ServiceException("æä½å¤±è´¥ï¼å
³èç产å(ID:" + processRouteItem.getProductModelId() + ")ä¸åå¨"); |
| | | } |
| | | } else { |
| | | throw new ServiceException("产åIDä¸è½ä¸ºç©º"); |
| | | } |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | processRouteItem.setTenantId(tenantId); |
| | | |
| | | boolean result; |
| | | if (processRouteItem.getId() == null) { |
| | | Long maxSort = processRouteItemMapper.selectCount(Wrappers.<ProcessRouteItem>lambdaQuery().eq(ProcessRouteItem::getRouteId, processRouteItem.getRouteId())); |
| | | processRouteItem.setDragSort((int) (maxSort + 1)); |
| | | |
| | | result = this.save(processRouteItem); |
| | | processRouteItemParamMapper.insertFromProcessTemplate(processRouteItem.getId(), processRouteItem.getProcessId(), tenantId); |
| | | } else { |
| | | result = this.updateById(processRouteItem); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | 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); |
| | | save(processRoute); |
| | | if (processRoute.getProcessRouteCode() == null || processRoute.getProcessRouteCode().trim().isEmpty()) { |
| | | String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String idStr = String.format("%06d", processRoute.getId()); |
| | | String newProductCode = "GYLX" + dateStr + idStr; |
| | | processRoute.setProcessRouteCode(newProductCode); |
| | | return processRouteMapper.updateById(processRoute); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public int batchDelete(List<Long> ids) { |
| | | //å
夿æ¯å¦å·²ç»å¼ç¨äº |
| | | List<ProductOrder> productOrders = productOrderMapper.selectList(Wrappers.<ProductOrder>lambdaQuery().in(ProductOrder::getRouteId, ids)); |
| | | if (productOrders.size()>0){ |
| | | if (productOrders.size() > 0) { |
| | | throw new RuntimeException("该工èºè·¯çº¿ç产已å¼ç¨ï¼ä¸è½å é¤"); |
| | | } |
| | | //å é¤å·¥èºè·¯çº¿è¯¦æ
|
| | |
| | | private StockUtils stockUtils; |
| | | |
| | | @Override |
| | | public IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder) { |
| | | public IPage<ProductOrderDto> pageProductOrder(Page<ProductOrder> page, ProductOrderDto productOrder) { |
| | | return productOrderMapper.pageProductOrder(page, productOrder); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiModelProperty("产åè§æ ¼") |
| | | @Excel(name = "产åè§æ ¼") |
| | | private String specification; |
| | | private String model; |
| | | |
| | | @ApiModelProperty("产ååä½") |
| | | @Excel(name = "产ååä½") |
| | | private String baseUnit; |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "ç产计åidéå") |
| | | private List<Long> ids; |
| | |
| | | * 产åè§æ ¼ |
| | | */ |
| | | @ApiModelProperty("产åè§æ ¼") |
| | | private String specification; |
| | | private String model; |
| | | |
| | | /** |
| | | * 产åé¿åº¦ |
| | |
| | | * åºæ¬åä½ |
| | | */ |
| | | @ApiModelProperty("åºæ¬åä½") |
| | | private String baseUnit; |
| | | private String unit; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | // æ ¡éªæ¯å¦åå¨ä¸åç产åè§æ ¼ |
| | | String firstProductSpec = plans.get(0).getSpecification(); |
| | | if (plans.stream().anyMatch(p -> p.getSpecification() == null || !p.getSpecification().equals(firstProductSpec))) { |
| | | String firstProductSpec = plans.get(0).getModel(); |
| | | if (plans.stream().anyMatch(p -> p.getModel() == null || !p.getModel().equals(firstProductSpec))) { |
| | | throw new BaseException("å并失败ï¼åå¨ä¸åç产åè§æ ¼"); |
| | | } |
| | | |
| | |
| | | public class QualityTestStandardBindingDto { |
| | | |
| | | private String productName; |
| | | private String model; |
| | | private String materialCode; |
| | | |
| | | private Long qualityTestStandardBindingId; |
| | | } |
| | |
| | | * å
³è产åid |
| | | */ |
| | | @NotBlank(message = "产åidä¸è½ä¸ºç©º") |
| | | //å®å¤-ä¸ç建æä½¿ç¨æ°ç产å表å
³èproduct_material_sku |
| | | private Long productId; |
| | | |
| | | /** |
| | |
| | | private String workOrderNo; |
| | | @TableField(exist = false) |
| | | private String purchaseContractNo; |
| | | |
| | | /** |
| | | * åæ ·æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "åæ ·æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date sampleTime; |
| | | |
| | | /** |
| | | * æ£æµæ§è´¨ |
| | | */ |
| | | @Excel(name = "æ£æµæ§è´¨") |
| | | private String inspectNature; |
| | | |
| | | /** |
| | | * è¯æ ·ç¼å· |
| | | */ |
| | | @Excel(name = "è¯æ ·ç¼å·") |
| | | private String sampleCode; |
| | | |
| | | /** |
| | | * è¯æ ·ç¶æ |
| | | */ |
| | | @Excel(name = "è¯æ ·ç¶æ") |
| | | private String sampleState; |
| | | |
| | | /** |
| | | * 车çå· |
| | | */ |
| | | @Excel(name = "车çå·") |
| | | private String licensePlateNumber; |
| | | } |
| | |
| | | |
| | | <select id="listProcessRouteItemDto" resultType="com.ruoyi.production.dto.ProcessRouteItemDto"> |
| | | select pri.*, |
| | | pr.description , |
| | | pp.name as process_name, |
| | | pm.speculative_trading_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} |
| | | pr.description, |
| | | pp.name as process_name, |
| | | pms.product_id, |
| | | pms.model, |
| | | pm.product_name, |
| | | pm.unit, |
| | | (SELECT COUNT(1) |
| | | FROM process_route_item_param prip |
| | | WHERE prip.route_item_id = pri.id) as paramCount |
| | | from process_route_item pri |
| | | left join process_route pr on pr.id = pri.route_id |
| | | left join product_process pp on pp.id = pri.process_id |
| | | left join product_material_sku pms on pms.id = pri.product_model_id |
| | | left join product_material pm on pm.id = pms.product_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.ProcessRouteItemParamMapper"> |
| | | |
| | | <resultMap id="ProcessRouteItemParamResultMap" type="com.ruoyi.production.pojo.ProcessRouteItemParam"> |
| | | <id property="id" column="id"/> |
| | | <result property="routeItemId" column="route_item_id"/> |
| | | <result property="paramId" column="param_id"/> |
| | | <result property="processParamId" column="process_param_id"/> |
| | | <result property="standardValue" column="standard_value"/> |
| | | <result property="minValue" column="min_value"/> |
| | | <result property="maxValue" column="max_value"/> |
| | | <result property="isRequired" column="is_required"/> |
| | | <result property="sort" column="sort"/> |
| | | <result property="tenantId" column="tenant_id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <insert id="insertFromProcessTemplate"> |
| | | INSERT INTO process_route_item_param (route_item_id, param_id, process_param_id, |
| | | standard_value, min_value, max_value, |
| | | is_required, sort, tenant_id, create_time) |
| | | SELECT #{routeItemId}, |
| | | param_id, |
| | | id, |
| | | standard_value, |
| | | min_value, |
| | | max_value, |
| | | is_required, |
| | | sort, |
| | | #{tenantId}, |
| | | NOW() |
| | | FROM product_process_param |
| | | WHERE process_id = #{processId} |
| | | </insert> |
| | | |
| | | <select id="selectParamPage" resultType="com.ruoyi.production.dto.ProcessRouteItemParamDto"> |
| | | select |
| | | prip.*, |
| | | bp.param_name, |
| | | bp.param_key, |
| | | bp.unit, |
| | | bp.param_type, |
| | | bp.param_format, |
| | | bp.value_mode |
| | | from process_route_item_param prip |
| | | left join base_param bp on prip.param_id = bp.id |
| | | <where> |
| | | <if test="p.routeItemId != null"> |
| | | and prip.route_item_id = #{p.routeItemId} |
| | | </if> |
| | | <if test="p.tenantId != null"> |
| | | and prip.tenant_id = #{p.tenantId} |
| | | </if> |
| | | </where> |
| | | order by prip.sort asc, prip.id asc |
| | | </select> |
| | | |
| | | <select id="selectMaxSortByRouteItemId" resultType="java.lang.Integer"> |
| | | SELECT MAX(sort) |
| | | FROM process_route_item_param |
| | | WHERE route_item_id = #{routeItemId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <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"/> |
| | | <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"/> |
| | | <result property="status" column="status"/> |
| | | </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.*, |
| | | pm.product_name, pms.product_id, pms.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 |
| | | left join product_material_sku pms on ps.product_model_id = pms.id |
| | | left join product_material pm on pms.product_id = pm.id |
| | | <where> |
| | | <if test="c.model != null and c.model != ''"> |
| | | and pm.model like concat('%',#{c.model},'%') |
| | | and pms.model like concat('%', #{c.model}, '%') |
| | | </if> |
| | | </where> |
| | | order by ps.id asc |
| | | order by ps.id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | SELECT |
| | | pb.*, |
| | | pms.model AS productModelName, |
| | | pm.product_name AS productName |
| | | pm.product_name AS productName, |
| | | pms.material_code AS productCode |
| | | FROM product_bom pb |
| | | LEFT JOIN product_material_sku pms ON pb.product_model_id = pms.id |
| | | LEFT JOIN product_material pm ON pms.product_id = pm.id |
| | |
| | | |
| | | <resultMap id="basicMap" type="com.ruoyi.production.pojo.ProductOrder"> |
| | | <id property="id" column="id"/> |
| | | <result property="productModelId" column="product_model_id"/> |
| | | <result property="tenantId" column="tenant_id"/> |
| | | <result property="salesLedgerId" column="sales_ledger_id"/> |
| | | <result property="routeId" column="route_id"/> |
| | | <result property="npsNo" column="nps_no"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="planCompleteTime" column="plan_complete_time"/> |
| | | </resultMap> |
| | | |
| | | <select id="pageProductOrder" resultType="com.ruoyi.production.dto.ProductOrderDto"> |
| | | select po.*, |
| | | ppr.process_route_code, |
| | |
| | | <select id="listProcessRoute" resultType="com.ruoyi.production.pojo.ProcessRoute"> |
| | | select pr.* |
| | | from process_route pr |
| | | left join product_model pm on pr.product_model_id = pm.id |
| | | where pm.id = #{productModelId} |
| | | left join product_material_sku pms on pms.id = pr.product_model_id |
| | | where pms.id = #{productModelId} |
| | | </select> |
| | | <select id="listProcessBom" resultType="com.ruoyi.production.dto.ProductStructureDto"> |
| | | select ps.id, |
| | |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <select id="listItem" resultType="com.ruoyi.production.dto.ProductProcessRouteItemDto"> |
| | | select ppri.*, |
| | | pp.name as process_name, |
| | | pm.model, |
| | | pp.name as process_name, |
| | | pms.model, |
| | | pm.unit, |
| | | p.product_name, |
| | | case when pwo.complete_quantity>0 then true else false end as is_complete |
| | | pm.product_name, |
| | | case when pwo.complete_quantity > 0 then true else false end as is_complete |
| | | from product_process_route_item ppri |
| | | left join product_model pm on ppri.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join product_material_sku pms on ppri.product_model_id = pms.id |
| | | left join product_material pm on pms.product_id = pm.id |
| | | left join product_process pp on pp.id = ppri.process_id |
| | | left join product_work_order pwo on pwo.product_process_route_item_id = ppri.id |
| | | where ppri.product_order_id = #{orderId} |
| | |
| | | pm.product_name as product_name, |
| | | pp.name as process_name, |
| | | pms.product_id as product_id, |
| | | pms.model as model |
| | | pms.model as model, |
| | | pms.material_code as productCode |
| | | from product_structure ps |
| | | left join product_material_sku pms on ps.product_model_id = pms.id |
| | | left join product_material pm on pms.product_id = pm.id |
| | |
| | | SELECT |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.specification AS specification, |
| | | pms.material_id AS productMaterialId, |
| | | pm.material_name AS productName, |
| | | pm.base_unit |
| | | pms.model, |
| | | pms.product_id AS productMaterialId, |
| | | pm.product_name AS productName, |
| | | pm.unit |
| | | FROM production_plan pp |
| | | left join product_material_sku pms on pp.product_material_sku_id = pms.id |
| | | left join product_material pm on pms.material_id = pm.id |
| | | left join product_material pm on pms.product_id = pm.id |
| | | WHERE 1 = 1 |
| | | <if test="c.customerName != null and c.customerName != '' "> |
| | | AND pp.customer_name LIKE CONCAT('%',#{c.customerName},'%') |
| | | </if> |
| | | <if test="c.productName != null and c.productName != '' "> |
| | | AND pm.material_name LIKE CONCAT('%',#{c.productName},'%') |
| | | AND pm.product_name LIKE CONCAT('%',#{c.productName},'%') |
| | | </if> |
| | | <if test="c.materialCode != null and c.materialCode != '' "> |
| | | AND pms.material_code LIKE CONCAT('%',#{c.materialCode},'%') |
| | | </if> |
| | | <if test="c.specification != null and c.specification != '' "> |
| | | AND pms.specification LIKE CONCAT('%',#{c.specification},'%') |
| | | <if test="c.model != null and c.model != '' "> |
| | | AND pms.model LIKE CONCAT('%',#{c.model},'%') |
| | | </if> |
| | | <if test="c.applyNo != null and c.applyNo != '' "> |
| | | AND pp.apply_no LIKE CONCAT('%',#{c.applyNo},'%') |
| | |
| | | <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto"> |
| | | SELECT |
| | | sku.material_code AS materialCode, |
| | | pm.material_name AS productName, |
| | | sku.specification AS specification, |
| | | pm.product_name AS productName, |
| | | sku.model, |
| | | pp.length, |
| | | pp.width, |
| | | pp.height, |
| | | pm.base_unit AS baseUnit, |
| | | pm.unit AS unit, |
| | | COALESCE(SUM(pp.quantity),0) AS quantity, |
| | | COALESCE(SUM(pp.volume),0) AS volume |
| | | FROM production_plan pp |
| | | LEFT JOIN product_material_sku sku |
| | | ON pp.product_material_sku_id = sku.id |
| | | LEFT JOIN product_material pm |
| | | ON sku.material_id = pm.id |
| | | ON sku.product_id = pm.id |
| | | <where> |
| | | <if test="materialCode != null and materialCode != ''"> |
| | | AND sku.material_code LIKE CONCAT('%', #{materialCode}, '%') |
| | | </if> |
| | | |
| | | <if test="productName != null and productName != ''"> |
| | | AND pm.material_name LIKE CONCAT('%', #{productName}, '%') |
| | | AND pm.product_name LIKE CONCAT('%', #{productName}, '%') |
| | | </if> |
| | | |
| | | <if test="specification != null and specification != ''"> |
| | | AND sku.specification LIKE CONCAT('%', #{specification}, '%') |
| | | <if test="model != null and model != ''"> |
| | | AND sku.model LIKE CONCAT('%', #{model}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY |
| | | sku.material_code, |
| | | pm.material_name, |
| | | sku.specification, |
| | | pm.product_name, |
| | | sku.model, |
| | | pp.length, |
| | | pp.width, |
| | | pp.height, |
| | | pm.base_unit |
| | | pm.unit |
| | | </select> |
| | | |
| | | <select id="selectWithMaterialByIds" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto"> |
| | | SELECT |
| | | pp.*, |
| | | pms.material_code AS materialCode, |
| | | pms.specification AS specification, |
| | | pm.material_name AS productName, |
| | | pm.base_unit |
| | | pms.model, |
| | | pm.product_name AS productName, |
| | | pm.unit |
| | | FROM production_plan pp |
| | | LEFT JOIN product_material_sku pms ON pp.product_material_sku_id = pms.id |
| | | LEFT JOIN product_material pm ON pms.material_id = pm.id |
| | | LEFT JOIN product_material pm ON pms.product_id = pm.id |
| | | WHERE pp.id IN |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | <select id="listBinding" resultType="com.ruoyi.quality.dto.QualityTestStandardBindingDto"> |
| | | select t2.product_name, |
| | | select t3.product_name , |
| | | t2.model , |
| | | t2.material_code , |
| | | t1.id qualityTestStandardBindingId |
| | | from quality_test_standard_binding t1 |
| | | left join product t2 on t1.product_id = t2.id |
| | | left join product_material_sku t2 on t1.product_id = t2.id |
| | | left join product_material t3 on t2.product_id = t3.id |
| | | where t1.test_standard_id = #{testStandardId} |
| | | </select> |
| | | |