shicf
2025-01-09 9b5da188281e5ae4b6fb6219c8813e2e02a2e617
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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;
import com.product.core.entity.RequestParameterEntity;
import com.product.mobile.core.service.ContanctOrgListService;
import com.product.module.sys.version.ApiVersion;
 
import javax.servlet.http.HttpServletRequest;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 通迅录
 * 
 * @Date 2022/3/3 19:54
 * @Desc
 */
@RestController
@RequestMapping("/api/mobile")
public class ContactPersonController extends AbstractBaseController {
 
    @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();
        }
        if (StringUtils.isEmpty(fse.getString("orgCode"))) {//延迟加载时,指定部门
            return this.OK_List(contanctOrgListService.orgList(fse));
        } else {
            return this.OK_List(contanctOrgListService.orgList(fse.getString("orgCode")));
        }
 
    }
 
}