Commit 0c18246f authored by 覃振观's avatar 覃振观 👶

23-12-2

parent 7468be85
var gridManager = null;
$(document).ready(function() {
debugger;
initializateUI();
loadCodeRuleListGrid();
});
......@@ -62,7 +61,6 @@ function updateHandler(data) {
return;
}
}
debugger;
var url=DataUtil.composeURLByParam('/product/forwardProductDetail.do',{ data: JSON.stringify(data) });
UICtrl.addTabItem({tabid:'viewFlowChart' + id, text:"产品信息",url:url});
// debugger;
......
$(document).ready(function() {
initializateSelectC();
});
function initializateSelectC() {
$('#productId').searchbox({
type: "product",
name: "productCode",
onChange: function (value, data) {
}
});
}
function loadDataTest() {
console.log("loadData")
var params = new URLSearchParams(document.location.search);
var paramsData = JSON.parse(params.get("data"));
Public.ajax(web_app.name + "/product/loadProductDetail.ajax", {
productId: paramsData.productId
}, function (data) {
debugger;
var selectedCategory = data.selectedCategory;
$("#selectedCategory").ligerComboBox({
textField: 'productCategoryName',
valueField: 'productCategoryId',
columns: [
{ header: 'ID', name: 'productCategoryId', width: 20 },
{ header: '名字', name: 'productCategoryName' }
],
data: selectedCategory,
selectBoxWidth: 200
});
});
}
......@@ -9,6 +9,7 @@
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree" />
<x:script src='/biz/topsun/product/productDetail.js'/>
</head>
<form class="hg-form" method="post" action="" id="submitForm">
......@@ -16,21 +17,20 @@
<x:hidden name="productId"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:title title="基本属性" name="group" hideTable="#info" />
<x:inputC name="productId" required="true" label="产品编码" labelCol="2" maxLength="64" fieldCol="4" />
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" maxLength="64" fieldCol="4" />
<x:selectC name="productCategoryId" required="false" label="产品类别ID" dictionary="selectedCategory" labelCol="2"/>
<%-- <x:inputC name="productCategoryId" required="true" label="产品类别ID" wrapper="select" labelCol="2" maxLength="64"--%>
<%-- fieldCol="4" />--%>
<x:inputC name="productUnit" required="false" label="单位" labelCol="2" maxLength="32" fieldCol="4" />
<x:inputC name="productSampleCode" required="false" label="样品编号" labelCol="2" maxLength="32" fieldCol="4" />
<x:inputC name="brandName" required="false" label="品牌名称" labelCol="2" maxLength="32" fieldCol="4" />
<x:title title="" name="group" hideTable="#info" />
</div>
<div labelCol="15"> </div>
</div>
<div class="hg-form-row">
<x:title title="基本属性" name="group" hideTable="#info" />
<x:inputC name="productId" required="true" label="产品编码" labelCol="2" maxLength="64" fieldCol="4" />
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" maxLength="64" fieldCol="4" />
<x:selectC name="productCategoryId" required="false" label="产品类别ID" id="selectedCategory" labelCol="2"/>
<%-- <x:inputC name="productCategoryId" required="true" label="产品类别ID" wrapper="select" labelCol="2" maxLength="64"--%>
<%-- fieldCol="4" />--%>
<x:inputC name="productUnit" required="false" label="单位" labelCol="2" maxLength="32" fieldCol="4" />
<x:inputC name="productSampleCode" required="false" label="样品编号" labelCol="2" maxLength="32" fieldCol="4" />
<x:inputC name="brandName" required="false" label="品牌名称" labelCol="2" maxLength="32" fieldCol="4" />
<x:title title="" name="group" hideTable="#info" />
</div>
......
......@@ -84,12 +84,12 @@ public class ProductApplicationImpl implements ProductApplication {
ArrayList<ProductCategory> categorys = (ArrayList<ProductCategory>)categoryRepository.findAll();
// --------------------------------- 详情查询 ---------------------------------
ProductTypesetConf typesetConf = typesetConfRepository.findByProductIdEquals(Long.toString(productId));
System.err.println(Long.toString(productId));
ProductLooked looked = lookedRepository.findByProductId(Long.toString(productId));
ProductPublishedConf publishedConf = publishedConfRepository.findByProductIdEquals(Long.toString(productId));
ProductLoss loss = lossRepository.findByProductIdEquals(Long.toString(productId));
ProductMaterial material = materialRepository.findByProductIdEquals(Long.toString(productId));
String strProductId = Long.toString(productId);
ProductTypesetConf typesetConf = typesetConfRepository.findByProductId(strProductId);
ProductLooked looked = lookedRepository.findByProductId(strProductId);
ProductPublishedConf publishedConf = publishedConfRepository.findByProductId(strProductId);
ProductLoss loss = lossRepository.findByProductId(strProductId);
ArrayList<ProductMaterial> material = (ArrayList<ProductMaterial>) materialRepository.findByProductId(strProductId);
resultMap.put("typesetConf", typesetConf);
resultMap.put("looked", looked);
resultMap.put("publishedConf", publishedConf);
......@@ -111,12 +111,16 @@ public class ProductApplicationImpl implements ProductApplication {
resultMap.put("backColor", backColor);
}
}
resultMap.put("selectedBrand", convertToMap(Brand.class, "brandName", "brandId", brands));
resultMap.put("selectedFactory", convertToMap(Factory.class, "factoryName", "factoryId", factorys));
resultMap.put("selectedColor", convertToMap(Color.class, "colorName", "colorId", colors));
resultMap.put("selectedCategory", convertToMap(ProductCategory.class, "productCategoryId",
"productCategoryName", categorys));
ObjectMapper mapper = new ObjectMapper();
resultMap.put("selectedBrand", mapper.convertValue(brands, List.class));
resultMap.put("selectedFactory", mapper.convertValue(factorys, List.class));
resultMap.put("selectedColor", mapper.convertValue(colors, List.class));
resultMap.put("selectedCategory", mapper.convertValue(categorys, List.class));
// resultMap.put("selectedBrand", convertToMap(Brand.class, "brandName", "brandId", brands));
// resultMap.put("selectedFactory", convertToMap(Factory.class, "factoryName", "factoryId", factorys));
// resultMap.put("selectedColor", convertToMap(Color.class, "colorName", "colorId", colors));
// resultMap.put("selectedCategory", convertToMap(ProductCategory.class, "productCategoryId",
// "productCategoryName", categorys));
return resultMap;
}
......
......@@ -64,7 +64,6 @@ public class ProductController extends CommonController {
public String forwardProduct() {
// 通过此方法可以查看系统配置的 字典 的数据结构
DictUtil.getDictionaryList("technologyType");
Map<String, Object> map4 = new HashMap<>();
map4.put("六六六", "666");
map4.put("七七七", "777");
......@@ -73,7 +72,7 @@ public class ProductController extends CommonController {
return forward("product");
}
public String forwardProductDetail() {
public String forwardProductDetail() {
ObjectMapper mapper = new ObjectMapper();
SDO sdo = this.getSDO();
Map param = null;
......@@ -82,22 +81,24 @@ public class ProductController extends CommonController {
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
Map<String, Object> map = productService.queryDetailAll(Integer.parseInt(param.get("productId") + ""));
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.putAll(mapper.convertValue(map.get("detail"), Map.class));
resultMap.putAll(param);
//字典
DictUtil.getDictionaryList("technologyType");
// this.putAttribute("selectedCategory", map.get("selectedCategory"));
Map<String, Object> map4 = new HashMap<>();
map4.put("code", "666");
map4.put("name", "777");
map4.put("value", "888");
this.putAttribute("selectedCategory", map4);
String productId= param.get("productId")+"";
Map<String, Object> resultMap = productService.queryDetailAll(Integer.parseInt(productId));
if(resultMap.get("detail") != null) {
resultMap.putAll(mapper.convertValue(resultMap.get("detail"), Map.class));
}
return forward("productDetail", param);
}
return forward("productDetail", resultMap);
public String loadProductDetail() {
ObjectMapper mapper = new ObjectMapper();
SDO sdo = this.getSDO();
String productId = sdo.getString("productId");
Map<String, Object> resultMap = productService.queryDetailAll(Integer.parseInt(productId));
if(resultMap.get("detail") != null) {
resultMap.putAll(mapper.convertValue(resultMap.get("detail"), Map.class));
}
return toResult(resultMap);
}
......
......@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
*/
public interface ProductLossRepository extends JpaRepository<ProductLoss,String> {
ProductLoss findByProductIdEquals(String productId) ;
ProductLoss findByProductId(String productId);
}
......@@ -3,11 +3,13 @@ package com.huigou.topsun.product.repository;
import com.huigou.topsun.product.domain.ProductMaterial;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: xin.lu
* @Date: 2023/11/22/10:46
* @Description:
*/
public interface ProductMaterialRepository extends JpaRepository<ProductMaterial,String> {
ProductMaterial findByProductIdEquals(String productId);
List<ProductMaterial> findByProductId(String productId);
}
......@@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
*/
public interface ProductPublishedConfRepository extends JpaRepository<ProductPublishedConf,String> {
ProductPublishedConf findByProductIdEquals(String productId);
ProductPublishedConf findByProductId(String productId);
ProductPublishedConf getProductPublishedConfByProductId(String productId);
}
......@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description:
*/
public interface ProductTypesetConfRepository extends JpaRepository<ProductTypesetConf,String> {
ProductTypesetConf findByProductIdEquals(String productId);
ProductTypesetConf findByProductId(String productId);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment