shicf
2025-03-11 684c97f7c6ba1b5f2fff7a08410b385a3f0c4a8b
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package com.product.mobile.core.controller;
 
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;
 
import com.product.admin.service.PublicService;
import com.product.core.config.CoreConst;
import com.product.core.controller.support.AbstractBaseController;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.entity.RequestParameterEntity;
import com.product.core.exception.BaseException;
import com.product.core.spring.context.SpringMVCContextHolder;
import com.product.mobile.core.config.MobileCoreCode;
import com.product.mobile.core.service.CommonMVCService;
import com.product.mobile.core.service.NavBarManagerService;
import com.product.mobile.core.service.SignInService;
import com.product.module.sys.version.ApiVersion;
import com.product.org.admin.config.CmnCode;
 
/**
 *  手机端通用查询
 *
 * @author shicf
 */
@RequestMapping("/api/mobile")
@RestController
public class CommonMVCController extends AbstractBaseController {
    @Autowired
    PublicService publicService;
    @Autowired
    CommonMVCService commonMVCService;
    /**
     * 根据业务数据,查询是否有审批流程,
     * 有则返回业务审批流程其中一个uuid
     * 无则  返回业务数据,包括所有子表,数据结构
     * @param request
     * @return
     */
    @RequestMapping(value = "/find-table/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String listData(HttpServletRequest request) {
        FieldSetEntity fse = null;
        Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
        if (bean != null) {
            RequestParameterEntity reqp = (RequestParameterEntity) bean;
            fse = reqp.getFormData();
        }
        try {
            String flow_detail_uuid=commonMVCService.getApproveDetailUUID(fse.getTableName(),fse.getString("uuid"));
            if(flow_detail_uuid==null) {
                FieldSetEntity fs=publicService.getFieldSetEntity(fse, true);
                
                return this.result_OK_List(fs);
            }else {
                return this.OK_Add(flow_detail_uuid);
            }
        } catch (BaseException e) {
            return this.error(e);
        } catch (Exception e) {
            
            return this.error(MobileCoreCode.GET_DATA_FAIL);
        }
    }
    /**
     * 加载MVC,包括,当前按钮,按钮操作界面,界面后面的更按钮
     * ///查出MVC中按钮操作的界面,界面后面的所有按钮
     * 
     * @param request
     * @return
     */
    @RequestMapping(value = "/find-button-page/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String findMVC(HttpServletRequest request) {
        FieldSetEntity fse = null;
        Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
        if (bean != null) {
            RequestParameterEntity reqp = (RequestParameterEntity) bean;
            fse = reqp.getFormData();
        }
        try {
            return result_OK_List(commonMVCService.getPageButtons(fse));
        } catch (BaseException e) {
            e.printStackTrace();
            return this.error(e);
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(MobileCoreCode.GET_ROUTER_FAIL);
        }
    }
}