Jelajahi Sumber

退款修改

plf 4 tahun lalu
induk
melakukan
445658b7ec

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

@@ -34,6 +34,8 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	private String orderID;      //主订单ID
 	private String orderNo;      //订单编号
 	private Integer organizeID;  //组织id
+	private Integer recordRefundType;   //退款方式: 5 补差价退款(其他正常退款)
+	private ChangePayShopDifference shopDifference; //补差价备注
 
 	public Integer getOrganizeID() {
 		return organizeID;
@@ -192,4 +194,20 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setRefundBalanceAmount(Double refundBalanceAmount) {
 		this.refundBalanceAmount = refundBalanceAmount;
 	}
+
+	public Integer getRecordRefundType() {
+		return recordRefundType;
+	}
+
+	public void setRecordRefundType(Integer recordRefundType) {
+		this.recordRefundType = recordRefundType;
+	}
+
+	public ChangePayShopDifference getShopDifference() {
+		return shopDifference;
+	}
+
+	public void setShopDifference(ChangePayShopDifference shopDifference) {
+		this.shopDifference = shopDifference;
+	}
 }

+ 19 - 19
src/main/java/com/caimei/modules/order/service/CmRefundShopService.java

@@ -9,7 +9,6 @@ import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.utils.DateUtils;
-import com.thinkgem.jeesite.common.utils.MacUtils;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.modules.sys.entity.User;
 import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
@@ -49,6 +48,8 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
     private NewOrderDao newOrderDao;
     @Resource
     private CmReceiptOrderRelationDao cmReceiptOrderRelationDao;
+    @Resource
+    private CmPayShopRecordDao cmPayShopRecordDao;
 
     public CmRefundShop get(String id) {
         return super.get(id);
@@ -130,7 +131,7 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
                 } else {
                     so.setRefundsAmount(0d);
                 }
-                refundAmount += (so.getPayedShopAmount()-so.getRefundsAmount()-so.getShouldPayShopAmount());
+                refundAmount += (so.getPayedShopAmount() - so.getRefundsAmount() - so.getShouldPayShopAmount());
                 List<NewOrderProduct> orderProductList = newOrderProductDao.findByShopOrderID(so.getShopOrderID());
                 /*
                  1. 若发生退货,数量要减去已退货和已取消的数量
@@ -140,15 +141,6 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
                     Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(so.getShopOrderID(), p.getOrderProductID());
                     returnNum = returnNum == null ? 0 : returnNum;
                     p.setReturnedNum(returnNum);
-                    /*if ( returnNum!=null && returnNum>0 ){
-                        if (p.getPresentNum()>0) {
-                            p.setNum(0);
-                            p.setPresentNum(0);
-                        } else {
-                            p.setNum(p.getNum()-returnNum);
-                        }
-                    }
-                    p.setReturnedNum((returnNum !=null && returnNum>0)?returnNum:0);*/
                 }
                 so.setNewOrderProducts(orderProductList);
                 //主订单退款(退货)总金额
@@ -167,6 +159,22 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
         } else {
             List<NewShopOrder> payOrderList = newShopOrderDao.findByRefundID(cmRefundShop.getId());
             List<CmRefundShopRecord> refundRecord = cmRefundShopRecordDao.getByRefundShopID(cmRefundShop.getId());
+            //差价退款备注
+            for (CmRefundShopRecord shopRecord : refundRecord) {
+                if (shopRecord.getRefundType() != null && "5".equals(shopRecord.getRefundType())) {
+                    cmRefundShop.setRecordRefundType(5);
+                    List<ChangePayShopDifference> shopDifferenceList = cmPayShopRecordDao.findShopDifference(Integer.valueOf(shopRecord.getShopOrderID()));
+                    if (shopDifferenceList != null && shopDifferenceList.size() > 0) {
+                        ChangePayShopDifference difference = shopDifferenceList.get(0);
+                        User user = UserUtils.get(difference.getModifyUserId().toString());
+                        if (user != null) {
+                            difference.setSystemName(user.getName());
+                        }
+                        cmRefundShop.setShopDifference(difference);
+                    }
+                    break;
+                }
+            }
             for (NewShopOrder so : payOrderList) {
                 //统计该子订单的主的收款金额和收款状态
                 NewOrder newOrder = newOrderDao.get(so.getOrderID().toString());
@@ -191,14 +199,6 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
                     Integer returnNum = newOrderProductDao.CountReturnedPurchaseProduct(so.getShopOrderID(), p.getOrderProductID());
                     returnNum = returnNum == null ? 0 : returnNum;
                     p.setReturnedNum(returnNum);
-                    /*if ( returnNum!=null && returnNum>0 ){
-                        if (p.getPresentNum()>0) {
-                            p.setNum(0);
-                            p.setPresentNum(0);
-                        } else {
-                            p.setNum(p.getNum()-returnNum);
-                        }
-                    }*/
                 }
                 so.setNewOrderProducts(orderProductList);
                 so.setRefundAmount(record.getRefundAmount());

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

@@ -30,11 +30,13 @@
 	</select>
 	
 	<select id="findList" resultType="CmRefundShop">
-		SELECT 
+		SELECT DISTINCT
 			<include refid="cmRefundShopColumns"/>,
+			crsr.refundType AS recordRefundType,
 			u.name AS operatorName,
 			s.name AS shopName
 		FROM cm_refund_shop a
+		LEFT JOIN cm_refund_shop_record crsr ON crsr.refundShopID = a.id
 		left join shop s on s.shopID = a.shopID
 		left join sys_user u on u.id = a.operator
 		<where>

+ 52 - 0
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -236,6 +236,7 @@
 					</table>
 				</c:forEach>
 			</div>
+		<c:if test="${cmRefundShop.recordRefundType ne 5}">
 			<div class="refund-form-bottom">
 				<div style="text-align: center">
 					<label style="text-align: right">退款总金额:</label><span id="totalRefundAmount">${cmRefundShop.refundAmount+cmRefundShop.refundBalanceAmount}</span>
@@ -282,7 +283,58 @@
 					${cmRefundShop.remark}</span>
 				</div>
 			</div>
+		</c:if>
 	</div>
+<c:if test="${cmRefundShop.recordRefundType eq 5}">
+	<div style="margin-left: 35px">
+		<div style="font-weight: bold;width: 100%;float: left;"><span style="float: left;">${cmRefundShop.shopDifference.systemName}</span><span style="float: left;margin-left:10px;"><fmt:formatDate value="${cmRefundShop.shopDifference.updateTime}" pattern="yyyy-MM-dd HH:mm"/></span></div>
+		<br><br>
+		<div>
+			<ul><b>差价类型:</b>${cmRefundShop.shopDifference.type eq 1 ? "少付":"多付"}</ul>
+			<ul><b>差价金额:</b>${cmRefundShop.shopDifference.differencePrice}</ul>
+			<c:if test="${not empty cmRefundShop}">
+				<ul><b>接收退款方式:</b></ul>
+				<div style="margin-left: 100px">
+					<div class="refund-wrapper">
+						<c:if test="${cmRefundShop.refundWay == '1'||cmRefundShop.refundWay == '3'}">
+							线下转账:
+							<c:if test="${cmRefundShop.refundType == '1'}">
+								建设银行7297
+							</c:if>
+							<c:if test="${cmRefundShop.refundType == '2'}">
+								中信银行0897
+							</c:if>
+							<c:if test="${cmRefundShop.refundType == '3'}">
+								中信银行7172
+							</c:if>
+							<c:if test="${cmRefundShop.refundType == '4'}">
+								广发银行0115
+							</c:if>
+							<c:if test="${cmRefundShop.refundType == '5'}">
+								广发银行5461
+							</c:if>
+							<c:if test="${cmRefundShop.refundType == '6'}">
+								虚拟银行0000
+							</c:if>
+							,¥${cmRefundShop.refundAmount}
+						</c:if>
+					</div>
+					<div class="refund-wrapper">
+						<c:if test="${cmRefundShop.refundWay == '2'||cmRefundShop.refundWay == '3'}">
+							<b>余额账户:</b>¥${cmRefundShop.refundBalanceAmount}
+						</c:if>
+					</div>
+				</div><br>
+			</c:if>
+			<ul><b>备注内容:</b>${cmRefundShop.shopDifference.remark}</ul>
+			<ul><b>图片:</b>
+				<c:forEach items="${cmRefundShop.shopDifference.remarkImages}" var="image">
+					<img src="${image}" style="height: 100px;width: 100px">
+				</c:forEach>
+			</ul>
+		</div>
+	</div>
+</c:if>
 	<div class="refund-btn">
 			<input id="btnCancel" class="return-btn btn" type="button" value="返 回" onclick="history.go(-1)"/>
 	</div>

+ 9 - 3
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopList.jsp

@@ -106,15 +106,21 @@
 			<tr>
 				<td>${cmRefundShop.id}</td>
 				<td>${cmRefundShop.shopName}</td>
-				<td><fmt:formatNumber value="${cmRefundShop.refundAmount+cmRefundShop.refundBalanceAmount}"
-									  type="currency"/></td>
+				<td>
+					<fmt:formatNumber value="${cmRefundShop.refundAmount+cmRefundShop.refundBalanceAmount}" type="currency"/>
+					<c:if test="${cmRefundShop.recordRefundType eq 5}">
+						<font color="red">(退差价)</font>
+					</c:if>
+				</td>
 				<td>${cmRefundShop.shopOrderIDs}</td>
 				<td>${cmRefundShop.orderNo}</td>
 				<td>${cmRefundShop.operatorName}</td>
 				<td>${cmRefundShop.operatTime}</td>
 				<shiro:hasPermission name="order:cmRefundShop:view"><td>
     				<a href="${ctx}/order/cmRefundShop/toRefund?id=${cmRefundShop.id}">查看详情</a>&nbsp&nbsp
-					<a href="${ctx}/order/cmRefundShop/revocation?id=${cmRefundShop.id}" onclick="return confirmx('确定撤销此次退款吗?', this.href)">撤销退款</a>
+					<c:if test="${cmRefundShop.recordRefundType ne 5}">
+						<a href="${ctx}/order/cmRefundShop/revocation?id=${cmRefundShop.id}" onclick="return confirmx('确定撤销此次退款吗?', this.href)">撤销退款</a>
+					</c:if>
 				</td></shiro:hasPermission>
 			</tr>
 		</c:forEach>

+ 4 - 0
src/main/webapp/WEB-INF/views/modules/product/cmSecondHandDetailForm.jsp

@@ -554,6 +554,7 @@
 		</div>
 		<div class="upload" style="box-sizing: border-box;padding-left: 120px;" >
 			<input type="file" name="file" id="controlsFiles" style="position: relative" accept=".pdf">
+			<font color="red">只支持pdf格式文件,不超过20M</font>
 		</div>
 	</div>
 	<div class="control-group">
@@ -566,6 +567,9 @@
 				<br>
 			</div>
 		</div>
+		<div style="margin-left: 205px">
+			<font color="red">若不方便上传承诺函文件,可对承诺函进行拍照或者截图,再上传图片;图片大小不超过5M</font>
+		</div>
 	</div>
 
 	<c:if test="${not empty cmSecondHandDetail.productID}">