|
|
@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.organization.bo.OrganizationListOut;
|
|
|
@@ -44,4 +45,45 @@ public class OrganizationManagementController extends BaseApiController{
|
|
|
organizationService.addOrganization(name, managerId, type, superId, remarks);
|
|
|
return res;
|
|
|
}
|
|
|
+ /**负责人自动补全查询**/
|
|
|
+ @RequestMapping(value = "/selectName" , method = RequestMethod.POST)
|
|
|
+ public Result selectName(String name){
|
|
|
+ Result res = new Result();
|
|
|
+ res.setData(organizationService.selectName(name));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /**编辑页面数据读取**/
|
|
|
+ @RequestMapping(value = "/selectAllById" , method = RequestMethod.POST)
|
|
|
+ public OrganizationListOut selectAllById(String id){
|
|
|
+ OrganizationListOut res = organizationService.selectAllById(id);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /**修改信息**/
|
|
|
+ @RequestMapping(value = "/updateOrganization" , method = RequestMethod.POST)
|
|
|
+ public Result updateOrganization(String name, String type, String managerId, String superId, String status,
|
|
|
+ String remarks,String id){
|
|
|
+ Result res = new Result();
|
|
|
+ if(StringUtils.isBlank(name) || StringUtils.isBlank(type)
|
|
|
+ || StringUtils.isBlank(managerId)|| StringUtils.isBlank(superId)
|
|
|
+ || StringUtils.isBlank(status)|| StringUtils.isBlank(remarks)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ organizationService.updateOrganization(name, type, managerId, superId, status, remarks,id);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**删除列表信息**/
|
|
|
+ @RequestMapping(value = "/deleteById" , method = RequestMethod.POST)
|
|
|
+ public Result deleteById(String id){
|
|
|
+ Result res = new Result();
|
|
|
+ if(StringUtils.isBlank(id)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ organizationService.deleteById(id);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
}
|