| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.TechnicalModelDto; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto; |
| | | 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.TechnicalModelService; |
| | | |
| | | |
| | | /** |
| | | * ææ¯ææ ç»´æ¤è¡¨(TechnicalModel)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 16:09:19 |
| | | */ |
| | | @Api(tags = "åºç¡æ°æ®-->ææ¯ææ ç»´æ¤") |
| | | @RestController |
| | | @RequestMapping("/technicalModel") |
| | | public class TechnicalModelController { |
| | | |
| | | @Autowired |
| | | private TechnicalModelService technicalModelService; |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææ¯ææ ç»´æ¤å表-->左边äºçº§å±ç¤ºå·¥åºåå·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=0æ©¡è¶è¿æ¥å¨)", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "message", value = "æç´¢å
容", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllTechTem") |
| | | public Result selectAllTechTem(Integer type, String message) { |
| | | return Result.success(technicalModelService.selectAllTechTem(type, message)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææ¯ææ ç»´æ¤å表-->å³è¾¹å±ç¤ºè¯¥å·¥èºä¸çæ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectAllTechNam") |
| | | public Result selectAllTechNam(Integer id) { |
| | | return Result.success(technicalModelService.selectAllTechNam(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢ææ¯ææ ç»´æ¤-->鿩工åºåå·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTechFath") |
| | | public Result chooseTechFath(Integer type) { |
| | | return Result.success(technicalModelService.chooseTechFath(type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢ææ¯ææ ç»´æ¤-->鿩项ç®ç¶ç±»") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseProFath") |
| | | public Result chooseProFath(Integer id) { |
| | | return Result.success(technicalModelService.chooseProFath(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢ææ¯ææ ç»´æ¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addTechMode") |
| | | public Result addTechMode(Integer id, @Validated @RequestBody TechnicalModelDto technicalModelDto) { |
| | | technicalModelService.addTechMode(id, technicalModelDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®idæ¥è¯¢è¯¦æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ææ¯ææ id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/selecTechById") |
| | | public Result selecTechById(Integer id) { |
| | | return Result.success(technicalModelService.selecTechById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¼è¾") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ææ¯ææ id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/writeTechById") |
| | | public Result writeTechById(Integer id,@Validated @RequestBody TechnicalModelDto technicalModelDto) { |
| | | technicalModelService.writeTechById(id,technicalModelDto); |
| | | return Result.success("ä¿®æ¹"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ææ¯ææ id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTechById") |
| | | public Result delTechById(Integer id) { |
| | | technicalModelService.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) { |
| | | technicalModelService.delAllTech(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * @author zss |
| | | * @since 2023-08-18 16:59:14 |
| | | */ |
| | | @Api(tags = "åºç¡æ°æ®-->å·¥èºè·¯çº¿ç»´æ¤è¡¨æ¥å£") |
| | | @Api(tags = "åºç¡æ°æ®-->å·¥èºè·¯çº¿ç»´æ¤") |
| | | @RestController |
| | | @RequestMapping("/technologyTemplate") |
| | | public class TechnologyTemplateController { |
| | |
| | | return Result.success(technologyTemplateService.chooseDevGroup()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢å·¥èºè·¯çº¿ç»´æ¤-->鿩工åº") |
| | | @GetMapping("/chooseTech") |
| | | public Result chooseTech() { |
| | | return Result.success(technologyTemplateService.chooseTech()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢å·¥èºè·¯çº¿ç»´æ¤-->éæ©å
ä»¶") |
| | | @GetMapping("/chooseElement") |
| | | public Result chooseElement() { |
| | | return Result.success(technologyTemplateService.chooseElement()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢å·¥èºè·¯çº¿ç»´æ¤") |
| | | @PostMapping("/addTechTemp") |
| | | public Result addSale(@Validated @RequestBody TechnologyTemplateDto technologyTemplateDto) { |
| | | technologyTemplateService.addSale(technologyTemplateDto); |
| | | public Result addTechTemp(@Validated @RequestBody TechnologyTemplateDto technologyTemplateDto) { |
| | | technologyTemplateService.addTechTemp(technologyTemplateDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å·¥èºè·¯çº¿å表") |
| | | @ApiOperation(value = "æ¥è¯¢å·¥èºè·¯çº¿å表-->左边äºçº§å±ç¤º") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "name", value = "å·¥èº", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "father", value = "å·¥åº", dataTypeClass = String.class) |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=0æ©¡è¶è¿æ¥å¨)", dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "message", value = "æç´¢å
容", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllTechTem") |
| | | public Result selectAllTechTem(int pageSize, int countSize, Integer type, String name, String father) { |
| | | IPage<Map<String, Object>> technologyTemplatePage = technologyTemplateService.selectAllTechTem(new Page<Object>(pageSize, countSize), type, name, father); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", technologyTemplatePage.getTotal()); |
| | | map.put("row", technologyTemplatePage.getRecords()); |
| | | return Result.success(map); |
| | | public Result selectAllTechTem(Integer type,String message) { |
| | | return Result.success(technologyTemplateService.selectAllTechTem(type,message)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å·¥èºè·¯çº¿å表-->å³è¾¹å±ç¤ºå·¥èºå设å¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "father", value = "å·¥åº(ç¶ç±»)", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/selectAllTechNam") |
| | | public Result selectAllTechNam(String father) { |
| | | return Result.success(technologyTemplateService.selectAllTechNam(father)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®idæ¥è¯¢è¯¦æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºid", dataTypeClass = Integer.class,required = true) |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/selecTechById") |
| | | public Result selecTechById(Integer id) { |
| | | return Result.success(technologyTemplateService.getById(id)); |
| | | return Result.success(technologyTemplateService.selecTechById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¼è¾") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºid", dataTypeClass = Integer.class,required = true) |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/writeTechById") |
| | | public Result writeTechById(Integer id,@RequestBody TechnologyTemplateDto technologyTemplateDto) { |
| | | public Result writeTechById(Integer id,@Validated @RequestBody TechnologyTemplateDto technologyTemplateDto) { |
| | | technologyTemplateService.writeTechById(id,technologyTemplateDto); |
| | | return Result.success("ä¿®æ¹æå!"); |
| | | return Result.success("ä¿®æ¹"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºid", dataTypeClass = Integer.class,required = true) |
| | | @ApiImplicitParam(name = "id", value = "å·¥èºè·¯çº¿id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTechById") |
| | | public Result delTechById(Integer id) { |
| | | technologyTemplateService.delTechById(id); |
| | | return Result.success("å 餿å!"); |
| | | return Result.success("å é¤"+id+"æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "å·¥èºid", dataTypeClass = String.class,required = true) |
| | | @ApiImplicitParam(name = "ids", value = "å·¥èºè·¯çº¿id", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllTech") |
| | | public Result delAllTech(String ids) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.Element; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å
件表(Element)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:48:45 |
| | | */ |
| | | public interface ElementMapper extends BaseMapper<Element> { |
| | | |
| | | //æ°å¢å·¥èºè·¯çº¿-->éæ©å
ä»¶ |
| | | List<Map<String,Object>> chooseElement(); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.ElementTechnology; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
ä»¶å·¥èºä¸é´è¡¨(ElementTechnology)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:49:07 |
| | | */ |
| | | public interface ElementTechnologyMapper extends BaseMapper<ElementTechnology> { |
| | | |
| | | //å é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | void delElemaByTechsId(Integer id); |
| | | |
| | | //æ¹éå é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | void delAllByTechId(String ids); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.TechnicalModel; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * ææ¯ææ ç»´æ¤è¡¨(TechnicalModel)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 16:09:19 |
| | | */ |
| | | public interface TechnicalModelMapper extends BaseMapper<TechnicalModel> { |
| | | |
| | | //æ¥è¯¢ææ¯ææ ç»´æ¤å表-->左边äºçº§å±ç¤ºå·¥åºåå·¥èº |
| | | List<Map<String, Object>> selectAllTechTem(Integer type, String message); |
| | | |
| | | //æ¥è¯¢ææ¯ææ ç»´æ¤å表-->å³è¾¹å±ç¤ºè¯¥å·¥èºä¸çæ£éªé¡¹ç® |
| | | List<Map<String, Object>> selectAllTechNam(Integer id); |
| | | |
| | | //æ°å¢ææ¯ææ ç»´æ¤-->鿩工åºåå·¥èº |
| | | List<Map<String,Object>> chooseTechFath(Integer type); |
| | | |
| | | //æ°å¢ææ¯ææ ç»´æ¤-->鿩项ç®ç¶ç±» |
| | | List<String> chooseProFath(Integer id); |
| | | |
| | | //æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | List<Map<String, Object>> selecTechById(Integer id); |
| | | |
| | | //æ¹éå 餿 ¹æ®ææ¯ææ id |
| | | void delAllTech(String ids); |
| | | |
| | | //å 餿 ¹æ®å·¥èºè·¯çº¿id |
| | | void delTeMoByTechId(Integer id); |
| | | |
| | | //æ¹éå 餿 ¹æ®å·¥èºè·¯çº¿id |
| | | void delAllByTechId(String ids); |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface TechnologyTemplateMapper extends BaseMapper<TechnologyTemplate> { |
| | | |
| | | //æ¥è¯¢å·¥èºè·¯çº¿å表 |
| | | IPage<Map<String, Object>> selectAllTechTem(Page<Object> page, Integer type, String name, String father); |
| | | //æ°å¢å·¥èºè·¯çº¿-->éæ©å·¥åº |
| | | List<String> chooseTech(); |
| | | |
| | | //æ¥è¯¢å·¥èºè·¯çº¿å表-->左边äºçº§å±ç¤º |
| | | List<Map<String,Object>> selectAllTechTem(Integer type,String message); |
| | | |
| | | //æ¥è¯¢å·¥èºè·¯çº¿å表-->å³è¾¹å±ç¤ºå·¥èºåè®¾å¤ |
| | | List<Map<String, Object>> selectAllTechNam(String father); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥ç详æ
|
| | | * @param id å·¥èºid |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selecTechById(Integer id); |
| | | |
| | | |
| | | //æ¹éå é¤ |
| | | void delAllTech(String ids); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * å
件表(Element)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:48:45 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("element") |
| | | public class Element implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å
ä»¶åç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * å
ä»¶å·¥èºä¸é´è¡¨(ElementTechnology)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:49:07 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("element_technology") |
| | | public class ElementTechnology implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å
³è å·¥èºid |
| | | **/ |
| | | private Integer techTemId; |
| | | |
| | | |
| | | /** |
| | | * å
³è å
ä»¶id |
| | | **/ |
| | | private Integer elementId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * ææ¯ææ ç»´æ¤è¡¨(TechnicalModel)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 16:09:19 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("technical_model") |
| | | public class TechnicalModel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å
³è å·¥èºid |
| | | **/ |
| | | private Integer techTemId; |
| | | |
| | | /** |
| | | * 项ç®ç¶ç±» |
| | | **/ |
| | | private String father; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * å
ä»¶0:æå¤´1:æä»¶ |
| | | **/ |
| | | private String element; |
| | | |
| | | /** |
| | | * 设å¤ç» |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | //æ°å¢ææ¯ææ ç»´æ¤åæ° |
| | | public class TechnicalModelDto { |
| | | |
| | | |
| | | @JsonSerialize |
| | | @NotNull(message = "ç±»åä¸è½ä¸ºç©º") |
| | | private Integer type; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "å·¥åºä¸è½ä¸ºç©º") |
| | | private String TechFather; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "å·¥èºä¸è½ä¸ºç©º") |
| | | private String TechName; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "项ç®ç¶ç±»ä¸è½ä¸ºç©º") |
| | | private String father; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "项ç®ä¸è½ä¸ºç©º") |
| | | private String name; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "åä½ä¸è½ä¸ºç©º") |
| | | private String unit; |
| | | } |
| | |
| | | private String name; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "å
ä»¶ä¸è½ä¸ºç©º") |
| | | private String element; |
| | | @NotBlank(message = "å
ä»¶idä¸è½ä¸ºç©º") |
| | | private String elementId; |
| | | |
| | | @JsonSerialize |
| | | @NotBlank(message = "设å¤ç»ä¸è½ä¸ºç©º") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Element; |
| | | |
| | | /** |
| | | * å
件表(Element)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:48:45 |
| | | */ |
| | | public interface ElementService extends IService<Element> { |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.ElementTechnology; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
ä»¶å·¥èºä¸é´è¡¨(ElementTechnology)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:49:07 |
| | | */ |
| | | public interface ElementTechnologyService extends IService<ElementTechnology> { |
| | | |
| | | //å é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | void delElemaByTechsId(Integer id); |
| | | |
| | | //æ¹éå é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | void delAllByTechId(String ids); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.TechnicalModel; |
| | | import com.yuanchu.mom.pojo.dto.TechnicalModelDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ææ¯ææ ç»´æ¤è¡¨(TechnicalModel)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 16:09:19 |
| | | */ |
| | | public interface TechnicalModelService extends IService<TechnicalModel> { |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ¯ææ ç»´æ¤å表-->左边äºçº§å±ç¤ºå·¥åºåå·¥èº |
| | | * |
| | | * @param type |
| | | * @param message |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectAllTechTem(Integer type, String message); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ¯ææ ç»´æ¤å表-->å³è¾¹å±ç¤ºè¯¥å·¥èºä¸çæ£éªé¡¹ç® |
| | | * |
| | | * @param id å·¥èºid |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> selectAllTechNam(Integer id); |
| | | |
| | | /** |
| | | * æ°å¢ææ¯ææ ç»´æ¤-->鿩工åºåå·¥èº |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> chooseTechFath(Integer type); |
| | | |
| | | /** |
| | | * æ°å¢ææ¯ææ ç»´æ¤-->鿩项ç®(ç¶ç±») |
| | | * |
| | | * @return |
| | | */ |
| | | List<String> chooseProFath(Integer id); |
| | | |
| | | /** |
| | | * æ°å¢ææ¯ææ ç»´æ¤ |
| | | * |
| | | * @param technicalModelDto |
| | | */ |
| | | void addTechMode(Integer id, TechnicalModelDto technicalModelDto); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | * @param id ææ¯ææ id |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selecTechById(Integer id); |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * @param id |
| | | * @param technicalModelDto |
| | | */ |
| | | void writeTechById(Integer id, TechnicalModelDto technicalModelDto); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | */ |
| | | void delTechById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllTech(String ids); |
| | | } |
| | | |
| | |
| | | public interface TechnologyTemplateService extends IService<TechnologyTemplate> { |
| | | |
| | | /** |
| | | * éæ©è®¾å¤ç» |
| | | * æ°å¢å·¥èºè·¯çº¿-->éæ©è®¾å¤ç» |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseDevGroup(); |
| | | |
| | | /** |
| | | *æ°å¢å·¥èºè·¯çº¿-->éæ©å·¥åº |
| | | * @return |
| | | */ |
| | | List<String> chooseTech(); |
| | | |
| | | /** |
| | | * æ°å¢å·¥èºè·¯çº¿-->éæ©å
ä»¶ |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseElement(); |
| | | |
| | | /** |
| | | * æ°å¢å·¥èºè·¯çº¿ |
| | | * @param technologyTemplateDto |
| | | */ |
| | | void addSale(TechnologyTemplateDto technologyTemplateDto); |
| | | void addTechTemp(TechnologyTemplateDto technologyTemplateDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥èºè·¯çº¿å表 |
| | | * @param page |
| | | * æ¥è¯¢å·¥èºè·¯çº¿å表-->左边äºçº§å±ç¤º |
| | | * @param type |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectAllTechTem(Integer type,String message); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥èºè·¯çº¿å表-->å³è¾¹å±ç¤ºå·¥èºåè®¾å¤ |
| | | * @param father |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllTechTem(Page<Object> page, Integer type, String name, String father); |
| | | List<Map<String,Object>> selectAllTechNam(String father); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | * @param id å·¥èºid |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selecTechById(Integer id); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @param id å·¥èºè·¯çº¿id |
| | | */ |
| | | void delTechById(Integer id); |
| | | |
| | |
| | | * @param ids |
| | | */ |
| | | void delAllTech(String ids); |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.ElementMapper; |
| | | import com.yuanchu.mom.pojo.Element; |
| | | import com.yuanchu.mom.service.ElementService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * å
件表(Element)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:48:45 |
| | | */ |
| | | @Service |
| | | public class ElementServiceImpl extends ServiceImpl<ElementMapper, Element> implements ElementService { |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.ElementTechnologyMapper; |
| | | import com.yuanchu.mom.pojo.ElementTechnology; |
| | | import com.yuanchu.mom.service.ElementTechnologyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
ä»¶å·¥èºä¸é´è¡¨(ElementTechnology)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 10:49:07 |
| | | */ |
| | | @Service |
| | | public class ElementTechnologyServiceImpl extends ServiceImpl<ElementTechnologyMapper, ElementTechnology> implements ElementTechnologyService { |
| | | |
| | | @Resource |
| | | ElementTechnologyMapper elementTechnologyMapper; |
| | | |
| | | //å é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | @Override |
| | | public void delElemaByTechsId(Integer id) { |
| | | elementTechnologyMapper.delElemaByTechsId(id); |
| | | } |
| | | |
| | | //æ¹éå é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | @Override |
| | | public void delAllByTechId(String ids) { |
| | | elementTechnologyMapper.delAllByTechId(ids); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechnicalModelMapper; |
| | | import com.yuanchu.mom.pojo.TechnicalModel; |
| | | import com.yuanchu.mom.pojo.dto.TechnicalModelDto; |
| | | import com.yuanchu.mom.service.TechnicalModelService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ææ¯ææ ç»´æ¤è¡¨(TechnicalModel)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-28 16:09:19 |
| | | */ |
| | | @Service |
| | | public class TechnicalModelServiceImpl extends ServiceImpl<TechnicalModelMapper, TechnicalModel> implements TechnicalModelService { |
| | | |
| | | @Resource |
| | | TechnicalModelMapper technicalModelMapper; |
| | | |
| | | //æ¥è¯¢ææ¯ææ ç»´æ¤å表-->左边äºçº§å±ç¤ºå·¥åºåå·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTechTem(Integer type, String message) { |
| | | return technicalModelMapper.selectAllTechTem(type, message); |
| | | } |
| | | |
| | | //æ¥è¯¢ææ¯ææ ç»´æ¤å表-->å³è¾¹å±ç¤ºè¯¥å·¥èºä¸çæ£éªé¡¹ç® |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTechNam(Integer id) { |
| | | return technicalModelMapper.selectAllTechNam(id); |
| | | } |
| | | |
| | | //æ°å¢ææ¯ææ ç»´æ¤-->鿩工åºåå·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> chooseTechFath(Integer type) { |
| | | return technicalModelMapper.chooseTechFath(type); |
| | | } |
| | | |
| | | |
| | | //æ°å¢ææ¯ææ ç»´æ¤-->鿩项ç®ç¶ç±» |
| | | @Override |
| | | public List<String> chooseProFath(Integer id) { |
| | | return technicalModelMapper.chooseProFath(id); |
| | | } |
| | | |
| | | //æ°å¢ææ¯ææ ç»´æ¤ |
| | | @Override |
| | | public void addTechMode(Integer id, TechnicalModelDto technicalModelDto) { |
| | | TechnicalModel technicalModel = new TechnicalModel(); |
| | | BeanUtils.copyProperties(technicalModelDto, technicalModel); |
| | | technicalModel.setTechTemId(id); |
| | | technicalModelMapper.insert(technicalModel); |
| | | } |
| | | |
| | | //æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | @Override |
| | | public List<Map<String, Object>> selecTechById(Integer id) { |
| | | return technicalModelMapper.selecTechById(id); |
| | | } |
| | | |
| | | //ç¼è¾ |
| | | @Override |
| | | public void writeTechById(Integer id, TechnicalModelDto technicalModelDto) { |
| | | TechnicalModel technicalModel = new TechnicalModel(); |
| | | BeanUtils.copyProperties(technicalModelDto, technicalModel); |
| | | technicalModel.setId(id); |
| | | technicalModelMapper.updateById(technicalModel); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | public void delTechById(Integer id) { |
| | | TechnicalModel technicalModel = new TechnicalModel(); |
| | | technicalModel.setState(0); |
| | | technicalModel.setId(id); |
| | | technicalModelMapper.updateById(technicalModel); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllTech(String ids) { |
| | | technicalModelMapper.delAllTech(ids); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.DeviceMapper; |
| | | import com.yuanchu.mom.mapper.TechnologyTemplateMapper; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.ElementTechnology; |
| | | import com.yuanchu.mom.pojo.TechnologyTemplate; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto; |
| | | import com.yuanchu.mom.service.ElementTechnologyService; |
| | | import com.yuanchu.mom.service.TechnologyTemplateService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥èºè·¯çº¿ç»´æ¤è¡¨(TechnologyTemplate)表æå¡å®ç°ç±» |
| | |
| | | @Resource |
| | | DeviceMapper deviceMapper; |
| | | |
| | | @Resource |
| | | ElementMapper elementMapper; |
| | | |
| | | //éæ©è®¾å¤ç» |
| | | @Resource |
| | | ElementTechnologyService elementTechnologyService; |
| | | |
| | | @Resource |
| | | TechnicalModelMapper technicalModelMapper; |
| | | |
| | | |
| | | //æ°å¢å·¥èºè·¯çº¿-->éæ©è®¾å¤ç» |
| | | @Override |
| | | public List<Map<String, Object>> chooseDevGroup() { |
| | | return deviceMapper.chooseDevGroup(); |
| | | } |
| | | |
| | | //æ°å¢å·¥èºè·¯çº¿-->éæ©å·¥åº |
| | | @Override |
| | | public List<String> chooseTech() { |
| | | return technologyTemplateMapper.chooseTech(); |
| | | } |
| | | |
| | | //æ°å¢å·¥èºè·¯çº¿-->éæ©å
ä»¶ |
| | | @Override |
| | | public List<Map<String, Object>> chooseElement() { |
| | | return elementMapper.chooseElement(); |
| | | } |
| | | |
| | | //æ°å¢å·¥èºè·¯çº¿ |
| | | @Override |
| | | public void addSale(TechnologyTemplateDto technologyTemplateDto) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addTechTemp(TechnologyTemplateDto technologyTemplateDto) { |
| | | /*æ°å¢å·¥èº*/ |
| | | TechnologyTemplate technologyTemplate = new TechnologyTemplate(); |
| | | BeanUtils.copyProperties(technologyTemplateDto,technologyTemplate); |
| | | technologyTemplateMapper.insert(technologyTemplate); |
| | | /*æ°å¢å·¥èºå
ä»¶ä¸é´è¡¨*/ |
| | | String[] split = technologyTemplateDto.getElementId().split(","); |
| | | List<ElementTechnology> elementTechnologies = Arrays.stream(split).map(s -> { |
| | | ElementTechnology elementTechnology = new ElementTechnology(); |
| | | elementTechnology.setTechTemId(technologyTemplate.getId()); |
| | | elementTechnology.setElementId(Integer.parseInt(s)); |
| | | return elementTechnology; |
| | | }).collect(Collectors.toList()); |
| | | elementTechnologyService.saveBatch(elementTechnologies); |
| | | } |
| | | |
| | | //æ¥è¯¢å·¥èºè·¯çº¿å表 |
| | | //æ¥è¯¢å·¥èºè·¯çº¿å表-->左边äºçº§å±ç¤º |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllTechTem(Page<Object> page, Integer type, String name, String father) { |
| | | return technologyTemplateMapper.selectAllTechTem(page,type,name,father); |
| | | public List<Map<String, Object>> selectAllTechTem(Integer type, String message) { |
| | | return technologyTemplateMapper.selectAllTechTem(type, message); |
| | | } |
| | | |
| | | //ç¼è¾ |
| | | //æ¥è¯¢å·¥èºè·¯çº¿å表-->å³è¾¹å±ç¤ºå·¥èºåè®¾å¤ |
| | | @Override |
| | | public List<Map<String, Object>> selectAllTechNam(String father) { |
| | | return technologyTemplateMapper.selectAllTechNam(father); |
| | | } |
| | | |
| | | //æ ¹æ®idæ¥ç详æ
|
| | | @Override |
| | | public List<Map<String, Object>> selecTechById(Integer id) { |
| | | return technologyTemplateMapper.selecTechById(id); |
| | | } |
| | | |
| | | //ç¼è¾ (å·¥èºid) |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void writeTechById(Integer id, TechnologyTemplateDto technologyTemplateDto) { |
| | | /*å·¥èºè¡¨æ´æ°*/ |
| | | TechnologyTemplate technologyTemplate = new TechnologyTemplate(); |
| | | BeanUtils.copyProperties(technologyTemplateDto,technologyTemplate); |
| | | technologyTemplate.setId(id); |
| | | technologyTemplateMapper.updateById(technologyTemplate); |
| | | /*æ´æ¹ä¸é´è¡¨*/ |
| | | //æ¹éå é¤åæçä¸é´è¡¨(æ ¹æ®å·¥åºid) |
| | | elementTechnologyService.delElemaByTechsId(id); |
| | | //æ¹éæ·»å ä¸é´è¡¨ |
| | | String[] split = technologyTemplateDto.getElementId().split(","); |
| | | List<ElementTechnology> elementTechnologies = Arrays.stream(split).map(s -> { |
| | | ElementTechnology elementTechnology = new ElementTechnology(); |
| | | elementTechnology.setTechTemId(technologyTemplate.getId()); |
| | | elementTechnology.setElementId(Integer.parseInt(s)); |
| | | return elementTechnology; |
| | | }).collect(Collectors.toList()); |
| | | elementTechnologyService.saveBatch(elementTechnologies); |
| | | } |
| | | |
| | | //å é¤ |
| | | //å é¤(å·¥èºè·¯çº¿id) |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delTechById(Integer id) { |
| | | //å é¤å·¥èºè¡¨ |
| | | TechnologyTemplate technologyTemplate = new TechnologyTemplate(); |
| | | technologyTemplate.setId(id).setState(0); |
| | | technologyTemplateMapper.updateById(technologyTemplate); |
| | | //å é¤ä¸é´è¡¨ |
| | | elementTechnologyService.delElemaByTechsId(id); |
| | | //å é¤ææ¯ææ ç»´æ¤è¡¨ |
| | | technicalModelMapper.delTeMoByTechId(id); |
| | | //todo:å 餿ªå®å¾
ç» |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delAllTech(String ids) { |
| | | //æ¹éå é¤å·¥èºè¡¨ |
| | | technologyTemplateMapper.delAllTech(ids); |
| | | //æ¹éå é¤ä¸é´è¡¨ |
| | | elementTechnologyService.delAllByTechId(ids); |
| | | //æ¹éå 餿æ ç»´æ¤è¡¨ |
| | | technicalModelMapper.delAllByTechId(ids); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ElementMapper"> |
| | | <!--æ°å¢å·¥èºè·¯çº¿ éæ©å
ä»¶--> |
| | | <select id="chooseElement" resultType="java.util.Map"> |
| | | select id, name |
| | | from mom_ocean.element |
| | | where 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.ElementTechnologyMapper"> |
| | | <!--å é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid)--> |
| | | <update id="delElemaByTechsId"> |
| | | update mom_ocean.element_technology |
| | | set state=0 |
| | | where tech_tem_id = #{id} |
| | | </update> |
| | | |
| | | <!--æ¹éå é¤ä¸é´è¡¨(æ ¹æ®å·¥åºid)--> |
| | | <update id="delAllByTechId"> |
| | | update mom_ocean.element_technology |
| | | set state=0 |
| | | where tech_tem_id in (${id}) |
| | | </update> |
| | | </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.TechnicalModelMapper"> |
| | | <!--æ¥è¯¢ææ¯ææ ç»´æ¤å表 左边äºçº§å±ç¤ºå·¥åºåå·¥èº --> |
| | | <resultMap id="selectAllTechTemMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllTechTemTowMap" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | </resultMap> |
| | | <select id="selectAllTechTem" resultMap="selectAllTechTemMap"> |
| | | select id, |
| | | name, |
| | | father |
| | | from mom_ocean.technology_template |
| | | where state=1 |
| | | and type=#{type} |
| | | <if test="message!=null and message!=''"> |
| | | and name like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢ææ¯ææ ç»´æ¤å表 å³è¾¹å±ç¤ºè¯¥å·¥èºä¸çæ£éªé¡¹ç®--> |
| | | <resultMap id="selectAllTechNamMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <collection property="children" resultMap="selectAllTechNamTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllTechNamTowMap" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="unit" column="unit"/> |
| | | </resultMap> |
| | | <select id="selectAllTechNam" resultMap="selectAllTechNamMap"> |
| | | select id, |
| | | father, |
| | | name, |
| | | unit |
| | | from mom_ocean.technical_model |
| | | where state = 1 |
| | | and tech_tem_id = #{id} |
| | | </select> |
| | | |
| | | <!--æ°å¢ææ¯ææ ç»´æ¤ éæ©å·¥åºåå·¥èº--> |
| | | <resultMap id="chooseTechFathMap" type="map"> |
| | | <id property="techFather" column="techFather"/> |
| | | <collection property="children" resultMap="chooseTechFathTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="chooseTechFathTowMap" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="techName" column="techName"/> |
| | | </resultMap> |
| | | <select id="chooseTechFath" resultMap="chooseTechFathMap"> |
| | | select id, |
| | | name techName, |
| | | father techFather |
| | | from mom_ocean.technology_template |
| | | where state = 1 |
| | | and type = #{type} |
| | | </select> |
| | | |
| | | <!--æ°å¢ææ¯ææ ç»´æ¤ éæ©é¡¹ç®ç¶ç±»--> |
| | | <select id="chooseProFath" resultType="java.lang.String"> |
| | | select distinct father |
| | | from mom_ocean.technical_model |
| | | where state = 1 |
| | | and tech_tem_id = #{id} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®idæ¥è¯¢è¯¦æ
--> |
| | | <select id="selecTechById" resultType="java.util.Map"> |
| | | select technical_model.father, |
| | | technical_model.name, |
| | | unit, |
| | | technology_template.name techName, |
| | | technology_template.father techFather, |
| | | type |
| | | from mom_ocean.technical_model, |
| | | mom_ocean.technology_template |
| | | where technical_model.state = 1 |
| | | and technology_template.id = tech_tem_id |
| | | and technical_model.id = #{id} |
| | | </select> |
| | | |
| | | <!--æ¹éå 餿 ¹æ®ææ¯ææ id--> |
| | | <update id="delAllTech"> |
| | | update mom_ocean.technical_model |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | |
| | | <!--å 餿 ¹æ®å·¥èºè·¯çº¿id--> |
| | | <update id="delTeMoByTechId"> |
| | | update mom_ocean.technical_model |
| | | set state=0 |
| | | where tech_tem_id=#{id} |
| | | </update> |
| | | |
| | | <!--æ¹éå 餿 ¹æ®å·¥èºè·¯çº¿id--> |
| | | <update id="delAllByTechId"> |
| | | update mom_ocean.technical_model |
| | | set state=0 |
| | | where tech_tem_id in (${ids}) |
| | | </update> |
| | | </mapper> |
| | |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | <select id="selectAllTechTem" resultType="java.util.Map"> |
| | | |
| | | <!--æ¥è¯¢å·¥èºè·¯çº¿å表 左边äºçº§å±ç¤º--> |
| | | <resultMap id="selectAllTechTemMap" type="map"> |
| | | <id property="elname" column="elname"/> |
| | | <collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllTechTemTowMap" type="map"> |
| | | <result property="father" column="father"/> |
| | | </resultMap> |
| | | <select id="selectAllTechTem" resultMap="selectAllTechTemMap"> |
| | | select e.name elname, |
| | | father |
| | | from mom_ocean.technology_template t, |
| | | mom_ocean.element e, |
| | | mom_ocean.element_technology et |
| | | where e.id = et.element_id |
| | | and t.id = tech_tem_id |
| | | and t.state = 1 |
| | | and type=#{type} |
| | | <if test="message!=null and message!=''"> |
| | | and father like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢å·¥èºè·¯çº¿å表 å³è¾¹å±ç¤ºå·¥èºå设å¤--> |
| | | <select id="selectAllTechNam" resultType="java.util.Map"> |
| | | select id, |
| | | name, |
| | | father, |
| | | element, |
| | | device_group |
| | | from mom_ocean.technology_template |
| | | where state=1 |
| | | <if test="type!=null"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="father!=null and father!=''"> |
| | | and father like concat('%',#{father},'%') |
| | | </if> |
| | | and father = #{father} |
| | | </select> |
| | | |
| | | <!--æ°å¢å·¥èºè·¯çº¿ 鿩工åº--> |
| | | <select id="chooseTech" resultType="java.lang.String"> |
| | | select distinct father |
| | | from mom_ocean.technology_template |
| | | where state = 1 |
| | | </select> |
| | | |
| | | <!--æ ¹æ®idæ¥ç详æ
--> |
| | | <resultMap id="selecTechByIdMap" type="map"> |
| | | <id property="type" column="type"/> |
| | | <result property="father" column="father"/> |
| | | <result property="name" column="name"/> |
| | | <result property="deviceGroup" column="device_group"/> |
| | | <collection property="children" resultMap="selecTechByIdsMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selecTechByIdsMap" type="map"> |
| | | <id property="id" column="id"/> |
| | | </resultMap> |
| | | <select id="selecTechById" resultMap="selecTechByIdMap"> |
| | | select e.id, |
| | | father, |
| | | t.name, |
| | | type, |
| | | device_group |
| | | from mom_ocean.technology_template t, |
| | | mom_ocean.element e, |
| | | mom_ocean.element_technology et |
| | | where e.id = et.element_id |
| | | and t.id = tech_tem_id |
| | | and t.state = 1 |
| | | and t.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class StatisticsData { |
| | | private int material; //åææåæ ¼ |
| | |
| | | private int unmaterial; //åææä¸åæ ¼ |
| | | private int unprocess; //è¿ç¨ä¸åæ ¼ |
| | | private int unfinished; //æåä¸åæ ¼ |
| | | /*private BigDecimal imaterial; //åææåæ ¼ç |
| | | private BigDecimal iprocess; //è¿ç¨åæ ¼ç |
| | | private BigDecimal ifinished; //æååæ ¼ç |
| | | private BigDecimal iunmaterial; //åææä¸åæ ¼ç |
| | | private BigDecimal iunprocess; //è¿ç¨ä¸åæ ¼ç |
| | | private BigDecimal iunfinished; //æåä¸åæ ¼ç*/ |
| | | |
| | | |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | |
| | | .finishedList(StringUtils.join(finishedList, ',')) |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | /*计ç®ç¾åæ¯*/ |
| | | private BigDecimal getRadio(Integer all, Long num) { |
| | | if (all.intValue() == 0) { |
| | | return new BigDecimal(0); |
| | | } |
| | | BigDecimal numBigDecimal = new BigDecimal(num); |
| | | BigDecimal allBigDecimal = new BigDecimal(all); |
| | | BigDecimal divide = numBigDecimal.divide(allBigDecimal, 4, BigDecimal.ROUND_HALF_UP); |
| | | return divide.multiply(new BigDecimal(100)); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/compile") |
| | | public Result compile(Integer id) { |
| | | ordersService.compile(id); |
| | | return Result.success("ç¼å¶å®æ!"); |
| | | return Result.success("ç¼å¶äº§å"+id+"宿!"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.service.ManufactureOrderService; |
| | | import com.yuanchu.mom.service.OrdersService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |