Ver código fonte

修改客户信息

liujiankang 7 anos atrás
pai
commit
e2864a29e6

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/customer/ChannelSaleInfo.java

@@ -17,6 +17,7 @@ public class ChannelSaleInfo implements Serializable{
     private Date create_date;//创建时间
     private Integer channelCategory;//渠道类别 1:电商 2:特殊渠道 3:线下 4:海外
     private String channelType;//渠道类型
+    private String channelName;//渠道名称
 
     public Integer getChannelSaleId() {
         return channelSaleId;
@@ -89,4 +90,12 @@ public class ChannelSaleInfo implements Serializable{
     public void setChannelType(String channelType) {
         this.channelType = channelType;
     }
+
+    public String getChannelName() {
+        return channelName;
+    }
+
+    public void setChannelName(String channelName) {
+        this.channelName = channelName;
+    }
 }

+ 38 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicService.java

@@ -171,4 +171,42 @@ public interface CustomerBasicService {
      * @return
      */
     /*public void saveTicketOpeningInfo(TicketOpeningInfo ticketOpeningInfo);*/
+
+    /**
+     * 修改客户基本信息
+     * @param customerBasicInfo
+     * @return
+     */
+    Integer updateCustomerBasic(CustomerBasicInfo customerBasicInfo);
+
+    /**
+     * 修改付款/退款信息
+     * @return
+     */
+    Integer updateBillingInfo(BillingInfo billingInfo);
+
+    /**
+     * 修改开票信息
+     * @return
+     */
+    Integer updateOpeningInfo(TicketOpeningInfo ticketOpeningInfo);
+
+    /**
+     * 删除联系人信息
+     * @return
+     */
+    Integer deleteContactInfo(Integer customerId);
+
+    /**
+     * 删除渠道销售信息
+     * @return
+     */
+    Integer deleteSaleInfo(Integer customerId);
+
+    /**
+     * 删除渠道划分信息
+     * @return
+     */
+    Integer deleteDivisionInfo(Integer channelDivisionId);
+
 }

+ 46 - 20
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicServiceImpl.java

@@ -71,33 +71,29 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
 
     private Logger logger = LoggerFactory.getLogger(CustomerBasicServiceImpl.class);
 
-    @Autowired
-    private CustomerBasicMapper customerBasicInfoSaveMapper;
-
-
     @Override
     public CustomerBasicInfo queryCustomerBasicInfoByCustomerId(int queryCustomerId) {
-        return customerBasicInfoSaveMapper.queryCustomerBasicInfoByCustomerId(queryCustomerId);
+        return customerBasicMapper.queryCustomerBasicInfoByCustomerId(queryCustomerId);
     }
 
     @Override
     public List<DockedContactInfo> queryDockedContactInfoListByCustomerId(int queryCustomerId) {
-        return customerBasicInfoSaveMapper.queryDockedContactInfoListByCustomerId(queryCustomerId);
+        return customerBasicMapper.queryDockedContactInfoListByCustomerId(queryCustomerId);
     }
 
     @Override
     public List<ChannelSaleInfo> queryChannelSaleInfoListByCustomerId(int queryCustomerId) {
-        return customerBasicInfoSaveMapper.queryChannelSaleInfoListByCustomerId(queryCustomerId);
+        return customerBasicMapper.queryChannelSaleInfoListByCustomerId(queryCustomerId);
     }
 
     @Override
     public BillingInfo queryBillingInfoByCustomerId(int queryCustomerId) {
-        return customerBasicInfoSaveMapper.queryBillingInfoByCustomerId(queryCustomerId);
+        return customerBasicMapper.queryBillingInfoByCustomerId(queryCustomerId);
     }
 
     @Override
     public TicketOpeningInfo queryTicketOpeningInfoByCustomerId(int queryCustomerId) {
-        return customerBasicInfoSaveMapper.queryTicketOpeningInfoByCustomerId(queryCustomerId);
+        return customerBasicMapper.queryTicketOpeningInfoByCustomerId(queryCustomerId);
     }
 
     @Override
@@ -107,26 +103,26 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
         logger.info("saveCustomerBasicInfo start...");
         int customerId = -1;
         try {
-            customerBasicInfo = customerBasicInfoSaveMapper.saveCustomerBasicInfo(customerBasicInfo);
+            customerBasicInfo = customerBasicMapper.saveCustomerBasicInfo(customerBasicInfo);
             if(customerBasicInfo != null){
                 customerId = customerBasicInfo.getCustomerId();
                 if(customerId != -1){
                     if(dockedContactInfoList != null && dockedContactInfoList.size()>0){
                         for (DockedContactInfo dockedContactInfo: dockedContactInfoList) {
                             dockedContactInfo.setCustomerId(customerId);
-                            customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);
+                            customerBasicMapper.saveDockedContactInfo(dockedContactInfo);
                         }
                     }
                     if(channelSaleInfoList != null && channelSaleInfoList.size()>0){
                         for (ChannelSaleInfo channelSaleInfo: channelSaleInfoList) {
                             channelSaleInfo.setCustomerId(customerId);
-                            customerBasicInfoSaveMapper.saveChannelSaleInfo(channelSaleInfo);
+                            customerBasicMapper.saveChannelSaleInfo(channelSaleInfo);
                         }
                     }
                     billingInfo.setCustomerId(customerId);
                     ticketOpeningInfo.setCustomerId(customerId);
-                    customerBasicInfoSaveMapper.saveBillingInfo(billingInfo);
-                    customerBasicInfoSaveMapper.saveTicketOpeningInfo(ticketOpeningInfo);
+                    customerBasicMapper.saveBillingInfo(billingInfo);
+                    customerBasicMapper.saveTicketOpeningInfo(ticketOpeningInfo);
                 }
             }
             logger.info("saveCustomerBasicInfo end...");
@@ -137,27 +133,57 @@ public class CustomerBasicServiceImpl implements CustomerBasicService{
     }
 
     public List<Province> queryProvinceList(String provinceId){
-        return (List<Province>)customerBasicInfoSaveMapper.queryProvinceList(provinceId);
+        return (List<Province>)customerBasicMapper.queryProvinceList(provinceId);
     }
 
     public List<City> queryCityList(String provinceId){
-        return (List<City>)customerBasicInfoSaveMapper.queryCityList(provinceId);
+        return (List<City>)customerBasicMapper.queryCityList(provinceId);
     }
 
     public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId){
-        return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelCategoryList(channelCategoryId);
+        return (List<ChannelDivisionInfo>)customerBasicMapper.queryChannelCategoryList(channelCategoryId);
     }
 
     public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId){
-        return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelTypeList(channelCategoryId);
+        return (List<ChannelDivisionInfo>)customerBasicMapper.queryChannelTypeList(channelCategoryId);
     }
 
     public List<Product> queryPromotingProductsList(String promotingProductsInfo){
-        return (List<Product>)customerBasicInfoSaveMapper.queryPromotingProductsList(promotingProductsInfo);
+        return (List<Product>)customerBasicMapper.queryPromotingProductsList(promotingProductsInfo);
     }
 
     public List<ProductColor> querySupplyPriceList(String promotingProductsId){
-        return (List<ProductColor>)customerBasicInfoSaveMapper.querySupplyPriceList(promotingProductsId);
+        return (List<ProductColor>)customerBasicMapper.querySupplyPriceList(promotingProductsId);
+    }
+
+    @Override
+    public Integer updateCustomerBasic(CustomerBasicInfo customerBasicInfo) {
+        return customerBasicMapper.updateCustomerBasic(customerBasicInfo);
+    }
+
+    @Override
+    public Integer updateBillingInfo(BillingInfo billingInfo) {
+        return customerBasicMapper.updateBillingInfo(billingInfo);
+    }
+
+    @Override
+    public Integer updateOpeningInfo(TicketOpeningInfo ticketOpeningInfo) {
+        return customerBasicMapper.updateOpeningInfo(ticketOpeningInfo);
+    }
+
+    @Override
+    public Integer deleteContactInfo(Integer customerId) {
+        return customerBasicMapper.deleteContactInfo(customerId);
+    }
+
+    @Override
+    public Integer deleteSaleInfo(Integer customerId) {
+        return customerBasicMapper.deleteSaleInfo(customerId);
+    }
+
+    @Override
+    public Integer deleteDivisionInfo(Integer channelDivisionId) {
+        return customerBasicMapper.deleteDivisionInfo(channelDivisionId);
     }
     /*@Override
     public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {

+ 39 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.java

@@ -146,4 +146,43 @@ public interface CustomerBasicMapper {
      * @return
      */
     public List<ProductColor> querySupplyPriceList(String promotingProductsId);
+
+    /**
+     * 修改客户基本信息
+     * @param customerBasicInfo
+     * @return
+     */
+    Integer updateCustomerBasic(CustomerBasicInfo customerBasicInfo);
+
+    /**
+     * 修改付款/退款信息
+     * @return
+     */
+    Integer updateBillingInfo(BillingInfo billingInfo);
+
+    /**
+     * 修改开票信息
+     * @return
+     */
+    Integer updateOpeningInfo(TicketOpeningInfo ticketOpeningInfo);
+
+    /**
+     * 删除联系人信息
+     * @return
+     */
+    Integer deleteContactInfo(Integer customerId);
+
+    /**
+     * 删除渠道销售信息
+     * @return
+     */
+    Integer deleteSaleInfo(Integer customerId);
+
+    /**
+     * 删除渠道划分信息
+     * @return
+     */
+    Integer deleteDivisionInfo(Integer channelDivisionId);
+
+
 }

+ 6 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicMapper.xml

@@ -166,10 +166,14 @@
         si.promoting_products as promotingProducts,
         si.supply_price as supplyPrice,
         si.account_period as account_period,
-        si.create_date as createDate
+        si.create_date as createDate,
+		di.channel_category as channelCategory,
+		di.channel_type as channelType,
+		di.channel_name as channelName
         from tb_rst_channel_sale_info si
+		LEFT JOIN tb_rst_channel_division_info di ON si.channel_division_id = di.channel_division_id
         where
-            si.channel_division_id  = #{channelDivisionId}
+            si.customer_id  = #{customerId}
     </select>
 
     <resultMap type="ChannelDivisionInfo" id="listChannelDivisionMap">