| | |
| | | |
| | | //æ¹éå é¤ |
| | | void delAllDevice(String ids); |
| | | |
| | | } |
| | |
| | | } |
| | | return Result.fail("没æè¯¥ç±»å!"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.MbomDto; |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.MbomService; |
| | | |
| | |
| | | @Autowired |
| | | private MbomService mbomService; |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ç©ææ¸
å-->鿩工åº,å·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result<?> chooseTech(Integer specificationsId) { |
| | | return Result.success(mbomService.chooseTech(specificationsId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ç©ææ¸
å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/add") |
| | | public Result<?> addMbom(Integer technologyId, @Validated @RequestBody MbomDto mbomDto) { |
| | | mbomService.addMbom(technologyId, mbomDto); |
| | | return Result.success("æ·»å ç©ææ¸
åã" + mbomDto.getName() + "ãæå"); |
| | | } |
| | | |
| | | @ApiOperation("å¡«åæ°é,é¼ æ ç§»å¼ä¿å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ç©ææ¸
åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "num", value = "æ°é", dataTypeClass = Integer.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | public Result<?> write(Integer id, Integer num) { |
| | | Integer write = mbomService.write(id, num); |
| | | if (write >= 1) { |
| | | return Result.success("æ´æ°æå"); |
| | | } |
| | | return Result.fail("æ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å åä¸ä¸ªåå·ç©ææ¸
åççæ¬") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "å½åçæ¬", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | public Result<?> addVersion(Integer specificationsId ,Integer version) { |
| | | Integer version1 = mbomService.addVersion(specificationsId,version); |
| | | return Result.success("æ·»å åå·"+specificationsId+"çç©ææ¸
åçæ¬"+version1+"æå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ç©ææ¸
åid", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delMbomById") |
| | | public Result delMbomById(Integer id) { |
| | | mbomService.delMbomById(id); |
| | | return Result.success("å é¤"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ç©ææ¸
åid", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllMbom") |
| | | public Result delAllMbom(String ids) { |
| | | mbomService.delAllMbom(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyDto; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | 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 java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "ææ¯ç®¡ç-->æ åBOM-->ææ¯ææ (æ£éªé¡¹ç®)") |
| | | @RestController |
| | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ææ¯ææ -->鿩工åº,å·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result<?> chooseTech(Integer specificationsId) { |
| | | return Result.success(productService.chooseTech(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ææ¯ææ -->鿩项ç®ç¶ç±»") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseFather") |
| | | public Result<?> chooseFather(Integer technologyId) { |
| | | return Result.success(productService.chooseFather(technologyId)); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ææ¯ææ ") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/add") |
| | | public Result<?> addProduct(Integer technologyId, @Validated @RequestBody ProductDto productDto) { |
| | | productService.addProduct(technologyId, productDto); |
| | | return Result.success("æ·»å ææ¯ææ ã" + productDto.getName() + "ãæå"); |
| | | } |
| | | |
| | | @ApiOperation("å¡«åæ åå¼ä¸å
æ§å¼,é¼ æ ç§»å¼ä¿å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ææ¯ææ id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "required", value = "æ åå¼", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "internal", value = "å
æ§å¼", dataTypeClass = String.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | public Result<?> write(Integer id, String required, String internal) { |
| | | Integer write = productService.write(id, required, internal); |
| | | if (write >= 1){ |
| | | return Result.success("æ´æ°æå"); |
| | | } |
| | | return Result.fail("æ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å åä¸ä¸ªåå·ææ¯ææ ççæ¬") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "å½åçæ¬", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | public Result<?> addVersion(Integer specificationsId ,Integer version) { |
| | | Integer version1 = productService.addVersion(specificationsId,version); |
| | | return Result.success("æ·»å åå·"+specificationsId+"çææ¯ææ çæ¬"+version1+"æå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ææ¯ææ id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTechById") |
| | | public Result delProById(Integer id) { |
| | | productService.delProById(id); |
| | | return Result.success("å é¤"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ææ¯ææ id", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllPro") |
| | | public Result delAllPro(String ids) { |
| | | productService.delAllPro(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | import com.yuanchu.mom.pojo.dto.TechniqueDto; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.TechniqueService; |
| | | |
| | |
| | | @Autowired |
| | | private TechniqueService techniqueService; |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ç产工èº-->鿩工åº,å·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result<?> chooseTech(Integer specificationsId) { |
| | | return Result.success(techniqueService.chooseTech(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ç产工èº-->éæ©è®¾å¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev(Integer technologyId) { |
| | | return Result.success(techniqueService.chooseDev(technologyId)); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ç产工èº-->鿩项ç®(ç¶å),åä½") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/choosePro") |
| | | public Result<?> choosePro(Integer technologyId) { |
| | | return Result.success(techniqueService.choosePro(technologyId)); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->ç产工èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/add") |
| | | public Result<?> addTechnique(Integer technologyId, @Validated @RequestBody TechniqueDto techniqueDto) { |
| | | techniqueService.addTechnique(technologyId, techniqueDto); |
| | | return Result.success("æ·»å çäº§å·¥èºæå"); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å åä¸ä¸ªåå·ç产工èºççæ¬") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "å½åçæ¬", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | public Result<?> addVersion(Integer specificationsId,Integer version ) { |
| | | Integer version1 = techniqueService.addVersion(specificationsId,version); |
| | | return Result.success("æ·»å åå·"+specificationsId+"çç产工èºçæ¬"+version1+"æå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ç产工èºid", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTeqById") |
| | | public Result delTeqById(Integer id) { |
| | | techniqueService.delTeqById(id); |
| | | return Result.success("å é¤"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ç产工èºid", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllTeq") |
| | | public Result delAllTeq(String ids) { |
| | | techniqueService.delAllTeq(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.TechnologyDto; |
| | | import com.yuanchu.mom.service.TechnologyService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Autowired |
| | | private TechnologyService technologyService; |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->éæ©è®¾å¤ç»") |
| | | @GetMapping("/chooseDevice") |
| | | public Result<?> chooseDevice() { |
| | | return Result.success(technologyService.chooseDevice()); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->鿩工åº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseFather") |
| | | public Result<?> chooseFather(Integer specificationsId) { |
| | | return Result.success(technologyService.chooseFather(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/add") |
| | | public Result<?> addTechnology(Integer specificationsId, @Validated @RequestBody TechnologyDto technologyDto) { |
| | | technologyService.addTechnology(specificationsId, technologyDto); |
| | | return Result.success("æ·»å å·¥èºã" + technologyDto.getName() + "ãæå"); |
| | | } |
| | | |
| | | @ApiOperation("å¡«åç产å®é¢,é¼ æ ç§»å¼ä¿å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "productionQuota", value = "ç产å®é¢(个/天)", dataTypeClass = Integer.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | public Result<?> write(Integer id, Integer productionQuota) { |
| | | Integer write = technologyService.write(id, productionQuota); |
| | | if (write >= 1) { |
| | | return Result.success("æ´æ°æå"); |
| | | } |
| | | return Result.fail("æ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å åä¸ä¸ªåå·å·¥èºè·¯çº¿ççæ¬") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "å½åçæ¬", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | public Result<?> addVersion(Integer specificationsId ,Integer version) { |
| | | Integer version1 = technologyService.addVersion(specificationsId,version); |
| | | return Result.success("æ·»å åå·"+specificationsId+"çå·¥èºè·¯çº¿çæ¬"+version1+"æå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTechById") |
| | | public Result delTechById(Integer id) { |
| | | technologyService.delTechById(id); |
| | | return Result.success("å é¤"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "å·¥èºè·¯çº¿id", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllTech") |
| | | public Result delAllTech(String ids) { |
| | | technologyService.delAllTech(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ç©ææ¸
å |
| | | List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version,String message); |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢è¯¥åå·ä¸ææå·¥èºéè¦çç©ææ¸
å |
| | | List<Mbom> selAllBySpeId(Integer specificationsId,Integer version); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idå é¤ç©ææ¸
å |
| | | void delMbomByTecId(Integer id); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idæ¹éå é¤ |
| | | void delAllByTecId(String ids); |
| | | |
| | | //æ ¹æ®ç©ææ¸
åidæ¹éå é¤ |
| | | void delAllMbom(String ids); |
| | | } |
| | | |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ææ¯ææ (æ£éªé¡¹ç®) |
| | | List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version,String message); |
| | | |
| | | //å³ä¸è§æ°å¢-->ææ¯ææ -->鿩项ç®ç¶ç±» |
| | | List<Map<String, Object>> chooseFather(Integer technologyId); |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢è¯¥åå·ä¸çææå·¥èºçææ¯ææ |
| | | List<Product> selAllBySpeId(Integer specificationsId,Integer version); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idå é¤ææ¯ææ |
| | | void delProByTecId(Integer id); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idæ¹éå é¤ |
| | | void delAllByTechId(String ids); |
| | | |
| | | //æ ¹æ®ææ¯ææ idæ¹éå é¤ |
| | | void delAllPro(String ids); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->çäº§å·¥èº |
| | | List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version,String message); |
| | | |
| | | //å³ä¸è§æ°å¢-->ç产工èº-->éæ©è®¾å¤ |
| | | List<Map<String, Object>> chooseDev(Integer technologyId); |
| | | |
| | | //å³ä¸è§æ°å¢-->ç产工èº-->鿩项ç®(ç¶å),åä½ |
| | | List<Map<String, Object>> choosePro(Integer technologyId); |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢è¯¥åå·ä¸ææå·¥èºççäº§å·¥èº |
| | | List<Technique> selAllBySpeId(Integer specificationsId,Integer version); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idå é¤çäº§å·¥èº |
| | | void delTeqByTecId(Integer id); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idæ¹éå é¤ |
| | | void delAllByTecId(String ids); |
| | | |
| | | //æ ¹æ®ç产工èºidæ¹éå é¤ |
| | | void delAllTeq(String ids); |
| | | } |
| | | |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->å·¥èºè·¯çº¿ |
| | | List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version,String message); |
| | | |
| | | //å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->éæ©å·¥åº |
| | | List<Map<String, Object>> chooseFather(Integer specificationsId); |
| | | |
| | | //å³ä¸è§æ°å¢-->ææ¯ææ -->鿩工åº,å·¥èº |
| | | List<Map<String, Object>> chooseTech(Integer specificationsId); |
| | | |
| | | //æ¹éå é¤ |
| | | void delAllTech(String ids); |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç产å®é¢(个/天)") |
| | | private Integer productionQuota; |
| | | |
| | | /** |
| | | * çæ¬ |
| | | **/ |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | //å³ä¸è§æ°å¢åæ° |
| | | public class MbomDto { |
| | | |
| | | /** |
| | | * åææåç§° |
| | | **/ |
| | | @NotBlank(message = "åææåç§°ä¸è½ä¸ºç©º!") |
| | | private String name; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | @NotBlank(message = "åä½ä¸è½ä¸ºç©º!") |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer num; |
| | | |
| | | /** |
| | | * ä¾åºå |
| | | **/ |
| | | @NotBlank(message = "ä¾åºåä¸è½ä¸ºç©º!") |
| | | private String supplier; |
| | | |
| | | /** |
| | | * è´¨éè¿½æº¯å· |
| | | **/ |
| | | @NotBlank(message = "è´¨é追溯å·ä¸è½ä¸ºç©º!") |
| | | private String qualityTraceability; |
| | | |
| | | /** |
| | | * (åææç)è§æ ¼åå· |
| | | **/ |
| | | @NotBlank(message = "è§æ ¼åå·ä¸è½ä¸ºç©º!") |
| | | private String specifications; |
| | | } |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | //å³ä¸è§æ°å¢åæ° |
| | | public class ProductDto { |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | @NotBlank(message = "å·¥èºåç§°ä¸è½ä¸ºç©º!") |
| | | private String name; |
| | | |
| | | /** |
| | | * 项ç®ç¶ç±» |
| | | */ |
| | | @NotBlank(message = "å·¥èºåç§°ä¸è½ä¸ºç©º!") |
| | | private String father; |
| | | |
| | | List<ProductDto2> children; |
| | | /** |
| | | * åä½ |
| | | */ |
| | | @NotBlank(message = "å·¥èºåç§°ä¸è½ä¸ºç©º!") |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ åå¼ |
| | | */ |
| | | private String required; |
| | | |
| | | /** |
| | | * å
æ§å¼ |
| | | */ |
| | | private String internal; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | //å³ä¸è§æ°å¢åæ° |
| | | public class TechniqueDto { |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | **/ |
| | | @NotBlank(message = "设å¤åç§°ä¸è½ä¸ºç©º!") |
| | | private String device; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®(ç¶ç±») |
| | | **/ |
| | | @NotBlank(message = "æ£éªé¡¹ç®ä¸è½ä¸ºç©º!") |
| | | private String productFather; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | @NotBlank(message = "åä½ä¸è½ä¸ºç©º!") |
| | | private String unit; |
| | | |
| | | /** |
| | | * ææ (å类项ç®) |
| | | **/ |
| | | @NotBlank(message = "ææ (å类项ç®)ä¸è½ä¸ºç©º!") |
| | | private String product; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | //å³ä¸è§æ°å¢åæ° |
| | | public class TechnologyDto { |
| | | |
| | | //å·¥èºåç§° |
| | | @NotBlank(message = "å·¥èºåç§°ä¸è½ä¸ºç©º!") |
| | | private String name; |
| | | |
| | | //å·¥åº |
| | | @NotBlank(message = "å·¥åºä¸è½ä¸ºç©º!") |
| | | private String father; |
| | | |
| | | //设å¤ç» |
| | | @NotBlank(message = "设å¤ç»ä¸è½ä¸ºç©º!") |
| | | private String deviceGroup; |
| | | |
| | | //ç产å®é¢(个/天) |
| | | private Integer productionQuota; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Mbom; |
| | | import com.yuanchu.mom.pojo.dto.MbomDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllMbom(Integer specificationsId, Integer version,String message); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ç©ææ¸
å-->鿩工åº,å·¥èº |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseTech(Integer specificationsId); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ç©ææ¸
å |
| | | * @param technologyId |
| | | * @param mbomDto |
| | | */ |
| | | void addMbom(Integer technologyId, MbomDto mbomDto); |
| | | |
| | | /** |
| | | * å¡«åæ°é,é¼ æ ç§»å¼ä¿å |
| | | * @param id |
| | | * @param num |
| | | * @return |
| | | */ |
| | | Integer write(Integer id, Integer num); |
| | | |
| | | /** |
| | | * æ·»å åä¸ä¸ªåå·ç©ææ¸
åççæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | Integer addVersion(Integer specificationsId,Integer version); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | */ |
| | | void delMbomById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllMbom(String ids); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllPro(Integer specificationsId, Integer version,String message); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ææ¯ææ -->鿩工åº,å·¥èº |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseTech(Integer specificationsId); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ææ¯ææ -->鿩项ç®ç¶ç±» |
| | | * @param technologyId |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseFather(Integer technologyId); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ææ¯ææ |
| | | * @param technologyId |
| | | * @param productDto |
| | | */ |
| | | void addProduct(Integer technologyId, ProductDto productDto); |
| | | |
| | | /** |
| | | * å¡«åæ åå¼ä¸å
æ§å¼,é¼ æ ç§»å¼ä¿å |
| | | * @param id |
| | | * @param required |
| | | * @param internal |
| | | * @return |
| | | */ |
| | | Integer write(Integer id, String required, String internal); |
| | | |
| | | /** |
| | | * æ·»å åä¸ä¸ªåå·ææ¯ææ ççæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | Integer addVersion(Integer specificationsId,Integer version); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | */ |
| | | void delProById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllPro(String ids); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Technique; |
| | | import com.yuanchu.mom.pojo.dto.TechniqueDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllTeq(Integer specificationsId, Integer version,String message); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ç产工èº-->鿩工åº,å·¥èº |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseTech(Integer specificationsId); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->ç产工èº-->éæ©è®¾å¤ |
| | | * @param technologyId |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseDev(Integer technologyId); |
| | | |
| | | /** |
| | | *å³ä¸è§æ°å¢-->ç产工èº-->鿩项ç®(ç¶å),åä½ |
| | | * @param technologyId |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> choosePro(Integer technologyId); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->çäº§å·¥èº |
| | | * @param technologyId |
| | | * @param techniqueDto |
| | | */ |
| | | void addTechnique(Integer technologyId, TechniqueDto techniqueDto); |
| | | |
| | | /** |
| | | * æ·»å åä¸ä¸ªåå·ç产工èºççæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | Integer addVersion(Integer specificationsId,Integer version); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | */ |
| | | void delTeqById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllTeq(String ids); |
| | | } |
| | | |
| | |
| | | |
| | | import com.yuanchu.mom.pojo.Technology; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllTec(Integer specificationsId, Integer version,String message); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->éæ©è®¾å¤ç» |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> chooseDevice(); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->éæ©å·¥åº |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseFather(Integer specificationsId); |
| | | |
| | | /** |
| | | * å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿ |
| | | * @param specificationsId |
| | | * @param technologyDto |
| | | */ |
| | | void addTechnology(Integer specificationsId, TechnologyDto technologyDto); |
| | | |
| | | /** |
| | | * å¡«åç产å®é¢,é¼ æ ç§»å¼ä¿å |
| | | * @param id |
| | | * @param productionQuota |
| | | * @return |
| | | */ |
| | | Integer write(Integer id, Integer productionQuota); |
| | | |
| | | /** |
| | | * æ·»å åä¸ä¸ªåå·å·¥èºè·¯çº¿ççæ¬ |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | Integer addVersion(Integer specificationsId,Integer version); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | */ |
| | | void delTechById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllTech(String ids); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.MbomMapper; |
| | | import com.yuanchu.mom.mapper.TechnologyMapper; |
| | | import com.yuanchu.mom.pojo.Mbom; |
| | | import com.yuanchu.mom.pojo.dto.MbomDto; |
| | | import com.yuanchu.mom.service.MbomService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | MbomMapper mbomMapper; |
| | | |
| | | @Resource |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | @Override |
| | | public List<Integer> selectVerByMbom(Integer specificationsId) { |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ç©ææ¸
å |
| | | @Override |
| | | public List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version,String message) { |
| | | return mbomMapper.selectAllMbom(specificationsId,version,message); |
| | | public List<Map<String, Object>> selectAllMbom(Integer specificationsId, Integer version, String message) { |
| | | return mbomMapper.selectAllMbom(specificationsId, version, message); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ç©ææ¸
å-->鿩工åº,å·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> chooseTech(Integer specificationsId) { |
| | | return technologyMapper.chooseTech(specificationsId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ç©ææ¸
å |
| | | @Override |
| | | public void addMbom(Integer technologyId, MbomDto mbomDto) { |
| | | Mbom mbom = new Mbom(); |
| | | BeanUtils.copyProperties(mbomDto, mbom); |
| | | mbom.setTechnologyId(technologyId); |
| | | mbomMapper.insert(mbom); |
| | | } |
| | | |
| | | //å¡«åæ°é,é¼ æ ç§»å¼ä¿å |
| | | @Override |
| | | public Integer write(Integer id, Integer num) { |
| | | Mbom mbom = new Mbom(); |
| | | mbom.setId(id); |
| | | mbom.setNum(num); |
| | | return mbomMapper.updateById(mbom); |
| | | } |
| | | |
| | | //æ·»å åä¸ä¸ªåå·ç©ææ¸
åççæ¬ |
| | | @Override |
| | | public Integer addVersion(Integer specificationsId,Integer version) { |
| | | List<Mbom> mbomList = mbomMapper.selAllBySpeId(specificationsId,version); |
| | | for (Mbom mbom : mbomList) { |
| | | mbom.setId(null); |
| | | //ææ°çæ¬+1 |
| | | mbom.setVersion(mbomMapper.selectVerByMbom(specificationsId).get(0) + 1); |
| | | } |
| | | saveBatch(mbomList); |
| | | return mbomList.get(0).getVersion(); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | public void delMbomById(Integer id) { |
| | | Mbom mbom = new Mbom(); |
| | | mbom.setId(id); |
| | | mbom.setState(0); |
| | | mbomMapper.updateById(mbom); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllMbom(String ids) { |
| | | mbomMapper.delAllMbom(ids); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechnologyMapper; |
| | | import com.yuanchu.mom.pojo.Product; |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import com.yuanchu.mom.mapper.ProductMapper; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãproductãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2023-07-26 16:00:44 |
| | | */ |
| | | * @author Administrator |
| | | * @description é对表ãproductãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2023-07-26 16:00:44 |
| | | */ |
| | | @Service |
| | | public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService{ |
| | | public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService { |
| | | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢é¡¹ç®(ææ¯ææ ) |
| | | @Override |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->ææ¯ææ (æ£éªé¡¹ç®) |
| | | @Override |
| | | public List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version,String message) { |
| | | return productMapper.selectAllPro(specificationsId,version,message); |
| | | public List<Map<String, Object>> selectAllPro(Integer specificationsId, Integer version, String message) { |
| | | return productMapper.selectAllPro(specificationsId, version, message); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ææ¯ææ -->鿩工åº,å·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> chooseTech(Integer specificationsId) { |
| | | return technologyMapper.chooseTech(specificationsId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ææ¯ææ -->鿩项ç®ç¶ç±» |
| | | @Override |
| | | public List<Map<String, Object>> chooseFather(Integer technologyId) { |
| | | return productMapper.chooseFather(technologyId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ææ¯ææ |
| | | @Override |
| | | public void addProduct(Integer technologyId, ProductDto productDto) { |
| | | Product product = new Product(); |
| | | BeanUtils.copyProperties(productDto, product); |
| | | product.setTechnologyId(technologyId); |
| | | productMapper.insert(product); |
| | | } |
| | | |
| | | //å¡«åæ åå¼ä¸å
æ§å¼,é¼ æ ç§»å¼ä¿å |
| | | @Override |
| | | public Integer write(Integer id, String required, String internal) { |
| | | Product product = new Product(); |
| | | product.setId(id); |
| | | product.setRequired(required); |
| | | product.setInternal(internal); |
| | | return productMapper.updateById(product); |
| | | } |
| | | |
| | | //æ·»å åä¸ä¸ªåå·ææ¯ææ ççæ¬ |
| | | @Override |
| | | public Integer addVersion(Integer specificationsId,Integer version) { |
| | | List<Product> productList = productMapper.selAllBySpeId(specificationsId,version); |
| | | for (Product product : productList) { |
| | | product.setId(null); |
| | | //ææ°çæ¬+1 |
| | | product.setVersion(productMapper.selectVerByPro(specificationsId).get(0)+1); |
| | | } |
| | | saveBatch(productList); |
| | | return productList.get(0).getVersion(); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | public void delProById(Integer id) { |
| | | Product product = new Product(); |
| | | product.setId(id); |
| | | product.setState(0); |
| | | productMapper.updateById(product); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllPro(String ids) { |
| | | productMapper.delAllPro(ids); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechniqueMapper; |
| | | import com.yuanchu.mom.mapper.TechnologyMapper; |
| | | import com.yuanchu.mom.pojo.Technique; |
| | | import com.yuanchu.mom.pojo.dto.TechniqueDto; |
| | | import com.yuanchu.mom.service.TechniqueService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | TechniqueMapper techniqueMapper; |
| | | |
| | | @Resource |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ææçæ¬ |
| | | @Override |
| | | public List<Integer> selectVerByTeq(Integer specificationsId) { |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->çäº§å·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version,String message) { |
| | | return techniqueMapper.selectAllTeq(specificationsId,version,message); |
| | | public List<Map<String, Object>> selectAllTeq(Integer specificationsId, Integer version, String message) { |
| | | return techniqueMapper.selectAllTeq(specificationsId, version, message); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ç产工èº-->鿩工åº,å·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> chooseTech(Integer specificationsId) { |
| | | return technologyMapper.chooseTech(specificationsId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ç产工èº-->éæ©è®¾å¤ |
| | | @Override |
| | | public List<Map<String, Object>> chooseDev(Integer technologyId) { |
| | | return techniqueMapper.chooseDev(technologyId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->ç产工èº-->鿩项ç®(ç¶å),åä½ |
| | | @Override |
| | | public List<Map<String, Object>> choosePro(Integer technologyId) { |
| | | return techniqueMapper.choosePro(technologyId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->çäº§å·¥èº |
| | | @Override |
| | | public void addTechnique(Integer technologyId, TechniqueDto techniqueDto) { |
| | | Technique technique = new Technique(); |
| | | BeanUtils.copyProperties(techniqueDto, technique); |
| | | technique.setTechnologyId(technologyId); |
| | | techniqueMapper.insert(technique); |
| | | } |
| | | |
| | | //æ·»å åä¸ä¸ªåå·ç产工èºççæ¬ |
| | | @Override |
| | | public Integer addVersion(Integer specificationsId,Integer version) { |
| | | List<Technique> techniqueList = techniqueMapper.selAllBySpeId(specificationsId,version); |
| | | for (Technique technique : techniqueList) { |
| | | technique.setId(null); |
| | | //ææ°çæ¬+1 |
| | | technique.setVersion(techniqueMapper.selectVerByTeq(specificationsId).get(0)+1); |
| | | } |
| | | saveBatch(techniqueList); |
| | | return techniqueList.get(0).getVersion(); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | public void delTeqById(Integer id) { |
| | | Technique technique = new Technique(); |
| | | technique.setId(id); |
| | | technique.setState(0); |
| | | techniqueMapper.updateById(technique); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllTeq(String ids) { |
| | | techniqueMapper.delAllTeq(ids); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.Technology; |
| | | import com.yuanchu.mom.mapper.TechnologyMapper; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyDto; |
| | | import com.yuanchu.mom.service.TechnologyService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Resource |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | @Resource |
| | | DeviceMapper deviceMapper; |
| | | |
| | | @Resource |
| | | ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | MbomMapper mbomMapper; |
| | | |
| | | @Resource |
| | | TechniqueMapper techniqueMapper; |
| | | |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢çæ¬ |
| | | @Override |
| | |
| | | |
| | | //å³ä¾§æ°æ®å±ç¤º-->å·¥èºè·¯çº¿ |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version,String message) { |
| | | return technologyMapper.selectAllTec(specificationsId,version,message); |
| | | public List<Map<String, Object>> selectAllTec(Integer specificationsId, Integer version, String message) { |
| | | return technologyMapper.selectAllTec(specificationsId, version, message); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->éæ©è®¾å¤ç» |
| | | @Override |
| | | public List<Map<String, Object>> chooseDevice() { |
| | | return deviceMapper.chooseDevGroup(); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿-->éæ©å·¥åº |
| | | @Override |
| | | public List<Map<String, Object>> chooseFather(Integer specificationsId) { |
| | | return technologyMapper.chooseFather(specificationsId); |
| | | } |
| | | |
| | | //å³ä¸è§æ°å¢-->å·¥èºè·¯çº¿ |
| | | @Override |
| | | public void addTechnology(Integer specificationsId, TechnologyDto technologyDto) { |
| | | Technology technology = new Technology(); |
| | | BeanUtils.copyProperties(technologyDto, technology); |
| | | technology.setSpecificationsId(specificationsId); |
| | | technologyMapper.insert(technology); |
| | | } |
| | | |
| | | //å¡«åç产å®é¢,é¼ æ ç§»å¼ä¿å |
| | | @Override |
| | | public Integer write(Integer id, Integer productionQuota) { |
| | | Technology technology = new Technology(); |
| | | technology.setId(id); |
| | | technology.setProductionQuota(productionQuota); |
| | | return technologyMapper.updateById(technology); |
| | | } |
| | | |
| | | //æ·»å åä¸ä¸ªåå·å·¥èºè·¯çº¿ççæ¬ |
| | | @Override |
| | | public Integer addVersion(Integer specificationsId, Integer version) { |
| | | List<Technology> technologyList = technologyMapper.selectList(Wrappers.<Technology>query() |
| | | .eq("specifications_id", specificationsId) |
| | | .eq("version", version)); |
| | | for (Technology technology : technologyList) { |
| | | technology.setId(null); |
| | | //ææ°çæ¬+! |
| | | technology.setVersion(technologyMapper.selectVerByTec(specificationsId).get(0) + 1); |
| | | } |
| | | saveBatch(technologyList); |
| | | return technologyList.get(0).getVersion(); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delTechById(Integer id) { |
| | | //å é¤å·¥èºè·¯çº¿è¡¨ |
| | | Technology technology = new Technology(); |
| | | technology.setId(id); |
| | | technology.setState(0); |
| | | technologyMapper.updateById(technology); |
| | | //å é¤ææ¯ææ 表 |
| | | productMapper.delProByTecId(id); |
| | | //å é¤ç©ææ¸
å表 |
| | | mbomMapper.delMbomByTecId(id); |
| | | //å é¤ç产工èºè¡¨ |
| | | techniqueMapper.delTeqByTecId(id); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delAllTech(String ids) { |
| | | //æ¹éå é¤å·¥èºè·¯çº¿è¡¨ |
| | | technologyMapper.delAllTech(ids); |
| | | //æ¹éå é¤ææ¯ææ 表 |
| | | productMapper.delAllByTechId(ids); |
| | | //æ¹éå é¤ç©ææ¸
å表 |
| | | mbomMapper.delAllByTecId(ids); |
| | | //æ¹éå é¤ç产工èºè¡¨ |
| | | techniqueMapper.delAllByTecId(ids); |
| | | } |
| | | } |
| | |
| | | </resultMap> |
| | | <select id="selectAllMbom" resultMap="oneMap"> |
| | | select m.id mid, |
| | | m.name mname, |
| | | unit, |
| | | num, |
| | | specifications, |
| | | t.name tname, |
| | | father |
| | | 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 |
| | | left join mom_ocean.technology t on m.technology_id = t.id |
| | | where m.state = 1 |
| | | and m.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | and m.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | <if test="message!=null and message!=''"> |
| | | and m.name like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--æ ¹æ®åå·idæ¥è¯¢è¯¥åå·ä¸ææå·¥èºéè¦çç©ææ¸
å--> |
| | | <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Mbom"> |
| | | select * |
| | | from mom_ocean.mbom |
| | | where state = 1 |
| | | and version = #{version} |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idå é¤ç©ææ¸
å--> |
| | | <update id="delMbomByTecId"> |
| | | update mom_ocean.mbom |
| | | set state=0 |
| | | where technology_id = #{id} |
| | | </update> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idæ¹éå é¤--> |
| | | <update id="delAllByTecId"> |
| | | update mom_ocean.mbom |
| | | set state=0 |
| | | where technology_id in (${ids}) |
| | | </update> |
| | | |
| | | <!--æ ¹æ®ç©ææ¸
åidæ¹éå é¤--> |
| | | <update id="delAllMbom"> |
| | | update mom_ocean.mbom |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | </mapper> |
| | |
| | | <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 |
| | | 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 |
| | | left join mom_ocean.technology t on p.technology_id = t.id |
| | | where p.state = 1 |
| | | and p.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | and p.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | <if test="message!=null and message!=''"> |
| | | and p.name like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--å³ä¸è§æ°å¢-ææ¯ææ -鿩项ç®ç¶ç±»--> |
| | | <select id="chooseFather" resultType="java.util.Map"> |
| | | select distinct father |
| | | from mom_ocean.product |
| | | where state = 1 |
| | | and technology_id = #{technologyId} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®åå·idæ¥è¯¢è¯¥åå·ä¸çææå·¥èºçææ¯ææ --> |
| | | <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Product"> |
| | | select * |
| | | from mom_ocean.product |
| | | where state = 1 |
| | | and version = #{version} |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idå é¤--> |
| | | <update id="delProByTecId"> |
| | | update mom_ocean.product |
| | | set state=0 |
| | | where technology_id = #{id} |
| | | </update> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idæ¹éå é¤--> |
| | | <update id="delAllByTechId"> |
| | | update mom_ocean.product |
| | | set state=0 |
| | | where technology_id in (${ids}) |
| | | </update> |
| | | |
| | | <!--æ ¹æ®ææ¯ææ idæ¹éå é¤--> |
| | | <update id="delAllPro"> |
| | | update mom_ocean.product |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | <select id="selectAllTeq" resultMap="oneMap"> |
| | | select tq.id tqid, |
| | | device, |
| | | product_father, |
| | | product, |
| | | unit, |
| | | name, |
| | | father |
| | | device, |
| | | product_father, |
| | | product, |
| | | unit, |
| | | name, |
| | | father |
| | | from mom_ocean.technique tq |
| | | left join mom_ocean.technology tc on tq.technology_id = tc.id |
| | | left join mom_ocean.technology tc on tq.technology_id = tc.id |
| | | where tq.state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | and tq.version = #{version} |
| | | and specifications_id = #{specificationsId} |
| | | and tq.version = #{version} |
| | | <if test="message!=null and message!=''"> |
| | | and device like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--å³ä¸è§æ°å¢-ç产工èº-éæ©è®¾å¤--> |
| | | <select id="chooseDev" resultType="java.util.Map"> |
| | | select name device |
| | | from mom_ocean.device |
| | | where state = 1 |
| | | and device_status in (1, 5) |
| | | and father = (select distinct device_group |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and technology.id = #{technologyId}) |
| | | </select> |
| | | |
| | | <!--å³ä¸è§æ°å¢-ç产工èº-鿩项ç®(ç¶å),åä½--> |
| | | <resultMap id="chooseProMap" type="map"> |
| | | <id property="name" column="productFather"/> |
| | | <collection property="children" resultMap="chooseProMaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="chooseProMaps" type="map"> |
| | | <id property="name" column="product"/> |
| | | <result property="unit" column="unit"/> |
| | | </resultMap> |
| | | <select id="choosePro" resultMap="chooseProMap"> |
| | | select name product, |
| | | father productFather, |
| | | unit |
| | | from mom_ocean.product |
| | | where state = 1 |
| | | and technology_id = #{technologyId} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®åå·idæ¥è¯¢è¯¥åå·ä¸ææå·¥èºçç产工èº--> |
| | | <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Technique"> |
| | | select * |
| | | from mom_ocean.technique |
| | | where state = 1 |
| | | and version = #{version} |
| | | and technology_id in (select id |
| | | from mom_ocean.technology |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idå é¤ç产工èº--> |
| | | <update id="delTeqByTecId"> |
| | | update mom_ocean.technique |
| | | set state=0 |
| | | where technology_id = #{id} |
| | | </update> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idæ¹éå é¤--> |
| | | <update id="delAllByTecId"> |
| | | update mom_ocean.technique |
| | | set state=0 |
| | | where technology_id in (${ids}) |
| | | </update> |
| | | |
| | | <!--æ ¹æ®ç产工èºidæ¹éå é¤--> |
| | | <update id="delAllTeq"> |
| | | update mom_ocean.technique |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | </mapper> |
| | |
| | | |
| | | <!--å³ä¾§æ°æ®å±ç¤º å·¥èºè·¯çº¿--> |
| | | <resultMap id="selectAllTecMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <id property="name" column="father"/> |
| | | <collection property="children" resultMap="selectAllTecMaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllTecMaps" type="map"> |
| | |
| | | and father like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--å³ä¸è§æ°å¢-å·¥èºè·¯çº¿-鿩工åº--> |
| | | <select id="chooseFather" resultType="java.util.Map"> |
| | | select distinct father |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | </select> |
| | | |
| | | <!--å³ä¸è§æ°å¢-ææ¯ææ -鿩工åº,å·¥èº--> |
| | | <resultMap id="chooseTechMap" type="map"> |
| | | <id property="name" column="father"/> |
| | | <collection property="children" resultMap="chooseTechMaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="chooseTechMaps" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | </resultMap> |
| | | <select id="chooseTech" resultMap="chooseTechMap"> |
| | | select id, |
| | | name, |
| | | father |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | </select> |
| | | |
| | | <!--æ¹éå é¤--> |
| | | <update id="delAllTech"> |
| | | update mom_ocean.technology |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | </mapper> |