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

23-12-2

parent 7468be85
var gridManager = null; var gridManager = null;
$(document).ready(function() { $(document).ready(function() {
debugger;
initializateUI(); initializateUI();
loadCodeRuleListGrid(); loadCodeRuleListGrid();
}); });
...@@ -62,7 +61,6 @@ function updateHandler(data) { ...@@ -62,7 +61,6 @@ function updateHandler(data) {
return; return;
} }
} }
debugger;
var url=DataUtil.composeURLByParam('/product/forwardProductDetail.do',{ data: JSON.stringify(data) }); var url=DataUtil.composeURLByParam('/product/forwardProductDetail.do',{ data: JSON.stringify(data) });
UICtrl.addTabItem({tabid:'viewFlowChart' + id, text:"产品信息",url:url}); UICtrl.addTabItem({tabid:'viewFlowChart' + id, text:"产品信息",url:url});
// debugger; // 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 @@ ...@@ -9,6 +9,7 @@
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x"%> <%@taglib uri="/WEB-INF/taglib.tld" prefix="x"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head> <head>
<x:base include="layout,dialog,grid,tree,combox,commonTree" />
<x:script src='/biz/topsun/product/productDetail.js'/> <x:script src='/biz/topsun/product/productDetail.js'/>
</head> </head>
<form class="hg-form" method="post" action="" id="submitForm"> <form class="hg-form" method="post" action="" id="submitForm">
...@@ -16,12 +17,13 @@ ...@@ -16,12 +17,13 @@
<x:hidden name="productId"/> <x:hidden name="productId"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div labelCol="15"> </div>
</div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:title title="基本属性" name="group" hideTable="#info" /> <x:title title="基本属性" name="group" hideTable="#info" />
<x:inputC name="productId" required="true" label="产品编码" labelCol="2" maxLength="64" fieldCol="4" /> <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: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: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"--%> <%-- <x:inputC name="productCategoryId" required="true" label="产品类别ID" wrapper="select" labelCol="2" maxLength="64"--%>
<%-- fieldCol="4" />--%> <%-- fieldCol="4" />--%>
...@@ -31,8 +33,6 @@ ...@@ -31,8 +33,6 @@
<x:title title="" name="group" hideTable="#info" /> <x:title title="" name="group" hideTable="#info" />
</div> </div>
</div>
<form2> <form2>
......
...@@ -84,12 +84,12 @@ public class ProductApplicationImpl implements ProductApplication { ...@@ -84,12 +84,12 @@ public class ProductApplicationImpl implements ProductApplication {
ArrayList<ProductCategory> categorys = (ArrayList<ProductCategory>)categoryRepository.findAll(); ArrayList<ProductCategory> categorys = (ArrayList<ProductCategory>)categoryRepository.findAll();
// --------------------------------- 详情查询 --------------------------------- // --------------------------------- 详情查询 ---------------------------------
ProductTypesetConf typesetConf = typesetConfRepository.findByProductIdEquals(Long.toString(productId)); String strProductId = Long.toString(productId);
System.err.println(Long.toString(productId)); ProductTypesetConf typesetConf = typesetConfRepository.findByProductId(strProductId);
ProductLooked looked = lookedRepository.findByProductId(Long.toString(productId)); ProductLooked looked = lookedRepository.findByProductId(strProductId);
ProductPublishedConf publishedConf = publishedConfRepository.findByProductIdEquals(Long.toString(productId)); ProductPublishedConf publishedConf = publishedConfRepository.findByProductId(strProductId);
ProductLoss loss = lossRepository.findByProductIdEquals(Long.toString(productId)); ProductLoss loss = lossRepository.findByProductId(strProductId);
ProductMaterial material = materialRepository.findByProductIdEquals(Long.toString(productId)); ArrayList<ProductMaterial> material = (ArrayList<ProductMaterial>) materialRepository.findByProductId(strProductId);
resultMap.put("typesetConf", typesetConf); resultMap.put("typesetConf", typesetConf);
resultMap.put("looked", looked); resultMap.put("looked", looked);
resultMap.put("publishedConf", publishedConf); resultMap.put("publishedConf", publishedConf);
...@@ -111,12 +111,16 @@ public class ProductApplicationImpl implements ProductApplication { ...@@ -111,12 +111,16 @@ public class ProductApplicationImpl implements ProductApplication {
resultMap.put("backColor", backColor); resultMap.put("backColor", backColor);
} }
} }
ObjectMapper mapper = new ObjectMapper();
resultMap.put("selectedBrand", convertToMap(Brand.class, "brandName", "brandId", brands)); resultMap.put("selectedBrand", mapper.convertValue(brands, List.class));
resultMap.put("selectedFactory", convertToMap(Factory.class, "factoryName", "factoryId", factorys)); resultMap.put("selectedFactory", mapper.convertValue(factorys, List.class));
resultMap.put("selectedColor", convertToMap(Color.class, "colorName", "colorId", colors)); resultMap.put("selectedColor", mapper.convertValue(colors, List.class));
resultMap.put("selectedCategory", convertToMap(ProductCategory.class, "productCategoryId", resultMap.put("selectedCategory", mapper.convertValue(categorys, List.class));
"productCategoryName", categorys)); // 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; return resultMap;
} }
......
...@@ -64,7 +64,6 @@ public class ProductController extends CommonController { ...@@ -64,7 +64,6 @@ public class ProductController extends CommonController {
public String forwardProduct() { public String forwardProduct() {
// 通过此方法可以查看系统配置的 字典 的数据结构 // 通过此方法可以查看系统配置的 字典 的数据结构
DictUtil.getDictionaryList("technologyType"); DictUtil.getDictionaryList("technologyType");
Map<String, Object> map4 = new HashMap<>(); Map<String, Object> map4 = new HashMap<>();
map4.put("六六六", "666"); map4.put("六六六", "666");
map4.put("七七七", "777"); map4.put("七七七", "777");
...@@ -82,22 +81,24 @@ public class ProductController extends CommonController { ...@@ -82,22 +81,24 @@ public class ProductController extends CommonController {
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
Map<String, Object> map = productService.queryDetailAll(Integer.parseInt(param.get("productId") + "")); String productId= param.get("productId")+"";
HashMap<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = productService.queryDetailAll(Integer.parseInt(productId));
resultMap.putAll(mapper.convertValue(map.get("detail"), Map.class)); if(resultMap.get("detail") != null) {
resultMap.putAll(param); resultMap.putAll(mapper.convertValue(resultMap.get("detail"), Map.class));
//字典 }
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);
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; ...@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description: * @Description:
*/ */
public interface ProductLossRepository extends JpaRepository<ProductLoss,String> { 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; ...@@ -3,11 +3,13 @@ package com.huigou.topsun.product.repository;
import com.huigou.topsun.product.domain.ProductMaterial; import com.huigou.topsun.product.domain.ProductMaterial;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
* @Date: 2023/11/22/10:46 * @Date: 2023/11/22/10:46
* @Description: * @Description:
*/ */
public interface ProductMaterialRepository extends JpaRepository<ProductMaterial,String> { 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; ...@@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description: * @Description:
*/ */
public interface ProductPublishedConfRepository extends JpaRepository<ProductPublishedConf,String> { public interface ProductPublishedConfRepository extends JpaRepository<ProductPublishedConf,String> {
ProductPublishedConf findByProductIdEquals(String productId); ProductPublishedConf findByProductId(String productId);
ProductPublishedConf getProductPublishedConfByProductId(String productId); ProductPublishedConf getProductPublishedConfByProductId(String productId);
} }
...@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository; ...@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @Description: * @Description:
*/ */
public interface ProductTypesetConfRepository extends JpaRepository<ProductTypesetConf,String> { 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