| | |
| | | package com.jilongda.manage.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.jilongda.common.Ticket.TicketUtil; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.jilongda.manage.model.TTicket; |
| | | import com.jilongda.manage.query.TWarehousingDetailQuery; |
| | | import com.jilongda.manage.query.TicketQuery; |
| | | import com.jilongda.manage.service.TStoreService; |
| | | import com.jilongda.manage.service.TTicketService; |
| | | import com.jilongda.manage.vo.TFrameWarehousingDetailVO; |
| | | import com.jilongda.manage.vo.TTicketVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import sun.security.krb5.internal.Ticket; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class TTicketController { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private TTicketService tTicketService; |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | |
| | | @ApiOperation(value = "小票机列表") |
| | | @PostMapping(value = "/pageList") |
| | |
| | | @ApiOperation(value = "小票机添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TTicket dto) { |
| | | TStore store = storeService.getById(dto.getStoreId()); |
| | | String res = TicketUtil.addprinter(dto.getCloudId() + "#" + dto.getSecret() + "#" + store.getName()); |
| | | JSONObject result = JSONObject.parseObject(res); |
| | | if (!result.getString("msg").equals("ok")){ |
| | | return ApiResult.failed(result.getString("msg")); |
| | | } |
| | | tTicketService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | |
| | | @ApiOperation(value = "小票机编辑") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TTicket dto) { |
| | | TStore store = storeService.getById(dto.getStoreId()); |
| | | String res = TicketUtil.editprinter(dto.getCloudId()+"",store.getName()); |
| | | JSONObject result = JSONObject.parseObject(res); |
| | | if (!result.getString("msg").equals("ok")){ |
| | | return ApiResult.failed(result.getString("msg")); |
| | | } |
| | | tTicketService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |