| | |
| | | package com.jttech.pfcs.controller; |
| | | |
| | | import com.jttech.pfcs.services.ITradeService; |
| | | import com.jttech.pfcs.vo.ResponseVo; |
| | | import com.jttech.pfcs.vo.req.trade.ReqEPCSnglTranType; |
| | | import com.jttech.pfcs.vo.req.trade.ReqTranQryType; |
| | | import com.jttech.pfcs.vo.resp.RspEPCSnglTranType; |
| | | import com.jttech.pfcs.vo.resp.RspTranQryType; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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 com.jttech.pfcs.services.ITradeService; |
| | | import com.jttech.pfcs.vo.resp.ResponseVo; |
| | | |
| | | /** |
| | | * @author wanghc |
| | |
| | | |
| | | /** |
| | | * 单笔交易 |
| | | * @param reqVo |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @PostMapping("/epcSnglTran") |
| | | public ResponseVo epcSnglTran(@RequestBody ReqEPCSnglTranType reqVo) { |
| | | mLogger.info("TradeController.epcSnglTran req={}", reqVo); |
| | | @PostMapping("/excute") |
| | | public ResponseVo excute(String url, String content) { |
| | | mLogger.info("TradeController.excute excute={}", content); |
| | | final long beginTime = System.currentTimeMillis(); |
| | | ResponseVo result = new ResponseVo(); |
| | | try { |
| | | RspEPCSnglTranType body = mTradeService.epcSnglTran(reqVo); |
| | | String body = mTradeService.excute(url, content); |
| | | return result.setBody(body); |
| | | } finally { |
| | | final long endTime = System.currentTimeMillis(); |
| | | mLogger.info("Execute epcSnglTran the result is {} time spent is {} ", result, (endTime - beginTime)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 单笔交易 |
| | | * @param reqVo |
| | | * @return |
| | | */ |
| | | @PostMapping("/tranQry") |
| | | public ResponseVo tranQry(@RequestBody ReqTranQryType reqVo) { |
| | | mLogger.info("TradeController.tranQry req={}", reqVo); |
| | | final long beginTime = System.currentTimeMillis(); |
| | | ResponseVo result = new ResponseVo(); |
| | | try { |
| | | RspTranQryType body = mTradeService.tranQry(reqVo); |
| | | return result.setBody(body); |
| | | } finally { |
| | | final long endTime = System.currentTimeMillis(); |
| | | mLogger.info("Execute tranQry the result is {} time spent is {} ", result, (endTime - beginTime)); |
| | | mLogger.info("Execute excute the result is {} time spent is {} ", result, (endTime - beginTime)); |
| | | } |
| | | } |
| | | } |