Browse Source

供应商给机构下单

huangzhiguo 1 năm trước cách đây
mục cha
commit
bdb47915f1

+ 18 - 0
src/main/java/com/caimei/modules/order/entity/CmChangePayShopProduct.java

@@ -18,6 +18,8 @@ public class CmChangePayShopProduct extends DataEntity<CmChangePayShopProduct> {
 	private Integer orderProductId;		// 订单商品ID
 	private String orderProductName;		// 商品名称
 	private Double costPrice;		// 购买时商品成本价
+	private Double organizeCostPrice;	// 购买时商品集团成本
+	private Double cmCostPrice;	// 购买时商品采美成本
 	private Double singleShouldPayTotalTax;		// 单个付供应商税费
 	private String includedTax;//   char(2) comment '是否含税 0不含税 1含税 2未知',
 	private String invoiceType;//   char(2) comment '发票类型 1增值税专用发票 2增值税普通发票 3不开发票',
@@ -79,6 +81,22 @@ public class CmChangePayShopProduct extends DataEntity<CmChangePayShopProduct> {
 		this.costPrice = costPrice;
 	}
 
+	public Double getOrganizeCostPrice() {
+		return organizeCostPrice;
+	}
+
+	public void setOrganizeCostPrice(Double organizeCostPrice) {
+		this.organizeCostPrice = organizeCostPrice;
+	}
+
+	public Double getCmCostPrice() {
+		return cmCostPrice;
+	}
+
+	public void setCmCostPrice(Double cmCostPrice) {
+		this.cmCostPrice = cmCostPrice;
+	}
+
 	public Double getSingleShouldPayTotalTax() {
 		return singleShouldPayTotalTax;
 	}

+ 7 - 1
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -220,6 +220,8 @@ public class CmPayShopController extends BaseController {
         double totalCostFee = 0D;
         double totalTaxesFee = 0D;
         NewShopOrder shopOrder = newShopOrderService.get(shopOrderID);
+        // 初始运费
+        Double postFee = null == shopOrder.getShopPostFee() ? 0d : shopOrder.getShopPostFee();
         String dbcostType = shopOrder.getCostType();
         String cmChangePayShopRecondId = "0";
         if (StringUtils.isEmpty(dbcostType)) {
@@ -356,6 +358,8 @@ public class CmPayShopController extends BaseController {
                     // 同步使用机构税率 作为供应商税率
                     cmChangePayShopProduct.setSupplierTaxRate(product.getTaxRate());
                     cmChangePayShopProduct.setCostPrice(orderProduct.getNewCostPrice());
+                    cmChangePayShopProduct.setOrganizeCostPrice(orderProduct.getOrganizeCostPrice());
+                    cmChangePayShopProduct.setCmCostPrice(orderProduct.getCmCostPrice());
                     cmChangePayShopProduct.setSingleShouldPayTotalTax(orderProduct.getSingleShouldPayTotalTax());
                     cmChangePayShopProductService.save(cmChangePayShopProduct);
                 }
@@ -382,6 +386,8 @@ public class CmPayShopController extends BaseController {
                 cmChangePayShopProduct.setOrderProductName(product.getName());
                 cmChangePayShopProduct.setSupplierTaxRate(supplierTaxRate);
                 cmChangePayShopProduct.setCostPrice(product.getCostPrice());
+                cmChangePayShopProduct.setOrganizeCostPrice(product.getOrganizeCostPrice());
+                cmChangePayShopProduct.setCmCostPrice(product.getCmCostPrice());
                 cmChangePayShopProduct.setSingleShouldPayTotalTax(product.getSingleShouldPayTotalTax());
                 cmChangePayShopProductService.save(cmChangePayShopProduct);
             }
@@ -521,7 +527,7 @@ public class CmPayShopController extends BaseController {
         shopOrder.setModifyShouldPayNote(modifyShouldPayNote);  //备注
         shopOrder.setModifyShouldPayUserID(UserUtils.getUser().getId());  //修改人的用户id
         shopOrder.setModifyShouldPayDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));  //修改时间
-        double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee(); // + shopOrder.getShopTaxFee();
+        double shouldPayShopAmount = shopOrder.getShopProductAmount() + shopOrder.getShopPostFee() - postFee; // + shopOrder.getShopTaxFee();
         if (shopOrder.getPayedShopAmount() != null && shouldPayShopAmount == shopOrder.getPayedShopAmount()) {
             shopOrder.setPayStatus("3");
         }

+ 1 - 1
src/main/resources/config/beta/caimei.properties

@@ -135,7 +135,7 @@ userfiles.basedir=/mnt/newdatadrive/nfs_client/
 photoServer=https\://img-b.caimei365.com/
 server=https\://admin-b.caimei365.com/
 admin2Server=https\://admin2-b.caimei365.com/
-wwwServer=https\://www-b.caimei365.com/
+wwwServer=http\://120.79.25.27:8009/
 bServer=http\://b.caimei365.com/
 
 #CRM\u5730\u5740

+ 8 - 0
src/main/resources/mappings/modules/order/CmChangePayShopProductMapper.xml

@@ -11,6 +11,8 @@
 		a.orderProductName AS "orderProductName",
 		a.supplierTaxRate AS "supplierTaxRate",
 		a.costPrice AS "costPrice",
+		a.organizeCostPrice AS "organizeCostPrice",
+		a.cmCostPrice AS "cmCostPrice",
 		a.singleShouldPayTotalTax AS "singleShouldPayTotalTax",
 		cop.includedTax AS "includedTax",
 		cop.invoiceType AS "invoiceType"
@@ -88,6 +90,8 @@
 			orderProductId,
 			orderProductName,
 			costPrice,
+			organizeCostPrice,
+			cmCostPrice,
 			singleShouldPayTotalTax,
 			supplierTaxRate
 		) VALUES (
@@ -97,6 +101,8 @@
 			#{orderProductId},
 			#{orderProductName},
 			#{costPrice},
+		    #{organizeCostPrice},
+		    #{cmCostPrice},
 			#{singleShouldPayTotalTax},
 			#{supplierTaxRate}
 		)
@@ -110,6 +116,8 @@
 			orderProductId = #{orderProductId},
 			orderProductName = #{orderProductName},
 			costPrice = #{costPrice},
+			organizeCostPrice = #{organizeCostPrice},
+			cmCostPrice = #{cmCostPrice},
 			singleShouldPayTotalTax = #{singleShouldPayTotalTax},
 			supplierTaxRate = #{supplierTaxRate}
 		WHERE id = #{id}

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

@@ -82,7 +82,7 @@
     		ifnull(a.shopTaxFee,0) AS shopTaxFee,
     		a.shouldPayShopAmount AS shouldPayShopAmount,
     		a.payedShopAmount AS payedShopAmount,
-    		a.shopOtherFee AS shopOtherFee,
+    		ifnull(a.shopOtherFee, 0) AS shopOtherFee,
     		a.paying AS paying,
     		a.costType AS costType,
             a.settleStatus AS settleStatus,

+ 6 - 6
src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml

@@ -192,7 +192,7 @@
     </select>
 
     <select id="behaviorAgency" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">
-            SELECT
+            (SELECT
             <include refid="behaviorRecord"/>
             ,b.accessDuration,
             u.userIdentity,
@@ -214,9 +214,9 @@
                      LEFT JOIN product p ON b.productID = p.productID
                      LEFT JOIN cm_page_type pt ON b.pageType = pt.id
             WHERE b.IP = #{IP} AND b.accessDate BETWEEN #{startTime} AND #{registerTime}
-            GROUP BY b.pageLabel
+            GROUP BY b.pageLabel, b.recordID)
         UNION
-            SELECT
+            (SELECT
             <include refid="behaviorRecord"/>
             ,b.accessDuration,
             u.userIdentity,
@@ -238,9 +238,9 @@
                      LEFT JOIN product p ON b.productID = p.productID
                      LEFT JOIN cm_page_type pt ON b.pageType = pt.id
             WHERE b.IP = #{IP} AND b.accessDate BETWEEN #{registerTime} AND #{endTime}
-            GROUP BY b.pageLabel
+            GROUP BY b.pageLabel, b.recordID)
         UNION
-            SELECT
+            (SELECT
             <include refid="behaviorRecord"/>
             ,b.accessDuration,
             u.userIdentity,
@@ -262,7 +262,7 @@
                  LEFT JOIN product p ON b.productID = p.productID
                  LEFT JOIN cm_page_type pt ON b.pageType = pt.id
         WHERE c.clubID = #{clubID} AND b.accessDate BETWEEN #{registerTime} AND #{endTime}
-        GROUP BY b.pageLabel
+        GROUP BY b.pageLabel, b.recordID)
         ORDER BY accessTime DESC
     </select>
     <select id="selRegion" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">

+ 38 - 6
src/main/webapp/WEB-INF/views/modules/order/cmPayShopChangeRecond.jsp

@@ -116,7 +116,9 @@
                             <table class="table table-striped table-bordered table-condensed" style="width: 900px">
                                 <tr>
                                     <td>商品名</td>
-                                    <td>成本(单)</td>
+                                    <td>供应商成本(单)</td>
+                                    <td>集团成本(单)</td>
+                                    <td>平台服务费(单)</td>
                                     <td>供应商税率</td>
                                     <td>供应商税费(单)</td>
                                 </tr>
@@ -130,6 +132,20 @@
                                                 </label>
                                             </c:if>
                                         </td>
+                                        <td>${payShopProduct.organizeCostPrice}
+                                            <c:if test="${payShopProduct.includedTax != null and payShopProduct.includedTax != '' and payShopProduct.includedTax ne 2}">
+                                                <label style="color: red">
+                                                    (${payShopProduct.includedTax eq 1?'含税':(payShopProduct.invoiceType eq 1 or payShopProduct.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                                </label>
+                                            </c:if>
+                                        </td>
+                                        <td>${payShopProduct.cmCostPrice}
+                                            <c:if test="${payShopProduct.includedTax != null and payShopProduct.includedTax != '' and payShopProduct.includedTax ne 2}">
+                                                <label style="color: red">
+                                                    (${payShopProduct.includedTax eq 1?'含税':(payShopProduct.invoiceType eq 1 or payShopProduct.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                                </label>
+                                            </c:if>
+                                        </td>
                                         <td>${(payShopProduct.includedTax ne '' and payShopProduct.includedTax eq 0 and payShopProduct.invoiceType eq 3)?'-----':empty payShopProduct.supplierTaxRate?'0%':payShopProduct.supplierTaxRate}</td>
                                         <td>${payShopProduct.includedTax ne '' and ((payShopProduct.includedTax eq 0 and payShopProduct.invoiceType eq 3) or payShopProduct.includedTax eq 1 )?'-----':empty payShopProduct.singleShouldPayTotalTax?'0':payShopProduct.singleShouldPayTotalTax}</td>
                                     </tr>
@@ -139,7 +155,7 @@
                                 <tr>
                                 <lable>供应商运费:<fmt:formatNumber type="number" pattern="0.00" value="${payShopRecond.shopPostFee}"/></lable>
                                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                                <%--<lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>--%>
+                                <lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>
                                 </tr>
                             </table>
                             <br>
@@ -155,9 +171,9 @@
                                 <tr>
                                     <td>供应商运费:<fmt:formatNumber type="number" pattern="0.00" value="${payShopRecond.shopPostFee}"/></td>
                                 </tr>
-                                <%--<tr>
+                                <tr>
                                     <td>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></td>
-                                </tr>--%>
+                                </tr>
                             </table>
                             <br>
                         </c:if>
@@ -189,7 +205,9 @@
                     <table class="table table-striped table-bordered table-condensed" style="width: 900px">
                         <tr>
                             <td>商品名</td>
-                            <td>成本(单)</td>
+                            <td>供应商成本(单)</td>
+                            <td>集团成本(单)</td>
+                            <td>平台服务费(单)</td>
                             <td>供应商税率</td>
                             <td>供应商税费(单)</td>
                         </tr>
@@ -203,6 +221,20 @@
                                         </label>
                                     </c:if>
                                 </td>
+                                <td>${payShopProduct.organizeCostPrice}
+                                    <c:if test="${payShopProduct.includedTax != null and payShopProduct.includedTax != '' and payShopProduct.includedTax ne 2}">
+                                        <label style="color: red">
+                                            (${payShopProduct.includedTax eq 1?'含税':(payShopProduct.invoiceType eq 1 or payShopProduct.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                        </label>
+                                    </c:if>
+                                </td>
+                                <td>${payShopProduct.cmCostPrice}
+                                    <c:if test="${payShopProduct.includedTax != null and payShopProduct.includedTax != '' and payShopProduct.includedTax ne 2}">
+                                        <label style="color: red">
+                                            (${payShopProduct.includedTax eq 1?'含税':(payShopProduct.invoiceType eq 1 or payShopProduct.invoiceType eq 2)?'不含税-能开票':'不含税-不能开票'})
+                                        </label>
+                                    </c:if>
+                                </td>
                                 <td>${(payShopProduct.includedTax ne '' and payShopProduct.includedTax eq 0 and payShopProduct.invoiceType eq 3)?'-----':empty payShopProduct.supplierTaxRate?'0%':payShopProduct.supplierTaxRate}</td>
                                 <td>${payShopProduct.includedTax ne '' and ((payShopProduct.includedTax eq 0 and payShopProduct.invoiceType eq 3) or payShopProduct.includedTax eq 1 )?'-----':empty payShopProduct.singleShouldPayTotalTax?'0':payShopProduct.singleShouldPayTotalTax}</td>
                             </tr>
@@ -212,7 +244,7 @@
                         <tr>
                         <lable>供应商运费:<fmt:formatNumber type="number" pattern="0.00" value="${payShopRecond.shopPostFee}"/></lable>
                         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                        <%--<lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>--%>
+                        <lable>付第三方:<fmt:formatNumber type="number" pattern="0.00" value="${empty payShopRecond.shopOtherFee  ? 0 : payShopRecond.shopOtherFee}"/></lable>
                         </tr>
                     </table>
                 </c:if>

+ 23 - 17
src/main/webapp/WEB-INF/views/modules/order/shopOrderDetail.jsp

@@ -127,7 +127,7 @@
                 <div class="operation-block ${order.shopOrderID}" style="position: sticky;">
                     <shiro:hasPermission name="order:order:edit">
                         <%--包含订单充值商品就不显示--%>
-                        <c:if test="${order.status == 0 and order.organizeId != 4}">
+                        <c:if test="${order.status == 0 and order.organizeID != 4}">
                             <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}"
                                onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
                         </c:if>
@@ -139,7 +139,7 @@
                         <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}">发货记录</a>
                         <a href="${ctx}/bulkpurchase/cmRefundsProduct/toShopOrderRefundRecord.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}&from=2">收付款记录</a>
                         <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRecturnRecordByShopOrder.rpc?orderID=${order.orderID}&shopOrderID=${order.shopOrderID}">退款(退货)记录</a>
-                        <c:if test="${order.status != 4 and order.payStatus eq 1 and order.receiptStatus eq 1 and order.sendOutStatus eq 1 and order.organizeId != 4}">
+                        <c:if test="${order.status != 4 and order.payStatus eq 1 and order.receiptStatus eq 1 and order.sendOutStatus eq 1 and order.organizeID != 4}">
                             <a href="${ctx}/order/cancelShopOrder?shopOrderId=${order.shopOrderID}"
                                onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
                         </c:if>
@@ -220,7 +220,7 @@
 <%--    </c:if>--%>
 <%--</div>--%>
 <div class="remarkShow">
-    <b>订单备注<a onclick="openRemarks(${order.orderID},${order.shopOrderID})" style="color: white">展开 《</a></b>
+    <b><a onclick="openRemarks(${order.orderID},${order.shopOrderID})" style="color: white">订单备注展开 《</a></b>
 </div>
 <div class="order-rows">
     <div>
@@ -556,7 +556,12 @@
     </c:if>
     <c:if test="${order.orderInvoice.type eq 1}">
         <%--            <input name="invoice" type="radio" checked="checked">--%>
-        <label>增值税普通发票</label>
+        <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
+            <label>普票 - 个人</label>
+        </c:if>
+        <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
+            <label>普票 - 单位</label>
+        </c:if>
     </c:if>
     <c:if test="${order.orderInvoice.type eq 2}">
         <%--            <input name="invoice" type="radio" checked="checked">--%>
@@ -569,19 +574,20 @@
     <c:if test="${order.orderInvoice.type == 1}">
         <br>
         <div>
-                    <span>
-                        <c:if test="${order.orderInvoice.invoiceTitleType eq 0}">
-                            个人抬头:
-                            <span>${order.orderInvoice.invoiceTitle}</span>
-                        </c:if>
-                        <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
-                            企业抬头:
-                            <span>${order.orderInvoice.invoiceTitle}</span>
-                            &nbsp;&nbsp;&nbsp;&nbsp;
-                            纳税人识别号:
-                            <span>${order.orderInvoice.corporationTaxNum}</span>
-                        </c:if>
-                    </span>
+            <span> 发票抬头: ${order.orderInvoice.invoiceTitle} </span>
+            <c:if test="${order.orderInvoice.invoiceTitleType eq 1}">
+                <span>单位税号:${order.orderInvoice.corporationTaxNum}</span>
+                <table>
+                    <tr>
+                        <td><span>注册地址:${order.orderInvoice.registeredAddress}</span></td>
+                        <td><span>注册电话:${order.orderInvoice.registeredPhone}</span></td>
+                    </tr>
+                    <tr>
+                        <td><span>开户银行:${empty order.orderInvoice.openBank ? '无' : order.orderInvoice.openBank }</span></td>
+                        <td><span>银行账号:${empty order.orderInvoice.bankAccountNo ? '无' : order.orderInvoice.bankAccountNo }</span></td>
+                    </tr>
+                </table>
+            </c:if>
         </div>
     </c:if>
     <c:if test="${order.orderInvoice.type == 2}">

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/user/newCmShopList.jsp

@@ -846,7 +846,7 @@
 	function empowerLogin(userId) {
 		var wwwServer = "${wwwServer}";
 		console.log(userId);
-		window.open(wwwServer + "/login-fast.html?userId=" + userId, "_blank");
+		window.open(wwwServer + "login-fast.html?userId=" + userId, "_blank");
 	}
 </script>
 </body>