zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package cn.autoform.web.controller.forminformation;
 
import java.util.List;
import java.util.concurrent.TimeoutException;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import cn.autoform.bean.page.PageResult;
import cn.autoform.db.entity.FormBaseEntity;
import cn.autoform.db.entity.FormSetEntity;
import cn.autoform.db.entity.FormSetInfoEntity;
import cn.autoform.db.entity.FormVersionEntity;
import cn.autoform.db.entity.TenantEntity;
import cn.autoform.fw.exception.FormClientException;
import cn.autoform.fw.exception.RestResult;
import cn.autoform.fw.utility.RestResultGenerator;
import cn.autoform.web.formula.info.Form;
import cn.autoform.web.request.FormBaseCopyRequestForm;
import cn.autoform.web.request.FormBaseUpdateRequestForm;
import cn.autoform.web.service.formtending.FormTendingService;
 
/**
 * 
 * @author huaixun.zhang
 *
 */
@RestController
public class FormInformationController {
    
    @Autowired
    private FormTendingService formTendingService = null;
    
    /**
     * 获取表单基本
     * @param tenantID
     * @param formID
     * @return 表单基本
     */
    @RequestMapping(value = "${requset.forminfomation01}", method = RequestMethod.POST)
    public RestResult<FormBaseEntity> getFormBaseInfoService(@RequestBody FormBaseEntity formBaseEntity) {
        FormBaseEntity entity = formTendingService.receiveFormBaseInfo(
                formBaseEntity.getTenantID(), formBaseEntity.getFormID());
        return RestResultGenerator.genSuccessResult(entity);
    }
    
    /**
     * 表单集合属性管理取出数据
     * @param tenantID
     * @param formSetid
     * @return 表单集合属性管理
     */
    @RequestMapping(value = "${requset.forminfomation02}", method = RequestMethod.POST)
    public RestResult<FormSetEntity> getFormSetInfoService(@RequestBody FormSetEntity formbaseEntity) {
        FormSetEntity entity = formTendingService.receiveFormSetInfo(
                formbaseEntity.getTenantID(), formbaseEntity.getFormSetID());
        return RestResultGenerator.genSuccessResult(entity);
    }
    
    /**
     * 表单集合取出数据
     * @param tenantID
     * @return 表单集合
     */
    @RequestMapping(value = "${requset.forminfomation03}", method = RequestMethod.POST)
    public  RestResult<PageResult<FormSetInfoEntity>> getFormSetListService(@RequestBody TenantEntity tenant) {
        PageResult<FormSetInfoEntity> listEntity = formTendingService.receiveFormSetListInfo(tenant.getTenantID(),
                tenant.getPageNum(),tenant.getPageSize(),tenant.getSelectName());
//        public  RestResult<List<PageResult<FormSetInfoEntity>>> getFormSetListService(@RequestBody TenantEntity tenant) {
//        System.out.println(tenant);
//        List<PageResult<FormSetInfoEntity>> listEntity = formTendingService.receiveFormSetListInfo(tenant.getTenantID(),tenant.getPageNum(),tenant.getPageSize());
        return RestResultGenerator.genSuccessResult(listEntity);
    }
    
    /**
     * 表单基本修正
     * @param entity
     * @return
     * @throws Exception 
     */
    @RequestMapping(value = "/forminfomation/modifyFormBaseService1", method = RequestMethod.POST)
    public  RestResult<Object> modifyFormBaseService1(@RequestBody FormBaseUpdateRequestForm entity) throws Exception {
        System.out.println("进入--------------------------------");
        formTendingService.updateFormBaseInfo(entity);
        return RestResultGenerator.genSuccessResult(null); 
    }
    
    
    /**
     * 表单基本修正
     * @param entity
     * @return
     * @throws Exception 
     */
    @RequestMapping(value = "${requset.forminfomation04}", method = RequestMethod.POST)
    public  RestResult<Object> modifyFormBaseService(@RequestBody FormBaseUpdateRequestForm entity) throws Exception{
        System.out.println("进入--------------------------------");
        formTendingService.updateFormBaseInfo1(entity);
        return RestResultGenerator.genSuccessResult(null); 
    }
    
    /**
     * 表单集合修正
     * @param entity
     * @return
     */
    @RequestMapping(value = "${requset.forminfomation05}", method = RequestMethod.POST)
    public RestResult<String> modifyFormSetService(@RequestBody FormSetEntity entity) {
        int nRs = formTendingService.updateFormSetInfo(entity);
        return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); 
    }
 
    /**
     * 表单基本复制
     * @param entity
     * @return
     */
    @RequestMapping(value = "${requset.forminfomation06}", method = RequestMethod.POST)
    public RestResult<String> copyFormBaseInfoService(@RequestBody FormBaseCopyRequestForm entity) {
        int nRs = formTendingService.copyFormBaseInfo(entity);
        return RestResultGenerator.genSuccessResult(String.valueOf(nRs));
    }
    
    @RequestMapping(value = "${requset.forminfomation07}", method = RequestMethod.POST)
    public RestResult<FormVersionEntity> getFormVersionInfoService(@RequestBody FormVersionEntity entity) {
        return RestResultGenerator.genSuccessResult(formTendingService.getFormVersionInfo(entity));
    }
    
    /**
     * 删除表单
     * @param entity
     * @return
     */
    @RequestMapping(value = "${requset.forminfomation08}", method = RequestMethod.POST)
    public RestResult<String> deleteFormSetService(@RequestBody FormSetEntity entity) {
        int nRs = formTendingService.deleteFormSet(entity);
        return RestResultGenerator.genSuccessResult(String.valueOf(nRs)); 
    }
}