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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package com.changhong.epc.form.rest.data;
 
 
 
import com.changhong.epc.bean.form.ApplyCostForm;
import com.changhong.epc.bean.form.CheckBuget;
import com.changhong.epc.bean.form.FormDataEntity;
import com.changhong.epc.bean.form.ProcessState;
import com.changhong.epc.bean.form.budget.addBudget.AddBudget;
import com.changhong.epc.bean.parsing.BillInfo;
import com.changhong.epc.constter.form.utf.FormUrlConst;
import com.changhong.epc.form.service.budget.department.util.FormCheck;
import com.changhong.epc.form.service.data.FormDataService;
import com.iemsoft.framework.cloud.core.thread.Keys;
import com.iemsoft.framework.cloud.core.thread.ThreadData;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping(method=RequestMethod.POST)
public class FormDataRest implements FormUrlConst{
    
    
    @Resource
    private FormCheck form;
    
    
    
    @Resource
    private FormDataService formDataService;
    
    @RequestMapping(FORM_DATA_SEARCH)
    public Map<String,Object> searchFormFieldProperty(@RequestBody FormDataEntity formData){
        return formDataService.searchFormData(formData);
    }
    
    @RequestMapping(FORM_DATA_SEARCH_LIST)
    public List<Map<String,Object>> searchFormFieldPropertys(@RequestBody FormDataEntity formData){
        return formDataService.searchFormDataList(formData);
    }
    
    
    @RequestMapping(FORM_DATA_URL)
    public Integer deleteFormFieldProperty(@RequestBody FormDataEntity formData){
        return formDataService.deleteFormData(formData);
    }
    
    @RequestMapping(FORM_DATA_INSERT)
    public List<Map<String,Object>>  insertFormFieldProperty(@RequestBody FormDataEntity formData){
         formDataService.insertFormData(formData);
         return formData.getData();
    }
    
    @RequestMapping(FORM_DATA_UPDATE)
    public Integer updateFormFieldProperty(@RequestBody FormDataEntity formData){
        return formDataService.updateFormData(formData);
    }
    
    @RequestMapping(CHECK_BUGET)
    public String checkBugetData(@RequestBody CheckBuget checkBuget) {
//        return "true";
        return formDataService.checkBugetData(checkBuget);
    }
    
    @RequestMapping(FORM_STATUS)
        public int updateFormStatus(@RequestBody CheckBuget checkBuget) {
        return formDataService.updateExpendFormState(checkBuget.getVoucherCode(),checkBuget.getFormID()
                                                    ,Integer.parseInt(checkBuget.getDataRowNum())
                                                    ,checkBuget.getStatus()
                                                    ,checkBuget.getTenantID());
    }
    
    @RequestMapping(UPDATA_BILLINFO_AND_FORM)
    public int updateFormAndBillInfo(@RequestBody BillInfo billInfo) {
        return billInfo != null ? formDataService.updateFormAndBillInfo(billInfo) : -1;
    }
    
    @RequestMapping(SELECT_DATAROWNUM)
    public int selectDataRowNum(@RequestBody Map<String,Object> map){
        return map.get("orderCode") !=null ?formDataService.selectDataRowNum(map):0;
    }
 
    /**
     * 查询表单单条
     * @param formDataEntity
     * @return
     */
    @RequestMapping(FORM_DATA_SELECT_ONE)
    public Map<String, Object> selectFormDataOne(@RequestBody FormDataEntity formDataEntity){
        return formDataService.selectFormDataOne(formDataEntity);
    }
    
    /**
     * 修改主表,子表单数据
     */
    @RequestMapping(FORM_DATA_UPDATFORM)
    public Integer updateFormData(@RequestBody FormDataEntity formData){
        return formDataService.updateForm(formData);
    }
    
    /**
     * 修改流程大状态
     */
    @RequestMapping(FORM_DATA_UPDATESTATE)
    public Integer updateState(@RequestBody ProcessState process){
        //return 1;
        return formDataService.updateState(process);
    }
    
    /*
     * 查询流程大状态
     */
    @RequestMapping(FORM_DATA_SELECTSTATE)
    public ProcessState selectState(@RequestBody ProcessState process){
//        ProcessState a = new ProcessState();
//        a.setProcessLog("[11,22,33]:10,[33,22]20");
//        a.setProcessTask("[001],[002]");
//        return a;
        return formDataService.selectState(process);
    }
    
    @RequestMapping(FORM_DATA_SELECTCOUNTMONEY)
    public Object selectCountMoney(@RequestBody FormDataEntity formData){
        return formDataService.selectCountMoney(formData);
    }
 
    /**
     * 追加预算检查上级预算余额
     * @param addBudget
     * @return Object
     */
    @RequestMapping(FORM_DATA_CHECK_SUPERBUDGETMONEY)
    public Object checkSuperBudgetMoney(@RequestBody AddBudget addBudget){
        return formDataService.checkSuperBudgetMoney(addBudget);
    }
    
    /**
     *固定资产报销单报销余额校验 
     * 
     */
    @RequestMapping(FORM_DATA_CHECK_ASSETFIXED)
    public Object checkAsserFixedMoney(@RequestBody Map<String,String> map){
        return formDataService.checkAsserFixedMoney(map);
    }
    
    
    
    /**
     *测试版 通过租户获取申请单列表 分页 
     */
    @RequestMapping(FORM_DATA_SELECT_SQBYUSER)
    public Object selectDataByUserName(@RequestBody Map<String,String> map){
        return formDataService.selectDatasByUserName(map);
    }
    
 
    /**
     *测试版 通过报销单号查询报销单 入参  formId bussinessNumber  
     */
    @RequestMapping("form/select/bxBybussinessNumber")
    public Object selectBXByRow(@RequestBody Map<String,String> map){
        return formDataService.selectBXByRow(map);
    }
 
 
    /**
     * 计算费用后自动修改
     */
    @PostMapping("form/updata/automatic")
    public Integer updateSubFormData(@RequestBody Map<String,Object> map){
        return formDataService.updateSubFormDat(map);
    }
 
 
    /**
     * 查询所有申请单
     */
    @PostMapping(FORM_SELECT_APPLY)
    public List<Map<String,Object>> selectApply(@RequestBody ApplyCostForm applyCostForm){
        return formDataService.selectApply(applyCostForm);
    }
 
 
}