소스 검색

修改客户信息

liujiankang 7 년 전
부모
커밋
91cdeb9579

+ 65 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/tools/LogisticsInfo.java

@@ -0,0 +1,65 @@
+package com.iamberry.rst.core.tools;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by Administrator on 2018/5/30.
+ */
+public class LogisticsInfo implements Serializable {
+    private static final long serialVersionUID = -188450183704153868L;
+    private Integer logisticsId;//主键
+    private String logisticsName;//物流公司名称
+    private String logisticsRstCode;//rst物流公司代码
+    private String logisticsEfastCode;//Efast物流公司代码
+    private String logisticsOnehundredCode;//快递100物流公司代码
+    private Date createDate;//创建时间
+
+    public Integer getLogisticsId() {
+        return logisticsId;
+    }
+
+    public void setLogisticsId(Integer logisticsId) {
+        this.logisticsId = logisticsId;
+    }
+
+    public String getLogisticsName() {
+        return logisticsName;
+    }
+
+    public void setLogisticsName(String logisticsName) {
+        this.logisticsName = logisticsName;
+    }
+
+    public String getLogisticsRstCode() {
+        return logisticsRstCode;
+    }
+
+    public void setLogisticsRstCode(String logisticsRstCode) {
+        this.logisticsRstCode = logisticsRstCode;
+    }
+
+    public String getLogisticsEfastCode() {
+        return logisticsEfastCode;
+    }
+
+    public void setLogisticsEfastCode(String logisticsEfastCode) {
+        this.logisticsEfastCode = logisticsEfastCode;
+    }
+
+    public String getLogisticsOnehundredCode() {
+        return logisticsOnehundredCode;
+    }
+
+    public void setLogisticsOnehundredCode(String logisticsOnehundredCode) {
+        this.logisticsOnehundredCode = logisticsOnehundredCode;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+}

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java

@@ -3,6 +3,7 @@ package com.iamberry.rst.faces.cm;
 import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.cm.SalesOrderItem;
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.tools.LogisticsInfo;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 
@@ -145,4 +146,9 @@ public interface SalesOrderService {
      * 根据交易号修改订单信息
      * **/
     Integer updateSalesOrderByDealCode(SalesOrder salesOrder);
+
+    /**
+     * 查询物流公司信息
+     * **/
+    List<LogisticsInfo> getLogisticsInfo(LogisticsInfo logisticsInfo);
 }

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -8,6 +8,7 @@ import com.iamberry.rst.core.cm.StoreInfo;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.SysConfig;
+import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.cm.SalesOrderService;
 import com.iamberry.rst.faces.cm.StoreInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
@@ -547,4 +548,9 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     public Integer updateSalesOrderByDealCode(SalesOrder salesOrder) {
         return salesOrderMapper.updateSalesOrderByDealCode(salesOrder);
     }
+
+    @Override
+    public List<LogisticsInfo> getLogisticsInfo(LogisticsInfo logisticsInfo) {
+        return salesOrderMapper.getLogisticsInfo(logisticsInfo);
+    }
 }

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/SalesOrderMapper.java

@@ -2,6 +2,7 @@ package com.iamberry.rst.service.cm.mapper;
 
 import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.cm.SalesOrderItem;
+import com.iamberry.rst.core.tools.LogisticsInfo;
 
 import java.util.List;
 
@@ -102,4 +103,9 @@ public interface SalesOrderMapper {
      * 根据交易号修改订单信息
      * **/
     Integer updateSalesOrderByDealCode(SalesOrder salesOrder);
+
+    /**
+     * 查询物流公司信息
+     * **/
+    List<LogisticsInfo> getLogisticsInfo(LogisticsInfo logisticsInfo);
 }

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

@@ -473,4 +473,22 @@
     </set>
     where sales_deal_code = #{salesDealCode}
   </update>
+  
+  <select id="getLogisticsInfo" parameterType="LogisticsInfo" resultType="LogisticsInfo">
+    SELECT * from tb_rst_logistics_info
+    <where>
+      <if test="logisticsName != null and logisticsName != '' ">
+        logistics_name = #{logisticsName}
+      </if>
+      <if test="logisticsRstCode != null and logisticsRstCode != '' ">
+        and logistics_rst_code = #{logisticsRstCode}
+      </if>
+      <if test="logisticsEfastCode !=null and logisticsEfastCode !=''">
+        AND logistics_efast_code = #{logisticsEfastCode}
+      </if>
+      <if test="logisticsOnehundredCode !=null and logisticsOnehundredCode !=''">
+        AND logistics_onehundred_code = #{logisticsOnehundredCode}
+      </if>
+    </where>
+  </select>
 </mapper>

+ 15 - 3
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSalesOrderController.java

@@ -4,6 +4,7 @@ import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.cm.SalesOrderItem;
 import com.iamberry.rst.core.cm.StoreInfo;
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.cm.SalesOrderService;
 import com.iamberry.rst.faces.cm.StoreInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
@@ -310,7 +311,18 @@ public class AdminSalesOrderController {
      * @return
      */
     public String getPostCode(String firm) {
-        String postCode = "";
+        if (firm == null || firm.equals("")) {
+            return "01";
+        }
+        LogisticsInfo logisticsInfo = new LogisticsInfo();
+        logisticsInfo.setLogisticsName(firm);
+        List<LogisticsInfo> listLogisticsInfo = salesOrderService.getLogisticsInfo(logisticsInfo);
+        if(listLogisticsInfo.size() > 0){
+            return listLogisticsInfo.get(0).getLogisticsRstCode();
+        }else{
+            return "01";
+        }
+        /*String postCode = "";
         switch (firm) {
             case "申通快递":postCode = "sto";break;
             case "圆通快递":postCode = "yto";break;
@@ -330,7 +342,7 @@ public class AdminSalesOrderController {
             case "上门送货":postCode = "02";break;
             default:postCode = "sto";break;
         }
-        return postCode;
+        return postCode;*/
     }
 
     /**
@@ -503,7 +515,7 @@ public class AdminSalesOrderController {
         String path = request.getServletContext().getRealPath(file);
         boolean flag = ExcelUtil.readExcelNumber(path,maxNumber);
         if(!flag){
-            return "最大上传数量为一百条,请检查文档内的数据是否正常!";
+            return "最大上传数量为一百条,请检查文档内的数据是否符合条件!";
         }
         List<String> listString  = ExcelUtil.readExcelHead(path);
         if(listString == null){

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

@@ -101,6 +101,7 @@
 		<typeAlias type="com.iamberry.rst.core.customer.TicketOpeningInfo" alias="TicketOpeningInfo"/>
 		<typeAlias type="com.iamberry.rst.core.customer.LowestPriceInfo" alias="LowestPriceInfo"/>
 		<typeAlias type="com.iamberry.rst.core.cm.CustomerStatisticalInfo" alias="CustomerStatisticalInfo"/>
+		<typeAlias type="com.iamberry.rst.core.tools.LogisticsInfo" alias="LogisticsInfo"/>
 	</typeAliases>
 	<!-- PageHelper -->
 	<plugins>