Commit c3239d70 authored by wei's avatar wei 🎱

Merge remote-tracking branch 'origin/master'

parents a2fbc69b 9225cc85
...@@ -3,9 +3,15 @@ package com.yonde.dcs.plan.core.controller; ...@@ -3,9 +3,15 @@ package com.yonde.dcs.plan.core.controller;
import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO; import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO;
import com.yonde.dcs.plan.core.controller.shadow.ExtSupplierManageControllerShadow; import com.yonde.dcs.plan.core.controller.shadow.ExtSupplierManageControllerShadow;
import com.yonde.dcs.plan.core.service.ExtSupplierManageService; import com.yonde.dcs.plan.core.service.ExtSupplierManageService;
import com.yonde.dcs.plan.entity.po.ExtSupplierManage;
import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/** /**
...@@ -20,6 +26,15 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -20,6 +26,15 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller(ExtSupplierManageController.BEAN_NAME) @Controller(ExtSupplierManageController.BEAN_NAME)
public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extends ExtSupplierManageService<V>> extends ExtSupplierManageControllerShadow<V, S> { public class ExtSupplierManageController<V extends ExtSupplierManageVO, S extends ExtSupplierManageService<V>> extends ExtSupplierManageControllerShadow<V, S> {
@Autowired
private ExtSupplierManageService extSupplierManageService;
@ApiOperation("发起审批流程")
@PostMapping({"startWorkflow"})
public ApiResult startWorkflow(@RequestParam("id") Long id){
return ApiResult.ok(extSupplierManageService.startWorkflow(id),"操作完成");
}
} }
......
...@@ -11,4 +11,6 @@ import com.yonde.dcs.plan.core.service.shadow.ExtSupplierManageServiceShadow; ...@@ -11,4 +11,6 @@ import com.yonde.dcs.plan.core.service.shadow.ExtSupplierManageServiceShadow;
**/ **/
public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends ExtSupplierManageServiceShadow<V> { public interface ExtSupplierManageService<V extends ExtSupplierManageVO> extends ExtSupplierManageServiceShadow<V> {
ExtSupplierManageVO startWorkflow(Long id);
} }
...@@ -4,6 +4,8 @@ import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO; ...@@ -4,6 +4,8 @@ import com.yonde.dcs.plan.common.vo.ExtSupplierManageVO;
import com.yonde.dcs.plan.core.repository.ExtSupplierManageRepository; import com.yonde.dcs.plan.core.repository.ExtSupplierManageRepository;
import com.yonde.dcs.plan.core.service.ExtSupplierManageService; import com.yonde.dcs.plan.core.service.ExtSupplierManageService;
import com.yonde.dcs.plan.entity.po.ExtSupplierManage; import com.yonde.dcs.plan.entity.po.ExtSupplierManage;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -17,13 +19,26 @@ import org.springframework.stereotype.Service; ...@@ -17,13 +19,26 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
@Service(ExtSupplierManageServiceImpl.BEAN_NAME) @Service(ExtSupplierManageServiceImpl.BEAN_NAME)
public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> implements ExtSupplierManageService<V> { public class ExtSupplierManageServiceImpl<V extends ExtSupplierManageVO> implements ExtSupplierManageService<V> {
public static final String BEAN_NAME = "extSupplierManageServiceImpl"; public static final String BEAN_NAME = "extSupplierManageServiceImpl";
@Autowired
private WfcProcessFeign wfcProcessFeign;
@Autowired @Autowired
ExtSupplierManageRepository<ExtSupplierManage> extSupplierManageRepository; ExtSupplierManageRepository<ExtSupplierManage> extSupplierManageRepository;
@Override
public ExtSupplierManageVO startWorkflow(Long id) {
ExtSupplierManageVO extSupplierManageVO= get(id);
if (extSupplierManageVO == null) {
throw new DxBusinessException("500", "获取不到对象");
}
if (!extSupplierManageVO.getState().equals("edit")) {
throw new DxBusinessException("500", "该对象不是编制状态");
}
wfcProcessFeign.startProcessByKey("supplierQualificationReviewWF", extSupplierManageVO);
return this.changeStatus(extSupplierManageVO.getId(), "submitReviewing", true);
}
} }
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