فهرست منبع

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

wangxiaoming 6 سال پیش
والد
کامیت
8795585295

+ 1 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CmRelation.java

@@ -65,7 +65,7 @@ public class CmRelation implements  Serializable{
     private Integer relationState;
     //转账账户
     private String relationAlipay;
-    //是否已转账邮费 0:不需要 1:已转 2:已申请待转 3:未申请
+    //是否已转账邮费  1.需要 2:不需要
     private Integer relationIsTransfer;
     //转账账户姓名
     private String relationAlipayName;

+ 92 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/PostageInfo.java

@@ -0,0 +1,92 @@
+package com.iamberry.rst.core.cm;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by Administrator on 2019/1/19.
+ */
+public class PostageInfo implements Serializable{
+    private static final long serialVersionUID = -2801220465255192898L;
+    private Integer postageId;//
+    private Integer relationId;//处理方式id
+    private Integer postageStatus;//状态
+    private Integer postageAmount;//邮费金额
+    private String postageAlipay;//支付宝账户
+    private String postageAlipayName;//支付宝姓名
+    private String postageDesc;//备注
+    private Date postageCreateTime;//创建时间
+    private Date postageUpdateTime;//修改时间
+
+    public Integer getPostageId() {
+        return postageId;
+    }
+
+    public void setPostageId(Integer postageId) {
+        this.postageId = postageId;
+    }
+
+    public Integer getRelationId() {
+        return relationId;
+    }
+
+    public void setRelationId(Integer relationId) {
+        this.relationId = relationId;
+    }
+
+    public Integer getPostageStatus() {
+        return postageStatus;
+    }
+
+    public void setPostageStatus(Integer postageStatus) {
+        this.postageStatus = postageStatus;
+    }
+
+    public Integer getPostageAmount() {
+        return postageAmount;
+    }
+
+    public void setPostageAmount(Integer postageAmount) {
+        this.postageAmount = postageAmount;
+    }
+
+    public String getPostageAlipay() {
+        return postageAlipay;
+    }
+
+    public void setPostageAlipay(String postageAlipay) {
+        this.postageAlipay = postageAlipay;
+    }
+
+    public String getPostageAlipayName() {
+        return postageAlipayName;
+    }
+
+    public void setPostageAlipayName(String postageAlipayName) {
+        this.postageAlipayName = postageAlipayName;
+    }
+
+    public String getPostageDesc() {
+        return postageDesc;
+    }
+
+    public void setPostageDesc(String postageDesc) {
+        this.postageDesc = postageDesc;
+    }
+
+    public Date getPostageCreateTime() {
+        return postageCreateTime;
+    }
+
+    public void setPostageCreateTime(Date postageCreateTime) {
+        this.postageCreateTime = postageCreateTime;
+    }
+
+    public Date getPostageUpdateTime() {
+        return postageUpdateTime;
+    }
+
+    public void setPostageUpdateTime(Date postageUpdateTime) {
+        this.postageUpdateTime = postageUpdateTime;
+    }
+}

+ 36 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java

@@ -233,4 +233,40 @@ public interface CustomerService {
     Integer updateRelation(CustomerInfo cm);
 
     List<CustomerCommon> listCustomerCommons(CustomerCommon customerCommon);
+
+    /**
+     * 查询邮费信息
+     * @return
+     */
+    PostageInfo  getPostageInfo(Integer postageId);
+
+    /**
+     * 查询邮费信息集合
+     * @return
+     */
+    List<PostageInfo>  listPostageInfo(Integer relationId);
+
+    /**
+     * 添加邮费信息
+     * @return
+     */
+    Integer  addPostageInfo(PostageInfo postageInfo);
+
+    /**
+     * 修改邮费信息
+     * @return
+     */
+    Integer  updatePostageInfo(PostageInfo postageInfo);
+
+    /**
+     * 修改邮费信息
+     * @return
+     */
+    Integer  deletePostageInfo(Integer postageId);
+
+    /**
+     * 同步邮费信息
+     * @return
+     */
+    String  synchronizePostageInfo();
 }

+ 71 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -1558,4 +1558,75 @@ public class CustomerServiceImpl implements CustomerService {
         }
         return customerCommonList;
     }
+
+    @Override
+    public PostageInfo getPostageInfo(Integer postageId) {
+        return customerInfoMapper.getPostageInfo(postageId);
+    }
+
+    @Override
+    public List<PostageInfo> listPostageInfo(Integer relationId) {
+        return customerInfoMapper.listPostageInfo(relationId);
+    }
+
+    @Override
+    public Integer addPostageInfo(PostageInfo postageInfo) {
+        return customerInfoMapper.addPostageInfo(postageInfo);
+    }
+
+    @Override
+    public Integer updatePostageInfo(PostageInfo postageInfo) {
+        return customerInfoMapper.updatePostageInfo(postageInfo);
+    }
+
+    @Override
+    public Integer deletePostageInfo(Integer postageId) {
+        return customerInfoMapper.deletePostageInfo(postageId);
+    }
+
+    @Override
+    @Transactional
+    public String synchronizePostageInfo() {
+        List<CmRelation> cmRelationlist = cmRelationMapper.getCmRelationList(new CmRelation());
+        Integer num = 0;//成功个数
+        Integer oum = 0;//失败个数
+        try {
+                for (CmRelation cmRelation : cmRelationlist){
+                    PostageInfo postageInfo = new PostageInfo();
+                    postageInfo.setRelationId(cmRelation.getRelationId());
+                    postageInfo.setPostageAlipay(cmRelation.getRelationAlipay() == null ? "" : cmRelation.getRelationAlipay());
+                    postageInfo.setPostageAlipayName(cmRelation.getRelationAlipayName() == null ? "" : cmRelation.getRelationAlipayName());
+                    if(cmRelation.getRelationBackPostage() == null){
+                        postageInfo.setPostageAmount(0);
+                    }else{
+                        postageInfo.setPostageAmount(cmRelation.getRelationBackPostage());
+                    }
+                    if(cmRelation.getRelationIsTransfer() == null){
+                        postageInfo.setPostageStatus(1);
+                    }else{
+                        if(cmRelation.getRelationIsTransfer() == 1){
+                            postageInfo.setPostageStatus(3);
+                        }else if (cmRelation.getRelationIsTransfer() == 3){
+                            postageInfo.setPostageStatus(1);
+                        }else if (cmRelation.getRelationIsTransfer() == 10){
+                            postageInfo.setPostageStatus(4);
+                        }else{
+                            postageInfo.setPostageStatus(cmRelation.getRelationIsTransfer());
+                        }
+                    }
+                    if(cmRelation.getRelationIsTransfer() != null){
+                        int msg = customerService.addPostageInfo(postageInfo);
+                        if(msg < 1){
+                            oum++;
+                        }else{
+                            num++;
+                        }
+                    }
+
+                }
+            } catch (Exception e) {
+                    throw new RuntimeException("同步邮费信息失败");
+            }
+        return "同步成功:"+num+"个,失败:"+oum+"个";
+    }
 }

+ 30 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/CustomerInfoMapper.java

@@ -116,4 +116,34 @@ public interface CustomerInfoMapper {
      */
     CmRelation getCmRelationInfo(CmRelation cmRelation);
 
+    /**
+     * 查询邮费信息
+     * @return
+     */
+    PostageInfo  getPostageInfo(Integer postageId);
+
+    /**
+     * 查询邮费信息集合
+     * @return
+     */
+    List<PostageInfo>  listPostageInfo(Integer relationId);
+
+    /**
+     * 添加邮费信息
+     * @return
+     */
+    Integer  addPostageInfo(PostageInfo postageInfo);
+
+    /**
+     * 修改邮费信息
+     * @return
+     */
+    Integer  updatePostageInfo(PostageInfo postageInfo);
+
+    /**
+     * 修改邮费信息
+     * @return
+     */
+    Integer  deletePostageInfo(Integer postageId);
+
 }

+ 52 - 6
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -700,12 +700,6 @@ si.store_name AS storeName,
 null AS itemProductName,
 null as itemProductColor,
 null as itemNum,
-null AS relationBackLogisticsCompany,
-null AS relationBackLogisticsNo,
-null  AS relationBackReceiptDate,
-null AS relationBackStatus,
-null AS relationSendLogisticsCompany,
-NULL AS relationSendLogisticsNo,
 (CASE
 WHEN c.customer_out_damaged = 1 THEN
 	'是'
@@ -1044,4 +1038,56 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
     </where>
   </select>
 
+  <select id="getPostageInfo" parameterType="Integer" resultType="PostageInfo">
+      SELECT * from tb_rst_postage_info where postage_id = #{postageId}
+  </select>
+
+  <select id="listPostageInfo" parameterType="Integer" resultType="PostageInfo">
+      SELECT * from tb_rst_postage_info where relation_id = #{relationId}
+  </select>
+  <insert id="addPostageInfo" parameterType="PostageInfo" keyProperty="postageId" useGeneratedKeys="true">
+    insert into tb_rst_postage_info
+    (
+      relation_id,
+      postage_status,
+      postage_amount,
+      postage_alipay,
+      postage_alipay_name,
+      postage_desc,
+      postage_create_time
+    )
+    VALUES
+    ( #{relationId},
+      #{postageStatus},
+      #{postageAmount},
+      #{postageAlipay},
+      #{postageAlipayName},
+      #{postageDesc},
+      NOW()
+      )
+  </insert>
+  <update id="updatePostageInfo" parameterType="PostageInfo">
+    UPDATE tb_rst_postage_info
+    <set>
+      <if test="postageStatus != null and postageStatus != ''">
+        postage_status = #{postageStatus},
+      </if>
+      <if test="postageAmount != null and postageAmount != ''">
+        postage_amount = #{postageAmount},
+      </if>
+      <if test="postageAlipay != null and postageAlipay != ''">
+        postage_alipay = #{postageAlipay},
+      </if>
+      <if test="postageAlipayName != null and postageAlipayName != ''">
+        postage_alipay_name = #{postageAlipayName},
+      </if>
+      <if test="postageDesc != null and postageDesc != ''">
+        postage_desc = #{postageDesc}
+      </if>
+    </set>
+    WHERE postage_id = #{postageId}
+  </update>
+  <delete id="deletePostageInfo" parameterType="Integer">
+    DELETE from tb_rst_postage_info WHERE postage_id = #{postageId}
+  </delete>
 </mapper>

+ 108 - 184
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -1179,7 +1179,9 @@ public class AdminCustomerController {
         cmRelation = customerService.getCmRelationInfo(cmRelation);
         ProcMethod procMethod = customerService.getProcMethod(cmRelation.getProcMethodId());
         List<LogisticsInfo>logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        List<PostageInfo> listPostageInfo = customerService.listPostageInfo(cmRelation.getRelationId());
         mv.addObject("logisticsInfoList",logisticsInfoList);
+        mv.addObject("listPostageInfo", listPostageInfo);
         mv.addObject("procMethod", procMethod);
         mv.addObject("customerId", customerId);
         return mv;
@@ -1206,6 +1208,7 @@ public class AdminCustomerController {
         if (cmRelation == null) {
             return new ResponseJson(500, "该客诉没有售后信息!", 500);
         } else {
+
             ResponseJson rj = new ResponseJson(200, "查询成功", 200);
             rj.addResponseKeyValue("cmRelation", cmRelation);
             return rj;
@@ -1250,186 +1253,10 @@ public class AdminCustomerController {
         }
     }
 
-    /**
-     * 进入修改维修页面
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @RequiresPermissions("customer:update:repair")
-    @RequestMapping("/_to_update_repair")
-    public ModelAndView toUpdateRepair(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("cm/customer/update_repair");
-        String customerId = request.getParameter("customerId");
-        mv.addObject("customerId", customerId);
-        return mv;
-    }
-
-    /**
-     * 进入修改维修页面
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @ResponseBody
-    @RequiresPermissions("customer:update:repair")
-    @RequestMapping("/_update_repair")
-    public ResponseJson updateRepairUI(HttpServletRequest request) throws Exception {
-        String customerId = request.getParameter("customerId");
-        if (!StringUtils.isNotEmpty(customerId)) {
-            return new ResponseJson(500, "该客诉信息不存在!", 500);
-        }
-        Repair repair = new Repair();
-        repair.setCustomerId(Integer.parseInt(customerId));
-        repair.setRepairState(1);
-        //获取维修详情和品质检测信息
-        repair = customerService.getRepairInfo(repair);
-        if (repair == null) {
-            return new ResponseJson(500, "该客诉没有维修信息!", 500);
-        } else {
-            ResponseJson rj = new ResponseJson(200, "查询成功", 200);
-            rj.addResponseKeyValue("repair", repair);
-            return rj;
-        }
-    }
-
-
-
-    /**
-     * 进入修改退货页面
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @RequiresPermissions("customer:update:backGoods")
-    @RequestMapping("/_to_update_book_goods")
-    public ModelAndView toUpdateBookGoods(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("cm/customer/update_back_goods");
-        String customerId = request.getParameter("customerId");
-        mv.addObject("customerId", customerId);
-        return mv;
-    }
-
-    /**
-     * 进入修改售后退货页面
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @ResponseBody
-    @RequiresPermissions("customer:update:backGoods")
-    @RequestMapping("/_update_back_goods")
-    public ResponseJson updateBackGoodsUI(HttpServletRequest request) throws Exception {
-        String customerId = request.getParameter("customerId");
-        if (!StringUtils.isNotEmpty(customerId)) {
-            return new ResponseJson(500, "该客诉信息不存在!", 500);
-        }
-        BackGoods backGoods = new BackGoods();
-        backGoods.setCustomerId(Integer.parseInt(customerId));
-        //获取售后退货信息
-        backGoods = customerService.getBackGoods(backGoods);
-        if (backGoods == null) {
-            return new ResponseJson(500, "该客诉没有售后退货信息!", 500);
-        } else {
-            ResponseJson rj = new ResponseJson(200, "查询成功", 200);
-            rj.addResponseKeyValue("backGoods", backGoods);
-            return rj;
-        }
-    }
-
-
-    /**
-     * 进入修改补寄页面
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @RequiresPermissions("customer:update:reissue")
-    @RequestMapping("/_to_update_reissue")
-    public ModelAndView toUpdateReissue(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("cm/customer/update_reissue");
-        String customerId = request.getParameter("customerId");
-        mv.addObject("customerId", customerId);
-        return mv;
-    }
 
-    /**
-     * 进入修改补寄信息页面
-     *
-     * @param request
-     * @return
-     */
-    @ResponseBody
-    @RequiresPermissions("customer:update:reissue")
-    @RequestMapping("/get_reissue_info")
-    public ResponseJson getReissueInfo(HttpServletRequest request) {
-        String customerId = request.getParameter("customerId");
-        if (!StringUtils.isNotEmpty(customerId)) {
-            return new ResponseJson(500, "该客诉信息不存在!", 500);
-        }
-        Reissue reissue = new Reissue();
-        reissue.setCustomerId(Integer.parseInt(customerId));
-        //获取售后补寄信息
-        reissue = customerService.getReissue(reissue);
-        if (reissue == null) {
-            return new ResponseJson(500, "该客诉没有售后退货信息!", 500);
-        } else {
-            ResponseJson rj = new ResponseJson(200, "查询成功", 200);
-            rj.addResponseKeyValue("reissue", reissue);
-            return rj;
-        }
-    }
 
 
-    /**
-     * 进入修改退货页面
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @RequiresPermissions("customer:update:noreason")
-    @RequestMapping("/_update_noreason_back")
-    public ModelAndView toUpdateNoreasonBack(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("cm/customer/update_noreason_back");
-        String customerId = request.getParameter("customerId");
-        mv.addObject("customerId", customerId);
-        return mv;
-    }
 
-    /**
-     * 获取无理由退货信息
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @ResponseBody
-    @RequiresPermissions("customer:update:noreason")
-    @RequestMapping("/get_noreason_back")
-    public ResponseJson getNoreasonBack(HttpServletRequest request) throws Exception {
-        String customerId = request.getParameter("customerId");
-        if (!StringUtils.isNotEmpty(customerId)) {
-            return new ResponseJson(500, "该客诉信息不存在!", 500);
-        }
-        NoreasonBack noreasonBack = new NoreasonBack();
-        noreasonBack.setCustomerId(Integer.parseInt(customerId));
-        noreasonBack.setNoreasonBackState(1);
-        //获取无理由退货信息
-        noreasonBack = customerService.getNoreasonBack(noreasonBack);
-        if (noreasonBack == null) {
-            return new ResponseJson(500, "该客诉没有无理由售后退货信息!", 500);
-        } else {
-            ResponseJson rj = new ResponseJson(200, "查询成功", 200);
-            rj.addResponseKeyValue("noreasonBack", noreasonBack);
-            return rj;
-        }
-    }
 
 
 
@@ -1772,18 +1599,22 @@ public class AdminCustomerController {
                                     //将数据copy到新容器
                                     CustomerStatisticalInfo customers = new CustomerStatisticalInfo();
                                     BeanUtils.copyProperties(customer, customers);
-                                    customers.setRelationBackLogisticsCompany(common.getRelationBackLogisticsCompany());
-                                    customers.setRelationBackLogisticsNo(common.getRelationBackLogisticsNo());
-                                    customers.setRelationSendLogisticsCompany(common.getRelationSendLogisticsCompany());
-                                    customers.setRelationSendLogisticsNo(common.getRelationSendLogisticsNo());
-                                    customers.setRelationBackStatus(String.valueOf(common.getRelationBackStatus()));
-                                    customers.setRelationBackReceiptDate(common.getRelationBackReceiptDate() == null?null:format.format(common.getRelationBackReceiptDate()));
+                                    customers.setRelationBackLogisticsCompany(customerInfo.getRelationBackLogisticsCompany());
+                                    customers.setRelationBackLogisticsNo(customerInfo.getRelationBackLogisticsNo());
+                                    customers.setRelationSendLogisticsCompany(customerInfo.getRelationSendLogisticsCompany());
+                                    customers.setRelationSendLogisticsNo(customerInfo.getRelationSendLogisticsNo());
+                                    customers.setRelationBackStatus(String.valueOf(customerInfo.getRelationBackStatus()));
+                                            if(customerInfo.getRelationBackReceiptDate() == null){
+                                                customers.setRelationBackReceiptDate(null);
+                                            }else{
+                                                customers.setRelationBackReceiptDate(customerInfo.getRelationBackReceiptDate());
+                                            }
                                     customers.setSalesPayTime(salesOrder.getSalesPayTime());
                                     customers.setItemProductName(salesOrderItem.getItemProductName());
                                     customers.setItemProductColor(salesOrderItem.getItemProductColor());
                                     customers.setItemNum(String.valueOf(salesOrderItem.getItemNum()));
-                                    customers.setRelationFactoryCosts(common.getRelationFactoryCosts());
-                                    customers.setRelationCustomerCosts(common.getRelationCustomerCosts());
+                                    customers.setRelationFactoryCosts(customerInfo.getRelationFactoryCosts());
+                                    customers.setRelationCustomerCosts(customerInfo.getRelationCustomerCosts());
                                     customerStatisticalInfoList.add(customers);
                                 }
                             } else {
@@ -2123,5 +1954,98 @@ public class AdminCustomerController {
         return rj;
     }
 
+
+    /**
+     * 获取邮费信息
+     * @param request
+     * @param postageId
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/get_PostageInfo")
+    public ResponseJson getPostageInfo(HttpServletRequest request,Integer postageId){
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        if(postageId == null){
+            return new ResponseJson(500, "查询失败!", 500);
+        }
+        PostageInfo postageInfo = customerService.getPostageInfo(postageId);
+        rj.addResponseKeyValue("postageInfo",postageInfo);
+        return rj;
+    }
+
+    /**
+     * 添加邮费信息
+     * @param request
+     * @param postageInfo
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/add_PostageInfo")
+    public ResponseJson addPostageInfo(HttpServletRequest request,PostageInfo postageInfo){
+        ResponseJson rj = new ResponseJson(200, "添加成功", 200);
+        if(postageInfo == null){
+            return new ResponseJson(500, "添加失败,请检查参数!", 500);
+        }
+        Integer msg = customerService.addPostageInfo(postageInfo);
+        if(msg < 1){
+            return new ResponseJson(500, "添加失败", 500);
+        }
+        rj.addResponseKeyValue("postageInfo",postageInfo);
+        return rj;
+    }
+
+    /**
+     * 修改邮费信息
+     * @param request
+     * @param postageInfo
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/update_PostageInfo")
+    public ResponseJson updatePostageInfo(HttpServletRequest request,PostageInfo postageInfo){
+        ResponseJson rj = new ResponseJson(200, "修改成功", 200);
+        if(postageInfo == null){
+            return new ResponseJson(500, "修改失败,请检查参数!", 500);
+        }
+        Integer msg = customerService.updatePostageInfo(postageInfo);
+        if(msg < 1){
+            return new ResponseJson(500, "修改失败", 500);
+        }
+        rj.addResponseKeyValue("postageInfo",postageInfo);
+        return rj;
+    }
+
+    /**
+     * 删除邮费信息
+     * @param request
+     * @param postageId
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/delete_PostageInfo")
+    public ResponseJson deletePostageInfo(HttpServletRequest request,Integer postageId){
+        ResponseJson rj = new ResponseJson(200, "删除成功", 200);
+        if(postageId == null){
+            return new ResponseJson(500, "删除失败,请检查参数!", 500);
+        }
+        Integer msg = customerService.deletePostageInfo(postageId);
+        if(msg < 1){
+            return new ResponseJson(500, "删除失败", 500);
+        }
+        return rj;
+    }
+
+    /**
+     * 同步邮费信息
+     * @param request
+     * @param
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/synchronize_PostageInfo")
+    public ResponseJson synchronizePostageInfo(HttpServletRequest request){
+           String msg = customerService.synchronizePostageInfo();
+        return new ResponseJson(200, msg, 200);
+    }
 }
 

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

@@ -188,6 +188,7 @@
 
 		<typeAlias type="com.iamberry.rst.core.order.OrderWarehouse" alias="OrderWarehouse"/>
 		<typeAlias type="com.iamberry.rst.core.order.OrderWarehouseAdmin" alias="OrderWarehouseAdmin"/>
+		<typeAlias type="com.iamberry.rst.core.cm.PostageInfo" alias="PostageInfo"/>
 	</typeAliases>
 	<!-- PageHelper -->
 	<plugins>

+ 352 - 54
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_relation.ftl

@@ -24,6 +24,8 @@
         .tabBar span {background-color: #e8e8e8;cursor: pointer;display: inline-block;float: left;font-weight: bold;height: 30px;line-height: 30px;padding: 0 15px}
         .tabBar span.current{background-color: #222;color: #fff}
         .tabCon {display: none}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
     </style>
     <title></title>
 </head>
@@ -135,48 +137,179 @@
                 <div class="formControls col-2 col-sm-2 text-r">
                     <strong>邮费处理</strong>
                 </div>
-                <div class="formControls col-8 col-sm-8 skin-minimal">
+                <div class="formControls col-8 col-sm-8">
                     <div class="radio-box">
-                        <input type="radio" id="tel-6" name="relationIsTransfer" value="0" seleType="postage">
+                        <input type="radio" id="tel-6" name="relationIsTransfer" onclick="isRelationIsTransfer(0)" value="0" seleType="postage">
                         <label for="tel-6">不需要转账</label>
                     </div>
-                    <#--<div class="radio-box">-->
-                        <#--<input type="radio" id="tel-10" name="renewedIsTransfer" value="10" seleType="postage">-->
-                        <#--<label for="tel-10">需要转账</label>-->
-                    <#--</div>-->
-                    <div class="radio-box">
-                        <input type="radio" id="tel-7" name="relationIsTransfer" value="1" seleType="postage">
-                        <label for="tel-7">已转账</label>
-                    </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-8" name="relationIsTransfer" value="2" seleType="postage">
-                        <label for="tel-8">已申请待转账</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-9" name="relationIsTransfer" value="3" seleType="postage">
-                        <label for="tel-9">未申请</label>
+                        <input type="radio" id="tel-7" name="relationIsTransfer" onclick="isRelationIsTransfer(10)" value="10" seleType="postage">
+                        <label for="tel-7">需要</label>
                     </div>
+
                 </div>
             </div>
-            <div class="row cl" id="postageInformation">
+            <div class="row cl" id="postageInformation" style="display: none;">
                 <div class="formControls col-2 col-sm-2 text-r">
                     <strong>邮费信息</strong>
                 </div>
-                <div class="formControls col-9 col-sm-9 text-r">
-                    <div class="formControls col-4 col-sm-4 text-r" style="padding-left: 0px;">
-                        <input  type="text" class="input-text" value="" placeholder="寄回邮费" id="relationBackPostage" name="relationBackPostage" seleType="postage">
+                <div class="formControls col-8 col-sm-8">
+                <table class="table table-border table-bg table-bordered" >
+                    <thead>
+                    <tr>
+                        <th>邮费id</th>
+                        <th>邮费金额</th>
+                        <th>支付宝姓名</th>
+                        <th>支付宝账号</th>
+                        <th>状态</th>
+                        <th>备注</th>
+                        <th>操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="trbodyId">
+                    <#if listPostageInfo?? &&  (listPostageInfo?size > 0) >
+                        <#list listPostageInfo as postageInfo>
+                        <tr id="deleteId${(postageInfo.postageId)!''}">
+                            <td>${(postageInfo.postageId)!''}</td>
+                            <td>${(postageInfo.postageAmount)!''}</td>
+                            <td>${(postageInfo.postageAlipayName)!''}</td>
+                            <td>${(postageInfo.postageAlipay)!''}</td>
+                            <#if postageInfo.postageStatus??>
+                                <#if postageInfo.postageStatus == 1><td>未申请</td></#if>
+                                <#if postageInfo.postageStatus == 2><td>已申请(待转账)</td></#if>
+                                <#if postageInfo.postageStatus == 3><td>已转账</td></#if>
+                                <#if postageInfo.postageStatus == 4><td>未知</td></#if>
+                            <#else>
+                                <td></td>
+                            </#if>
+                            <td>${postageInfo.postageDesc!''}</td>
+                            <td><a onclick="deletePostage(${(postageInfo.postageId)!});">删除</a>&nbsp;&nbsp;<a onclick="getPostage(${(postageInfo.postageId)!});">修改</a></td>
+                        </tr>
+                        </#list>
+                    <#else>
+                    <tr><td colspan="7" class="td-manage text-c" >暂时没有邮费信息,请添加!</td></tr>
+                    </#if>
+                    </tbody>
+                </table>
+                    <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="showPostageDiv();">录入邮费转账</button>
+                </div>
+            </div>
+            <div id="addPostageId" style="display: none;">
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>状态</strong>
                     </div>
+                    <div class="formControls col-8 col-sm-8">
+                        <div class="radio-box">
+                            <input type="radio" id="tel-66" name="postageStatus" checked value="1">
+                            <label for="tel-66">未申请</label>
+                        </div>
+                        <div class="radio-box">
+                            <input type="radio" id="tel-77" name="postageStatus" value="2">
+                            <label for="tel-77">已申请(待转账)</label>
+                        </div>
 
-                    <div class="formControls col-4 col-sm-4 text-r" style="padding-left: 0px;">
-                        <input  type="text" class="input-text" value="" placeholder="用户支付宝账户" id="relationAlipay" name="relationAlipay" seleType="postage">
+                        <div class="radio-box">
+                            <input type="radio" id="tel-88" name="postageStatus" value="3">
+                            <label for="tel-88">已转账</label>
+                        </div>
                     </div>
-
-                    <div class="formControls col-4 col-sm-4 text-r" style="padding-left: 0px;">
-                        <input  type="text" class="input-text" value="" placeholder="用户支付宝姓名" id="relationAlipayName" name="relationAlipayName" seleType="postage">
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>运费金额</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="运费金额" id="postageAmount" name="postageAmount">
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>支付宝</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="填写支付宝姓名" id="postageAlipayName" name="postageAlipayName">
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="填写支付宝账号" id="postageAlipay" name="postageAlipay">
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>备注信息</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                            <textarea type="text" placeholder="" id="postageDesc" name="postageDesc" style="width: 100%;height: 80px;"></textarea>
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong></strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="addPostage()">确定录入邮费转账</button>
                     </div>
                 </div>
             </div>
 
+            <div id="updatePostageId" style="display: none;">
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>状态</strong>
+                    </div>
+                    <div class="formControls col-8 col-sm-8 skin-minimal">
+                        <div class="radio-box">
+                            <input type="radio" id="tel-666" name="postageStatuss" value="1">
+                            <label for="tel-666">未申请</label>
+                        </div>
+                        <div class="radio-box">
+                            <input type="radio" id="tel-777" name="postageStatuss" value="2">
+                            <label for="tel-777">已申请(待转账)</label>
+                        </div>
+
+                        <div class="radio-box">
+                            <input type="radio" id="tel-888" name="postageStatuss" value="3">
+                            <label for="tel-888">已转账</label>
+                        </div>
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>运费金额</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="运费金额" id="postageAmounts" name="postageAmounts">
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>支付宝</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="填写支付宝姓名" id="postageAlipayNames" name="postageAlipayNames">
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <input type="text" class="input-text" placeholder="填写支付宝账号" id="postageAlipays" name="postageAlipays">
+                    </div>
+                </div>
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong>备注信息</strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <textarea type="text" placeholder="" id="postageDescs" name="postageDescs" style="width: 100%;height: 80px;"></textarea>
+                    </div>
+                </div>
+                <input type="hidden" value="" id="postageIds">
+                <div class="row cl">
+                    <div class="formControls col-2 col-sm-2 text-r">
+                        <strong></strong>
+                    </div>
+                    <div class="formControls col-5 col-sm-5">
+                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;" id="" name="" onclick="updatePostage()">确定修改邮费信息</button>
+                    </div>
+                </div>
+            </div>
             <div class="row cl">
                 <div class="formControls col-2 col-sm-2">
                 </div>
@@ -213,22 +346,6 @@
                     <input type="text" class="input-text" value="" placeholder="Efast订单号" id="relationBackEfastOrderId" name="relationBackEfastOrderId" seleType="sendInformation">
                 </div>
             </div>
-                <#--<div class="row cl">
-                    <div class="formControls col-2 col-sm-2 text-r">
-                        <strong>寄出产品</strong>
-                    </div>
-                    <div class="formControls col-10 col-sm-10">
-                        <div class="update-parts" id="sendProduct"></div>
-                    </div>
-                </div>
-                <div class="row cl">
-                    <div class="formControls col-2 col-sm-2">
-                    </div>
-                    <div class="formControls col-10 col-sm-10">
-                        (如需修改,在Efast系统作废订单,重新生成订单,并与此处修改Efast重新生成的订单号!)
-                    </div>
-                </div>-->
-
                 <div class="row cl" id="sendUserInfo">
                     <div class="formControls col-2 col-sm-2 text-r">
                         <strong>用户信息</strong>
@@ -358,12 +475,187 @@
     var uname = /^[\u4e00-\u9fa5a-zA-Z]{1,12}$/; //中文英文
     var money = /^(0{1}|([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;//金额
 
+    function showPostageDiv() {
+        $("#updatePostageId").hide();
+        $("#addPostageId").show();
+    }
+
+    function isRelationIsTransfer(type) {
+        if(type == 0){
+            $("#postageInformation").hide();
+        }else{
+            $("#postageInformation").show();
+        }
+    }
+
+    /*添加邮费信息*/
+    function addPostage() {
+        var postageInfo;
+        var relationId = $("#relationId").val();
+        var postageStatus = parseInt($("input[name='postageStatus']:checked").val());
+        var postageAmount = $("#postageAmount").val()*100;
+        var postageAlipayName = $("#postageAlipayName").val();
+        var postageAlipay = $("#postageAlipay").val();
+        var postageDesc = $("#postageDesc").val();
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: {"relationId" : relationId,
+                       "postageStatus" : postageStatus,
+                       "postageAmount" : postageAmount,
+                       "postageAlipayName" : postageAlipayName,
+                       "postageAlipay" : postageAlipay,
+                       "postageDesc" : postageDesc},
+                url: "${path}/admin/customer/add_PostageInfo",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        postageInfo = postageInfo = data.returnMsg.postageInfo;
+                        var postageStatuss
+                        if(postageInfo.postageStatus == 1){
+                            postageStatuss = "未申请";
+                        }
+                        if(postageInfo.postageStatus == 2){
+                            postageStatuss = "已申请(待转账)";
+                        }
+                        if(postageInfo.postageStatus == 3){
+                            postageStatuss = "已转账";
+                        }
+                        if(postageInfo.postageStatus == 4){
+                            postageStatuss = "未知";
+                        }
+                        $("#trbodyId").append('<tr id="deleteId'+postageInfo.postageId+'"><td>'+postageInfo.postageId+'</td>' +
+                                '<td>'+(postageInfo.postageAmount)/100+'</td>' +
+                                '<td>'+postageInfo.postageAlipayName+'</td>' +
+                                '<td>'+postageInfo.postageAlipay+'</td>' +
+                                '<td>'+postageStatuss+'</td>' +
+                                '<td>'+postageInfo.postageDesc+'</td>' +
+                                '<td><a onclick="deletePostage('+postageInfo.postageId+');">删除</a>&nbsp&nbsp<a onclick="getPostage('+postageInfo.postageId+');">修改</a></td></tr>');
+                        layer.msg("添加成功!",{icon: 1,time:1000});
+                    } else {
+                        layer.msg("添加失败!",{icon: 5,time:1000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    window.parent.admin_result("修改失败!",5);
+                }
+            })
+    }
+
+    /*删除邮费信息*/
+    function deletePostage(postageId) {
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"postageId" : postageId},
+            url: "${path}/admin/customer/delete_PostageInfo",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    $("#deleteId"+postageId).remove();
+                    layer.msg("删除成功!",{icon: 1,time:1000});
+                } else {
+                    layer.msg("删除失败!",{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                window.parent.admin_result("修改失败!",5);
+            }
+        })
+    }
+
+    /*查询邮费信息*/
+    function getPostage(postageId) {
+        var postageInfo;
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {"postageId" : postageId},
+            url: "${path}/admin/customer/get_PostageInfo",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    $("#addPostageId").hide();
+                    $("#updatePostageId").show();
+                    postageInfo = data.returnMsg.postageInfo;
+                    $("#postageDescs").val("");
+                    $("#postageIds").val(postageInfo.postageId);
+                    $("input[type=radio][name=postageStatuss][value='"+postageInfo.postageStatus+"']").prop("checked",true);
+                    $("#postageAmounts").val(postageInfo.postageAmount/100);
+                    $("#postageAlipays").val(postageInfo.postageAlipay);
+                    $("#postageAlipayNames").val(postageInfo.postageAlipayName);
+                    $("#postageDescs").val(postageInfo.postageDesc);
+
+                } else {
+                    layer.msg("修改失败!",{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                window.parent.admin_result("修改失败!",5);
+            }
+        })
+    }
+
+    /*修改邮费信息*/
+    function updatePostage() {
+        var postageInfo;
+        var postageId = $("#postageIds").val();
+        var postageStatus = parseInt($("input[name='postageStatuss']:checked").val());
+        var postageAmount = $("#postageAmounts").val()*100;
+        var postageAlipayName = $("#postageAlipayNames").val();
+        var postageAlipay = $("#postageAlipays").val();
+        var postageDesc = $("#postageDescs").val();
+
+        $.ajax({
+            cache: true,
+            type: "POST",
+            data: {
+                "postageId" : postageId,
+                "postageStatus" : postageStatus,
+                "postageAmount" : postageAmount,
+                "postageAlipayName" : postageAlipayName,
+                "postageAlipay" : postageAlipay,
+                "postageDesc" : postageDesc},
+            url: "${path}/admin/customer/update_PostageInfo",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    postageInfo = data.returnMsg.postageInfo;
+                    var postageStatuss
+                    if(postageInfo.postageStatus == 1){
+                        postageStatuss = "未申请";
+                    }
+                    if(postageInfo.postageStatus == 2){
+                        postageStatuss = "已申请(待转账)";
+                    }
+                    if(postageInfo.postageStatus == 3){
+                        postageStatuss = "已转账";
+                    }
+                    if(postageInfo.postageStatus == 4){
+                        postageStatuss = "未知";
+                    }
+                    $("#deleteId"+postageId).html("");
+                    $("#deleteId"+postageId).append('<td>'+postageInfo.postageId+'</td>' +
+                            '<td>'+(postageInfo.postageAmount)/100+'</td>' +
+                            '<td>'+postageInfo.postageAlipayName+'</td>' +
+                            '<td>'+postageInfo.postageAlipay+'</td>' +
+                            '<td>'+postageStatuss+'</td>' +
+                            '<td>'+postageInfo.postageDesc+'</td>' +
+                            '<td><a onclick="deletePostage('+postageInfo.postageId+');">删除</a>&nbsp&nbsp<a onclick="getPostage('+postageInfo.postageId+');">修改</a></td>');
+
+                    layer.msg("修改成功!",{icon: 1,time:1000});
+                } else {
+                    layer.msg("修改失败!",{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                window.parent.admin_result("修改失败!",5);
+            }
+        })
+    }
+
     $(function(){
-        $('.skin-minimal input').iCheck({
-            checkboxClass: 'icheckbox-blue',
-            radioClass: 'iradio-blue',
-            increaseArea: '20%'
-        });
+
         get_cmRelation_info();
         showUpdateSendProduct();
         get_product_type();
@@ -654,13 +946,19 @@
                     $("#cityNumber option[value='" + relation.cityNumber + "']").attr("selected","true");
                     $("#areaNumber option[value='" + relation.areaNumber + "']").attr("selected","true");
                     $('#relationBackLogisticsNo').val(relation.relationBackLogisticsNo);
-                    $('#relationBackPostage').val(relation.relationBackPostage/100);
+                    /*$('#relationBackPostage').val(relation.relationBackPostage/100);
                     $('#relationAlipay').val(relation.relationAlipay);
-                    $('#relationAlipayName').val(relation.relationAlipayName);
+                    $('#relationAlipayName').val(relation.relationAlipayName);*/
                     $('input[name="relationIsTransfer"]').each(function(){
                         if (this.value == relation.relationIsTransfer) {
                             $(this).iCheck('check');
+                            if(relation.relationIsTransfer == 0){
+                                $("#postageInformation").hide();
+                            }else{
+                                $("#postageInformation").show();
+                            }
                         }
+
                     });
                     $('#relationBackName').val(relation.relationBackName);
                     $('#relationBackTel').val(relation.relationBackTel);
@@ -745,8 +1043,8 @@
         $('#merge_address').val(provinceNumber+'-'+cityNumber+'-'+areaNumber);
 
         //寄回邮费
-        var relationBackPostage = $("#relationBackPostage").val();
-        $("#relationBackPostage").val(parseInt(relationBackPostage*100));
+        /*var relationBackPostage = $("#relationBackPostage").val();
+        $("#relationBackPostage").val(parseInt(relationBackPostage*100));*/
         var obj = null;
         if(type == 1){
             obj = getseleType("send");
@@ -848,16 +1146,16 @@
             }
         }else if(type == 2){
             var relationIsTransfer = $('input[name="relationIsTransfer"]:checked').val();
-            var relationBackPostage = $('#relationBackPostage').val().trim();//寄回邮费
+            /*var relationBackPostage = $('#relationBackPostage').val().trim();//寄回邮费
             var relationAlipay = $('#relationAlipay').val().trim();//支付宝账户
-            var relationAlipayName = $('#relationAlipayName').val().trim();//支付宝账户姓名
+            var relationAlipayName = $('#relationAlipayName').val().trim();//支付宝账户姓名*/
 
             if(relationIsTransfer == 1){
-                if (!money.test(relationBackPostage)) {
+                /*if (!money.test(relationBackPostage)) {
                     layer.msg("邮费格式不正确,请重新输入!",{icon: 5,time:1000});
                     relation_flag = false;
                     return relation_flag;
-                }
+                }*/
 //                if (!money.test(renewedAlipay)) {
 //                    layer.msg("支付宝账户格式不正确,请重新输入!",{icon: 5,time:1000});
 //                    renewed_flag = false;