Commit 27618cd1 authored by sml's avatar sml

bug修复及树删除和编辑

parent 0d912774
......@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.resource.ResourceHttpRequestHandler;
import com.alibaba.fastjson.JSONObject;
import com.jz.common.annotation.ResubmitCheck;
......@@ -25,6 +26,10 @@ import com.jz.common.constant.StatuConstant;
public class ResubmitCheckInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (handler instanceof ResourceHttpRequestHandler) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod)handler;
......
......@@ -7,9 +7,12 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.jz.common.annotation.MethodCallLogPrint;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.constant.StatuConstant;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeDto;
import com.jz.dmp.modules.controller.bean.DmpNavigationTreeRequest;
......@@ -17,6 +20,7 @@ import com.jz.dmp.modules.model.DmpNavigationTree;
import com.jz.dmp.modules.service.DmpNavigationTreeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
/**
......@@ -87,5 +91,56 @@ public class DmpNavigationTreeController {
return baseBeanResponse;
}
/**删除DMP资源导航树
* @param id
* @return
*/
@MethodCallLogPrint
@RequestMapping(method = RequestMethod.GET, value = "/deleteById")
@ApiOperation(value = "删除DMP资源导航树", notes = "删除DMP资源导航树")
@ApiImplicitParam(name = "id", value = "DMP资源导航树主键")
public BaseResponse deleteById(@RequestParam(name = "id", required = true ) Integer id, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
boolean flag = dmpNavigationTreeService.deleteById(id);
if (flag) {
baseResponse.setMessage("删除成功");
baseResponse.setCode(StatuConstant.SUCCESS_CODE);
} else {
baseResponse.setMessage("删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
}
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**修改DMP资源导航树
* @param dmpNavigationTreeRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping(method = RequestMethod.POST, value = "/edit")
@ApiOperation(value = "修改DMP资源导航树", notes = "修改DMP资源导航树")
public BaseBeanResponse<DmpNavigationTree> edit(@RequestBody DmpNavigationTree dmpNavigationTree, HttpServletRequest httpRequest){
BaseBeanResponse<DmpNavigationTree> baseBeanResponse = new BaseBeanResponse<DmpNavigationTree>();
try {
DmpNavigationTree dmpNavigationTreeDb = dmpNavigationTreeService.update(dmpNavigationTree);
baseBeanResponse.setMessage("修改成功");
baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseBeanResponse.setData(dmpNavigationTreeDb);
} catch (Exception e) {
baseBeanResponse.setMessage("修改失败");
baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
}
\ No newline at end of file
......@@ -1183,6 +1183,7 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
DmpNavigationTree dmpNavigationTree = dmpNavigationTreeDao.queryById(treeId.intValue());
Long projectId = Long.parseLong(dmpNavigationTree.getProjectId().toString());
flowPro.setPublishedToProjectId(projectId);
//提交发布任务流程
BaseResponse baseResponsePublish = flowService.publishFlow(flowPro);
if (StatuConstant.SUCCESS_CODE.equals(baseResponsePublish.getCode())) {
flowPro.setIsSubmit("1");
......
......@@ -82,6 +82,8 @@ public class DmpNavigationTreeServiceImpl extends BaseService implements DmpNavi
@Override
@Transactional(rollbackFor = Exception.class)
public DmpNavigationTree update(DmpNavigationTree dmpNavigationTree) {
dmpNavigationTree.setUpdateUserId(""+getHttpRequestUserId(null));
dmpNavigationTree.setUpdateTime(new Date());
this.dmpNavigationTreeDao.update(dmpNavigationTree);
return this.queryById(dmpNavigationTree.getId());
}
......
......@@ -13,6 +13,7 @@ import com.jz.common.utils.FlowParseTool;
import com.jz.common.utils.GZIPUtils;
import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowNodeChangeInfo;
import com.jz.dmp.modules.controller.DataIntegration.bean.flow.FlowPro;
import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoDto;
import com.jz.dmp.modules.dao.DmpProjectDao;
import com.jz.dmp.modules.dao.DmpWorkFlowSubmitDetailsDao;
import com.jz.dmp.modules.model.DmpProject;
......@@ -63,6 +64,7 @@ public class FlowServiceImpl implements FlowService {
Long publishedToProjectId = flowPro.getPublishedToProjectId();
DmpProject publishToProject = dmpProjectDao.get(publishedToProjectId);
DmpProjectSystemInfo publishToProjectSystemInfo = dmpProjectService.getProjectSystemInfo(publishedToProjectId);
//DmpProjectConfigInfoDto dmpProjectConfigInfoDto =
try {
FlowParseTool flowParseTool = new FlowParseTool(flowPro,
publishToProject,
......
......@@ -172,6 +172,9 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
if (dmpProjectConfigInfoRequest.getUpdateTimeEnd() != null) {
param.put("updateTimeEnd", dmpProjectConfigInfoRequest.getUpdateTimeEnd());
}
//加上可用标识(未软删除)
param.put("dataStatu", "1");
List<DmpProjectConfigInfoDto> list = dmpProjectConfigInfoMapper.findList(param);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment