|
|
@@ -117,10 +117,9 @@ public class ProdBatchController extends CommonController {
|
|
|
String factoryId = getPara("factoryId");
|
|
|
String sku = getPara("sku");
|
|
|
|
|
|
- String selectSql = "select distinct b.task_no as taskOrderNo, b.device_no, b.sku, a.box_code as boxCode, b.duo_code as palletCode, a.reprint_time as reprintTime, c.item_name as productName, e.workshop_name as workshopName, f.factory_name as factoryName,d.`desc` as lineName";
|
|
|
+ String selectSql = "select b.task_no as taskOrderNo, b.device_no,d.id as deviceId, b.sku, a.box_code as boxCode, b.duo_code as palletCode, a.reprint_time as reprintTime, e.workshop_name as workshopName, f.factory_name as factoryName,d.`desc` as lineName";
|
|
|
StringBuilder fromSql = new StringBuilder("FROM t_reprint_record a ");
|
|
|
fromSql.append(" inner join jinzai_upload_master b on a.box_code = b.id");
|
|
|
- fromSql.append(" left join t_jz_item c on b.sku = c.sku");
|
|
|
fromSql.append(" left join t_jz_device d on b.device_no = d.device_no");
|
|
|
fromSql.append(" left join t_workshop e on d.workshop_id = e.id");
|
|
|
fromSql.append(" left join t_factory f on e.factory_id = f.id");
|
|
|
@@ -155,7 +154,26 @@ public class ProdBatchController extends CommonController {
|
|
|
renderJson(new PageResult<>(0, pageNumber, pageSize, new ArrayList<>()));
|
|
|
return;
|
|
|
}
|
|
|
- renderJson(new PageResult<>(page.getTotalRow(), pageNumber, pageSize, page.getList()));
|
|
|
+
|
|
|
+ List<Record> list = page.getList();
|
|
|
+ try {
|
|
|
+ for (Record record : list) {
|
|
|
+ StringBuilder productSql = new StringBuilder("select b.*");
|
|
|
+ productSql.append(" from t_line_product a");
|
|
|
+ productSql.append(" inner join t_jz_product b on a.product_id = b.id");
|
|
|
+ productSql.append(" inner join t_jz_item c on b.id = c.product_id");
|
|
|
+ productSql.append(" where a.line_id = ? and c.sku = ?");
|
|
|
+ Record item = Db.findFirst(productSql.toString(), WxUtil.getInt("deviceId", record), record.getStr("sku"));
|
|
|
+ String productName = "";
|
|
|
+ if(item != null){
|
|
|
+ productName = item.getStr("product_name");
|
|
|
+ }
|
|
|
+ record.set("productName", productName);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("查询补打信息记录异常:", e);
|
|
|
+ }
|
|
|
+ renderJson(new PageResult<>(page.getTotalRow(), pageNumber, pageSize, list));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -573,17 +591,22 @@ public class ProdBatchController extends CommonController {
|
|
|
if(deviceNo != null){
|
|
|
deviceMonitorRecordDto.setOnline(1);
|
|
|
}
|
|
|
- List<Record> itemList = Db.find("select sku,id,item_name from t_jz_item where Status =1");
|
|
|
- Map<String,Record>paramMap = new HashMap<>();
|
|
|
- for (Record itemRecord : itemList) {
|
|
|
- paramMap.put(itemRecord.getStr("sku"),itemRecord);
|
|
|
- }
|
|
|
- String sku = record.getStr("product_sku");
|
|
|
- String itemName = "";
|
|
|
- if (paramMap.containsKey(sku)) {
|
|
|
- itemName = paramMap.get(sku).getStr("item_name");
|
|
|
+
|
|
|
+ try {
|
|
|
+ StringBuilder productSql = new StringBuilder("select b.*");
|
|
|
+ productSql.append(" from t_line_product a");
|
|
|
+ productSql.append(" inner join t_jz_product b on a.product_id = b.id");
|
|
|
+ productSql.append(" inner join t_jz_item c on b.id = c.product_id");
|
|
|
+ productSql.append(" where a.line_id = ? and c.sku = ?");
|
|
|
+ Record item = Db.findFirst(productSql.toString(), WxUtil.getInt("deviceId", record), record.getStr("product_sku"));
|
|
|
+ String productName = "";
|
|
|
+ if(item != null){
|
|
|
+ productName = item.getStr("product_name");
|
|
|
+ }
|
|
|
+ deviceMonitorRecordDto.setProduct(productName);
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("工控机记录查询获取品相异常:", e);
|
|
|
}
|
|
|
- deviceMonitorRecordDto.setProduct(itemName);
|
|
|
return deviceMonitorRecordDto;
|
|
|
}
|
|
|
}
|