package com.changhong.epc.form.rest.budget; import com.changhong.autoform.entity.WorkFlowStateEntity; import com.changhong.epc.bean.PageResult; import com.changhong.epc.bean.form.BorrowType; import com.changhong.epc.constter.form.utf.FormUrlConst; import com.changhong.epc.form.mapper.tenant.log.OperationLogMapper; import com.changhong.epc.form.service.budget.CheckFormDataServes; import com.changhong.epc.form.service.budget.department.model.BudgetExtend; import com.changhong.epc.rely.api.bean.report.OperationLog; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.sql.Timestamp; import java.util.List; import java.util.Map; @RestController @Slf4j public class CheckFormDataController implements FormUrlConst { @Resource private CheckFormDataServes checkFormDataServes; @Resource private OperationLogMapper operationLogMapper; @PostMapping(CHECK_FORM_DATA_ALL) public Object checkFormData(@RequestBody WorkFlowStateEntity workFlowStateEntity) { // System.out.println("验证入参:::::::::::::::"); // System.out.println(JSONTool.toJson(workFlowStateEntity)); return checkFormDataServes.checkData(workFlowStateEntity); } @PostMapping(CHECK_REIMBURSEMENT_DATA_ALL) public Integer checkReimbursement(@RequestBody Map param) { String borrowMoneyUser = param.get("borrowMoneyUser"); BorrowType borrowType = BorrowType.valueOf(param.get("borrowType")); return checkFormDataServes.checkReimbursement(borrowMoneyUser, borrowType); } /** * 合同付款阶段金额汇总 */ @PostMapping(FORM_DATA_BUDGET_GETSUMALREADYPAID) public List> getSumAlreadyPaid(@RequestBody BudgetExtend budgetExtend) { return checkFormDataServes.getSumAlreadyPaid(budgetExtend); } @RequestMapping(value = OPERATION_LOG_SHOW, produces = MediaType.APPLICATION_JSON_VALUE) public List queryFormDataPage(@RequestBody Map operationLog) { log.debug("查询日志断点调试-------------"); Integer pageNum = ((Integer) operationLog.get("pageNum")); Integer pageSize = ((Integer) operationLog.get("pageSize")); //------------------------- OperationLog olog = new OperationLog(); olog.setPageNum(pageNum); olog.setPageSize(pageSize); olog.setCompanyName(((Map) operationLog.get("seach")).get("companyName")); olog.setTenantName(((Map) operationLog.get("seach")).get("tenantName")); String startTime = ((Map) operationLog.get("seach")).get("startTime"); String endTime = ((Map) operationLog.get("seach")).get("endTime"); olog.setBeginTime(StringUtils.isNotBlank(startTime) ? Timestamp.valueOf(startTime) : null); olog.setEndTime(StringUtils.isNotBlank(endTime) ? Timestamp.valueOf(endTime) : null); olog.setFormId(((Map) operationLog.get("seach")).get("billNumber")); //------------------------- //分页查询 int pageStart = (pageNum-1)*pageSize; List logObj = operationLogMapper.select(olog,pageStart,pageSize); log.debug("查询到的分页信息------{}",logObj); // Integer num = operationLogMapper.selectNum(olog); // PageResult pageResult=new PageResult<>(); // pageResult.setData(logObj); // pageResult.setRow(Long.valueOf(num)); // log.debug("查询到的分页信息------{}",pageResult); return logObj; //------------------------- } }