Quellcode durchsuchen

需求:供应商退款列表增加CRM关联的退款

chao vor 3 Jahren
Ursprung
Commit
d0a753ea0f

+ 17 - 8
src/main/java/com/caimei/modules/order/entity/CmRefundShop.java

@@ -13,13 +13,13 @@ import java.util.List;
  * @version 2019-07-01
  */
 public class CmRefundShop extends DataEntity<CmRefundShop> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String shopID;		// 供应商Id
 	private String shopName;		// 供应商名称
 	private String operator;		// 操作人ID
 	private String operatTime;		// 操作时间
-	private String refundWay;       //退款方式:1线下转账,2余额账号,3线下和余额同时退
+	private String refundWay;       //退款方式:1线下转账,2余额账号,3线下和余额同时退,4收款CRM(供应商退款)
 	private Double refundBalanceAmount;   //退款余额金额(余额账号)
 	private Double refundAmount;		// 退款金额(线下转账)
 	private String refundType;		// 线下转账具体银行
@@ -30,6 +30,7 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	private String endTime;
 	private String shopOrderIDs; //关联子订单ids
 	private String operatorName; //操作人名称
+	private String crmOperatorName;
 	private String shopOrderID;  //子订单ID
 	private String orderID;      //主订单ID
 	private String orderNo;      //订单编号
@@ -61,7 +62,7 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setShopID(String shopID) {
 		this.shopID = shopID;
 	}
-	
+
 	@Length(min=0, max=11, message="操作人ID长度必须介于 0 和 11 之间")
 	public String getOperator() {
 		return operator;
@@ -70,7 +71,7 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setOperator(String operator) {
 		this.operator = operator;
 	}
-	
+
 	@Length(min=0, max=19, message="操作时间长度必须介于 0 和 19 之间")
 	public String getOperatTime() {
 		return operatTime;
@@ -79,7 +80,7 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setOperatTime(String operatTime) {
 		this.operatTime = operatTime;
 	}
-	
+
 	public Double getRefundAmount() {
 		return refundAmount;
 	}
@@ -87,7 +88,7 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setRefundAmount(Double refundAmount) {
 		this.refundAmount = refundAmount;
 	}
-	
+
 	@Length(min=0, max=1, message="接收退款方式长度必须介于 0 和 1 之间")
 	public String getRefundType() {
 		return refundType;
@@ -96,7 +97,7 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setRefundType(String refundWay) {
 		this.refundType = refundWay;
 	}
-	
+
 	@Length(min=0, max=100, message="付款时间长度必须介于 0 和 100 之间")
 	public String getRemark() {
 		return remark;
@@ -155,6 +156,14 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 		this.operatorName = operatorName;
 	}
 
+	public String getCrmOperatorName() {
+		return crmOperatorName;
+	}
+
+	public void setCrmOperatorName(String crmOperatorName) {
+		this.crmOperatorName = crmOperatorName;
+	}
+
 	public String getShopOrderID() {
 		return shopOrderID;
 	}
@@ -210,4 +219,4 @@ public class CmRefundShop extends DataEntity<CmRefundShop> {
 	public void setShopDifference(ChangePayShopDifference shopDifference) {
 		this.shopDifference = shopDifference;
 	}
-}
+}

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

@@ -90,6 +90,12 @@ public class CmRefundShopService extends CrudService<CmRefundShopDao, CmRefundSh
         return page;
     }
 
+//    public List<CmRefundShop> exports(Page<CmRefundShop> cmRefundShopPage, CmRefundShop cmRefundShop){
+//        Page<CmRefundShop> result = super.findPage(cmRefundShopPage, cmRefundShop);
+//        List<CmRefundShop> list = result.getList();
+//        return list;
+//    }
+
     @Transactional(readOnly = false)
     public void save(CmRefundShop cmRefundShop) {
         super.save(cmRefundShop);

+ 40 - 14
src/main/java/com/caimei/modules/order/web/CmRefundShopController.java

@@ -1,10 +1,14 @@
 package com.caimei.modules.order.web;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.caimei.modules.common.utils.ExcelUtil;
+import com.caimei.modules.order.entity.CmRefundShop;
+import com.caimei.modules.order.service.CmRefundShopService;
 import com.caimei.modules.user.entity.CmUserOrganize;
 import com.caimei.modules.user.service.CmUserOrganizeService;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.thinkgem.jeesite.common.web.BaseController;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -14,14 +18,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.order.entity.CmRefundShop;
-import com.caimei.modules.order.service.CmRefundShopService;
-
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 退款表--供应商退款给采美Controller
@@ -37,7 +38,7 @@ public class CmRefundShopController extends BaseController {
 
 	@Autowired
 	private CmUserOrganizeService cmUserOrganizeService;
-	
+
 	@ModelAttribute
 	public CmRefundShop get(@RequestParam(required=false) String id) {
 		CmRefundShop entity = null;
@@ -49,7 +50,7 @@ public class CmRefundShopController extends BaseController {
 		}
 		return entity;
 	}
-	
+
 	@RequiresPermissions("order:cmRefundShop:view")
 	@RequestMapping(value = {"list", ""})
 	public String list(CmRefundShop cmRefundShop, HttpServletRequest request, HttpServletResponse response, Model model) {
@@ -69,6 +70,31 @@ public class CmRefundShopController extends BaseController {
 		return "modules/order/cmRefundShopList";
 	}
 
+	@RequestMapping(value = "export")
+	public void exports(CmRefundShop cmRefundShop, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+		if (null != cmRefundShop.getStartTime() && !"".equals(cmRefundShop.getStartTime()) && !cmRefundShop.getStartTime().endsWith("00:00:00")) {
+			cmRefundShop.setStartTime(cmRefundShop.getStartTime().trim() + " 00:00:00");
+		}
+		if (null != cmRefundShop.getEndTime() && !"".equals(cmRefundShop.getEndTime()) && !cmRefundShop.getEndTime().endsWith("23:59:59")) {
+			cmRefundShop.setEndTime(cmRefundShop.getEndTime().trim() + " 23:59:59");
+		}
+		//获取订单数据
+		String fileName = "退款记录列表.xls";
+		String template = Global.getConfig("export.template");
+		String templateFileName = template + "/refundShopList.xls";
+		try {
+			Map data = new HashMap<String, Object>();
+			Page<CmRefundShop> page = cmRefundShopService.findPage(new Page<CmRefundShop>(request, response), cmRefundShop);
+			List<CmRefundShop> list = page.getList();
+			data.put("list", list);
+			new ExcelUtil().createExcel(templateFileName, data, fileName, response);
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "退款记录列表导出失败!" + e.getMessage());
+			logger.info(e.getMessage());
+			e.printStackTrace();
+		}
+	}
+
 	@RequiresPermissions("order:cmRefundShop:view")
 	@RequestMapping(value = "form")
 	public String form(CmRefundShop cmRefundShop, Model model) {
@@ -86,7 +112,7 @@ public class CmRefundShopController extends BaseController {
 		addMessage(redirectAttributes, "保存退款表--供应商退款给采美成功");
 		return "redirect:"+Global.getAdminPath()+"/order/cmRefundShop/?repage";
 	}
-	
+
 	@RequiresPermissions("order:cmRefundShop:delete")
 	@RequestMapping(value = "delete")
 	public String delete(CmRefundShop cmRefundShop, RedirectAttributes redirectAttributes) {
@@ -145,4 +171,4 @@ public class CmRefundShopController extends BaseController {
 		}
 		return "redirect:"+Global.getAdminPath()+"/order/cmRefundShop/?repage";
 	}
-}
+}

+ 1 - 0
src/main/java/com/thinkgem/jeesite/common/service/CrudService.java

@@ -11,6 +11,7 @@ import com.caimei.modules.bulkpurchase.entity.PurchaseProduct;
 import com.caimei.modules.hehe.entity.HeheOrder;
 import com.caimei.modules.hehe.entity.HeheProduct;
 import com.caimei.modules.hehe.entity.HeheTransaction;
+import com.caimei.modules.order.entity.CmRefundShop;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 

BIN
src/main/resources/export/refundShopList.xls


+ 15 - 13
src/main/resources/mappings/modules/order/CmRefundShopMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.order.dao.CmRefundShopDao">
-    
+
 	<sql id="cmRefundShopColumns">
 		a.id AS "id",
 		a.shopID AS "shopID",
@@ -14,12 +14,12 @@
 		a.refundBalanceAmount AS "refundBalanceAmount",
 		a.delFlag AS "delFlag"
 	</sql>
-	
+
 	<sql id="cmRefundShopJoins">
 	</sql>
-    
+
 	<select id="get" resultType="CmRefundShop">
-		SELECT 
+		SELECT
 			<include refid="cmRefundShopColumns"/>,
 			s.name AS shopName
 		FROM cm_refund_shop a
@@ -28,17 +28,19 @@
 		WHERE a.id = #{id}
 		AND a.delFlag='0'
 	</select>
-	
+
 	<select id="findList" resultType="CmRefundShop">
 		SELECT DISTINCT
 			<include refid="cmRefundShopColumns"/>,
 			crsr.refundType AS recordRefundType,
 			u.name AS operatorName,
+			up.name AS crmOperatorName,
 			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
+		left join receipt_user_permission up on up.id = a.operator
 		<where>
 			<if test="organizeID != null and organizeID != 9999 and organizeID != 0 ">
 				AND a.id IN (
@@ -102,15 +104,15 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="CmRefundShop">
-		SELECT 
+		SELECT
 			<include refid="cmRefundShopColumns"/>
 		FROM cm_refund_shop a
 		<include refid="cmRefundShopJoins"/>
 		<where>
 			AND a.delFlag='0'
-		</where>		
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -119,7 +121,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert" parameterType="CmRefundShop"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_refund_shop(
 			id,
@@ -145,9 +147,9 @@
 			#{delFlag}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE cm_refund_shop SET 	
+		UPDATE cm_refund_shop SET
 			shopID = #{shopID},
 			operator = #{operator},
 			operatTime = #{operatTime},
@@ -159,7 +161,7 @@
 			delFlag = #{delFlag}
 		WHERE id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		DELETE FROM cm_refund_shop
 		WHERE id = #{id}
@@ -192,4 +194,4 @@
 		group by cfs.id
 		ORDER BY cfs.operatTime desc;
 	</select>
-</mapper>
+</mapper>

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

@@ -220,12 +220,12 @@
                     <span class="org-note">星范</span>
                 </c:if>
                     ${cmDiscernReceipt.name}
+                <c:if test="${cmDiscernReceipt.name eq null or cmDiscernReceipt.name  == ''}">
+                    ${cmDiscernReceipt.userName}
+                </c:if>
                 <c:if test="${cmDiscernReceipt.receiptOrderType eq 2}">
                     <font color="red">(呵呵商城)</font>
                 </c:if>
-                <c:if test="${cmDiscernReceipt.organizeID == 3}">
-
-                </c:if>
             </td>
             <td>
                 <c:if test="${cmDiscernReceipt.receiptType != 6}">${cmDiscernReceipt.orderType}</c:if>

+ 4 - 1
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopDetail.jsp

@@ -296,7 +296,7 @@
 				<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.refundWay == '1'||cmRefundShop.refundWay == '3'||cmRefundShop.refundWay == '4'}">
 							线下转账:
 							<c:if test="${cmRefundShop.refundType == '1'}">
 								建设银行7297
@@ -317,6 +317,9 @@
 								虚拟银行0000
 							</c:if>
 							,¥${cmRefundShop.refundAmount}
+							<c:if test="${cmRefundShop.refundWay eq 4}">
+								,${cmRefundShop.crmOperatorName}确认(CRM收款:${cmRefundShop.operatTime})
+							</c:if>
 						</c:if>
 					</div>
 					<div class="refund-wrapper">

+ 8 - 2
src/main/webapp/WEB-INF/views/modules/order/cmRefundShopList.jsp

@@ -114,11 +114,17 @@
 				</td>
 				<td>${cmRefundShop.shopOrderIDs}</td>
 				<td>${cmRefundShop.orderNo}</td>
-				<td>${cmRefundShop.operatorName}</td>
+				<td><c:if test="${cmRefundShop.refundWay ne 4}">
+						${cmRefundShop.operatorName}
+					</c:if>
+					<c:if test="${cmRefundShop.refundWay eq 4}">
+						${cmRefundShop.crmOperatorName}(CRM)
+					</c:if>
+				</td>
 				<td>${cmRefundShop.operatTime}</td>
 				<shiro:hasPermission name="order:cmRefundShop:view"><td>
     				<a href="${ctx}/order/cmRefundShop/toRefund?id=${cmRefundShop.id}">查看详情</a>&nbsp&nbsp
-					<c:if test="${cmRefundShop.recordRefundType ne 5}">
+					<c:if test="${cmRefundShop.recordRefundType ne 5 and cmRefundShop.refundWay ne 4}">
 						<a href="${ctx}/order/cmRefundShop/revocation?id=${cmRefundShop.id}" onclick="return confirmx('确定撤销此次退款吗?', this.href)">撤销退款</a>
 					</c:if>
 				</td></shiro:hasPermission>