Browse Source

邮费转账

wangxiaoming 7 years ago
parent
commit
dd072122da

+ 24 - 4
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Postage.java

@@ -1,7 +1,9 @@
 package com.iamberry.rst.core.cm;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 邮费转账
@@ -20,8 +22,10 @@ public class Postage implements Serializable {
     private Integer postageCustomerStatus;
     //状态(客服经理审核)1:审核中 2:通过  3:驳回
     private Integer postageManagerStatus;
-    //状态(财务审核) 1:审核中 2:通过(已申请待转账)  3:驳回  4:已转账
+    //状态(财务审核) 1:审核中 2:通过(已申请待转账)  3:驳回
     private Integer postageFinanceStatus;
+    //转账状态  是否转账:1待转   2:已转
+    private Integer postageTransferStatus;
     //订单来源 销售渠道id
     private Integer postageOrderSource;
     //售后处理方式 3:换新  4:维修  5:补发  6:退货  7:无理由退货
@@ -60,13 +64,13 @@ public class Postage implements Serializable {
     private  Integer[] companyIds;
 
     private Integer customerConfirm;    //确认   1有权限
-
     private Integer customerManager;    //经理审核权限   1有权限
-
     private Integer financeManager;    //财务审核权限   1有权限
-
     private Integer financePay;    //财务转账         1有权限
 
+    //邮费转账日志记录
+    private List<PostageAuthorityLog> postageAuthorityLogList = new ArrayList<PostageAuthorityLog>();
+
     public Integer getPostageId() {
         return postageId;
     }
@@ -290,4 +294,20 @@ public class Postage implements Serializable {
     public void setPostageLogisticsImg(String postageLogisticsImg) {
         this.postageLogisticsImg = postageLogisticsImg;
     }
+
+    public Integer getPostageTransferStatus() {
+        return postageTransferStatus;
+    }
+
+    public void setPostageTransferStatus(Integer postageTransferStatus) {
+        this.postageTransferStatus = postageTransferStatus;
+    }
+
+    public List<PostageAuthorityLog> getPostageAuthorityLogList() {
+        return postageAuthorityLogList;
+    }
+
+    public void setPostageAuthorityLogList(List<PostageAuthorityLog> postageAuthorityLogList) {
+        this.postageAuthorityLogList = postageAuthorityLogList;
+    }
 }

+ 62 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/PostageAuthorityLog.java

@@ -0,0 +1,62 @@
+package com.iamberry.rst.core.cm;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  邮费转账审核日志表类
+ * @author Administrator
+ * @Date 2018-04-12
+ */
+public class PostageAuthorityLog  implements  Serializable{
+    private static final long serialVersionUID = -3003636937972673119L;
+    //日志id
+    private Integer authorityLogId;
+    //审核人员id
+    private Integer adminId;
+    //邮费转账id
+    private Integer postageId;
+    //审核类型:审核类型:1:客服人员   2:客服经理  3:财务审核  4:财务打款
+    private Integer authorityLogType;
+    //审核创建时间'
+    private Date authorityLogCreateTime;
+
+    public Integer getAuthorityLogId(){
+        return authorityLogId;
+    }
+
+    public void setAuthorityLogId(Integer  authorityLogId){
+        this.authorityLogId=authorityLogId;
+    }
+
+    public Integer getAdminId(){
+        return adminId;
+    }
+
+    public void setAdminId(Integer  adminId){
+        this.adminId=adminId;
+    }
+
+    public Integer getPostageId(){
+        return postageId;
+    }
+
+    public void setPostageId(Integer  postageId){
+        this.postageId=postageId;
+    }
+
+    public Integer getAuthorityLogType(){
+        return authorityLogType;
+    }
+
+    public void setAuthorityLogType(Integer  authorityLogType){
+        this.authorityLogType=authorityLogType;
+    }
+
+    public Date getAuthorityLogCreateTime(){
+        return authorityLogCreateTime;
+    }
+
+    public void setAuthorityLogCreateTime(Date  authorityLogCreateTime){
+        this.authorityLogCreateTime=authorityLogCreateTime;
+    }
+}

+ 43 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/PostageAuthorityLogService.java

@@ -0,0 +1,43 @@
+package com.iamberry.rst.faces.cm;
+
+import com.iamberry.rst.core.cm.PostageAuthorityLog;
+
+import java.util.List;
+
+/**
+ *  邮费转账审核日志表接口
+ * @author Administrator
+ * @Date 2018-04-12
+ */
+public interface PostageAuthorityLogService {
+    /**
+     * 获取集合
+     * @param  postageAuthorityLog
+     * @return List
+     */
+    List<PostageAuthorityLog> getPostageAuthorityLogList(PostageAuthorityLog  postageAuthorityLog);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  postageAuthorityLog
+     */
+    PostageAuthorityLog  getPostageAuthorityLogById(Integer  id);
+    /**
+     * 增加数据
+     * @param  postageAuthorityLog
+     * @return Integer
+     */
+    Integer  save(PostageAuthorityLog  postageAuthorityLog);
+    /**
+     * 修改数据
+     * @param  postageAuthorityLog
+     * @return Integer
+     */
+    Integer  update(PostageAuthorityLog  postageAuthorityLog);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+}

+ 65 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/PostageAuthorityLogServiceImpl.java

@@ -0,0 +1,65 @@
+package com.iamberry.rst.service.cm;
+
+import com.iamberry.rst.core.cm.PostageAuthorityLog;
+import com.iamberry.rst.faces.cm.PostageAuthorityLogService;
+import com.iamberry.rst.service.cm.mapper.PostageAuthorityLogMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  邮费转账审核日志表接口
+ * @author Administrator
+ * @Date 2018-04-12
+ */
+@Service
+public class PostageAuthorityLogServiceImpl  implements PostageAuthorityLogService {
+    @Autowired
+    private PostageAuthorityLogMapper postageAuthorityLogMapper;
+    /**
+     * 获取集合
+     * @param  postageAuthorityLog
+     * @return List
+     */
+    @Override
+    public List<PostageAuthorityLog> getPostageAuthorityLogList(PostageAuthorityLog  postageAuthorityLog){
+        return  postageAuthorityLogMapper.getPostageAuthorityLogList(postageAuthorityLog);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  postageAuthorityLog
+     */
+    @Override
+    public  PostageAuthorityLog  getPostageAuthorityLogById(Integer  id){
+        return  postageAuthorityLogMapper.getPostageAuthorityLogById(id);
+    }
+    /**
+     * 增加数据
+     * @param  postageAuthorityLog
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(PostageAuthorityLog  postageAuthorityLog){
+        return  postageAuthorityLogMapper.save(postageAuthorityLog);
+    }
+    /**
+     * 修改数据
+     * @param  postageAuthorityLog
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(PostageAuthorityLog  postageAuthorityLog){
+        return  postageAuthorityLogMapper.update(postageAuthorityLog);
+    }
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    @Override
+    public  Integer  delete(Integer  id){
+        return  postageAuthorityLogMapper.delete(id);
+    }
+}

+ 43 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/PostageAuthorityLogMapper.java

@@ -0,0 +1,43 @@
+package com.iamberry.rst.service.cm.mapper;
+
+import com.iamberry.rst.core.cm.PostageAuthorityLog;
+
+import java.util.List;
+
+/**
+ *  邮费转账审核日志表接口
+ * @author Administrator
+ * @Date 2018-04-12
+ */
+public interface PostageAuthorityLogMapper {
+    /**
+     * 获取集合
+     * @param  postageAuthorityLog
+     * @return List
+     */
+    List<PostageAuthorityLog> getPostageAuthorityLogList(PostageAuthorityLog  postageAuthorityLog);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  postageAuthorityLog
+     */
+    PostageAuthorityLog  getPostageAuthorityLogById(Integer  id);
+    /**
+     * 增加数据
+     * @param  postageAuthorityLog
+     * @return Integer
+     */
+    Integer  save(PostageAuthorityLog  postageAuthorityLog);
+    /**
+     * 修改数据
+     * @param  postageAuthorityLog
+     * @return Integer
+     */
+    Integer  update(PostageAuthorityLog  postageAuthorityLog);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+}

+ 84 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/postageAuthorityLogMapper.xml

@@ -0,0 +1,84 @@
+<?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.iamberry.rst.service.cm.mapper.PostageAuthorityLogMapper">
+    <resultMap  id="BaseResultMap" type="PostageAuthorityLog" >
+        <result    column="authority_log_id"    property="authorityLogId" />
+        <result    column="admin_id"    property="adminId" />
+        <result    column="postage_id"    property="postageId" />
+        <result    column="authority_log_type"    property="authorityLogType" />
+        <result    column="authority_log_create_time"    property="authorityLogCreateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.authority_log_id,
+        t.admin_id,
+        t.postage_id,
+        t.authority_log_type,
+        t.authority_log_create_time
+    </sql>
+    <select id="getPostageAuthorityLogList" resultMap="BaseResultMap" parameterType="PostageAuthorityLog" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_postage_authority_log t
+        <where>
+            <if test="authorityLogId != null ">
+                AND t.authority_log_id = #{authorityLogId}
+            </if >
+            <if test="adminId != null ">
+                AND t.admin_id = #{adminId}
+            </if >
+            <if test="postageId != null ">
+                AND t.postage_id = #{postageId}
+            </if >
+            <if test="authorityLogType != null ">
+                AND t.authority_log_type = #{authorityLogType}
+            </if >
+        </where>
+    </select>
+    <select id="getPostageAuthorityLogById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_postage_authority_log t
+        where t.authority_log_id= #{authorityLogId}
+    </select>
+    <insert id="save" parameterType="PostageAuthorityLog" >
+        insert into
+        tb_rst_postage_authority_log
+        (
+        authority_log_id,
+        admin_id,
+        postage_id,
+        authority_log_type
+        )
+        values
+        (
+        #{authorityLogId},
+        #{adminId},
+        #{postageId},
+        #{authorityLogType}
+        )
+    </insert>
+    <update id="update" parameterType="PostageAuthorityLog" >
+        update
+        tb_rst_postage_authority_log
+        <set >
+            <if test="authorityLogId != null ">
+                authority_log_id = #{authorityLogId},
+            </if >
+            <if test="adminId != null ">
+                admin_id = #{adminId},
+            </if >
+            <if test="postageId != null ">
+                postage_id = #{postageId},
+            </if >
+            <if test="authorityLogType != null ">
+                authority_log_type = #{authorityLogType},
+            </if >
+        </set >
+        where authority_log_id= #{authorityLogId}
+    </update>
+    <delete id="delete" parameterType="Integer" >
+        delete FROM
+        tb_rst_postage_authority_log
+        where authority_log_id=#{authorityLogId}
+    </delete>
+</mapper>

+ 13 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/postageMapper.xml

@@ -8,6 +8,7 @@
     <result column="postage_customer_status" property="postageCustomerStatus" jdbcType="INTEGER" />
     <result column="postage_manager_status" property="postageManagerStatus" jdbcType="INTEGER" />
     <result column="postage_finance_status" property="postageFinanceStatus" jdbcType="INTEGER" />
+    <result column="postage_transfer_status" property="postageTransferStatus" jdbcType="INTEGER" />
     <result column="postage_order_source" property="postageOrderSource" jdbcType="INTEGER" />
     <result column="postage_treatment_method" property="postageTreatmentMethod" jdbcType="INTEGER" />
     <result column="sales_orderId" property="salesOrderId" jdbcType="VARCHAR" />
@@ -24,7 +25,7 @@
   </resultMap>
 
   <sql id="Base_Column_List" >
-    p.postage_id, p.admin_id, p.customer_id, p.company_id,  p.postage_customer_status, p.postage_manager_status, p.postage_finance_status,p.postage_logistics_img,
+    p.postage_id, p.admin_id, p.customer_id, p.company_id,  p.postage_customer_status, p.postage_manager_status, p.postage_finance_status, p.postage_transfer_status, p.postage_logistics_img,
     p.postage_order_source, p.postage_treatment_method, p.sales_orderId, p.postage_client_name,
     p.postage_client_tel,p.postage_client_address, p.postage_logistics_company, p.postage_logistics_no, p.postage_amount,
     p.postage_alipay, p.postage_alipay_name, p.postage_create_time, p.postage_update_time
@@ -57,6 +58,9 @@
       <if test="postageFinanceStatus != null and postageFinanceStatus != ''">
         AND p.postage_finance_status = #{postageFinanceStatus}
       </if>
+      <if test="postageTransferStatus != null and postageTransferStatus != ''">
+        AND p.postage_transfer_status = #{postageTransferStatus}
+      </if>
       <if test="postageOrderSource != null and postageOrderSource != ''">
         AND p.postage_order_source = #{postageOrderSource}
       </if>
@@ -107,7 +111,7 @@
 
     <insert id="savePostage" parameterType="Postage" >
     insert into tb_rst_postage (postage_id, admin_id, customer_id, company_id, postage_customer_status,
-    postage_manager_status, postage_finance_status,
+    postage_manager_status, postage_finance_status,postage_transfer_status,
     postage_order_source, postage_treatment_method,
     sales_orderId, postage_client_name, postage_client_tel,
     postage_client_address,
@@ -115,7 +119,7 @@
     postage_amount, postage_alipay, postage_alipay_name,postage_logistics_img
     )
     values (#{postageId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},#{companyId,jdbcType=INTEGER}, #{postageCustomerStatus,jdbcType=INTEGER},
-    #{postageManagerStatus,jdbcType=INTEGER}, #{postageFinanceStatus,jdbcType=INTEGER},
+    #{postageManagerStatus,jdbcType=INTEGER}, #{postageFinanceStatus,jdbcType=INTEGER},  #{postageTransferStatus,jdbcType=INTEGER},
     #{postageOrderSource,jdbcType=INTEGER}, #{postageTreatmentMethod,jdbcType=INTEGER},
     #{salesOrderId,jdbcType=VARCHAR}, #{postageClientName,jdbcType=VARCHAR}, #{postageClientTel,jdbcType=VARCHAR},
     #{postageClientAddress,jdbcType=VARCHAR},
@@ -145,6 +149,9 @@
       <if test="postageFinanceStatus != null" >
         postage_finance_status = #{postageFinanceStatus,jdbcType=INTEGER},
       </if>
+      <if test="postageTransferStatus != null" >
+        postage_transfer_status = #{postageTransferStatus,jdbcType=INTEGER},
+      </if>
       <if test="postageOrderSource != null" >
         postage_order_source = #{postageOrderSource,jdbcType=INTEGER},
       </if>
@@ -213,6 +220,9 @@
       <if test="postageFinanceStatus != null and postageFinanceStatus != ''">
         AND p.postage_finance_status = #{postageFinanceStatus}
       </if>
+      <if test="postageTransferStatus != null and postageTransferStatus != ''">
+        AND p.postage_transfer_status = #{postageTransferStatus}
+      </if>
       <if test="postageOrderSource != null and postageOrderSource != ''">
         AND p.postage_order_source = #{postageOrderSource}
       </if>

+ 75 - 8
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminPostageController.java

@@ -4,6 +4,8 @@ import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.order.ProductType;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.Admin;
+import com.iamberry.rst.faces.cm.CompanyInfoService;
+import com.iamberry.rst.faces.cm.PostageAuthorityLogService;
 import com.iamberry.rst.faces.cm.PostageAuthorityService;
 import com.iamberry.rst.faces.cm.PostageService;
 import com.iamberry.rst.faces.sys.SysService;
@@ -42,6 +44,10 @@ public class AdminPostageController {
     private PostageAuthorityService postageAuthorityService;
     @Autowired
     private SysService sysService;
+    @Autowired
+    private CompanyInfoService companyInfoService;
+    @Autowired
+    private PostageAuthorityLogService postageAuthorityLogService;
 
     /**
      * 获取客诉列表
@@ -60,11 +66,19 @@ public class AdminPostageController {
 
         PagedResult<Postage> pagedResult = new PagedResult<>();
 
+        List<CompanyInfo> companyInfoList = companyInfoService.listCompanyInfo(new CompanyInfo());
+
         //获取登录人id
-        if(loginAdmin.getAdminDept() == 3 && loginAdmin.getAdminManager() == 1){        //员工
+        if(loginAdmin.getAdminDept() == 3){        //员工
             postage.setAdminId(loginAdmin.getAdminId());
-        }else if(loginAdmin.getAdminDept() == 3 && loginAdmin.getAdminManager() == 2) {
 
+            if(companyInfoList != null && companyInfoList.size() > 0){
+                Integer[]  companyIds = new Integer[companyInfoList.size()];
+                for (int m=0;m<companyInfoList.size();m++){
+                    companyIds[m] = companyInfoList.get(m).getCompanyId();
+                }
+                postage.setCompanyIds(companyIds);
+            }
         }else{
             /*  获取个人权限所属的销售公司 ,只查询所分的权限的列表 */
             ArrayList companyIdList = new ArrayList();
@@ -72,7 +86,7 @@ public class AdminPostageController {
             for (PostageAuthority postageAuthority:postageAuthorityList ) {
                 companyIdList.add(postageAuthority.getCompanyId());
             }
-            Integer[] companyIds = (Integer[]) companyIdList.toArray(new Integer[companyIdList.size()]);//能正确运行
+            Integer[] companyIds = (Integer[]) companyIdList.toArray(new Integer[companyIdList.size()]);    //获取本身配置的销售公司
             if(companyIds == null || companyIds.length == 0){
                 companyIds = new Integer[]{99};
             }
@@ -190,6 +204,10 @@ public class AdminPostageController {
         if( status == null || status == 0){
             return new ResponseJson(500, "修改状态失败,请重试", 500);
         }
+
+        //获取登录人id
+        Admin loginAdmin = AdminUtils.getLoginAdmin();
+
         Postage post = postageService.getPostage(postageId);
 
         Postage postage = new Postage();
@@ -215,25 +233,49 @@ public class AdminPostageController {
                         postage.setPostageManagerStatus(status);    //驳回
                     }
                     num = postageService.updatePostage(postage);
+                    if(num > 0){        //客服经理审核
+                        PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
+                        postageAuthorityLog.setAdminId(loginAdmin.getAdminId());
+                        postageAuthorityLog.setPostageId(postageId);
+                        postageAuthorityLog.setAuthorityLogType(2);
+                        postageAuthorityLogService.save(postageAuthorityLog);       //增加日志
+                    }
                 }
                 break;
             case 3:         //财务审核
                 if((post.getPostageFinanceStatus() == 1) && verificaAuthority(post.getCompanyId(),3)){
                     //状态(财务审核) 1:审核中 2:通过(已申请待转账)  3:驳回  4:已转账
-                    postage.setPostageFinanceStatus(status);
+                    if(status == 2){
+                        postage.setPostageFinanceStatus(status);
+                        postage.setPostageTransferStatus(1);
+                    }else{
+                        postage.setPostageFinanceStatus(status);
+                    }
                     num = postageService.updatePostage(postage);
+                    if(num > 0){        //客服经理审核
+                        PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
+                        postageAuthorityLog.setAdminId(loginAdmin.getAdminId());
+                        postageAuthorityLog.setPostageId(postageId);
+                        postageAuthorityLog.setAuthorityLogType(3);
+                        postageAuthorityLogService.save(postageAuthorityLog);       //增加日志
+                    }
                 }
                 break;
             case 4:     //财务打款
-
                 if((post.getPostageFinanceStatus() == 2) && verificaAuthority(post.getCompanyId(),4)){
-                    //状态(财务审核) 1:审核中 2:通过(已申请待转账)  3:驳回  4:已转账
-                    postage.setPostageFinanceStatus(status);
+                    //转账状态 是否转账:1已转   2:未转
+                    postage.setPostageTransferStatus(status);
                     num = postageService.updatePostage(postage);
+                    if(num > 0){        //客服经理审核
+                        PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
+                        postageAuthorityLog.setAdminId(loginAdmin.getAdminId());
+                        postageAuthorityLog.setPostageId(postageId);
+                        postageAuthorityLog.setAuthorityLogType(4);
+                        postageAuthorityLogService.save(postageAuthorityLog);       //增加日志
+                    }
                 }
                 break;
         }
-
         if(num > 0){
             return new ResponseJson(200, "修改状态成功", 200);
         }else{
@@ -242,6 +284,31 @@ public class AdminPostageController {
     }
 
     /**
+     * 打印
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("postage:select:list")
+    @RequestMapping(value = "/print_postage")
+    public ResponseJson printPostage(HttpServletRequest request, Integer postageId) throws Exception {
+        if(postageId == null || postageId == 0){
+            return new ResponseJson(500, "未获取到记录id", 500);
+        }
+        Postage  postage = postageService.getPostage(postageId);
+
+        PostageAuthorityLog postageAuthorityLog = new PostageAuthorityLog();
+        postageAuthorityLog.setPostageId(postageId);
+        List<PostageAuthorityLog> postageAuthorityLogList = postageAuthorityLogService.getPostageAuthorityLogList(postageAuthorityLog);
+        postage.setPostageAuthorityLogList(postageAuthorityLogList);
+
+        if(postage != null){
+            return new ResponseJson(200, "修改状态成功", 200);
+        }else{
+            return new ResponseJson(500, "修改状态失败", 500);
+        }
+    }
+
+    /**
      * 删除
      * @return
      */

+ 2 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java

@@ -519,7 +519,7 @@ public class MQTask implements InitializingBean {
 
 			pt = new Postage();
 			pt.setCompanyId(ci.getCompanyId());
-			pt.setPostageFinanceStatus(2);		//状态(财务审核) 2:通过(已申请待转账)
+			pt.setPostageTransferStatus(1);		//是否转账:1待转   2:已转
 			for (Integer financialPayment: authorityFinancialPaymentSet) {    //financialPayment 为id
 				Integer postageNumber = postageService.getPostageNumber(pt);
 				if(map.get(financialPayment) == null){
@@ -529,6 +529,7 @@ public class MQTask implements InitializingBean {
 					map.put(financialPayment,number + postageNumber);
 				}
 			}
+
 		}
 
 		for (Map.Entry<Integer,Integer> m: map.entrySet()) {

+ 2 - 0
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -83,6 +83,7 @@
 		<typeAlias type="com.iamberry.rst.core.cm.CustomerCommon" alias="CustomerCommon"/>
 		<typeAlias type="com.iamberry.rst.core.cm.Postage" alias="Postage"/>
 		<typeAlias type="com.iamberry.rst.core.cm.PostageAuthority" alias="PostageAuthority"/>
+		<typeAlias type="com.iamberry.rst.core.cm.PostageAuthorityLog" alias="PostageAuthorityLog"/>
 
 		<typeAlias type="com.iamberry.rst.core.sys.SysConfig" alias="SysConfig"/>
 
@@ -145,6 +146,7 @@
 		<mapper resource="com/iamberry/rst/service/cm/mapper/customerCommonMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/cm/mapper/postageMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/cm/mapper/postageAuthorityMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/cm/mapper/postageAuthorityLogMapper.xml"/>
 
 		<mapper resource="com/iamberry/rst/service/address/mapper/addressMapper.xml"/>
 

+ 115 - 11
watero-rst-web/src/main/webapp/WEB-INF/views/cm/postage/postage_list.ftl

@@ -47,6 +47,7 @@
                 <option value="2" <#if postage.postageManagerStatus??><#if postage.postageManagerStatus == 2 >selected="selected"</#if></#if>>通过</option>
                 <option value="3" <#if postage.postageManagerStatus??><#if postage.postageManagerStatus == 3 >selected="selected"</#if></#if>>驳回</option>
             </select>
+
             <select class="my-select" name="postageFinanceStatus" id="postageFinanceStatus" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
                 <option value="">财务审核</option>
                 <option value="1" <#if postage.postageFinanceStatus??><#if postage.postageFinanceStatus == 1 >selected="selected"</#if></#if>>待审核</option>
@@ -55,20 +56,26 @@
                 <option value="4" <#if postage.postageFinanceStatus??><#if postage.postageFinanceStatus == 4 >selected="selected"</#if></#if>>已转账</option>
             </select>
 
+            <select class="my-select" name="postageTransferStatus" id="postageTransferStatus" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
+                <option value="">财务打款</option>
+                <option value="1" <#if postage.postageTransferStatus??><#if postage.postageTransferStatus == 1 >selected="selected"</#if></#if>>待转</option>
+                <option value="2" <#if postage.postageTransferStatus??><#if postage.postageTransferStatus == 2 >selected="selected"</#if></#if>>已转</option>
+            </select>
+
             <button type="submit" class="btn" style="background: #32a3d8;color: #fff;height: 35px; id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
         </form>
     </div>
 
-
     <div class="mt-20">
         <table class="table table-border table-bg table-bordered">
             <thead>
             <tr class="text-c">
-                <th width="50">客诉编号</th>
+                <th width="40">客诉编号</th>
                 <th width="50">客服人员</th>
                 <th width="50">申请状态</th>
-                <th width="50">客服经理审核状态</th>
-                <th width="50">财务审核状态</th>
+                <th width="50">客服经理审核</th>
+                <th width="50">财务审核</th>
+                <th width="50">财务打款</th>
                 <th width="60">订单来源</th>
                 <th width="70">售后处理方式</th>
                 <th width="80">订单号</th>
@@ -115,11 +122,20 @@
                             <#if postage.postageFinanceStatus == 1>
                                 审核中
                             <#elseif postage.postageFinanceStatus == 2>
-                                通过(已申请待转账)
+                                通过
                             <#elseif postage.postageFinanceStatus == 3>
                                 驳回
-                            <#elseif postage.postageFinanceStatus == 4>
-                                已转账
+                            </#if>
+                        <#else>
+                            -
+                        </#if>
+                    </td>
+                    <td>
+                        <#if postage.postageTransferStatus??>
+                            <#if postage.postageTransferStatus == 1>
+                                待转
+                            <#elseif postage.postageTransferStatus == 2>
+                                已转
                             </#if>
                         <#else>
                             -
@@ -171,7 +187,7 @@
                         </#if>
                     </td>
                     <td>${postage.postageLogisticsNo!''}</td>
-                    <td>${postage.postageAmount!''}</td>
+                    <td>${postage.postageAmount/100!''}</td>
                     <td>${postage.postageAlipay!''}</td>
                     <td>${postage.postageAlipayName!''}</td>
                     <td>
@@ -207,15 +223,24 @@
                             <a style="text-decoration:none" href="javascript:;" title="审核通过" onclick="updatePostage(${postage.postageId},2,3);">
                                 <i class="iconfont icon-pass-2-copy"></i>
                             </a>
-                            <a style="text-decoration:none" href="javascript:;" title="审核不通过" onclick="updatePostage(${postage.postageId},2,3);">
+                            <a style="text-decoration:none" href="javascript:;" title="审核不通过" onclick="updatePostage(${postage.postageId},3,3);">
                                 <i class="iconfont icon-bohui"></i>
                             </a>
                         </#if>
-                        <#if postage.postageFinanceStatus?? && postage.postageFinanceStatus == 2 &&  postage.financePay==1 >
-                            <a style="text-decoration:none" href="javascript:;" title="已转账" onclick="updatePostage(${postage.postageId},4,4);">
+
+                        <#if postage.postageTransferStatus?? && postage.postageTransferStatus == 1 &&  postage.financePay==1 >
+                            <a style="text-decoration:none" href="javascript:;" title="已转账" onclick="updatePostage(${postage.postageId},2,4);">
                                 <i class="iconfont icon-zhuanzhang"></i>
                             </a>
+                            &nbsp;
+                        </#if>
+
+                        <#if postage.postageTransferStatus?? && (postage.postageTransferStatus == 1 ||  postage.postageTransferStatus == 2) >
+                            <a style="text-decoration:none" href="javascript:;" title="打印" onclick="printPostage(${postage.postageId});">
+                                <i class="Hui-iconfont">&#xe652;</i>
+                            </a>
                         </#if>
+
                     </td>
                 </tr>
                 </#list>
@@ -226,9 +251,66 @@
         </table>
     </div>
 </div>
+
+<div  style="padding: 0px;margin: 0px;display: nonde;" >
+    <div id="printlist" style="">
+        <ul style=" height: 460px;margin-left: 20px;margin-right: 20px;">
+            <li style="font-size: 23px;height: 25px;display: block;text-align: center;font-weight: bold;margin-top: 15px">商品换货退货退款审批</li>
+            <li style="font-size: 15px;height: 30px;display: block;text-align: left;margin-top: 15px">深圳爱贝源科技有限公司&nbsp;&nbsp;&nbsp;&nbsp;申请日期:<span>2018-12-11</span></li>
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">审批编码</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">2018xxxxxxxxxxxxxxxx</div>
+            </li>
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">申请人</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">wxm</div>
+            </li>
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">申请部门</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">运营部</div>
+            </li>
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;"></div>
+                <div style="float:left;display:block;width:99px;line-height: 15px;height: 40px;border-right: 1px solid #000000;text-align: center;">客户成交入口</div>
+                <div style="float:left;display:block;width:50px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">售后类型</div>
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">销售时间及退换货原因</div>
+                <div style="float:left;display:block;width:50px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">交易号</div>
+                <div style="float:left;display:block;width:89px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">客户名称</div>
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">联系电话</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">详细地址</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">快递公司</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">快递单号</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">快递费用承担方</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">退回商品名称/型号</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">销售员</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">数量</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">退款金额</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">退款账户</div>
+            </li>
+
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">客服经理审批</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">xxx</div>
+            </li>
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">财务经理审批</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">xxx</div>
+            </li>
+            <li style="height: 40px;font-size: 12px;font-weight: normal;border-bottom: 1px solid #000000;border-left: 1px solid #000000;border-right: 1px solid #000000;">
+                <div style="float:left;display:block;width:80px;line-height: 40px;height: 40px;border-right: 1px solid #000000;text-align: center;">财务打款</div>
+                <div style="float:left;display:block;width:140px;line-height: 40px;height: 40px;text-align: center;">xxx</div>
+            </li>
+
+            <li style="font-size: 15px;height: 30px;display: block;text-align: left;margin-top: 15px">打印时间:<span>2018-12-11</span>&nbsp;&nbsp;&nbsp;&nbsp;打印人:<span>xxx</span></li>
+        </ul>
+    </div>
+</div>
+
+
 <tfoot>
 <#include "/base/page_util.ftl">
 <script type="text/javascript" src="${path}/common/lib/lightbox2/2.8.1/js/lightbox.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery.PrintArea/jquery.PrintArea.js"></script>
 </tfoot>
 <script type="text/javascript">
     /**
@@ -256,6 +338,28 @@
         }, function() {
         });
     }
+
+    /**
+     * 打印
+     */
+    function printPostage(postageId) {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: {"postageId":postageId},
+                url: "${path}" + "/admin/postage/print_postage",
+                async: true,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        $("#printlist").printArea();
+                    } else {
+                        layer.msg(data.resultMsg,{icon: 5,time:3000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            })
+    }
 </script>
 </body>
 </html>