许鹏程
2023-08-21 01e2c982dec2a55fb8666f8cc801dd1540fa62cd
src/main/java/com/product/mobile/core/controller/ContactPersonController.java
@@ -1,5 +1,6 @@
package com.product.mobile.core.controller;
import com.product.common.lang.StringUtils;
import com.product.core.config.CoreConst;
import com.product.core.controller.support.AbstractBaseController;
import com.product.core.entity.FieldSetEntity;
@@ -14,9 +15,9 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
 * 通迅录
 *
 * @Date 2022/3/3 19:54
 * @Desc
 */
@@ -24,19 +25,24 @@
@RequestMapping("/api/mobile")
public class ContactPersonController extends AbstractBaseController {
    @Autowired
    ContanctOrgListService contanctOrgListService;
   @Autowired
   ContanctOrgListService contanctOrgListService;
    @RequestMapping(value = "/contact/org/list/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String contactOrgList(HttpServletRequest request) {
        FieldSetEntity fse = null;
         Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
         if (bean != null) {
             RequestParameterEntity reqp = (RequestParameterEntity) bean;
             fse = reqp.getFormData();
         }
        return this.OK_List(contanctOrgListService.orgList(fse));
    }
   @RequestMapping(value = "/contact/org/list/{version}", method = RequestMethod.POST)
   @ApiVersion(1)
   public String contactOrgList(HttpServletRequest request) {
      FieldSetEntity fse = null;
      Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
      if (bean != null) {
         RequestParameterEntity reqp = (RequestParameterEntity) bean;
         fse = reqp.getFormData();
      }
      if (StringUtils.isEmpty(fse.getString("orgCode"))) {//延迟加载时,指定部门
         return this.OK_List(contanctOrgListService.orgList(fse));
      } else {
         return this.OK_List(contanctOrgListService.orgList(fse.getString("orgCode")));
      }
   }
}