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 searchFormFieldProperty(@RequestBody FormDataEntity formData){ return formDataService.searchFormData(formData); } @RequestMapping(FORM_DATA_SEARCH_LIST) public List> 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> 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 map){ return map.get("orderCode") !=null ?formDataService.selectDataRowNum(map):0; } /** * 查询表单单条 * @param formDataEntity * @return */ @RequestMapping(FORM_DATA_SELECT_ONE) public Map 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 map){ return formDataService.checkAsserFixedMoney(map); } /** *测试版 通过租户获取申请单列表 分页 */ @RequestMapping(FORM_DATA_SELECT_SQBYUSER) public Object selectDataByUserName(@RequestBody Map map){ return formDataService.selectDatasByUserName(map); } /** *测试版 通过报销单号查询报销单 入参 formId bussinessNumber */ @RequestMapping("form/select/bxBybussinessNumber") public Object selectBXByRow(@RequestBody Map map){ return formDataService.selectBXByRow(map); } /** * 计算费用后自动修改 */ @PostMapping("form/updata/automatic") public Integer updateSubFormData(@RequestBody Map map){ return formDataService.updateSubFormDat(map); } /** * 查询所有申请单 */ @PostMapping(FORM_SELECT_APPLY) public List> selectApply(@RequestBody ApplyCostForm applyCostForm){ return formDataService.selectApply(applyCostForm); } }