| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.yuanchu.mom.service.MaterialService; |
| | | import com.yuanchu.mom.pojo.dto.MaterialDto; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åMOM-->左侧äºçº§æ å±ç¤º") |
| | | import javax.annotation.Resource; |
| | | |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM") |
| | | @RestController |
| | | @RequestMapping("/material") |
| | | public class MaterialController { |
| | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Resource |
| | | TechnologyService technologyService; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | MbomService mbomService; |
| | | |
| | | @Resource |
| | | TechniqueService techniqueService; |
| | | |
| | | @ApiOperation(value = "左侧äºçº§æ å±ç¤º") |
| | | @GetMapping("/selectTreeByMaterial") |
| | | public Result selectTreeByMaterial(){ |
| | | return Result.success(materialService.selectTreeByMaterial()); |
| | | } |
| | | |
| | | @ApiOperation("(1,2级)æ°å¢-->ç©æ,æ å,åå·") |
| | | @PostMapping("/add") |
| | | public Result<?> addMaterial(@Validated @RequestBody MaterialDto materialDto) { |
| | | materialService.addMaterial(materialDto); |
| | | return Result.success("æ·»å ç©æã" + materialDto.getName() + "ãæå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å³ä¾§æ°æ®å±ç¤º-->éæ©çæ¬") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(0:å·¥èºè·¯çº¿;1:ææ¯ææ ;2:ç©ææ¸
å;3:ç产工èº)", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectVersion") |
| | | public Result selectVersion(Integer type, Integer specificationsId) { |
| | | switch (type) { |
| | | case 0: |
| | | //å·¥èºè·¯çº¿ |
| | | return Result.success(technologyService.selectVerByTec(specificationsId)); |
| | | case 1: |
| | | //ææ¯ææ |
| | | return Result.success(productService.selectVerByPro(specificationsId)); |
| | | case 2: |
| | | //ç©ææ¸
å |
| | | return Result.success(mbomService.selectVerByMbom(specificationsId)); |
| | | case 3: |
| | | //çäº§å·¥èº |
| | | return Result.success(techniqueService.selectVerByTeq(specificationsId)); |
| | | } |
| | | return Result.fail("没æè¯¥ç±»å!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å³ä¾§æ°æ®å±ç¤º") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(0:å·¥èºè·¯çº¿;1:ææ¯ææ ;2:ç©ææ¸
å;3:ç产工èº)", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "çæ¬(é»è®¤ææ°)", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "message", value = "æç´¢å
容", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAll") |
| | | public Result selectAll(Integer specificationsId, Integer type, Integer version,String message) { |
| | | switch (type) { |
| | | case 0: |
| | | //å·¥èºè·¯çº¿ |
| | | return Result.success(technologyService.selectAllTec(specificationsId, version,message)); |
| | | case 1: |
| | | //ææ¯ææ |
| | | return Result.success(productService.selectAllPro(specificationsId, version,message)); |
| | | case 2: |
| | | //ç©ææ¸
å |
| | | return Result.success(mbomService.selectAllMbom(specificationsId, version,message)); |
| | | case 3: |
| | | //çäº§å·¥èº |
| | | return Result.success(techniqueService.selectAllTeq(specificationsId, version,message)); |
| | | } |
| | | return Result.fail("没æè¯¥ç±»å!"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.MbomService; |
| | | |
| | | |
| | | /** |
| | | * æ åBOM-ç©ææ¸
å表(Mbom)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:58:23 |
| | | */ |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM-->ç©ææ¸
å") |
| | | @RestController |
| | | @RequestMapping("/mbom") |
| | | public class MbomController { |
| | | |
| | | @Autowired |
| | | private MbomService mbomService; |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åMOM-->é¡¹ç®æ¨¡å") |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM-->ææ¯ææ (æ£éªé¡¹ç®)") |
| | | @RestController |
| | | @RequestMapping("/product") |
| | | public class ProductController { |
| | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation(value = "项ç®è¡¨æ ¼äºçº§æ ") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "project", value = "项ç®", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "specifications", value = "åå·ID", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/selectTreeByMaterial") |
| | | public Result<?> selectTreeProduct(String specifications, String project){ |
| | | List<ProductDto> map = productService.selectTreeProduct(specifications, project); |
| | | return Result.success(map); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.SpecificationsDto; |
| | | import com.yuanchu.mom.pojo.dto.StandardDto; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.SpecificationsService; |
| | | |
| | | |
| | | /** |
| | | * åå·è¡¨(Specifications)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 09:35:56 |
| | | */ |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM") |
| | | @RestController |
| | | @RequestMapping("/specifications") |
| | | public class SpecificationsController { |
| | | |
| | | @Autowired |
| | | private SpecificationsService specificationsService; |
| | | |
| | | @ApiOperation("(4级)æ°å¢-->åå·") |
| | | @PostMapping("/add") |
| | | public Result<?> addSpecifications(@Validated @RequestBody SpecificationsDto specificationsDto) { |
| | | specificationsService.addSpecifications(specificationsDto); |
| | | return Result.fail("æ·»å åå·ã"+ specificationsDto.getSpecifications() +"ãæåï¼"); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.MaterialDto; |
| | | import com.yuanchu.mom.pojo.dto.StandardDto; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.StandardService; |
| | | |
| | | |
| | | /** |
| | | * æ å表(Standard)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 09:35:38 |
| | | */ |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM") |
| | | @RestController |
| | | @RequestMapping("/standard") |
| | | public class StandardController { |
| | | |
| | | @Autowired |
| | | private StandardService standardService; |
| | | |
| | | @ApiOperation("(3级)æ°å¢-->æ å,åå·") |
| | | @PostMapping("/add") |
| | | public Result<?> addStandard(@Validated @RequestBody StandardDto standardDto) { |
| | | standardService.addStandard(standardDto); |
| | | return Result.fail("æ·»å æ åã"+ standardDto.getStandard() +"ãæåï¼"); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.TechniqueService; |
| | | |
| | | |
| | | /** |
| | | * æ åBOM-ç产工èºè¡¨(Technique)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:57:52 |
| | | */ |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM-->ç产工èº") |
| | | @RestController |
| | | @RequestMapping("/technique") |
| | | public class TechniqueController { |
| | | |
| | | @Autowired |
| | | private TechniqueService techniqueService; |
| | | |
| | | } |
| | | |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-31 |
| | | */ |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åMOM-->å·¥èºè·¯çº¿") |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM-->å·¥èºè·¯çº¿") |
| | | @RestController |
| | | @RequestMapping("/technology") |
| | | public class TechnologyController { |
| | |
| | | @Autowired |
| | | private TechnologyService technologyService; |
| | | |
| | | @ApiOperation(value = "鿩工èºè·¯çº¿åºç°çè¡¨æ ¼æ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyName", value = "å·¥èºåç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "specificationId", value = "è§æ ¼ID", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/select") |
| | | public Result<?> selectTechnology(String technologyName, String specificationId){ |
| | | List<Map<String, Object>> map = technologyService.selectTechnology(technologyName); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //æ ¹æ®ç©æåç§°åç©æç¼ç æ¥è¯¢ç©æid,è§æ ¼ä¿¡æ¯ååå·ä¿¡æ¯ |
| | | List<Map> selectIdByCoNa(String name, String code); |
| | | |
| | | //æ ¹æ®æ åidæ¥è¯¢ç©æ |
| | | Material selFath(Integer id); |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.Mbom; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ åBOM-ç©ææ¸
å表(Mbom)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:58:23 |
| | | */ |
| | | public interface MbomMapper extends BaseMapper<Mbom> { |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | List<Integer> selectVerByMbom(Integer specificationsId); |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ç©ææ¸
å |
| | | List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version,String message); |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface ProductMapper extends BaseMapper<Product> { |
| | | |
| | | List<ProductDto> selectTreeProduct(String specifications, String project); |
| | | //æ ¹æ®åå·idæ¥è¯¢é¡¹ç®(ææ¯ææ ) |
| | | List<Map<String, Object>> selectProductList(Integer specificationsId); |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | List<Integer> selectVerByPro(Integer specificationsId); |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ææ¯ææ (æ£éªé¡¹ç®) |
| | | List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version,String message); |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.Technique; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ åBOM-ç产工èºè¡¨(Technique)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:57:52 |
| | | */ |
| | | public interface TechniqueMapper extends BaseMapper<Technique> { |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | List<Integer> selectVerByTeq(Integer specificationsId); |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->çäº§å·¥èº |
| | | List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version,String message); |
| | | } |
| | | |
| | |
| | | import com.yuanchu.mom.pojo.Technology; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | |
| | | */ |
| | | public interface TechnologyMapper extends BaseMapper<Technology> { |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢çæ¬ |
| | | List<Integer> selectVerByTec(Integer specificationsId); |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->å·¥èºè·¯çº¿ |
| | | List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version,String message); |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | **/ |
| | | private Integer father; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¹è§é", hidden = true) |
| | | @Version |
| | | //çæ¬ |
| | | private Integer version; |
| | | |
| | | @TableField(exist = false) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æ åBOM-ç©ææ¸
å表(Mbom)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:58:24 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("mbom") |
| | | public class Mbom implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å
³è å·¥èºè·¯çº¿id |
| | | **/ |
| | | private Integer technologyId; |
| | | |
| | | /** |
| | | * åææåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer num; |
| | | |
| | | /** |
| | | * ä¾åºå |
| | | **/ |
| | | private String supplier; |
| | | |
| | | /** |
| | | * è´¨éè¿½æº¯å· |
| | | **/ |
| | | private String qualityTraceability; |
| | | |
| | | /** |
| | | * (åææç)è§æ ¼åå· |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * çæ¬ |
| | | **/ |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| | |
| | | private String internal; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¹è§é", hidden = true) |
| | | @Version |
| | | //çæ¬ |
| | | private Integer version; |
| | | |
| | | /** |
| | | * å
³è åå·id |
| | | * å
³è å·¥èºè·¯çº¿id |
| | | */ |
| | | private Integer specificationsId; |
| | | private Integer technologyId; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æ åBOM-ç产工èºè¡¨(Technique)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:57:53 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("technique") |
| | | public class Technique implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å
³è å·¥èºè·¯çº¿id |
| | | **/ |
| | | private Integer technologyId; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | **/ |
| | | private String device; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®(ç¶ç±») |
| | | **/ |
| | | private String productFather; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * ææ (å类项ç®) |
| | | **/ |
| | | private String product; |
| | | |
| | | /** |
| | | * çæ¬ |
| | | **/ |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | |
| | | @Data |
| | | //æ åBOMæ°å¢åæ°(1,2级æ°å¢) |
| | | public class MaterialDto { |
| | | |
| | | @JsonSerialize |
| | | @NotNull(message = "ç±»å(æååæå)ä¸è½ä¸ºç©º") |
| | | private Integer type; |
| | | |
| | | @JsonSerialize |
| | | @NotNull(message = "产å大类(4大类)ä¸è½ä¸ºç©º") |
| | | private Integer father; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "ç©æåç§°ä¸è½ä¸ºç©º") |
| | | private String name; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "æ åä¸è½ä¸ºç©º") |
| | | private String standard; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "åå·ä¸è½ä¸ºç©º") |
| | | private String specifications; |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | class SpecificationsDto { |
| | | //æ åBOMæ°å¢åæ°(4级æ°å¢) |
| | | public class SpecificationsDto { |
| | | |
| | | @JsonSerialize |
| | | @NotNull(message = "æ åidä¸è½ä¸ºç©º") |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | private String code = "[4]"; |
| | | @JsonSerialize |
| | | @NotBlank(message = "åå·ä¸è½ä¸ºç©º") |
| | | private String specifications; |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | class StandardDto { |
| | | //æ åBOMæ°å¢åæ°(3级æ°å¢) |
| | | public class StandardDto { |
| | | |
| | | @JsonSerialize |
| | | @NotNull(message = "ç©æidä¸è½ä¸ºç©º") |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | @JsonSerialize |
| | | @NotBlank(message = "æ åä¸è½ä¸ºç©º") |
| | | private String standard; |
| | | |
| | | private String code = "[3]"; |
| | | |
| | | List<SpecificationsDto> children; |
| | | @JsonSerialize |
| | | @NotBlank(message = "åå·ä¸è½ä¸ºç©º") |
| | | private String specifications; |
| | | } |
| | | |
| | |
| | | |
| | | import com.yuanchu.mom.pojo.Material; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.dto.MaterialDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | List<Map<String,Object>> selectTreeByMaterial(); |
| | | |
| | | /** |
| | | * (1,2级)æ°å¢-->ç©æ,æ å,åå· |
| | | * @param materialDto |
| | | * @return |
| | | */ |
| | | void addMaterial(MaterialDto materialDto); |
| | | |
| | | /** |
| | | * æ ¹æ®ç©æåç§°æ¥è¯¢ç©æidåç©æç¼ç |
| | | * @param name |
| | | * @return |
| | |
| | | * @return |
| | | */ |
| | | List<Map> selectIdByCoNa(String name, String code); |
| | | |
| | | /** |
| | | * æ£éªæ¨¡å-->OMS管ç-->æåæ£éª-->æ°å¢(项ç®åç§°ä¸ææ¡ï¼Idä¸åç§°ï¼ç¼ç ) |
| | | * æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(项ç®åç§°ä¸ææ¡ï¼Idä¸åç§°ï¼ç¼ç ) |
| | | */ |
| | | List<Map<String, Object>> selectMaterialIdAndNameAndCode(); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<Material> selectMaterial(); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Mbom; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ åBOM-ç©ææ¸
å表(Mbom)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:58:23 |
| | | */ |
| | | public interface MbomService extends IService<Mbom> { |
| | | |
| | | /** |
| | | * æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Integer> selectVerByMbom(Integer specificationsId); |
| | | |
| | | /** |
| | | *å³ä¾§æ°æ®å±ç¤º-->ç©ææ¸
å |
| | | * @param specificationsId |
| | | * @param version |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllMbom(Integer specificationsId, Integer version,String message); |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface ProductService extends IService<Product> { |
| | | |
| | | List<ProductDto> selectTreeProduct(String specifications, String project); |
| | | |
| | | /** |
| | | * æ ¹æ®åå·idæ¥è¯¢é¡¹ç®(ææ¯ææ ) |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectProductList(Integer specificationsId); |
| | | |
| | | /** |
| | | * æ ¹æ®åå·idæ¥è¯¢çæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Integer> selectVerByPro(Integer specificationsId); |
| | | |
| | | /** |
| | | *å³ä¾§æ°æ®å±ç¤º-->ææ¯ææ (æ£éªé¡¹ç®) |
| | | * @param specificationsId |
| | | * @param version |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllPro(Integer specificationsId, Integer version,String message); |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.Material; |
| | | import com.yuanchu.mom.pojo.Specifications; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.dto.SpecificationsDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * æ£éªæ¨¡å-->OMS管ç-->æåæ£éª-->æ°å¢(éè¦è§æ ¼åå·çIdä¸åç§°) |
| | | */ |
| | | List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId); |
| | | |
| | | /** |
| | | * (4级)æ°å¢-->åå· |
| | | * @param specificationsDto |
| | | */ |
| | | void addSpecifications(SpecificationsDto specificationsDto); |
| | | |
| | | } |
| | |
| | | |
| | | import com.yuanchu.mom.pojo.Standard; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.dto.StandardDto; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | */ |
| | | public interface StandardService extends IService<Standard> { |
| | | |
| | | /** |
| | | * (3级)æ°å¢-->æ å,åå· |
| | | * @param standardDto |
| | | */ |
| | | void addStandard(StandardDto standardDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Technique; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ åBOM-ç产工èºè¡¨(Technique)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:57:53 |
| | | */ |
| | | public interface TechniqueService extends IService<Technique> { |
| | | |
| | | /** |
| | | * æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Integer> selectVerByTeq(Integer specificationsId); |
| | | |
| | | /** |
| | | * å³ä¾§æ°æ®å±ç¤º-->çäº§å·¥èº |
| | | * @param specificationsId |
| | | * @param version |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllTeq(Integer specificationsId, Integer version,String message); |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface TechnologyService extends IService<Technology> { |
| | | |
| | | List<Map<String, Object>> selectTechnology(String technologyName); |
| | | /** |
| | | * æ ¹æ®åå·idæ¥è¯¢çæ¬ |
| | | * @return |
| | | */ |
| | | List<Integer> selectVerByTec(Integer specificationsId); |
| | | |
| | | /** |
| | | * å³ä¾§æ°æ®å±ç¤º-->å·¥èºè·¯çº¿ |
| | | * @param specificationsId åå·id |
| | | * @param version çæ¬ |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllTec(Integer specificationsId, Integer version,String message); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.pojo.Material; |
| | | import com.yuanchu.mom.service.MaterialService; |
| | | import com.yuanchu.mom.mapper.MaterialMapper; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.dto.MaterialDto; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | * @createDate 2023-07-26 15:52:50 |
| | | */ |
| | | @Service |
| | | public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> |
| | | implements MaterialService { |
| | | public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService { |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | StandardMapper standardMapper; |
| | | |
| | | @Resource |
| | | SpecificationsMapper specificationsMapper; |
| | | |
| | | @Resource |
| | | TechnologyService technologyService; |
| | | |
| | | @Resource |
| | | TechnologyTemplateMapper technologyTemplateMapper; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | TechnicalModelMapper technicalModelMapper; |
| | | |
| | | @Resource |
| | | MbomService mbomService; |
| | | |
| | | @Resource |
| | | MbomModelMapper mbomModelMapper; |
| | | |
| | | @Resource |
| | | TechniqueService techniqueService; |
| | | |
| | | @Resource |
| | | TechniqueModelMapper techniqueModelMapper; |
| | | |
| | | @Resource |
| | | DeviceMapper deviceMapper; |
| | | |
| | | //æ åMOM-->左侧äºçº§æ å±ç¤º |
| | | @Override |
| | |
| | | return materialMapper.selectTreeByMaterial(); |
| | | } |
| | | |
| | | //(1,2级)æ°å¢-->ç©æ,æ å,åå· |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addMaterial(MaterialDto materialDto) { |
| | | /*æ°å¢ç©æè¡¨*/ |
| | | Material material = new Material(); |
| | | material.setCode(MyUtil.getTimeSixNumberCode("ML", "ML")); |
| | | material.setName(materialDto.getName()); |
| | | material.setType(materialDto.getType()); |
| | | material.setFather(materialDto.getFather()); |
| | | materialMapper.insert(material); |
| | | /*æ°å¢æ å表*/ |
| | | Standard standard = new Standard(); |
| | | standard.setName(materialDto.getStandard()); |
| | | standard.setMaterial_id(material.getId()); |
| | | standardMapper.insert(standard); |
| | | /*æ°å¢åå·è¡¨*/ |
| | | Specifications specifications = new Specifications(); |
| | | specifications.setName(materialDto.getSpecifications()); |
| | | specifications.setStandardId(standard.getId()); |
| | | specificationsMapper.insert(specifications); |
| | | /*æ°å¢æ åBOM-->å·¥èºè·¯çº¿(æ¹éæ·»å )*/ |
| | | List<TechnologyTemplate> technologyTemplateList = technologyTemplateMapper.selectList(Wrappers.<TechnologyTemplate>query().eq("type", materialDto.getFather())); |
| | | List<Technology> technologyList = technologyTemplateList.stream().map(technologyTemplate -> { |
| | | Technology technology = new Technology(); |
| | | technology.setSpecificationsId(specifications.getId()); |
| | | technology.setFather(technologyTemplate.getFather()); |
| | | technology.setName(technologyTemplate.getName()); |
| | | technology.setDeviceGroup(technologyTemplate.getDeviceGroup()); |
| | | return technology; |
| | | }).collect(Collectors.toList()); |
| | | technologyService.saveBatch(technologyList); |
| | | /*æ°å¢æ åBOM-->ææ¯ææ (æ¹éæ·»å )*/ |
| | | //æ°å¢çå·¥èºè·¯çº¿idéå |
| | | List<Integer> technologyIds = technologyList.stream().map(Technology::getId).collect(Collectors.toList()); |
| | | //åºç¡æ°æ®ä¸å·¥èºè·¯çº¿idéå |
| | | List<Integer> techTemIds = technologyTemplateList.stream().map(TechnologyTemplate::getId).collect(Collectors.toList()); |
| | | //两è
é¿åº¦ä¸å®ä¸æ · |
| | | List<Product> productList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<TechnicalModel> technicalModelList = technicalModelMapper.selectList(Wrappers.<TechnicalModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (TechnicalModel technicalModel : technicalModelList) { |
| | | Product product = new Product(); |
| | | product.setFather(technicalModel.getFather()); |
| | | product.setName(technicalModel.getName()); |
| | | product.setUnit(technicalModel.getUnit()); |
| | | product.setTechnologyId(technologyIds.get(i)); |
| | | productList.add(product); |
| | | } |
| | | } |
| | | productService.saveBatch(productList); |
| | | /*æ°å¢æ åBOM-->ç©ææ¸
å(æ¹éæ·»å )*/ |
| | | List<Mbom> mbomList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<MbomModel> mbomModelList = mbomModelMapper.selectList(Wrappers.<MbomModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (MbomModel mbomModel : mbomModelList) { |
| | | Mbom mbom = new Mbom(); |
| | | mbom.setUnit(mbomModel.getUnit()); |
| | | mbom.setName(mbomModel.getName()); |
| | | mbom.setSupplier(mbomModel.getSupplier()); |
| | | mbom.setQualityTraceability(mbomModel.getQualityTraceability()); |
| | | mbom.setSpecifications(mbomModel.getSpecifications()); |
| | | mbom.setTechnologyId(technologyIds.get(i)); |
| | | mbomList.add(mbom); |
| | | } |
| | | } |
| | | mbomService.saveBatch(mbomList); |
| | | /*æ°å¢æ åBOM-->ç产工èº(æ¹éæ·»å )*/ |
| | | List<Technique> techniqueList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<TechniqueModel> techniqueModelList = techniqueModelMapper.selectList(Wrappers.<TechniqueModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (TechniqueModel techniqueModel : techniqueModelList) { |
| | | //æ¥è¯¢è®¾å¤åç§° |
| | | Device device = deviceMapper.selectById(techniqueModel.getDeviceId()); |
| | | //æ¥è¯¢åºç¡ç产工èºä¸æ¯ä¸ªè®¾å¤çå
·ä½é¡¹ç® |
| | | TechnicalModel technicalModel = technicalModelMapper.selectById(techniqueModel.getTechnicalModelId()); |
| | | Technique technique = new Technique(); |
| | | technique.setTechnologyId(technologyIds.get(i)); |
| | | technique.setDevice(device.getName()); |
| | | technique.setProductFather(technicalModel.getFather()); |
| | | technique.setProduct(technicalModel.getName()); |
| | | technique.setUnit(technicalModel.getUnit()); |
| | | techniqueList.add(technique); |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | } |
| | | |
| | | //æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(项ç®åç§°ä¸ææ¡ï¼Idä¸åç§°ï¼ç¼ç ) |
| | | @Override |
| | | public List<Map<String, Object>> selectMaterialIdAndNameAndCode() { |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.MbomMapper; |
| | | import com.yuanchu.mom.pojo.Mbom; |
| | | import com.yuanchu.mom.service.MbomService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ åBOM-ç©ææ¸
å表(Mbom)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:58:24 |
| | | */ |
| | | @Service |
| | | public class MbomServiceImpl extends ServiceImpl<MbomMapper, Mbom> implements MbomService { |
| | | |
| | | @Resource |
| | | MbomMapper mbomMapper; |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | @Override |
| | | public List<Integer> selectVerByMbom(Integer specificationsId) { |
| | | return mbomMapper.selectVerByMbom(specificationsId); |
| | | } |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ç©ææ¸
å |
| | | @Override |
| | | public List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version,String message) { |
| | | return mbomMapper.selectAllMbom(specificationsId,version,message); |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | |
| | | @Override |
| | | public List<ProductDto> selectTreeProduct(String specifications, String project) { |
| | | return productMapper.selectTreeProduct(specifications, project); |
| | | } |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢é¡¹ç®(ææ¯ææ ) |
| | | @Override |
| | | public List<Map<String, Object>> selectProductList(Integer specificationsId) { |
| | | LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Product::getSpecificationsId, specificationsId); |
| | | wrapper.select(Product::getName, Product::getFather, Product::getRequired, Product::getInternal, Product::getUnit); |
| | | return productMapper.selectMaps(wrapper); |
| | | return productMapper.selectProductList(specificationsId); |
| | | } |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | @Override |
| | | public List<Integer> selectVerByPro(Integer specificationsId) { |
| | | return productMapper.selectVerByPro(specificationsId); |
| | | } |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ææ¯ææ (æ£éªé¡¹ç®) |
| | | @Override |
| | | public List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version,String message) { |
| | | return productMapper.selectAllPro(specificationsId,version,message); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.SpecificationsMapper; |
| | | import com.yuanchu.mom.pojo.Specifications; |
| | | import com.yuanchu.mom.service.SpecificationsService; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.dto.SpecificationsDto; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | * @createDate 2023-07-26 16:01:49 |
| | | */ |
| | | @Service |
| | | public class SpecificationsServiceImpl extends ServiceImpl<SpecificationsMapper, Specifications> |
| | | implements SpecificationsService { |
| | | public class SpecificationsServiceImpl extends ServiceImpl<SpecificationsMapper, Specifications> implements SpecificationsService { |
| | | |
| | | @Resource |
| | | private SpecificationsMapper specificationsMapper; |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | SpecificationsMapper specificationsMapper; |
| | | |
| | | @Resource |
| | | TechnologyService technologyService; |
| | | |
| | | @Resource |
| | | TechnologyTemplateMapper technologyTemplateMapper; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | TechnicalModelMapper technicalModelMapper; |
| | | |
| | | @Resource |
| | | MbomService mbomService; |
| | | |
| | | @Resource |
| | | MbomModelMapper mbomModelMapper; |
| | | |
| | | @Resource |
| | | TechniqueService techniqueService; |
| | | |
| | | @Resource |
| | | TechniqueModelMapper techniqueModelMapper; |
| | | |
| | | @Resource |
| | | DeviceMapper deviceMapper; |
| | | |
| | | //(4级)æ°å¢-->åå· |
| | | @Override |
| | | public void addSpecifications(SpecificationsDto specificationsDto) { |
| | | /*æ°å¢åå·è¡¨*/ |
| | | Specifications specifications = new Specifications(); |
| | | specifications.setStandardId(specificationsDto.getId()); |
| | | specifications.setName(specificationsDto.getSpecifications()); |
| | | specificationsMapper.insert(specifications); |
| | | /*æ°å¢æ åBOM-->å·¥èºè·¯çº¿(æ¹éæ·»å )*/ |
| | | //æ ¹æ®æ åidæ¥è¯¢ç©æå¤§ç±» |
| | | Material material = materialMapper.selFath(specificationsDto.getId()); |
| | | List<TechnologyTemplate> technologyTemplateList = technologyTemplateMapper.selectList(Wrappers.<TechnologyTemplate>query().eq("type", material.getFather())); |
| | | List<Technology> technologyList = technologyTemplateList.stream().map(technologyTemplate -> { |
| | | Technology technology = new Technology(); |
| | | technology.setSpecificationsId(specifications.getId()); |
| | | technology.setFather(technologyTemplate.getFather()); |
| | | technology.setName(technologyTemplate.getName()); |
| | | technology.setDeviceGroup(technologyTemplate.getDeviceGroup()); |
| | | return technology; |
| | | }).collect(Collectors.toList()); |
| | | technologyService.saveBatch(technologyList); |
| | | /*æ°å¢æ åBOM-->ææ¯ææ (æ¹éæ·»å )*/ |
| | | //æ°å¢çå·¥èºè·¯çº¿idéå |
| | | List<Integer> technologyIds = technologyList.stream().map(Technology::getId).collect(Collectors.toList()); |
| | | //åºç¡æ°æ®ä¸å·¥èºè·¯çº¿idéå |
| | | List<Integer> techTemIds = technologyTemplateList.stream().map(TechnologyTemplate::getId).collect(Collectors.toList()); |
| | | //两è
é¿åº¦ä¸å®ä¸æ · |
| | | List<Product> productList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<TechnicalModel> technicalModelList = technicalModelMapper.selectList(Wrappers.<TechnicalModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (TechnicalModel technicalModel : technicalModelList) { |
| | | Product product = new Product(); |
| | | product.setFather(technicalModel.getFather()); |
| | | product.setName(technicalModel.getName()); |
| | | product.setUnit(technicalModel.getUnit()); |
| | | product.setTechnologyId(technologyIds.get(i)); |
| | | productList.add(product); |
| | | } |
| | | } |
| | | productService.saveBatch(productList); |
| | | /*æ°å¢æ åBOM-->ç©ææ¸
å(æ¹éæ·»å )*/ |
| | | List<Mbom> mbomList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<MbomModel> mbomModelList = mbomModelMapper.selectList(Wrappers.<MbomModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (MbomModel mbomModel : mbomModelList) { |
| | | Mbom mbom = new Mbom(); |
| | | mbom.setUnit(mbomModel.getUnit()); |
| | | mbom.setName(mbomModel.getName()); |
| | | mbom.setSupplier(mbomModel.getSupplier()); |
| | | mbom.setQualityTraceability(mbomModel.getQualityTraceability()); |
| | | mbom.setSpecifications(mbomModel.getSpecifications()); |
| | | mbom.setTechnologyId(technologyIds.get(i)); |
| | | mbomList.add(mbom); |
| | | } |
| | | } |
| | | mbomService.saveBatch(mbomList); |
| | | /*æ°å¢æ åBOM-->ç产工èº(æ¹éæ·»å )*/ |
| | | List<Technique> techniqueList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<TechniqueModel> techniqueModelList = techniqueModelMapper.selectList(Wrappers.<TechniqueModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (TechniqueModel techniqueModel : techniqueModelList) { |
| | | //æ¥è¯¢è®¾å¤åç§° |
| | | Device device = deviceMapper.selectById(techniqueModel.getDeviceId()); |
| | | //æ¥è¯¢åºç¡ç产工èºä¸æ¯ä¸ªè®¾å¤çå
·ä½é¡¹ç® |
| | | TechnicalModel technicalModel = technicalModelMapper.selectById(techniqueModel.getTechnicalModelId()); |
| | | Technique technique = new Technique(); |
| | | technique.setTechnologyId(technologyIds.get(i)); |
| | | technique.setDevice(device.getName()); |
| | | technique.setProductFather(technicalModel.getFather()); |
| | | technique.setProduct(technicalModel.getName()); |
| | | technique.setUnit(technicalModel.getUnit()); |
| | | techniqueList.add(technique); |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | } |
| | | |
| | | /** |
| | | * æ£éªæ¨¡å-->OMS管ç-->æåæ£éª-->æ°å¢(éè¦è§æ ¼åå·çIdä¸åç§°) |
| | | * æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(éè¦è§æ ¼åå·çIdä¸åç§°) |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId) { |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.pojo.Standard; |
| | | import com.yuanchu.mom.service.StandardService; |
| | | import com.yuanchu.mom.mapper.StandardMapper; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.dto.StandardDto; |
| | | import com.yuanchu.mom.service.*; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | @Service |
| | | public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> implements StandardService { |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | StandardMapper standardMapper; |
| | | |
| | | @Resource |
| | | SpecificationsMapper specificationsMapper; |
| | | |
| | | @Resource |
| | | TechnologyService technologyService; |
| | | |
| | | @Resource |
| | | TechnologyTemplateMapper technologyTemplateMapper; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | TechnicalModelMapper technicalModelMapper; |
| | | |
| | | @Resource |
| | | MbomService mbomService; |
| | | |
| | | @Resource |
| | | MbomModelMapper mbomModelMapper; |
| | | |
| | | @Resource |
| | | TechniqueService techniqueService; |
| | | |
| | | @Resource |
| | | TechniqueModelMapper techniqueModelMapper; |
| | | |
| | | @Resource |
| | | DeviceMapper deviceMapper; |
| | | |
| | | //(3级)æ°å¢-->æ å,åå· |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addStandard(StandardDto standardDto) { |
| | | /*æ°å¢æ å表*/ |
| | | Standard standard = new Standard(); |
| | | standard.setMaterial_id(standardDto.getId()); |
| | | standard.setName(standardDto.getStandard()); |
| | | standardMapper.insert(standard); |
| | | /*æ°å¢åå·è¡¨*/ |
| | | Specifications specifications = new Specifications(); |
| | | specifications.setStandardId(standard.getId()); |
| | | specifications.setName(standardDto.getSpecifications()); |
| | | specificationsMapper.insert(specifications); |
| | | /*æ°å¢æ åBOM-->å·¥èºè·¯çº¿(æ¹éæ·»å )*/ |
| | | //æ¥è¯¢ç©æç大类(æ ¹æ®ç©æid) |
| | | Material material = materialMapper.selectById(standardDto.getId()); |
| | | List<TechnologyTemplate> technologyTemplateList = technologyTemplateMapper.selectList(Wrappers.<TechnologyTemplate>query().eq("type", material.getFather())); |
| | | List<Technology> technologyList = technologyTemplateList.stream().map(technologyTemplate -> { |
| | | Technology technology = new Technology(); |
| | | technology.setSpecificationsId(specifications.getId()); |
| | | technology.setFather(technologyTemplate.getFather()); |
| | | technology.setName(technologyTemplate.getName()); |
| | | technology.setDeviceGroup(technologyTemplate.getDeviceGroup()); |
| | | return technology; |
| | | }).collect(Collectors.toList()); |
| | | technologyService.saveBatch(technologyList); |
| | | /*æ°å¢æ åBOM-->ææ¯ææ (æ¹éæ·»å )*/ |
| | | //æ°å¢çå·¥èºè·¯çº¿idéå |
| | | List<Integer> technologyIds = technologyList.stream().map(Technology::getId).collect(Collectors.toList()); |
| | | //åºç¡æ°æ®ä¸å·¥èºè·¯çº¿idéå |
| | | List<Integer> techTemIds = technologyTemplateList.stream().map(TechnologyTemplate::getId).collect(Collectors.toList()); |
| | | //两è
é¿åº¦ä¸å®ä¸æ · |
| | | List<Product> productList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<TechnicalModel> technicalModelList = technicalModelMapper.selectList(Wrappers.<TechnicalModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (TechnicalModel technicalModel : technicalModelList) { |
| | | Product product = new Product(); |
| | | product.setFather(technicalModel.getFather()); |
| | | product.setName(technicalModel.getName()); |
| | | product.setUnit(technicalModel.getUnit()); |
| | | product.setTechnologyId(technologyIds.get(i)); |
| | | productList.add(product); |
| | | } |
| | | } |
| | | productService.saveBatch(productList); |
| | | /*æ°å¢æ åBOM-->ç©ææ¸
å(æ¹éæ·»å )*/ |
| | | List<Mbom> mbomList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<MbomModel> mbomModelList = mbomModelMapper.selectList(Wrappers.<MbomModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (MbomModel mbomModel : mbomModelList) { |
| | | Mbom mbom = new Mbom(); |
| | | mbom.setUnit(mbomModel.getUnit()); |
| | | mbom.setName(mbomModel.getName()); |
| | | mbom.setSupplier(mbomModel.getSupplier()); |
| | | mbom.setQualityTraceability(mbomModel.getQualityTraceability()); |
| | | mbom.setSpecifications(mbomModel.getSpecifications()); |
| | | mbom.setTechnologyId(technologyIds.get(i)); |
| | | mbomList.add(mbom); |
| | | } |
| | | } |
| | | mbomService.saveBatch(mbomList); |
| | | /*æ°å¢æ åBOM-->ç产工èº(æ¹éæ·»å )*/ |
| | | List<Technique> techniqueList = new ArrayList<>(); |
| | | for (int i = 0; i < technologyIds.size(); i++) { |
| | | List<TechniqueModel> techniqueModelList = techniqueModelMapper.selectList(Wrappers.<TechniqueModel>query().eq("tech_tem_id", techTemIds.get(i))); |
| | | for (TechniqueModel techniqueModel : techniqueModelList) { |
| | | //æ¥è¯¢è®¾å¤åç§° |
| | | Device device = deviceMapper.selectById(techniqueModel.getDeviceId()); |
| | | //æ¥è¯¢åºç¡ç产工èºä¸æ¯ä¸ªè®¾å¤çå
·ä½é¡¹ç® |
| | | TechnicalModel technicalModel = technicalModelMapper.selectById(techniqueModel.getTechnicalModelId()); |
| | | Technique technique = new Technique(); |
| | | technique.setTechnologyId(technologyIds.get(i)); |
| | | technique.setDevice(device.getName()); |
| | | technique.setProductFather(technicalModel.getFather()); |
| | | technique.setProduct(technicalModel.getName()); |
| | | technique.setUnit(technicalModel.getUnit()); |
| | | techniqueList.add(technique); |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | } |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechniqueMapper; |
| | | import com.yuanchu.mom.pojo.Technique; |
| | | import com.yuanchu.mom.service.TechniqueService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ åBOM-ç产工èºè¡¨(Technique)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-31 11:57:53 |
| | | */ |
| | | @Service |
| | | public class TechniqueServiceImpl extends ServiceImpl<TechniqueMapper, Technique> implements TechniqueService { |
| | | |
| | | @Resource |
| | | TechniqueMapper techniqueMapper; |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | @Override |
| | | public List<Integer> selectVerByTeq(Integer specificationsId) { |
| | | return techniqueMapper.selectVerByTeq(specificationsId); |
| | | } |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->çäº§å·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version,String message) { |
| | | return techniqueMapper.selectAllTeq(specificationsId,version,message); |
| | | } |
| | | } |
| | | |
| | |
| | | public class TechnologyServiceImpl extends ServiceImpl<TechnologyMapper, Technology> implements TechnologyService { |
| | | |
| | | @Resource |
| | | private TechnologyMapper technologyMapper; |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢çæ¬ |
| | | @Override |
| | | public List<Map<String, Object>> selectTechnology(String technologyName) { |
| | | LambdaQueryWrapper<Technology> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!ObjectUtils.isEmpty(technologyName)){ |
| | | wrapper.like(Technology::getName, technologyName); |
| | | public List<Integer> selectVerByTec(Integer specificationsId) { |
| | | return technologyMapper.selectVerByTec(specificationsId); |
| | | } |
| | | wrapper.select(Technology::getId, Technology::getName, Technology::getDeviceGroup, Technology::getFather); |
| | | return technologyMapper.selectMaps(wrapper); |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->å·¥èºè·¯çº¿ |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version,String message) { |
| | | return technologyMapper.selectAllTec(specificationsId,version,message); |
| | | } |
| | | } |
| | |
| | | sp.id spid, #äºçº§åå·id |
| | | sp.name spname #äºçº§åå·å |
| | | from (select type, id, name,father from mom_ocean.material where state = 1) m |
| | | left join (select id, name, material_id from mom_ocean.standard where state = 1) s on m.id = s.material_id |
| | | left join (select id, name, material_id from mom_ocean.standard where state = 1) s |
| | | on m.id = s.material_id |
| | | left join (select id, name, standard_id from mom_ocean.specifications where state = 1) sp |
| | | on sp.standard_id = s.id |
| | | </select> |
| | |
| | | and m.name = #{name} |
| | | and code = #{code} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®æ åidæ¥è¯¢ç©æ--> |
| | | <select id="selFath" resultType="com.yuanchu.mom.pojo.Material"> |
| | | select * |
| | | from mom_ocean.material |
| | | where state = 1 |
| | | and id = (select material_id |
| | | from mom_ocean.standard |
| | | where standard.state = 1 |
| | | and standard.id = #{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.yuanchu.mom.mapper.MbomMapper"> |
| | | <!--æ ¹æ®åå·idæ¥è¯¢ææçæ¬--> |
| | | <select id="selectVerByMbom" resultType="java.lang.Integer"> |
| | | select distinct version |
| | | from mom_ocean.mbom |
| | | where state = 1 |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | order by version desc |
| | | </select> |
| | | |
| | | <!--å³ä¾§æ°æ®å±ç¤º ç©ææ¸
å--> |
| | | <resultMap id="oneMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <collection property="children" resultMap="twoMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="twoMap" type="map"> |
| | | <id property="tname" column="tname"/> |
| | | <collection property="children" resultMap="threeMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="threeMap" type="map"> |
| | | <id property="id" column="mid"/> |
| | | <result property="mname" column="mname"/> |
| | | <result property="specifications" column="specifications"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="num" column="num"/> |
| | | </resultMap> |
| | | <select id="selectAllMbom" resultMap="oneMap"> |
| | | select m.id mid, |
| | | m.name mname, |
| | | unit, |
| | | num, |
| | | specifications, |
| | | t.name tname, |
| | | father |
| | | from mom_ocean.mbom m |
| | | left join mom_ocean.technology t on m.technology_id = t.id |
| | | where m.state = 1 |
| | | and m.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | <if test="message!=null and message!=''"> |
| | | and m.name like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.ProductMapper"> |
| | | <!--æ ¹æ®åå·idæ¥è¯¢é¡¹ç®(ææ¯ææ )--> |
| | | <select id="selectProductList" resultType="java.util.Map"> |
| | | select name, |
| | | father, |
| | | unit, |
| | | required, |
| | | internal |
| | | from mom_ocean.product |
| | | where state = 1 |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.Product"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="father" column="father" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="required" column="required" jdbcType="VARCHAR"/> |
| | | <result property="internal" column="internal" jdbcType="VARCHAR"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="version" column="version" jdbcType="INTEGER"/> |
| | | <result property="specificationsId" column="specifications_id" jdbcType="INTEGER"/> |
| | | <!--æ ¹æ®åå·idæ¥è¯¢ææçæ¬--> |
| | | <select id="selectVerByPro" resultType="java.lang.Integer"> |
| | | select distinct version |
| | | from mom_ocean.product |
| | | where state = 1 |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | order by version desc |
| | | </select> |
| | | |
| | | <!--å³ä¾§æ°æ®å±ç¤º ææ¯ææ (æ£éªé¡¹ç®)--> |
| | | <resultMap id="oneMap" type="map"> |
| | | <id property="tfather" column="tfather"/> |
| | | <collection property="children" resultMap="twoMap" javaType="List"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="selectTreeProduct" type="ProductDto"> |
| | | <id property="father" column="father" jdbcType="VARCHAR"/> |
| | | <collection property="children" resultMap="productDto2ListMap"/> |
| | | <resultMap id="twoMap" type="map"> |
| | | <id property="tname" column="tname"/> |
| | | <collection property="children" resultMap="threeMap" javaType="List"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="productDto2ListMap" type="ProductDto2"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="required" column="required" jdbcType="VARCHAR"/> |
| | | <result property="internal" column="internal" jdbcType="VARCHAR"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <resultMap id="threeMap" type="map"> |
| | | <id property="pfather" column="pfather"/> |
| | | <collection property="children" resultMap="fourMap" javaType="List"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectTreeProduct" resultMap="selectTreeProduct"> |
| | | SELECT p.id, p.`name`, IFNULL(p.`father`,p.`name`) father, p.`unit`, p.`required`, p.`internal` |
| | | FROM product p |
| | | where p.specifications_id = #{specifications} |
| | | <if test="project != null and project != ''"> |
| | | AND p.father like concat('%',#{project},'%') |
| | | <resultMap id="fourMap" type="map"> |
| | | <id property="pid" column="pid"/> |
| | | <result property="pname" column="pname"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="required" column="required"/> |
| | | <result property="internal" column="internal"/> |
| | | </resultMap> |
| | | <select id="selectAllPro" resultMap="oneMap"> |
| | | select p.id pid, |
| | | p.name pname, |
| | | p.father pfather, |
| | | unit, |
| | | required, |
| | | internal, |
| | | t.father tfather, |
| | | t.name tname |
| | | from mom_ocean.product p |
| | | left join mom_ocean.technology t on p.technology_id = t.id |
| | | where p.state = 1 |
| | | and p.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | <if test="message!=null and message!=''"> |
| | | and p.name like concat('%',#{message},'%') |
| | | </if> |
| | | and p.state = 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.yuanchu.mom.mapper.TechniqueMapper"> |
| | | <!--æ ¹æ®åå·idæ¥è¯¢ææçæ¬--> |
| | | <select id="selectVerByTeq" resultType="java.lang.Integer"> |
| | | select distinct version |
| | | from mom_ocean.technique |
| | | where state = 1 |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | order by version desc |
| | | </select> |
| | | |
| | | <!--å³ä¾§æ°æ®å±ç¤º ç产工èº--> |
| | | <resultMap id="oneMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <collection property="children" resultMap="twoMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="twoMap" type="map"> |
| | | <id property="name" column="name"/> |
| | | <collection property="children" resultMap="threeMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="threeMap" type="map"> |
| | | <id property="tqid" column="tqid"/> |
| | | <result property="device" column="device"/> |
| | | <result property="productFather" column="product_father"/> |
| | | <result property="product" column="product"/> |
| | | <result property="unit" column="unit"/> |
| | | </resultMap> |
| | | <select id="selectAllTeq" resultMap="oneMap"> |
| | | select tq.id tqid, |
| | | device, |
| | | product_father, |
| | | product, |
| | | unit, |
| | | name, |
| | | father |
| | | from mom_ocean.technique tq |
| | | left join mom_ocean.technology tc on tq.technology_id = tc.id |
| | | where tq.state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | and tq.version = #{version} |
| | | <if test="message!=null and message!=''"> |
| | | and device like concat('%',#{message},'%') |
| | | </if> |
| | | </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.yuanchu.mom.mapper.TechnologyMapper"> |
| | | <!--æ ¹æ®åå·idæ¥è¯¢çæ¬--> |
| | | <select id="selectVerByTec" resultType="java.lang.Integer"> |
| | | select distinct version |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | order by version desc |
| | | </select> |
| | | |
| | | <!--å³ä¾§æ°æ®å±ç¤º å·¥èºè·¯çº¿--> |
| | | <resultMap id="selectAllTecMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <collection property="children" resultMap="selectAllTecMaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllTecMaps" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="dg" column="dg"/> |
| | | <result property="pq" column="pq"/> |
| | | </resultMap> |
| | | <select id="selectAllTec" resultMap="selectAllTecMap"> |
| | | select id, |
| | | name, |
| | | father, |
| | | device_group dg, |
| | | production_quota pq |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | and version = #{version} |
| | | <if test="message!=null and message!=''"> |
| | | and father like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |