2369059705@qq.com
2023-07-07 e63c20ecfc103f4456d79c198b35eac1698b86f3
项目预警
已修改2个文件
155 ■■■■■ 文件已修改
product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
product-server-project-management/src/main/java/com/product/project/management/service/ProjectInfoService.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
product-server-project-management/src/main/java/com/product/project/management/controller/ProjectInfoController.java
@@ -20,19 +20,20 @@
@RequestMapping("/api/qxlw-project")
@RestController("qxlw-project-controller")
public class ProjectInfoController extends AbstractBaseController{
public class ProjectInfoController extends AbstractBaseController {
    @Autowired
    ProjectInfoService projectInfoService;
    @Autowired
    ProjectInfoService projectInfoService;
     /**
     *    获取模板项目分项
    /**
     * 获取模板项目分项
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/get-projectTypeItem/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String getProjectTypeItem(HttpServletRequest request){
    public String getProjectTypeItem(HttpServletRequest request) {
        try {
            // 获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
@@ -54,12 +55,13 @@
    /**
     * 获取项目信息(项目分项多个树)
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/get-projectItem/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String getProjectItem(HttpServletRequest request){
    public String getProjectItem(HttpServletRequest request) {
        try {
            // 获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
@@ -80,13 +82,14 @@
    }
    /**
     *     获取项目子表分项(单个树)
     * 获取项目子表分项(单个树)
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/get-projectAllItem/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String getProjectAllItem(HttpServletRequest request){
    public String getProjectAllItem(HttpServletRequest request) {
        try {
            // 获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
@@ -107,114 +110,120 @@
    }
    /**
     *     获取项目信息(无分页参数)
     * 获取项目信息(无分页参数)
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/list-project/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String listProject(HttpServletRequest request) {
        try {
            return OK_List(projectInfoService.listProject());
        } catch (BaseException e) {
        try {
            return OK_List(projectInfoService.listProject());
        } catch (BaseException e) {
            e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
        }
    }
    /**
     *     获取项目分析数据
     * 获取项目分析数据
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/statist-analysis-report/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String statistAnalysis(HttpServletRequest request) {
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
            //判断uuid是否为空
            if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECT_UUID))) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            return ResultInfo.success(projectInfoService.statistAnalysis(fse.getString(Cmnconst.PROJECT_UUID)));
            //判断uuid是否为空
            if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECT_UUID))) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            return ResultInfo.success(projectInfoService.statistAnalysis(fse.getString(Cmnconst.PROJECT_UUID)));
//            return OK_List(projectInfoService.statistAnalysis(fse.getString(Cmnconst.PROJECT_UUID)));
        } catch (BaseException e) {
        } catch (BaseException e) {
            e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
        }
    }
    /**
     *     删除单个项目分项验证(根据预算验证是否删除)
     * 删除单个项目分项验证(根据预算验证是否删除)
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/del-itemize-valdate/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String deleteItemizeValidate(HttpServletRequest request) {
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
            //判断uuid是否为空
            if (BaseUtil.strIsNull(fse.getUUID())) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            projectInfoService.deleteItemizeValidate(fse.getUUID());
            return OK();
        } catch (BaseException e) {
            //判断uuid是否为空
            if (BaseUtil.strIsNull(fse.getUUID())) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            projectInfoService.deleteItemizeValidate(fse.getUUID());
            return OK();
        } catch (BaseException e) {
            e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
        }
    }
    /**
     *     获取项目预算信息
     * 获取项目预算信息
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/list-itemize-budget/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String listItemizeBudget(HttpServletRequest request) {
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
            //判断uuid是否为空
            if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECT_UUID))) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            //判断uuid是否为空
            if (BaseUtil.strIsNull(fse.getString(Cmnconst.PROJECT_UUID))) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            //判断分页参数是否为空
            if (BaseUtil.strIsNull(fse.getString(CoreConst.CPAGE)) || BaseUtil.strIsNull(fse.getString(CoreConst.PAGESIZE))) {
                return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText());
            }
            return OK_List(projectInfoService.listItemizeBudget(fse.getString(Cmnconst.PROJECT_UUID), fse.getString(Cmnconst.ITEMIZE_CODE), fse.getInteger(CoreConst.CPAGE), fse.getInteger(CoreConst.PAGESIZE)));
        } catch (BaseException e) {
            //判断分页参数是否为空
            if (BaseUtil.strIsNull(fse.getString(CoreConst.CPAGE)) || BaseUtil.strIsNull(fse.getString(CoreConst.PAGESIZE))) {
                return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText());
            }
            return OK_List(projectInfoService.listItemizeBudget(fse.getString(Cmnconst.PROJECT_UUID), fse.getString(Cmnconst.ITEMIZE_CODE), fse.getInteger(CoreConst.CPAGE), fse.getInteger(CoreConst.PAGESIZE)));
        } catch (BaseException e) {
            e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
        }
    }
    /**
     *     获取项目分项材料
     * 获取项目分项材料
     *
     * @param request
     * @return
     */
@@ -244,14 +253,43 @@
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
        }
    }
    /**
     * 获取项目分项材料
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/find-inventory_v/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String findInventoryV(HttpServletRequest request) {
        try {
            //获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
            //判断仓库和材料是否为空
            if (BaseUtil.strIsNull(fse.getString("warehouse_uuid"))||BaseUtil.strIsNull(fse.getString("material_uuid"))) {
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            return OK_List(projectInfoService.findInventoryV(fse.getString("warehouse_uuid"), fse.getString("material_uuid")));
        } catch (BaseException e) {
            e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(),
                    SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage());
        }
    }
    /**
     * 根据uuid获取项目分项树结构详情
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/get-treeProjectItem/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String getTreeProjectItem(HttpServletRequest request){
    public String getTreeProjectItem(HttpServletRequest request) {
        try {
            // 获取参数
            FieldSetEntity fse = BaseUtil.getFieldSetEntity(request);
product-server-project-management/src/main/java/com/product/project/management/service/ProjectInfoService.java
@@ -6,7 +6,6 @@
import java.util.Map;
import com.alibaba.fastjson.JSONArray;
import com.product.core.websocket.config.CmnConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -209,7 +208,13 @@
    public DataTableEntity listMaterialV(String uuid, Integer capge, Integer pageSize) {
        return baseDao.listTable("product_project_base_material_v","project_itemize_uuid=?",new String[]{uuid},null,null,pageSize, capge);
    }
    /**
     * 更具仓库和材料获取库存
     * @return
     */
    public FieldSetEntity findInventoryV(String warehouse_uuid, String material_uuid) {
        return baseDao.getFieldSetByFilter("product_project_inventory_v","warehouse_uuid=? and uuid=?",new String[]{warehouse_uuid,material_uuid},false);
    }
    /**
     * 根据项目uuid获取项目分项树结构
     * @param uuid