Commit 95567921 authored by 赵啸非's avatar 赵啸非

添加申报撤销接口

parent 55da12b8
...@@ -145,7 +145,10 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl ...@@ -145,7 +145,10 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
if(between > 30) throw new AppException("超过30分钟无法取消申报!"); if(between > 30) throw new AppException("超过30分钟无法取消申报!");
if(declareEntity.getDeclareStatus() != DeclareStatusEnum.草稿.getValue()) throw new AppException("当前申报不是草稿状态,不能撤销!"); if(declareEntity.getDeclareStatus() != DeclareStatusEnum.草稿.getValue()) throw new AppException("当前申报不是草稿状态,不能撤销!");
declareEntity.setDeclareStatus(DeclareStatusEnum.撤销.getValue());
declareEntity.setUpdateTime(new Date());
declareEntity.setUpdateUserId(this.getContextUserId(context));
this.update(declareEntity, context);
return Rest.ok("取消申报成功!"); return Rest.ok("取消申报成功!");
} }
} }
\ No newline at end of file
...@@ -2,10 +2,12 @@ package com.mortals.xhx.module.declare.web; ...@@ -2,10 +2,12 @@ package com.mortals.xhx.module.declare.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.DeclareStatusEnum; import com.mortals.xhx.common.code.DeclareStatusEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.declare.model.*; import com.mortals.xhx.module.declare.model.*;
import com.mortals.xhx.module.declare.service.DeclareFinImagesService; import com.mortals.xhx.module.declare.service.DeclareFinImagesService;
import com.mortals.xhx.module.declare.service.DeclareImagesService; import com.mortals.xhx.module.declare.service.DeclareImagesService;
...@@ -65,9 +67,10 @@ public class DeclareController extends BaseCRUDJsonBodyMappingController<Declare ...@@ -65,9 +67,10 @@ public class DeclareController extends BaseCRUDJsonBodyMappingController<Declare
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String busiDesc = "申报撤销" + this.getModuleDesc(); String busiDesc = "申报撤销" + this.getModuleDesc();
try { try {
Rest<String> rest = this.service.declareCancel(query, getContext());
if(YesNoEnum.NO.getValue()==rest.getCode()){
throw new AppException(rest.getMsg());
}
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "申报撤销成功!"); jsonObject.put(KEY_RESULT_MSG, "申报撤销成功!");
} catch (Exception e) { } catch (Exception e) {
......
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