liuxm
2024-06-13 a8a841000119370ec34a59a7f4f51dc2f8ee0976
去掉原controller 中的try catch 和BindingResult
14个文件已修改
577 ■■■■ 已修改文件
pms-parent/pms-common/src/main/java/com/dy/common/aop/CheckLength.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-common/src/main/java/com/dy/common/webUtil/GlExceptionHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltMaterial.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/material/MaterialCtrl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proItems/ProItemsCtrl.java 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proParam/ParamCtrl.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proSR/ProSRCtrl.java 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proUR/ProURCtrl.java 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessCtrl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblyPlanCtrl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/DevOpsPlanCtrl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-common/src/main/java/com/dy/common/aop/CheckLength.java
@@ -11,7 +11,7 @@
public @interface CheckLength {
    int min() default 11;
    int max() default 12;
    int max() default 11;
    String message() default "手机号长度必须是11位";
pms-parent/pms-common/src/main/java/com/dy/common/webUtil/GlExceptionHandler.java
@@ -47,6 +47,6 @@
    @ExceptionHandler
    public BaseResponse exceptionHandler(Throwable t) {
        log.error("捕获到异常:{}",t.getMessage(),t);
        return BaseResponseUtils.buildException("在Controller中或后产生异常:" + t.getMessage());
        return BaseResponseUtils.buildException( t.getMessage());
    }
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltMaterial.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.*;
/**
@@ -31,7 +32,7 @@
     * 产品实体编号
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @NotEmpty(message = "产品实体编号不能为空")
    @NotNull(message = "产品实体编号不能为空")
    public Long proId;
    /**
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/material/MaterialCtrl.java
@@ -10,11 +10,9 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 物料管理
@@ -33,22 +31,18 @@
    /**
     * 保存物料信息
     * @param material
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300001")
    @Log("保存物料信息")
    public BaseResponse<PltMaterial> save(@RequestBody @Valid PltMaterial material,BindingResult bindingResult){
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            material.deleted = false;
            return BaseResponseUtils.buildSuccess(sv.save(material));
        }catch (Exception e){
            log.error("保存物料异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
    public BaseResponse<PltMaterial> save(@RequestBody @Valid PltMaterial material){
        material.deleted = false;
        int count = sv.save(material);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
@@ -56,21 +50,17 @@
    /**
     * 更新物料信息
     * @param material
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300001")
    @Log("更新物料信息")
    public BaseResponse<PltMaterial> update(@RequestBody @Valid PltMaterial material,BindingResult bindingResult){
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            return BaseResponseUtils.buildSuccess(sv.update(material));
        }catch (Exception e){
            log.error("更新物料异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
    public BaseResponse<PltMaterial> update(@RequestBody @Valid PltMaterial material){
        int count = sv.update(material);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
@@ -83,11 +73,11 @@
    @SsoPowerAop(power = "10300001")
    @Log("删除物料信息")
    public BaseResponse<PltMaterial> delete(String id){
        try {
            return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id)));
        }catch (Exception e){
            log.error("删除物料异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
@@ -101,13 +91,8 @@
    @SsoPowerAop(power = "10300000") //登录与权限同时验证
    @Log("根据ID查询物料信息")
    public BaseResponse<PltMaterial> one(String id){
        try{
            PltMaterial material=sv.selectById(id);
            return BaseResponseUtils.buildSuccess(JSON.toJSON(material));
        }catch (Exception e){
            log.error("查询物料异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        PltMaterial material=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(JSON.toJSON(material));
    }
    /**
@@ -119,13 +104,8 @@
    @SsoPowerAop(power = "10300000")
    @Log("查询物料信息")
    public BaseResponse<QueryResultVo<List<PltMaterial>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltMaterial>> list = sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("查询物料异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltMaterial>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
}
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proItems/ProItemsCtrl.java
@@ -6,18 +6,14 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoBa.BaRole;
import com.dy.pmsGlobal.pojoPlt.PltProductParams;
import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
import com.dy.pmsGlobal.pojoPlt.PltProductUnqualifiedReason;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 产品品质检查项目
@@ -36,25 +32,15 @@
    /**
     * 保存产品品质检查项目
     * @param item
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300003")
    @Log("保存产品品质检查项目信息")
    public BaseResponse<Boolean> save(@RequestBody @Valid PltProductQualityInspectionItems item, BindingResult bindingResult){
        int count = 0;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            item.deleted = false;
            item.disabled = false;
            count =sv.save(item);
        }catch (Exception e){
            log.error("保存产品品质检查项目异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> save(@RequestBody @Valid PltProductQualityInspectionItems item){
        item.deleted = false;
        item.disabled = false;
        int count =sv.save(item);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -66,23 +52,13 @@
    /**
     * 更新产品品质检查项目信息
     * @param item
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300003")
    @Log("更新产品品质检查项目信息")
    public BaseResponse<Boolean> update(@RequestBody @Valid PltProductQualityInspectionItems item,BindingResult bindingResult){
        int count ;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            count = sv.update(item);
        }catch (Exception e){
            log.error("更新产品品质检查项目异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> update(@RequestBody @Valid PltProductQualityInspectionItems item){
        int count = sv.update(item);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -99,13 +75,8 @@
    @SsoPowerAop(power = "10300003")
    @Log("删除产品品质检查项目信息")
    public BaseResponse<Boolean> delete(String id){
        int count;
        try {
            count = sv.delete(Long.parseLong(id));
        }catch (Exception e){
            log.error("删除产品品质检查项目异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -123,13 +94,8 @@
    @SsoPowerAop(power = "10300002") //登录与权限同时验证
    @Log("根据ID查询产品品质检查项目信息")
    public BaseResponse<PltProductQualityInspectionItems> one(String id){
        try{
            PltProductQualityInspectionItems item=sv.selectById(id);
            return BaseResponseUtils.buildSuccess(JSON.toJSON(item));
        }catch (Exception e){
            log.error("查询产品品质检查项目异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        PltProductQualityInspectionItems item=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(JSON.toJSON(item));
    }
    /**
@@ -141,13 +107,8 @@
    @SsoPowerAop(power = "10300002")
    @Log("查询产品品质检查项目信息")
    public BaseResponse<QueryResultVo<List<PltProductQualityInspectionItems>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltProductQualityInspectionItems>> list = sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("查询产品品质检查项目异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltProductQualityInspectionItems>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
     * 禁用或启用
@@ -158,13 +119,8 @@
    @SsoPowerAop(power = "10100011")
    @Log("禁用或启用质检项目")
    public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){
        int count;
        try {
            count = sv.disabled(reason.id,reason.disabled);
        }catch (Exception e){
            log.error("禁用或启用质检项目异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.disabled(reason.id,reason.disabled);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proParam/ParamCtrl.java
@@ -10,11 +10,9 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 产品技术参数管理
@@ -33,22 +31,18 @@
    /**
     * 保存产品技术参数信息
     * @param param
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300001")
    @Log("保存产品技术参数信息")
    public BaseResponse<PltProductParams> save(@RequestBody @Valid PltProductParams param,BindingResult bindingResult){
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            param.deleted = false;
            return BaseResponseUtils.buildSuccess(sv.save(param));
        }catch (Exception e){
            log.error("保存产品技术参数异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
    public BaseResponse<PltProductParams> save(@RequestBody @Valid PltProductParams param){
        param.deleted = false;
        int count = sv.save(param);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
@@ -56,21 +50,18 @@
    /**
     * 更新产品技术参数信息
     * @param param
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300001")
    @Log("更新产品技术参数信息")
    public BaseResponse<PltProductParams> update(@RequestBody @Valid PltProductParams param,BindingResult bindingResult){
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            return BaseResponseUtils.buildSuccess(sv.update(param));
        }catch (Exception e){
            log.error("更新产品技术参数异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
    public BaseResponse<PltProductParams> update(@RequestBody @Valid PltProductParams param){
        param.deleted = false;
        int count = sv.update(param);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
@@ -83,11 +74,11 @@
    @SsoPowerAop(power = "10300001")
    @Log("删除产品技术参数信息")
    public BaseResponse<PltProductParams> delete(String id){
        try {
            return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id)));
        }catch (Exception e){
            log.error("删除产品技术参数异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
@@ -101,13 +92,8 @@
    @SsoPowerAop(power = "10300000") //登录与权限同时验证
    @Log("根据ID查询产品技术参数信息")
    public BaseResponse<PltProductParams> one(String id){
        try{
            PltProductParams param=sv.selectById(id);
            return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
        }catch (Exception e){
            log.error("查询产品技术参数异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        PltProductParams param=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
    }
    /**
@@ -119,13 +105,8 @@
    @SsoPowerAop(power = "10300000")
    @Log("查询产品技术参数信息")
    public BaseResponse<QueryResultVo<List<PltProductParams>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltProductParams>> list = sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("查询产品技术参数异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltProductParams>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
}
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proSR/ProSRCtrl.java
@@ -6,17 +6,14 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoBa.BaRole;
import com.dy.pmsGlobal.pojoPlt.PltProductScrappingReason;
import com.dy.pmsGlobal.pojoPlt.PltProductUnqualifiedReason;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 产品设备报废原因
@@ -35,25 +32,15 @@
    /**
     * 保存
     * @param reason
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300011")
    @Log("保存产品设备报废原因")
    public BaseResponse<Boolean> save(@RequestBody @Valid PltProductScrappingReason reason,BindingResult bindingResult){
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            reason.disabled = false;
            reason.deleted = false;
            count = sv.save(reason);
        }catch (Exception e){
            log.error("保存产品设备报废原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> save(@RequestBody @Valid PltProductScrappingReason reason){
        reason.disabled = false;
        reason.deleted = false;
        int count = sv.save(reason);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -65,23 +52,13 @@
    /**
     * 更新
     * @param reason
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300011")
    @Log("更新产品设备报废原因")
    public BaseResponse<Boolean> update(@RequestBody @Valid PltProductScrappingReason reason,BindingResult bindingResult){
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            count = sv.update(reason);
        }catch (Exception e){
            log.error("更新产品设备报废原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> update(@RequestBody @Valid PltProductScrappingReason reason){
        int count = sv.update(reason);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -98,13 +75,8 @@
    @SsoPowerAop(power = "10300011")
    @Log("删除产品设备报废原因")
    public BaseResponse<Boolean> delete(String id){
        int count;
        try {
            count = sv.delete(Long.parseLong(id));
        }catch (Exception e){
            log.error("删除产品设备报废原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -122,13 +94,8 @@
    @SsoPowerAop(power = "10300010") //登录与权限同时验证
    @Log("根据ID查询产品设备报废原因")
    public BaseResponse<PltProductScrappingReason> one(String id){
        try{
            PltProductScrappingReason param=sv.selectById(id);
            return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
        }catch (Exception e){
            log.error("查询产品设备报废原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        PltProductScrappingReason param=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
    }
    /**
@@ -140,13 +107,8 @@
    @SsoPowerAop(power = "10300010")
    @Log("查询产品设备报废原因")
    public BaseResponse<QueryResultVo<List<PltProductScrappingReason>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltProductScrappingReason>> list = sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("查询产品设备报废原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltProductScrappingReason>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
@@ -158,13 +120,8 @@
    @SsoPowerAop(power = "10100011")
    @Log("禁用或启用报废原因")
    public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){
        int count;
        try {
            count = sv.disabled(reason.id,reason.disabled);
        }catch (Exception e){
            log.error("禁用或启用报废原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.disabled(reason.id,reason.disabled);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proUR/ProURCtrl.java
@@ -10,11 +10,9 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 产品生产不合格原因
@@ -33,25 +31,15 @@
    /**
     * 保存产品生产不合格原因
     * @param reason
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300009")
    @Log("保存产品生产不合格原因")
    public BaseResponse<Boolean> save(@RequestBody @Valid PltProductUnqualifiedReason reason,BindingResult bindingResult){
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            reason.deleted = false;
            reason.disabled = false;
            count = sv.save(reason);
        }catch (Exception e){
            log.error("保存产品生产不合格原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> save(@RequestBody @Valid PltProductUnqualifiedReason reason){
        reason.deleted = false;
        reason.disabled = false;
        int count = sv.save(reason);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -63,23 +51,13 @@
    /**
     * 更新产品生产不合格原因
     * @param reason
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300009")
    @Log("更新产品生产不合格原因")
    public BaseResponse<Boolean> update(@RequestBody @Valid PltProductUnqualifiedReason reason,BindingResult bindingResult){
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            count = sv.update(reason);
        }catch (Exception e){
            log.error("更新产品生产不合格原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> update(@RequestBody @Valid PltProductUnqualifiedReason reason){
        int count = sv.update(reason);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -96,13 +74,8 @@
    @SsoPowerAop(power = "10300009")
    @Log("删除产品生产不合格原因")
    public BaseResponse<Boolean> delete(String id){
        int count;
        try {
            count = sv.delete(Long.parseLong(id));
        }catch (Exception e){
            log.error("删除产品生产不合格原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -120,13 +93,8 @@
    @SsoPowerAop(power = "10300008") //登录与权限同时验证
    @Log("根据ID查询产品生产不合格原因")
    public BaseResponse<PltProductUnqualifiedReason> one(String id){
        try{
            PltProductUnqualifiedReason param=sv.selectById(id);
            return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
        }catch (Exception e){
            log.error("根据ID查询产品生产不合格原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        PltProductUnqualifiedReason param=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
    }
    /**
@@ -138,13 +106,8 @@
    @SsoPowerAop(power = "10300008")
    @Log("查询产品生产不合格原因")
    public BaseResponse<QueryResultVo<List<PltProductUnqualifiedReason>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltProductUnqualifiedReason>> list = sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("查询产品生产不合格原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltProductUnqualifiedReason>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
@@ -156,13 +119,7 @@
    @SsoPowerAop(power = "10300009")
    @Log("禁用或启用不合格原因")
    public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){
        int count;
        try {
            count = sv.disabled(reason.id,reason.disabled);
        }catch (Exception e){
            log.error("禁用或启用不合格原因异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.disabled(reason.id,reason.disabled);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java
@@ -13,7 +13,6 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
@@ -43,26 +42,15 @@
    /**
     * 保存产品信息
     * @param pro
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300001")
    @Log("保存产品信息")
    public BaseResponse<PltProduct> save(@RequestBody @Valid PltProduct pro,
                                         BindingResult bindingResult){
    public BaseResponse<PltProduct> save(@RequestBody @Valid PltProduct pro){
        pro.id = null;
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            pro.setDeleted(false);
            count = proSv.save(pro);
        }catch (Exception e){
            log.error("保存产品异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        pro.setDeleted(false);
        int count = proSv.save(pro);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -74,23 +62,13 @@
    /**
     * 更新产品信息
     * @param pro
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300001")
    @Log("更新产品信息")
    public BaseResponse<PltProduct> update(@RequestBody @Valid PltProduct pro,BindingResult bindingResult){
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            count = proSv.update(pro);
        }catch (Exception e){
            log.error("更新产品异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<PltProduct> update(@RequestBody @Valid PltProduct pro){
        int count = proSv.update(pro);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -107,13 +85,7 @@
    @SsoPowerAop(power = "10300001")
    @Log("删除产品信息")
    public BaseResponse<Boolean> delete(String id){
        int count;
        try {
            count = proSv.delete(Long.parseLong(id));
        }catch (Exception e){
            log.error("删除产品异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = proSv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -130,14 +102,9 @@
    @SsoPowerAop(power = "10300000") //登录与权限同时验证
    @Log("根据ID查询产品信息")
    public BaseResponse<PltProduct> one(String id){
        try{
            PltProduct pro=proSv.selectById(id);
        PltProduct pro=proSv.selectById(id);
            return BaseResponseUtils.buildSuccess(pro);
        }catch (Exception e){
            log.error("根据ID查询产品异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        return BaseResponseUtils.buildSuccess(pro);
    }
    /**
@@ -149,13 +116,8 @@
    @SsoPowerAop(power = "10300000")
    @Log("分页查询产品信息")
    public BaseResponse<QueryResultVo<List<PltProduct>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltProduct>> list = proSv.selectSome(vo);
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("分页查询产品异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltProduct>> list = proSv.selectSome(vo);
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
@@ -166,42 +128,33 @@
    @SsoPowerAop(power = "10300000")
    @Log("查询所有产品")
    public BaseResponse<List<PltProduct>> all(){
        try {
            QueryVo vo = new QueryVo();
            return BaseResponseUtils.buildSuccess(proSv.selectAll(vo));
        }catch (Exception e){
            log.error("查询所有产品异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryVo vo = new QueryVo();
        return BaseResponseUtils.buildSuccess(proSv.selectAll(vo));
    }
    @PostMapping(path="export")
    @SsoPowerAop(power = "10300000")
    @Log("导出产品信息")
    public void export(@RequestBody QueryVo queryVo, HttpServletResponse response){
        try{
            List<Converter> list = new ArrayList<>() ;
        List<Converter> list = new ArrayList<>() ;
            List<PltProduct> porList = proSv.selectAll(queryVo);
            // 使用并行流提高性能
            porList.parallelStream().forEach(pro -> {
                ExcelVo vo = new ExcelVo();
                vo.name = pro.name;
                vo.type = pro.type;
                vo.code = pro.code;
                try {
                    vo.qrCode = QrCodeUtil.genQrCode(pro.code);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (WriterException e) {
                    e.printStackTrace();
                }
                list.add(vo);
            });
            QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
        }catch (Exception e){
            log.error("导出产品信息异常", e);
        }
        List<PltProduct> porList = proSv.selectAll(queryVo);
        // 使用并行流提高性能
        porList.parallelStream().forEach(pro -> {
            ExcelVo vo = new ExcelVo();
            vo.name = pro.name;
            vo.type = pro.type;
            vo.code = pro.code;
            try {
                vo.qrCode = QrCodeUtil.genQrCode(pro.code);
            } catch (IOException e) {
                e.printStackTrace();
            } catch (WriterException e) {
                e.printStackTrace();
            }
            list.add(vo);
        });
        QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
    }
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java
@@ -14,13 +14,11 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
 * 工站
@@ -42,24 +40,14 @@
    /**
     * 保存
     * @param station
     * @param bindingResult
     * @return
     */
    @PostMapping(path="save")
    @SsoPowerAop(power = "10300007")
    @Log("保存工站")
    public BaseResponse<Boolean> save(@RequestBody @Valid PltStation station,BindingResult bindingResult){
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        int count;
        try {
            station.deleted = false;
            count = sv.save(station);
        }catch (Exception e){
            log.error("保存工站异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> save(@RequestBody @Valid PltStation station){
        station.deleted = false;
        int count = sv.save(station);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
@@ -72,23 +60,14 @@
    /**
     * 更新
     * @param station
     * @param bindingResult
     * @return
     */
    @PostMapping(path="update")
    @SsoPowerAop(power = "10300007")
    @Log("更新工站")
    public BaseResponse<Boolean> update(@RequestBody @Valid PltStation station,BindingResult bindingResult){
        int count;
        try {
            if (bindingResult != null && bindingResult.hasErrors()) {
                return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
            }
            count = sv.update(station);
        }catch (Exception e){
            log.error("更新工站异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    public BaseResponse<Boolean> update(@RequestBody @Valid PltStation station){
        int count = sv.update(station);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -105,13 +84,8 @@
    @SsoPowerAop(power = "10300007")
    @Log("删除工站")
    public BaseResponse<Boolean> delete(String id){
       int count;
        try {
            count = sv.delete(Long.parseLong(id));
        }catch (Exception e){
            log.error("删除工站异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
       int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -126,13 +100,8 @@
    @SsoPowerAop(power = "10300006") //登录与权限同时验证
    @Log("根据ID查询工站")
    public BaseResponse<PltStation> one(String id){
        try{
            PltStation param=sv.selectById(id);
            return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
        }catch (Exception e){
            log.error("根据ID查询工站异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        PltStation param=sv.selectById(id);
        return BaseResponseUtils.buildSuccess(JSON.toJSON(param));
    }
    /**
@@ -144,26 +113,16 @@
    @SsoPowerAop(power = "10300006")
    @Log("分页查询工站")
    public BaseResponse<QueryResultVo<List<PltStation>>> some(@RequestBody QueryVo vo){
        try {
            QueryResultVo<List<PltStation>> list = sv.selectSome(vo) ;
            return BaseResponseUtils.buildSuccess(list);
        }catch (Exception e){
            log.error("分页查询工站异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        QueryResultVo<List<PltStation>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
    @PostMapping(path="disabled")
    @SsoPowerAop(power = "10100011")
    @Log("禁用或启用工站")
    public BaseResponse<Boolean> disabled(@RequestBody PltStation station){
        int count;
        try {
            count = sv.disabled(station.id,station.disabled);
        }catch (Exception e){
            log.error("禁用或启用工站异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
        int count = sv.disabled(station.id,station.disabled);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
@@ -174,29 +133,25 @@
    @SsoPowerAop(power = "10300000")
    @Log("导出工站信息")
    public void export(HttpServletResponse response){
        try{
            List<Converter> list = new ArrayList<>() ;
        List<Converter> list = new ArrayList<>() ;
            List<PltStation> stations = sv.selectAll();
            // 使用并行流提高性能
            stations.parallelStream().forEach(station -> {
                ExcelVo vo = new ExcelVo();
                vo.name = station.name;
        List<PltStation> stations = sv.selectAll();
        // 使用并行流提高性能
        stations.parallelStream().forEach(station -> {
            ExcelVo vo = new ExcelVo();
            vo.name = station.name;
//                vo.code = "103"+station.id;
                vo.lineName = station.lineName;
                try {
                    vo.qrCode = QrCodeUtil.genQrCode(stationPrefix+station.id);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (WriterException e) {
                    e.printStackTrace();
                }
                list.add(vo);
            });
            QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
        }catch (Exception e){
            log.error("导出产品信息异常", e);
        }
            vo.lineName = station.lineName;
            try {
                vo.qrCode = QrCodeUtil.genQrCode(stationPrefix+station.id);
            } catch (IOException e) {
                e.printStackTrace();
            } catch (WriterException e) {
                e.printStackTrace();
            }
            list.add(vo);
        });
        QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
    }
}
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
@@ -30,9 +30,9 @@
    }
    @Transactional
    public int save(PltStation station) throws Exception {
    public int save(PltStation station) throws RuntimeException {
        if(dao.selectByCodeId(station.id,station.code)>0){
            throw new Exception("工站编号已存在");
            throw new RuntimeException("工站编号已存在");
        }
        int count = dao.insertSelective(station);
        return count;
@@ -51,9 +51,9 @@
    @Transactional
    public int update(PltStation station) throws Exception {
    public int update(PltStation station) throws RuntimeException {
        if(dao.selectByCodeId(station.id,station.code)>0){
            throw new Exception("工站编号已存在");
            throw new RuntimeException("工站编号已存在");
        }
        int count = dao.updateByPrimaryKeySelective(station);
        return count;
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessCtrl.java
@@ -9,12 +9,10 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * 生产流程
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblyPlanCtrl.java
@@ -14,14 +14,12 @@
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
 * 组装任务计划
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/DevOpsPlanCtrl.java
@@ -5,16 +5,13 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoPr.PrDevOpsPlan;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
/**
 * 安装运维任务计划