|
|
@ -16,6 +16,7 @@ import com.hfkj.service.BsDeviceService; |
|
|
|
import com.hfkj.service.merchant.BsMerchantService; |
|
|
|
import com.hfkj.service.merchant.BsMerchantService; |
|
|
|
import com.hfkj.sysenum.DeviceReceiptOutContentEnum; |
|
|
|
import com.hfkj.sysenum.DeviceReceiptOutContentEnum; |
|
|
|
import com.hfkj.sysenum.DeviceTypeEnum; |
|
|
|
import com.hfkj.sysenum.DeviceTypeEnum; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.MerchantSourceTypeEnum; |
|
|
|
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
|
|
|
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -95,6 +96,21 @@ public class BsDeviceController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeviceReceiptOutContentEnum receiptOutContent = null; |
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
param.put("type", DeviceTypeEnum.type1.getType()); |
|
|
|
|
|
|
|
param.put("merNo", body.getMerNo()); |
|
|
|
|
|
|
|
// 查询设备
|
|
|
|
|
|
|
|
List<BsDevice> deviceList = deviceService.getDeviceList(param); |
|
|
|
|
|
|
|
if (!deviceList.isEmpty()) { |
|
|
|
|
|
|
|
// 查询设备的设置
|
|
|
|
|
|
|
|
receiptOutContent = DeviceReceiptOutContentEnum.getDataByType(deviceList.get(0).getReceiptOutContent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (receiptOutContent == null) { |
|
|
|
|
|
|
|
receiptOutContent = DeviceReceiptOutContentEnum.content2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
device.setMerId(merchant.getId()); |
|
|
|
device.setMerId(merchant.getId()); |
|
|
|
device.setMerNo(merchant.getMerNo()); |
|
|
|
device.setMerNo(merchant.getMerNo()); |
|
|
|
device.setMerName(merchant.getMerName()); |
|
|
|
device.setMerName(merchant.getMerName()); |
|
|
@ -104,7 +120,7 @@ public class BsDeviceController { |
|
|
|
device.setDeviceKey(body.getDeviceKey()); |
|
|
|
device.setDeviceKey(body.getDeviceKey()); |
|
|
|
device.setDeviceImei(body.getDeviceImei()); |
|
|
|
device.setDeviceImei(body.getDeviceImei()); |
|
|
|
device.setDeviceIccid(body.getDeviceIccid()); |
|
|
|
device.setDeviceIccid(body.getDeviceIccid()); |
|
|
|
device.setReceiptOutContent(body.getReceiptOutContent()==null?DeviceReceiptOutContentEnum.content2.getType():body.getReceiptOutContent()); |
|
|
|
device.setReceiptOutContent(receiptOutContent.getType()); |
|
|
|
device.setReceiptTop(body.getReceiptTop()); |
|
|
|
device.setReceiptTop(body.getReceiptTop()); |
|
|
|
device.setReceiptSource(body.getReceiptSource()); |
|
|
|
device.setReceiptSource(body.getReceiptSource()); |
|
|
|
device.setReceiptBottom(body.getReceiptBottom()); |
|
|
|
device.setReceiptBottom(body.getReceiptBottom()); |
|
|
@ -206,6 +222,32 @@ public class BsDeviceController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getSettingReceipt",method = RequestMethod.GET) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "查询小票打印内容") |
|
|
|
|
|
|
|
public ResponseData getSettingReceipt(@RequestParam(name = "merNo", required = true) String merNo) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
DeviceReceiptOutContentEnum receiptOutContent = null; |
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
param.put("type", DeviceTypeEnum.type1.getType()); |
|
|
|
|
|
|
|
param.put("merNo", merNo); |
|
|
|
|
|
|
|
// 查询设备
|
|
|
|
|
|
|
|
List<BsDevice> deviceList = deviceService.getDeviceList(param); |
|
|
|
|
|
|
|
if (!deviceList.isEmpty()) { |
|
|
|
|
|
|
|
// 查询设备的设置
|
|
|
|
|
|
|
|
receiptOutContent = DeviceReceiptOutContentEnum.getDataByType(deviceList.get(0).getReceiptOutContent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (receiptOutContent == null) { |
|
|
|
|
|
|
|
receiptOutContent = DeviceReceiptOutContentEnum.content2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return ResponseMsgUtil.success(receiptOutContent.getType()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("HighDeviceController -> settingReceipt() error!",e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/settingReceipt",method = RequestMethod.POST) |
|
|
|
@RequestMapping(value="/settingReceipt",method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "设置小票打印内容") |
|
|
|
@ApiOperation(value = "设置小票打印内容") |
|
|
|