package com.changhong.epc.parsing.controller; import javax.annotation.Resource; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.changhong.epc.bean.parsing.BillInfo; import com.changhong.epc.bean.tenant.sunCloud.PushOrderBill; import com.changhong.epc.constter.parsing.auto.ParsingUrl; import com.changhong.epc.parsing.service.bill.BillInfoService; import com.changhong.epc.rely.api.service.CscApiService; import com.iemsoft.framework.cloud.core.tools.JSONTool; /** * 票据信息(bill_info)相关操作 * @author yuezhw * */ @RestController public class BillInfoController implements ParsingUrl{ @Resource private BillInfoService billInfoService; /** * 云尚行调用 * 返回OCR识别票据数据并添加到BillInfo表中 */ @RequestMapping(value=REST_TENANT_JSON_PUSHORDERBILL_ORIGINAL, method=RequestMethod.POST) public int billInfoInsert(@RequestParam("data") String data){ PushOrderBill pushOrderBill =JSONTool.toObj(data, PushOrderBill.class); return pushOrderBill != null ? billInfoService.billInfoInsert(pushOrderBill) :-1; } }