| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- package com.persagy.fm.sop.controller;
- import com.alibaba.fastjson.JSONObject;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- import com.persagy.common.exception.BusinessException;
- import com.persagy.fm.common.old.utils.StringUtil;
- import com.persagy.fm.common.old.utils.ToolsUtil;
- import com.persagy.fm.common.validator.Insert;
- import com.persagy.fm.common.validator.Update;
- import com.persagy.fm.sop.model.dto.RefedSopBean;
- import com.persagy.fm.sop.model.dto.SopBean;
- import com.persagy.fm.sop.model.vo.*;
- import com.persagy.fm.sop.service.IGroupSopService;
- import com.persagy.fm.sop.utils.OldResponseResult;
- import com.persagy.fm.sop.utils.OldResponseResultUtil;
- import com.persagy.fm.sop.service.IObjectService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.transaction.annotation.Transactional;
- import org.springframework.validation.annotation.Validated;
- 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 java.util.ArrayList;
- /**
- * 集团SOP业务
- * @author lijie
- * @since 2021-03-31 18:08:21
- */
- @Slf4j
- @RequiredArgsConstructor
- @RestController
- @RequestMapping("/restGroupSopService/")
- @Api("集团SOP业务")
- public class GroupSopController {
- private final IGroupSopService groupSopService;
- private final IObjectService objectService;
- /**
- * Description: 集团sop-新增页-添加发布状态sop
- * @param saveSopVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/3/31 20:46
- * Update By lijie 2021/3/31 20:46
- */
- @ApiOperation("集团sop-新增页-添加发布状态sop")
- @PostMapping("addPublishedSop")
- @Transactional(rollbackFor = BusinessException.class)
- public OldResponseResult<Void> addPublishedSop(@RequestBody @Validated(Insert.class) SaveSopVo saveSopVo) throws Exception {
- groupSopService.addPublishedSop(saveSopVo);
- return OldResponseResultUtil.successResult(new ArrayList<>());
- }
- /***
- * Description: 集团sop-编辑页-编辑sop时验证sop名称
- * @param queryVerifySopNameBaseVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/2 11:51
- * Update By lijie 2021/4/2 11:51
- */
- @ApiOperation("集团sop-编辑页-编辑sop时验证sop名称")
- @PostMapping("verifySopNameForUpdate")
- public OldResponseResult<VerifySopNameVo> verifySopNameForUpdate(
- @RequestBody @Validated(Update.class) QueryVerifySopNameBaseVo queryVerifySopNameBaseVo) throws Exception{
- return OldResponseResultUtil.successResult(groupSopService.verifySopNameForUpdate(queryVerifySopNameBaseVo));
- }
- /***
- * Description: 新增页:查询可供选择的sop,复制、引用时用
- * @param queryVerifySopNameBaseVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/2 14:13
- * Update By lijie 2021/4/2 14:13
- */
- @ApiOperation("新增页:查询可供选择的sop,复制、引用时用")
- @PostMapping("verifySopNameForAdd")
- public OldResponseResult<VerifySopNameVo> verifySopNameForAdd(
- @RequestBody @Validated(Insert.class) QueryVerifySopNameBaseVo queryVerifySopNameBaseVo) throws Exception{
- return OldResponseResultUtil.successResult(groupSopService.verifySopNameForAdd(queryVerifySopNameBaseVo));
- }
- /***
- * Description: 集团sop-新增页-添加草稿状态sop
- * @param saveSopVo : 保存SOP的参数
- * @return : com.persagy.fm.sop.utils.OldResponseResult<com.persagy.fm.sop.model.vo.QuerySopVo>
- * @author : lijie
- * @date :2021/4/2 14:30
- * Update By lijie 2021/4/2 14:30
- */
- @ApiOperation("集团sop-新增页-添加草稿状态sop")
- @PostMapping("/addDraftSop")
- @Transactional(rollbackFor = BusinessException.class)
- public OldResponseResult<QuerySopVo> addDraftSop(@RequestBody @Validated SaveSopVo saveSopVo) throws Exception{
- return OldResponseResultUtil.successResult(groupSopService.addDraftSop(saveSopVo));
- }
- /***
- * Description: 集团sop-编辑页-发布sop
- * @param saveSopVo : 更新的SOP的参数
- * @return : com.persagy.fm.sop.utils.OldResponseResult<com.persagy.fm.sop.model.vo.QuerySopVo>
- * @author : lijie
- * @date :2021/4/8 14:05
- * Update By lijie 2021/4/8 14:05
- */
- @ApiOperation("集团sop-编辑页-发布sop")
- @Transactional(rollbackFor = BusinessException.class)
- @PostMapping("/publishSop")
- public OldResponseResult<QuerySopVo> publishSop(@RequestBody @Validated(Update.class) SaveSopVo saveSopVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.publishSop(saveSopVo));
- }
- /***
- * Description: 集团sop-编辑页-保存草稿状态sop
- * @param saveSopVo : 保存SOP的参数
- * @return : com.persagy.fm.sop.utils.OldResponseResult<com.persagy.fm.sop.model.vo.QuerySopVo>
- * @author : lijie
- * @date :2021/4/8 17:24
- * Update By lijie 2021/4/8 17:24
- */
- @ApiOperation("集团sop-编辑页-保存草稿状态sop")
- @Transactional
- @PostMapping("/saveDraftSop")
- public OldResponseResult<QuerySopVo> saveDraftSop(@RequestBody @Validated SaveSopVo saveSopVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.saveDraftSop(saveSopVo));
- }
- /***
- * Description: 集团sop-新增页-验证sop
- * @param saveSopVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/2 15:28
- * Update By lijie 2021/4/2 15:28
- */
- @ApiOperation("集团sop-新增页-验证sop")
- @PostMapping("/verifySopBeforePublish")
- public OldResponseResult<String> verifySopBeforePublish(@RequestBody @Validated SaveSopVo saveSopVo) throws Exception{
- return OldResponseResultUtil.successResult(groupSopService.verifySopBeforePublish(saveSopVo));
- }
- /***
- * Description: 集团sop-列表页:查询已发布的sop列表
- * @param queryPublishedListVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/10 15:56
- * Update By lijie 2021/4/10 15:56
- */
- @ApiOperation("集团sop-查询已发布的sop列表 ")
- @PostMapping("/queryPublishedSopList")
- public OldResponseResult<PublishedListVo> queryPublishedSopList(@RequestBody @Validated QueryPublishedListVo queryPublishedListVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.queryPublishedSopList(queryPublishedListVo));
- }
- /***
- * Description: 集团sop-列表页 查询编辑中的sop列表
- * @param queryPublishedListBaseVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/10 18:22
- * Update By lijie 2021/4/10 18:22
- */
- @ApiOperation("集团sop-列表页 查询编辑中的sop列表")
- @PostMapping("/queryEditingSopList")
- @JsonIgnoreProperties({"project_id", "extend_field", "operator_id",
- "operator_name", "sop_type","no_obj",
- "related_data", "sop_status", "publish_status",
- "version_count", "version_explain", "create_time",
- "valid", "domains", "order_type", "tools",
- "fit_objs", "equip_model_ids", "labels",
- "steps", "step_count", "stauts_explain"})
- public OldResponseResult<SopBean> queryEditingSopList(@RequestBody @Validated QueryPublishedListBaseVo queryPublishedListBaseVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.queryEditingSopList(queryPublishedListBaseVo));
- }
- /***
- * Description: 集团sop-列表页 查询已作废中的sop列表
- * @param queryPublishedListBaseVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/10 18:37
- * Update By lijie 2021/4/10 18:37
- */
- @PostMapping("/queryDestroyedSopList")
- @JsonIgnoreProperties({"project_id", "extend_field", "operator_id",
- "operator_name", "sop_type","no_obj",
- "related_data", "sop_status", "publish_status",
- "version_count", "version_explain", "create_time",
- "valid", "domains", "order_type", "tools",
- "fit_objs", "equip_model_ids", "labels",
- "steps", "step_count", "stauts_explain"})
- public OldResponseResult<SopBean> queryDestroyedSopList(@RequestBody @Validated QueryPublishedListBaseVo queryPublishedListBaseVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.queryDestroyedSopList(queryPublishedListBaseVo));
- }
- /***
- * Description: 新增页:查询可供选择的sop,复制、引用时用
- * @param queryPublishedSelVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/14 12:23
- * Update By lijie 2021/4/14 12:23
- */
- @ApiOperation("新增页:查询可供选择的sop,复制、引用时用")
- @PostMapping("/querySopListForSel")
- public OldResponseResult<PublishedListVo> querySopListForSel(@RequestBody @Validated QueryPublishedSelVo queryPublishedSelVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.querySopListForSel(queryPublishedSelVo));
- }
- /***
- * Description: 详细页-查询当前sop被引用的sop列表
- * @param queryReferencedSopVo : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/19 10:46
- * Update By lijie 2021/4/19 10:46
- */
- @PostMapping("/queryReferencedSopListById")
- public OldResponseResult<RefedSopBean> queryReferencedSopListById(@RequestBody @Validated QueryReferencedSopVo queryReferencedSopVo) throws Exception {
- return OldResponseResultUtil.successResult(groupSopService.queryReferencedSopListById(queryReferencedSopVo));
- }
- /***
- * Description: 集团sop-新增页-对象选择:搜索物理世界对象大类
- * @param jsonObject : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/19 11:54
- * Update By lijie 2021/4/19 11:54
- */
- @PostMapping("/searchObjectClass")
- public String searchObjectClass(@RequestBody JSONObject jsonObject) throws Exception {
- if(StringUtil.isNull(jsonObject, "user_id") ){
- return ToolsUtil.return_error_json;
- }
- return objectService.searchObjectClass(jsonObject.toJSONString());
- }
- /***
- * Description: 集团sop-新增页-信息点选择:搜索对象大类信息点
- * @param jsonObject : 请求参数
- * @return : java.lang.String
- * @author : lijie
- * @date :2021/4/19 12:00
- * Update By lijie 2021/4/19 12:00
- */
- @PostMapping("/searchClassInfoPoint")
- public String searchClassInfoPoint(@RequestBody JSONObject jsonObject) throws Exception {
- if(StringUtil.isNull(jsonObject, "user_id") ){
- return ToolsUtil.return_error_json;
- }
- return objectService.searchClassInfoPoint(jsonObject.toJSONString());
- }
-
- }
|