|
|
|
@ -2,6 +2,7 @@ package com.gaotao.modules.otherInbound.controller; |
|
|
|
|
|
|
|
import com.gaotao.common.utils.R; |
|
|
|
import com.gaotao.modules.otherInbound.service.OtherInboundService; |
|
|
|
import com.gaotao.modules.otherInbound.dao.OtherInboundMapper; |
|
|
|
import com.gaotao.modules.sys.controller.AbstractController; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -23,6 +24,9 @@ public class OtherInboundController extends AbstractController { |
|
|
|
@Autowired |
|
|
|
private OtherInboundService otherInboundService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private OtherInboundMapper otherInboundMapper; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取其他入库单列表 |
|
|
|
* 数据来源:inbound_notification_head表,类型为其他入库 |
|
|
|
@ -340,4 +344,38 @@ public class OtherInboundController extends AbstractController { |
|
|
|
return R.error("添加物料失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取用户默认打印机配置 |
|
|
|
* 根据 site、username、labelNo 查询配置的打印机名称 |
|
|
|
*/ |
|
|
|
@PostMapping("/getUserDefaultPrinter") |
|
|
|
@ApiOperation("获取用户默认打印机配置") |
|
|
|
public R getUserDefaultPrinter(@RequestBody Map<String, Object> params) { |
|
|
|
try { |
|
|
|
String username = (String) params.get("username"); |
|
|
|
String labelNo = (String) params.get("labelNo"); |
|
|
|
|
|
|
|
// 如果未传用户名,使用当前登录用户 |
|
|
|
if (username == null || username.trim().isEmpty()) { |
|
|
|
username = getUser().getUsername(); |
|
|
|
} |
|
|
|
|
|
|
|
// 查询用户的打印机配置 |
|
|
|
Map<String, Object> printerConfig = otherInboundMapper.getUserDefaultPrinter(username, labelNo); |
|
|
|
|
|
|
|
if (printerConfig != null && printerConfig.get("printerName") != null) { |
|
|
|
return R.ok() |
|
|
|
.put("printerName", printerConfig.get("printerName")) |
|
|
|
.put("printerIp", printerConfig.get("printerIp")) |
|
|
|
.put("labelNo", printerConfig.get("labelNo")); |
|
|
|
} |
|
|
|
|
|
|
|
// 没有配置打印机 |
|
|
|
return R.ok().put("printerName", null).put("printerIp", null); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("获取用户默认打印机配置失败", e); |
|
|
|
return R.error("获取打印机配置失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |