Browse Source

Merge remote-tracking branch 'origin/developerF' into developerF

zhijiezhao 3 years ago
parent
commit
804a988214

+ 2 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java

@@ -52,4 +52,6 @@ public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
     void addActivityProduct(@Param("productId") Integer productId, @Param("activityId") Integer activityId);
 
     void addFloorProduct(@Param("productId") String productId, @Param("floorId") String floorId);
+
+    void updateProductId(@Param("heheProductId") Integer heheProductId, @Param("newProductId") Integer newProductId);
 }

+ 45 - 0
src/main/java/com/caimei/modules/order/entity/NewShopOrder.java

@@ -45,6 +45,11 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     private Integer refundStatus;//    int(11),
     private BigInteger deliveryTimeMills;//   bigint(20) comment '发货时间(时间戳)',
     private Double needPayAmount;//   decimal(20,2) comment '实付金额',
+    private Double realPay;     // 实际支付金额
+    private Double eachDiscount;        // 分摊优惠金额
+    private Double receiptAmount;       // 已付金额
+    private Double restAmount;      // 待付金额
+    private Integer shopReceiptStatus;      // 子订单收款状态:1待收款,2部分收款,3已收款
     private Double canRefundAmount;//   float comment '退款金额',
     private Double refundAmount;//   float,
     private Integer clubID;//  int(11),
@@ -1147,4 +1152,44 @@ public class NewShopOrder extends DataEntity<NewShopOrder> {
     public void setSvipShopReduction(Double svipShopReduction) {
         this.svipShopReduction = svipShopReduction;
     }
+
+    public Double getRealPay() {
+        return realPay;
+    }
+
+    public void setRealPay(Double realPay) {
+        this.realPay = realPay;
+    }
+
+    public Double getEachDiscount() {
+        return eachDiscount;
+    }
+
+    public void setEachDiscount(Double eachDiscount) {
+        this.eachDiscount = eachDiscount;
+    }
+
+    public Double getReceiptAmount() {
+        return receiptAmount;
+    }
+
+    public void setReceiptAmount(Double receiptAmount) {
+        this.receiptAmount = receiptAmount;
+    }
+
+    public Double getRestAmount() {
+        return restAmount;
+    }
+
+    public void setRestAmount(Double restAmount) {
+        this.restAmount = restAmount;
+    }
+
+    public Integer getShopReceiptStatus() {
+        return shopReceiptStatus;
+    }
+
+    public void setShopReceiptStatus(Integer shopReceiptStatus) {
+        this.shopReceiptStatus = shopReceiptStatus;
+    }
 }

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

@@ -61,4 +61,6 @@ public interface ProductNewDao extends CrudDao<Product> {
     List<SplitCode> findSplitCode(Integer shopID);
 
     String findSplitCodeByProduct(Integer productID);
+
+    Integer getShopIdByName(String shopName);
 }

+ 57 - 4
src/main/java/com/caimei/modules/product/service/ProductNewService.java

@@ -3,14 +3,16 @@ package com.caimei.modules.product.service;
 
 import com.caimei.dfs.image.beens.ImageUploadInfo;
 import com.caimei.modules.common.utils.UploadUtils;
+import com.caimei.modules.hehe.dao.CmHeheProductDao;
+import com.caimei.modules.hehe.entity.CmHeheProduct;
 import com.caimei.modules.product.dao.CmPromotionDao;
+import com.caimei.modules.product.dao.ProductDao;
 import com.caimei.modules.product.dao.ProductNewDao;
-import com.caimei.modules.product.entity.CmPromotion;
-import com.caimei.modules.product.entity.Product;
-import com.caimei.modules.product.entity.ProductParameters;
-import com.caimei.modules.product.entity.ProductStatusRecord;
+import com.caimei.modules.product.entity.*;
 import com.caimei.modules.sys.utils.UploadImageUtils;
+import com.caimei.modules.user.dao.NewCmShopDao;
 import com.caimei.po.ProductImage;
+import com.caimei.po.ProductLadderPrice;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
@@ -40,7 +42,13 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
     @Autowired
     ProductNewDao productNewDao;
     @Autowired
+    ProductDao productDao;
+    @Autowired
     private CmPromotionDao cmPromotionDao;
+    @Autowired
+    private CmHeheProductDao cmHeheProductDao;
+    @Autowired
+    private ProductService productService;
 
     @Override
     public Product get(String id) {
@@ -264,4 +272,49 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         }
         return recordList;
     }
+
+    public void moveHeheProducts() {
+        List<CmHeheProduct> heheProductList = cmHeheProductDao.findList(new CmHeheProduct());
+        heheProductList.forEach(heheProduct->{
+            Integer heheProductId = Integer.parseInt(heheProduct.getId());
+            // 采美商品id
+            Integer productId = heheProduct.getProductId();
+            // 查询商品
+            Product product = productNewDao.get(productId.toString());
+            Integer shopId = productNewDao.getShopIdByName("采美奥泰特殊供应商");
+            if (null != shopId) {
+                product.setId(null);
+                product.setShopID(shopId);
+                // 置为冻结状态
+                product.setValidFlag("10");
+                // 添加商品到奥泰特殊供应商下
+                productDao.insert(product);
+                Integer newProductId = product.getProductID();
+                // 查询商品详情信息
+                ProductDetailInfo productDetailInfo = productService.getProductDetailInfo(productId);
+                productDetailInfo.setProductID(newProductId);
+                productDao.insertProductDetailInfo(productDetailInfo);
+                // 查询阶梯列表
+                List<ProductLadderPrice> ladderPriceList = productService.findLadderPrice(productId);
+                ladderPriceList.forEach(ladder->{
+                    ladder.setProductId(newProductId);
+                    productDao.insertLadderPrice(ladder);
+                });
+                // 查询商品图片
+                List<ProductImage> imageList = productNewDao.getImageList(productId);
+                imageList.forEach(image->{
+                    image.setProductID(newProductId);
+                    productNewDao.insertProductImage(image);
+                });
+                // 查询相关参数
+                List<ProductParameters> productParams = getProductParams(productId);
+                productParams.forEach(productParam->{
+                    productParam.setProductId(newProductId);
+                    productNewDao.insertParameters(productParam);
+                });
+                // 将呵呵商品关联到新商品上
+                cmHeheProductDao.updateProductId(heheProductId, newProductId);
+            }
+        });
+    }
 }

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

@@ -1077,5 +1077,15 @@ public class ProductNewController extends BaseController {
         model.addAttribute("productId", productId);
         return "modules/product-new/statusRemarksList";
     }
+
+    /**
+     * 迁移呵呵对应的采美商品到采美奥泰特殊供应商中,并将呵呵商品关联到迁移后的商品
+     */
+    @RequestMapping("/hehe/move")
+    @ResponseBody
+    public String moveHeheProducts(){
+        productNewService.moveHeheProducts();
+        return "success";
+    }
 }
 

+ 4 - 1
src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml

@@ -217,5 +217,8 @@
 	<update id="deleteActivityProduct">
 		UPDATE cm_hehe_activity_product SET delFlag = 1 WHERE productId = #{productId}
 	</update>
-	
+	<update id="updateProductId">
+		update cm_hehe_product set productId = #{newProductId} where id = #{heheProductId}
+	</update>
+
 </mapper>

+ 5 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -23,6 +23,11 @@
 			a.finishTime AS finishTime,
 			a.refundStatus AS  refundStatus,
 			a.needPayAmount AS  needPayAmount,
+            a.realPay AS realPay,
+            a.eachDiscount AS eachDiscount,
+            a.receiptAmount AS receiptAmount,
+            (ifnull(a.realPay,0) - ifnull(a.receiptAmount,0)) as restAmount,
+            a.receiptStatus as shopReceiptStatus,
 			a.canRefundAmount AS  canRefundAmount,
 			a.refundAmount AS  refundAmount,
 			a.clubID  AS clubID,

+ 4 - 2
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -395,7 +395,8 @@
 			trainingType,
 			trainingFee,
 			productDescribe,
-			splitCode
+			splitCode,
+			productDetail
 		) VALUES (
 					 #{brandID},
 					 #{bigTypeID},
@@ -468,7 +469,8 @@
 					 #{trainingType},
 					 #{trainingFee},
 		          	 #{productDescribe},
-					 #{splitCode}
+					 #{splitCode},
+					 #{productDetail}
 						 )
 	</insert>
 

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

@@ -85,6 +85,8 @@
         a.trainingMethod as "trainingMethod",
         a.trainingType as "trainingType",
         a.trainingFee as "trainingFee",
+        a.splitCode as "splitCode",
+        a.productDescribe as "productDescribe",
         cshd.secondHandType as "secondHandType",
         cshd.instrumentType as "instrumentType",
         cshd.sold as "sold",
@@ -125,7 +127,7 @@
     </select>
 
     <select id="getProductParams" resultType="com.caimei.modules.product.entity.ProductParameters">
-        select *from cm_product_related_parameters where productId =  #{productId}  and delFlag = 0 LIMIT 50
+        select * from cm_product_related_parameters where productId =  #{productId}  and delFlag = 0 LIMIT 50
     </select>
 
     <select id="findList" resultType="Product">
@@ -754,6 +756,9 @@
     <select id="findSplitCodeByProduct" resultType="java.lang.String">
         select splitCode from product where productID = #{productID}
     </select>
+    <select id="getShopIdByName" resultType="java.lang.Integer">
+        select shopID from shop where name like concat('%',#{shopName},'%')
+    </select>
 
 </mapper>
 

+ 41 - 1
src/main/webapp/WEB-INF/views/modules/hehe/heheNewOrderDetail.jsp

@@ -384,7 +384,47 @@
     <div class="order-rows">
         <span><label>下单时间:</label>${order.orderTime}</span>
         <span><label>子订单号(ID):</label>${shopOrder.shopOrderNo}(${shopOrder.shopOrderID})</span>
-        <span><label>子订单金额:</label><fmt:formatNumber value="${shopOrder.needPayAmount}" type="currency"/></span>
+        <span><label>子订单金额:</label><fmt:formatNumber value="${shopOrder.realPay}" type="currency"/></span>
+        <br/>
+        <span><label>商品总额:</label><fmt:formatNumber value="${shopOrder.needPayAmount}" type="currency"/></span>
+        <span><label>优惠:</label><fmt:formatNumber value="${shopOrder.eachDiscount}" type="currency"/></span>
+        <span><label>应付金额:</label><fmt:formatNumber value="${shopOrder.realPay}" type="currency"/></span>
+        <span><label>已付金额:</label><fmt:formatNumber value="${shopOrder.receiptAmount}" type="currency"/></span>
+        <span><label>待付金额:</label><fmt:formatNumber value="${shopOrder.restAmount}" type="currency"/></span>
+        <br/>
+        <span><label>收款状态:</label>
+                <c:if test="${shopOrder.shopReceiptStatus == 1}">
+                    <font color="red">待收款</font>
+                </c:if>
+                <c:if test="${shopOrder.shopReceiptStatus == 2}">
+                    <font color="#ff8c00">部分收款</font>
+                </c:if>
+                <c:if test="${shopOrder.shopReceiptStatus == 3}">
+                    <font color="green">已收款</font>
+                </c:if>
+        </span>
+        <span><label>付款状态:</label>
+                <c:if test="${shopOrder.payStatus == 1}">
+                    <font color="red">待付款</font>
+                </c:if>
+                <c:if test="${shopOrder.payStatus == 2}">
+                    <font color="#ff8c00">部分付款</font>
+                </c:if>
+                <c:if test="${shopOrder.payStatus == 3}">
+                    <font color="green">已付款</font>
+                </c:if>
+        </span>
+        <span><label>发货状态:</label>
+                <c:if test="${shopOrder.sendOutStatus == 1}">
+                    <font color="red">待发货</font>
+                </c:if>
+                <c:if test="${shopOrder.sendOutStatus == 2}">
+                    <font color="#ff8c00">部分发货</font>
+                </c:if>
+                <c:if test="${shopOrder.sendOutStatus == 3}">
+                    <font color="green">已发货</font>
+                </c:if>
+        </span>
         <c:if test="${shopOrder.postFeeCos eq '0'}">
             <div class="print-wrapper">
                 <a href="${ctx}/order/printOrder?shopOrderID=${shopOrder.shopOrderID}">打印</a>