north-glass-erp/pom.xml
@@ -155,6 +155,12 @@ <version>5.14.2</version> </dependency> <dependency> <groupId>org.hibernate.validator</groupId> <artifactId>hibernate-validator</artifactId> <version>6.1.5.Final</version> </dependency> </dependencies> <build> north-glass-erp/src/main/java/com/example/erp/config/ExceptionController.java
New file @@ -0,0 +1,30 @@ package com.example.erp.config; import com.example.erp.common.Result; import org.mybatis.logging.Logger; import org.mybatis.logging.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; @ControllerAdvice public class ExceptionController { private final Logger log = LoggerFactory.getLogger(ExceptionController.class); @ResponseStatus(value = HttpStatus.BAD_REQUEST) @ExceptionHandler(MethodArgumentNotValidException.class) @ResponseBody public Result getMessage(MethodArgumentNotValidException exception){ Result result = new Result(); result.setCode("400"); String message = exception.getBindingResult().getFieldError().getDefaultMessage(); // exception.getBindingResult().getFieldErrors(); 获取所有的错误信息 result.setMsg("'"+exception.getBindingResult().getFieldError().getField()+"':"+message); return result; } } north-glass-erp/src/main/java/com/example/erp/controller/pp/OtherSystemInfoController.java
New file @@ -0,0 +1,26 @@ package com.example.erp.controller.pp; import com.example.erp.common.Result; import com.example.erp.dto.otherSystem.OptimizeProject; import com.example.erp.service.pp.OtherSystemInfoService; import io.swagger.annotations.Api; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; @RequiredArgsConstructor @RestController @Api(tags = "其他系统信息") @RequestMapping("/getOtherSystemInfo") public class OtherSystemInfoController { private final OtherSystemInfoService otherSystemInfoService; @PostMapping("/getGlassInfo") public Result getGlassInfo(@Valid @RequestBody OptimizeProject glassInfo) { return Result.seccess(otherSystemInfoService.saveGlassInfo(glassInfo)); } } north-glass-erp/src/main/java/com/example/erp/dto/otherSystem/FlowCardList.java
New file @@ -0,0 +1,38 @@ package com.example.erp.dto.otherSystem; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import javax.persistence.Column; import javax.validation.constraints.NotNull; @Data @TableName("pp.other_flow_card") public class FlowCardList { @TableId(type = IdType.AUTO) private Long id; @TableField("process_id") @NotNull(message = "This field cannot be null") private String flowCardId; @NotNull(message = "This field cannot be null") private Double width; @NotNull(message = "This field cannot be null") private Double height; @NotNull(message = "This field cannot be null") private Double thickness; @NotNull(message = "This field cannot be null") private String filmsid; @NotNull(message = "This field cannot be null") private String totalLayer; @NotNull(message = "This field cannot be null") private String layer; @NotNull(message = "This field cannot be null") private String glassTotal; @NotNull(message = "This field cannot be null") private String orderNumber; @NotNull(message = "This field cannot be null") private String productName; } north-glass-erp/src/main/java/com/example/erp/dto/otherSystem/GlassDetailList.java
New file @@ -0,0 +1,98 @@ package com.example.erp.dto.otherSystem; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import javax.persistence.Column; import javax.validation.constraints.NotNull; @Data @TableName("pp.optimize_detail") public class GlassDetailList { @TableId(type = IdType.AUTO) private Long id; @TableField(select = false,exist = false) private String glassId; @TableField("project_no")//工程号 @NotNull(message = "This field cannot be null") private String engineerId; @TableField("process_id")//流程卡 @NotNull(message = "This field cannot be null") private String flowCardId; @TableField("order_sort")//订单序号 @NotNull(message = "This field cannot be null") private Integer orderNumber; @NotNull(message = "This field cannot be null") private Double width; @NotNull(message = "This field cannot be null") private Double height; @TableField(select = false,exist = false) private Double thickness; @TableField(select = false,exist = false) private String filmsId; //总层数 @NotNull(message = "This field cannot be null") private Integer totalLayer; //当前层数 @NotNull(message = "This field cannot be null") private Integer layer; @NotNull(message = "This field cannot be null") @TableField("stock_id")//版图序号 private Integer patternSequence; @NotNull(message = "This field cannot be null") @TableField("p_width")//磨前宽 private Double edgWidth; @TableField("p_height")//磨前高 @NotNull(message = "This field cannot be null") private Double edgHeight; @TableField("x_axis")//x坐标 @NotNull(message = "This field cannot be null") private Integer xaxis; @TableField("y_axis")//y坐标 private Integer yaxis; @NotNull(message = "This field cannot be null") @TableField(select = false,exist = false)//原片旋转角度 private String patternAngle; @TableField("heat_layout_id")//钢化版图号 private Integer temperingLayoutId; @TableField("heat_layout_sort")//钢化序号 private Integer temperingFeedSequence; @TableField(select = false,exist = false)//钢化x坐标 private Integer xcoordinate; @TableField(select = false,exist = false)//钢化y坐标 private Integer ycoordinate; @TableField(select = false,exist = false)//旋转角度逆时针 private Integer angle; @TableField(select = false,exist = false)//钢化是否接受横放 private Integer isHorizontal; @TableField(select = false,exist = false)//是否配片 private Integer isMultiple; @TableField(select = false,exist = false)//配片最大宽 private Double maxWidth; @TableField(select = false,exist = false)//配片最大高 private Double maxHeight; @TableField(select = false,exist = false)//打标属性 private String markIcon; @TableField(select = false,exist = false)//生产规则id private Integer ruleId; @TableField(select = false,exist = false)//是否合并 private Integer combine; @TableField(select = false,exist = false)//除膜方式 private Integer filmRemove; } north-glass-erp/src/main/java/com/example/erp/dto/otherSystem/OptimizeProject.java
New file @@ -0,0 +1,74 @@ package com.example.erp.dto.otherSystem; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.List; @Data @TableName("pp.optimize_project") public class OptimizeProject { @TableId(type = IdType.AUTO) private Long id; //工程号 @NotNull(message = "This field cannot be null") @TableField("project_no") private String engineerId; //工程名称 @TableField("project_name") private String engineerName; //平均利用率 @TableField("avg_cut_pct") private Double avgAvailability; //有效利用率 @TableField("valid_cut_pct") private Double validAvailability; //尾片利用率 @TableField("last_cut_pct") private Double lastAvailability; //小片总数 @NotNull(message = "This field cannot be null") @TableField("glass_total") private Integer glassTotal; //小片总面积 @TableField("glass_total_area") private Double glassTotalArea; //计划原片总数 @TableField("frist_stock_qty") private Integer planPatternTotal; //计划原片总面积 @TableField(select = false,exist = false) private Double planPatternTotalArea; //实际原片总数 @TableField("raw_stock_qty") private Integer realityPatternTotal; //实际原片总面积 @TableField("raw_stock_area") private Double realityPatternTotalArea; //膜系id @TableField("glass_type") private String filmsId; @NotNull(message = "This field cannot be null") private Integer type;//补单0,正常1 @TableField("glass_thickness") @NotNull(message = "This field cannot be null") private Double thickness; private String state; //原片使用 @TableField(select = false,exist = false) private List<UpPattenList> upPattenList; //第三方流程卡表 @TableField(select = false,exist = false) private List<FlowCardList> flowCardList; //优化小片明细 @TableField(select = false,exist = false) private List<GlassDetailList> glassDetailList; } north-glass-erp/src/main/java/com/example/erp/dto/otherSystem/UpPattenList.java
New file @@ -0,0 +1,36 @@ package com.example.erp.dto.otherSystem; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import javax.persistence.Column; import javax.validation.constraints.NotNull; @Data @TableName("pp.optimize_layout") public class UpPattenList { @TableId(type = IdType.AUTO) private Long id; //工程号 @TableField("project_no") @NotNull(message = "This field cannot be null") private String engineeringId; //膜系 /*@TableField("project_no") private String filmsId;*/ //宽度 @NotNull(message = "This field cannot be null") private double width; //高度 @NotNull(message = "This field cannot be null") private double height; /*//厚度 private double thickness;*/ //原片版图序号stock_id @TableField("stock_id") @NotNull(message = "This field cannot be null") private Integer layoutSequence; } north-glass-erp/src/main/java/com/example/erp/mapper/pp/OptimizeDetailMapper.java
New file @@ -0,0 +1,11 @@ package com.example.erp.mapper.pp; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.example.erp.dto.otherSystem.GlassDetailList; import org.apache.ibatis.annotations.Mapper; @DS("pp") @Mapper public interface OptimizeDetailMapper extends BaseMapper<GlassDetailList> { } north-glass-erp/src/main/java/com/example/erp/mapper/pp/OptimizeLayoutMapper.java
New file @@ -0,0 +1,11 @@ package com.example.erp.mapper.pp; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.example.erp.dto.otherSystem.UpPattenList; import org.apache.ibatis.annotations.Mapper; @DS("pp") @Mapper public interface OptimizeLayoutMapper extends BaseMapper<UpPattenList> { } north-glass-erp/src/main/java/com/example/erp/mapper/pp/OptimizeProjectMapper.java
New file @@ -0,0 +1,11 @@ package com.example.erp.mapper.pp; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.example.erp.dto.otherSystem.OptimizeProject; import org.apache.ibatis.annotations.Mapper; @DS("pp") @Mapper public interface OptimizeProjectMapper extends BaseMapper<OptimizeProject> { } north-glass-erp/src/main/java/com/example/erp/mapper/pp/OtherFlowCardMapper.java
New file @@ -0,0 +1,12 @@ package com.example.erp.mapper.pp; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.example.erp.dto.otherSystem.FlowCardList; import org.apache.ibatis.annotations.Mapper; @Mapper @DS("pp") public interface OtherFlowCardMapper extends BaseMapper<FlowCardList> { } north-glass-erp/src/main/java/com/example/erp/service/pp/OtherSystemInfoService.java
New file @@ -0,0 +1,39 @@ package com.example.erp.service.pp; import com.example.erp.dto.otherSystem.GlassDetailList; import com.example.erp.dto.otherSystem.OptimizeProject; import com.example.erp.mapper.pp.OptimizeDetailMapper; import com.example.erp.mapper.pp.OptimizeLayoutMapper; import com.example.erp.mapper.pp.OptimizeProjectMapper; import com.example.erp.mapper.pp.OtherFlowCardMapper; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @RequiredArgsConstructor @Service public class OtherSystemInfoService { private final OptimizeProjectMapper optimizeProjectMapper; private final OptimizeDetailMapper optimizeDetailMapper; private final OptimizeLayoutMapper optimizeLayoutMapper; private final OtherFlowCardMapper otherFlowCardMapper; @Transactional public Object saveGlassInfo(OptimizeProject glassInfo) { optimizeProjectMapper.insert(glassInfo); for (GlassDetailList glassDetailList : glassInfo.getGlassDetailList()) { optimizeDetailMapper.insert(glassDetailList); } glassInfo.getFlowCardList().forEach(flowCard -> { otherFlowCardMapper.insert(flowCard); }); glassInfo.getUpPattenList().forEach(upPatten -> { optimizeLayoutMapper.insert(upPatten); }); return true; } } north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -1067,7 +1067,7 @@ select reviewed_state from pp.reporting_work where reporting_work_id=#{reportingWorkId}; </select> <select id="qualityReviewSearchMp"> <select id="qualityReviewSearchMp" resultMap="reportingWorkMap"> select rw.reporting_work_id, rw.reporting_work_time, rw.process_id,