|
|
@@ -873,9 +873,9 @@ public class MesProductStorageRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取产品型号列表
|
|
|
+ * 获取产品型号列表(安卓端 anon 访问,跟610对齐)
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductStorageRecord:view")
|
|
|
+// @RequiresPermissions("mes:mesProductStorageRecord:view")
|
|
|
@RequestMapping(value = "getProductModelList")
|
|
|
@ResponseBody
|
|
|
public CommonResp<List<MesProductModel>> getProductModelList() {
|
|
|
@@ -897,9 +897,9 @@ public class MesProductStorageRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 验证产品二维码
|
|
|
+ * 验证产品二维码(安卓端 anon 访问,跟610对齐)
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductStorageRecord:edit")
|
|
|
+// @RequiresPermissions("mes:mesProductStorageRecord:edit")
|
|
|
@RequestMapping(value = "validateProductQr")
|
|
|
@ResponseBody
|
|
|
public CommonResp<String> validateProductQr(HttpServletRequest request) {
|
|
|
@@ -1049,9 +1049,9 @@ public class MesProductStorageRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 保存入库数据
|
|
|
+ * 保存入库数据(安卓端 anon 访问,跟610对齐)
|
|
|
*/
|
|
|
- @RequiresPermissions("mes:mesProductStorageRecord:edit")
|
|
|
+// @RequiresPermissions("mes:mesProductStorageRecord:edit")
|
|
|
@RequestMapping(value = "saveStorage")
|
|
|
@ResponseBody
|
|
|
public CommonResp<String> saveStorage(@RequestBody Map<String, Object> requestData) {
|
|
|
@@ -1127,5 +1127,108 @@ public class MesProductStorageRecordController extends BaseController {
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 包装入库列表(安卓端,按托盘码分组)
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "appList")
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResp<Map<String, Object>> appList(HttpServletRequest request) {
|
|
|
+ CommonResp<Map<String, Object>> resp = new CommonResp<>();
|
|
|
+ try {
|
|
|
+ String pageNo = request.getParameter("pageNo");
|
|
|
+ String pageSize = request.getParameter("pageSize");
|
|
|
+ int pNo = StringUtils.hasText(pageNo) ? Integer.parseInt(pageNo) : 1;
|
|
|
+ int pSize = StringUtils.hasText(pageSize) ? Integer.parseInt(pageSize) : 10;
|
|
|
+ int offset = (pNo - 1) * pSize;
|
|
|
+
|
|
|
+ // 按托盘码分组查询
|
|
|
+ List<Map<String, Object>> list = jdbcTemplate.queryForList(
|
|
|
+ "SELECT batch_sn AS batchSn, product_model AS productModel, COUNT(*) AS count, MAX(create_date) AS createDate " +
|
|
|
+ "FROM mes_product_storage_record WHERE bind = '1' AND batch_sn IS NOT NULL AND batch_sn != '' " +
|
|
|
+ "GROUP BY batch_sn, product_model ORDER BY MAX(create_date) DESC LIMIT ? OFFSET ?",
|
|
|
+ pSize, offset
|
|
|
+ );
|
|
|
+
|
|
|
+ // 查询总数
|
|
|
+ Integer total = jdbcTemplate.queryForObject(
|
|
|
+ "SELECT COUNT(DISTINCT batch_sn) FROM mes_product_storage_record WHERE bind = '1' AND batch_sn IS NOT NULL AND batch_sn != ''",
|
|
|
+ Integer.class
|
|
|
+ );
|
|
|
+
|
|
|
+ Map<String, Object> resultData = MapUtils.newHashMap();
|
|
|
+ resultData.put("list", list);
|
|
|
+ resultData.put("count", total != null ? total : 0);
|
|
|
+
|
|
|
+ resp.setData(resultData);
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
+ resp.setMessage("操作成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("查询包装入库列表失败", e);
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("查询失败");
|
|
|
+ }
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 包装入库详情(安卓端,根据托盘码查看绑定的工件)
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "appDetail")
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResp<Map<String, Object>> appDetail(HttpServletRequest request) {
|
|
|
+ CommonResp<Map<String, Object>> resp = new CommonResp<>();
|
|
|
+ String batchSn = request.getParameter("batchSn");
|
|
|
+ if (!StringUtils.hasText(batchSn)) {
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("托盘码为空");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ MesProductStorageRecord query = new MesProductStorageRecord();
|
|
|
+ query.setBatchSn(batchSn);
|
|
|
+ query.setBind("1");
|
|
|
+ query.getSqlMap().getOrder().setOrderBy("a.create_date ASC");
|
|
|
+ List<MesProductStorageRecord> list = mesProductStorageRecordService.findList(query);
|
|
|
+
|
|
|
+ Map<String, Object> data = MapUtils.newHashMap();
|
|
|
+ data.put("batchSn", batchSn);
|
|
|
+ data.put("productModel", ListUtils.isEmpty(list) ? "" : list.get(0).getProductModel());
|
|
|
+ data.put("count", list.size());
|
|
|
+ data.put("createBy", ListUtils.isEmpty(list) ? "" : list.get(0).getCreateBy());
|
|
|
+ data.put("createDate", ListUtils.isEmpty(list) ? "" : list.get(0).getCreateDate());
|
|
|
+ data.put("remark", ListUtils.isEmpty(list) ? "" : (list.get(0).getRemark() != null ? list.get(0).getRemark() : ""));
|
|
|
+
|
|
|
+ // 工件码列表(逗号分隔)
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ if (i > 0) sb.append(",");
|
|
|
+ sb.append(list.get(i).getSn());
|
|
|
+ }
|
|
|
+ data.put("products", sb.toString());
|
|
|
+
|
|
|
+ // 图片(取第一条记录关联的图片)
|
|
|
+ List imgList = ListUtils.newArrayList();
|
|
|
+ if (!ListUtils.isEmpty(list)) {
|
|
|
+ String host = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/js";
|
|
|
+ FileUpload fu = new FileUpload();
|
|
|
+ fu.setBizKey(list.get(0).getId());
|
|
|
+ fu.setBizType("mesProductPackage_image");
|
|
|
+ List<FileUpload> finfo = fileUploadService.findList(fu);
|
|
|
+ for (FileUpload fi : finfo) {
|
|
|
+ Map<String, Object> map1 = MapUtils.newHashMap();
|
|
|
+ map1.put("id", fi.getFileEntity().getFileId());
|
|
|
+ map1.put("url", host + fi.getFileUrl());
|
|
|
+ map1.put("name", fi.getFileName());
|
|
|
+ map1.put("size", fi.getFileEntity().getFileSize());
|
|
|
+ imgList.add(map1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data.put("imgList", imgList);
|
|
|
+
|
|
|
+ resp.setData(data);
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
+ resp.setMessage("操作成功");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
}
|