Duan_xu 2 years ago
parent
commit
17d0eb4658

+ 2 - 0
src/main/java/com/caimei/modules/product/dao/ProductDao.java

@@ -151,6 +151,8 @@ public interface ProductDao extends CrudDao<Product> {
 
 
     ProductDetailInfo queryProductDetailInfo(@Param("productID") Integer productID);
     ProductDetailInfo queryProductDetailInfo(@Param("productID") Integer productID);
 
 
+    Product qualification(@Param("productID") Integer productID);
+
     List<ProductLadderPrice> findProductLadderPrice(@Param("productId") Integer productId, @Param("userType") Integer userType);
     List<ProductLadderPrice> findProductLadderPrice(@Param("productId") Integer productId, @Param("userType") Integer userType);
 
 
     void updateByPrimaryKeySelective(Product product);
     void updateByPrimaryKeySelective(Product product);

+ 4 - 4
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -269,7 +269,7 @@ public String productName;
 /*
 /*
 *证书有效日期
 *证书有效日期
  */
  */
-    public Date qualificationTime;
+    public String qualificationTime;
 
 
     /**
     /**
      *证书有效链接
      *证书有效链接
@@ -291,12 +291,12 @@ public String productName;
     public void setProductName(String productName) {
     public void setProductName(String productName) {
         this.productName = productName;
         this.productName = productName;
     }
     }
-
-    public Date getQualificationTime() {
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    public String getQualificationTime() {
         return qualificationTime;
         return qualificationTime;
     }
     }
 
 
-    public void setQualificationTime(Date qualificationTime) {
+    public void setQualificationTime(String qualificationTime) {
         this.qualificationTime = qualificationTime;
         this.qualificationTime = qualificationTime;
     }
     }
 
 

+ 4 - 0
src/main/java/com/caimei/modules/product/service/ProductService.java

@@ -346,6 +346,10 @@ public class ProductService extends CrudService<ProductDao, Product> {
         return productDao.queryProductDetailInfo(productID);
         return productDao.queryProductDetailInfo(productID);
     }
     }
 
 
+    public Product qualification(Integer productID){
+        return productDao.qualification(productID);
+    }
+
     public List<ProductLadderPrice> findLadderPrice(Integer productID) {
     public List<ProductLadderPrice> findLadderPrice(Integer productID) {
         // userType用户类型,1游客,2普通用户,3会员用户
         // userType用户类型,1游客,2普通用户,3会员用户
         return productDao.findProductLadderPrice(productID, 3);
         return productDao.findProductLadderPrice(productID, 3);

+ 5 - 0
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -296,6 +296,11 @@ public class ProductNewController extends BaseController {
     public String editProduct(Product product, Model model) {
     public String editProduct(Product product, Model model) {
         if (null != product.getProductID()) {
         if (null != product.getProductID()) {
             ProductDetailInfo productDetailInfo = productService.getProductDetailInfo(product.getProductID());
             ProductDetailInfo productDetailInfo = productService.getProductDetailInfo(product.getProductID());
+            Product produ=productService.qualification(product.getProductID());
+            product.setQualificationLink(produ.getQualificationLink());
+            product.setQualificationNo(produ.getQualificationNo());
+            product.setQualificationTime(produ.getQualificationTime());
+            product.setProductName(produ.getProductName());
             List<ProductLadderPrice> ladderPriceList = productService.findLadderPrice(product.getProductID());
             List<ProductLadderPrice> ladderPriceList = productService.findLadderPrice(product.getProductID());
             if (null != productDetailInfo) {
             if (null != productDetailInfo) {
                 product.setDetailInfo(productDetailInfo.getDetailInfo());
                 product.setDetailInfo(productDetailInfo.getDetailInfo());

File diff suppressed because it is too large
+ 1386 - 1400
src/main/resources/mappings/modules/product/ProductMapper.xml


+ 1 - 0
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -6,6 +6,7 @@
         <result property="name" column="name"/>
         <result property="name" column="name"/>
     </resultMap>
     </resultMap>
     <sql id="productColumns">
     <sql id="productColumns">
+
         a.newvalidFlag,
         a.newvalidFlag,
       ifnull(a.newProductType,2) as newProductType,
       ifnull(a.newProductType,2) as newProductType,
         ifnull(a.announType,1) as announType,
         ifnull(a.announType,1) as announType,

+ 8 - 2
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -531,18 +531,24 @@
             </td>
             </td>
         </tr>
         </tr>
         </c:if>
         </c:if>
+        <c:if test="${product.productType ==2}">
         <tr class="machineType">
         <tr class="machineType">
             <th><span class="red">*</span>产品名称:</th>
             <th><span class="red">*</span>产品名称:</th>
             <td colspan="2">
             <td colspan="2">
                 <form:input path="productName" maxlength="80" class="input-small required"/>
                 <form:input path="productName" maxlength="80" class="input-small required"/>
             </td>
             </td>
         </tr>
         </tr>
+        </c:if>
+        <c:if test="${product.productType ==2}">
         <tr class="machineType">
         <tr class="machineType">
             <th><span class="red">*</span>证书有效期:</th>
             <th><span class="red">*</span>证书有效期:</th>
             <td colspan="3">
             <td colspan="3">
-                <form:input path="qualificationTime" type="text" maxlength="20" class="input-medium Wdate" value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+                <form:input path="qualificationTime" type="text" maxlength="20" class="input-medium Wdate" value="${product.qualificationTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+<%--    <fmt:formatDate value="${product.qualificationTime}" pattern="yyyy-MM-dd"/>--%>
             </td>
             </td>
         </tr>
         </tr>
+        </c:if>
+        <c:if test="${product.productType ==2}">
         <tr class="machineType">
         <tr class="machineType">
             <th><span class="red">*</span>证书基本信息链接:</th>
             <th><span class="red">*</span>证书基本信息链接:</th>
             <td colspan="4">
             <td colspan="4">
@@ -550,7 +556,7 @@
                             class="input-small required"/>
                             class="input-small required"/>
             </td>
             </td>
         </tr>
         </tr>
-
+        </c:if>
 
 
         <tr>
         <tr>
             <th><span class="red">*</span>市场价:</th>
             <th><span class="red">*</span>市场价:</th>

Some files were not shown because too many files changed in this diff