Browse Source

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

wangxiaoming 7 years ago
parent
commit
bb5eded492
17 changed files with 603 additions and 423 deletions
  1. 143 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java
  2. 6 1
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintSignclosedInfoService.java
  3. 2 1
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java
  4. 12 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductService.java
  5. 122 8
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintSignclosedInfoServiceImpl.java
  6. 65 19
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java
  7. 1 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintSignclosedInfoMapper.xml
  8. 8 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/noreasonBackMapper.xml
  9. 8 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/renewedMapper.xml
  10. 11 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java
  11. 11 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductMapper.java
  12. 20 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml
  13. 4 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
  14. 71 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java
  15. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/PtsCodeController.java
  16. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/utils/StitchAttrUtil.java
  17. 117 391
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl

+ 143 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java

@@ -402,4 +402,147 @@ public class CustomerCommon implements Serializable {
     }
 
 
+
+
+    /**
+     * 封装参数
+     * @param solve  处理类型
+     * @param object
+     * @return
+     */
+    public static CustomerCommon getCustomerCommon(int solve, Object object) {
+        if (object == null) {
+            return null;
+        }
+        CustomerCommon customerCommon = new CustomerCommon();
+        switch (solve) {
+            case 3://换新
+                Renewed renewed = (Renewed)object;
+                customerCommon.setRelationId(renewed.getRenewedId());
+                customerCommon.setCustomerId(renewed.getCustomerId());
+                customerCommon.setOrderId(renewed.getOrderId());
+                customerCommon.setSignclosedId(renewed.getSignclosedId());
+                customerCommon.setRelationBackEfastOrderId(renewed.getRenewedBackEfastOrderId());
+                customerCommon.setRelationBackStatus(renewed.getRenewedBackStatus());
+                customerCommon.setRelationBackName(renewed.getRenewedBackName());
+                customerCommon.setRelationBackTel(renewed.getRenewedBackTel());
+                customerCommon.setRelationBackLogisticsCompany(renewed.getRenewedBackLogisticsCompany());
+                customerCommon.setRelationBackLogisticsNo(renewed.getRenewedBackLogisticsNo());
+                customerCommon.setRelationBackPostage(renewed.getRenewedBackPostage());
+                customerCommon.setRelationBackMachineNo(renewed.getRenewedBackMachineNo());
+                customerCommon.setRelationSendStatus(renewed.getRenewedSendStatus());
+                customerCommon.setRelationSendName(renewed.getRenewedSendName());
+                customerCommon.setRelationSendTel(renewed.getRenewedSendTel());
+                customerCommon.setProvinceNumber(renewed.getProvinceNumber());
+                customerCommon.setCityNumber(renewed.getCityNumber());
+                customerCommon.setAreaNumber(renewed.getAreaNumber());
+                customerCommon.setRelationSendMergeAddress(renewed.getRenewedSendMergeAddress());
+                customerCommon.setRelationSendAddress(renewed.getRenewedSendAddress());
+                customerCommon.setRelationSendLogisticsCompany(renewed.getRenewedSendLogisticsCompany());
+                customerCommon.setRelationSendLogisticsNo(renewed.getRenewedSendLogisticsNo());
+                customerCommon.setRelationDesc(renewed.getRenewedDesc());
+                customerCommon.setRelationState(renewed.getRenewedState());
+                customerCommon.setRelationAlipay(renewed.getRenewedAlipay());
+                customerCommon.setRelationIsTransfer(renewed.getRenewedIsTransfer());
+                customerCommon.setRelationCreateTime(renewed.getRenewedCreateTime());
+                customerCommon.setRelationUpdateTime(renewed.getRenewedUpdateTime());
+                break;
+            case 4://维修
+                Repair repair = (Repair)object;
+                customerCommon.setRelationId(repair.getRepairId());
+                customerCommon.setCustomerId(repair.getCustomerId());
+                customerCommon.setOrderId(repair.getOrderId());
+                customerCommon.setSignclosedId(repair.getSignclosedId());
+                customerCommon.setRelationBackEfastOrderId(repair.getRepairBackEfastOrderId());
+                customerCommon.setRelationBackStatus(repair.getRepairBackStatus());
+                customerCommon.setRelationBackName(repair.getRepairBackName());
+                customerCommon.setRelationBackTel(repair.getRepairBackTel());
+                customerCommon.setRelationBackLogisticsCompany(repair.getRepairBackLogisticsCompany());
+                customerCommon.setRelationBackLogisticsNo(repair.getRepairBackLogisticsNo());
+                customerCommon.setRelationBackPostage(repair.getRepairBackPostage());
+                customerCommon.setRelationBackMachineNo(repair.getRepairBackMachineNo());
+                customerCommon.setRelationSendStatus(repair.getRepairSendStatus());
+                customerCommon.setRelationSendName(repair.getRepairSendName());
+                customerCommon.setRelationSendTel(repair.getRepairSendTel());
+                customerCommon.setProvinceNumber(repair.getProvinceNumber());
+                customerCommon.setCityNumber(repair.getCityNumber());
+                customerCommon.setAreaNumber(repair.getAreaNumber());
+                customerCommon.setRelationSendMergeAddress(repair.getRepairSendMergeAddress());
+                customerCommon.setRelationSendAddress(repair.getRepairSendAddress());
+                customerCommon.setRelationSendLogisticsCompany(repair.getRepairSendLogisticsCompany());
+                customerCommon.setRelationSendLogisticsNo(repair.getRepairSendLogisticsNo());
+                customerCommon.setRelationDesc(repair.getRepairDesc());
+                customerCommon.setRelationState(repair.getRepairState());
+                customerCommon.setRelationAlipay(repair.getRepairAlipay());
+                customerCommon.setRelationIsTransfer(repair.getRepairIsTransfer());
+                customerCommon.setRelationCreateTime(repair.getRepairCreateTime());
+                customerCommon.setRelationUpdateTime(repair.getRepairUpdateTime());
+                break;
+            case 5://补发
+                Reissue reissue = (Reissue)object;
+                customerCommon.setRelationId(reissue.getReissueId());
+                customerCommon.setCustomerId(reissue.getCustomerId());
+                customerCommon.setOrderId(reissue.getOrderId());
+                customerCommon.setRelationBackEfastOrderId(reissue.getReissueBackEfastOrderId());
+                customerCommon.setRelationSendStatus(reissue.getReissueSendStatus());
+                customerCommon.setRelationSendName(reissue.getReissueSendName());
+                customerCommon.setRelationSendTel(reissue.getReissueSendTel());
+                customerCommon.setProvinceNumber(reissue.getProvinceNumber());
+                customerCommon.setCityNumber(reissue.getCityNumber());
+                customerCommon.setAreaNumber(reissue.getAreaNumber());
+                customerCommon.setRelationSendMergeAddress(reissue.getReissueSendMergeAddress());
+                customerCommon.setRelationSendAddress(reissue.getReissueSendAddress());
+                customerCommon.setRelationSendLogisticsCompany(reissue.getReissueSendLogisticsCompany());
+                customerCommon.setRelationSendLogisticsNo(reissue.getReissueSendLogisticsNo());
+                customerCommon.setRelationDesc(reissue.getReissueDesc());
+                customerCommon.setRelationState(reissue.getReissueState());
+                customerCommon.setRelationCreateTime(reissue.getReissueCreateTime());
+                customerCommon.setRelationUpdateTime(reissue.getReissueUpdateTime());
+                break;
+            case 6://退货
+                BackGoods backGoods = (BackGoods)object;
+                customerCommon.setRelationId(backGoods.getBackGoodsId());
+                customerCommon.setCustomerId(backGoods.getCustomerId());
+                customerCommon.setOrderId(backGoods.getOrderId());
+                customerCommon.setSignclosedId(backGoods.getSignclosedId());
+                customerCommon.setRelationBackStatus(backGoods.getBackGoodsBackStatus());
+                customerCommon.setRelationBackName(backGoods.getBackGoodsBackName());
+                customerCommon.setRelationBackTel(backGoods.getBackGoodsBackTel());
+                customerCommon.setRelationBackLogisticsCompany(backGoods.getBackGoodsBackLogisticsCompany());
+                customerCommon.setRelationBackLogisticsNo(backGoods.getBackGoodsBackLogisticsNo());
+                customerCommon.setRelationBackPostage(backGoods.getBackGoodsBackPostage());
+                customerCommon.setRelationBackMachineNo(backGoods.getBackGoodsBackMachineNo());
+                customerCommon.setRelationDesc(backGoods.getBackGoodsDesc());
+                customerCommon.setRelationState(backGoods.getBackGoodsState());
+                customerCommon.setRelationAlipay(backGoods.getBackGoodsAlipay());
+                customerCommon.setRelationIsTransfer(backGoods.getBackGoodsIsTransfer());
+                customerCommon.setRelationCreateTime(backGoods.getBackGoodsCreateTime());
+                customerCommon.setRelationUpdateTime(backGoods.getBackGoodsUpdateTime());
+                break;
+            case 7://无理由退货
+                NoreasonBack noreasonBack = (NoreasonBack)object;
+                customerCommon.setRelationId(noreasonBack.getNoreasonBackId());
+                customerCommon.setCustomerId(noreasonBack.getCustomerId());
+                customerCommon.setOrderId(noreasonBack.getOrderId());
+                customerCommon.setSignclosedId(noreasonBack.getSignclosedId());
+                customerCommon.setRelationBackStatus(noreasonBack.getNoreasonBackBackStatus());
+                customerCommon.setRelationBackName(noreasonBack.getNoreasonBackBackName());
+                customerCommon.setRelationBackTel(noreasonBack.getNoreasonBackBackTel());
+                customerCommon.setRelationBackLogisticsCompany(noreasonBack.getNoreasonBackBackLogisticsCompany());
+                customerCommon.setRelationBackLogisticsNo(noreasonBack.getNoreasonBackBackLogisticsNo());
+                customerCommon.setRelationBackPostage(noreasonBack.getNoreasonBackBackPostage());
+                customerCommon.setRelationBackMachineNo(noreasonBack.getNoreasonBackBackMachineNo());
+                customerCommon.setRelationDesc(noreasonBack.getNoreasonBackDesc());
+                customerCommon.setRelationState(noreasonBack.getNoreasonBackState());
+                customerCommon.setRelationAlipay(noreasonBack.getNoreasonBackAlipay());
+                customerCommon.setRelationIsTransfer(noreasonBack.getNoreasonBackIsTransfer());
+                customerCommon.setRelationCreateTime(noreasonBack.getNoreasonBackCreateTime());
+                customerCommon.setRelationUpdateTime(noreasonBack.getNoreasonBackUpdateTime());
+                break;
+                default:
+                    customerCommon = null;
+                    break;
+        }
+        return customerCommon;
+    }
 }

+ 6 - 1
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintSignclosedInfoService.java

@@ -6,6 +6,7 @@ import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 客诉-签收表Service
@@ -15,7 +16,11 @@ public interface ComplaintSignclosedInfoService {
      * 添加单个签收记录
      * @return
      */
-    int insert(ComplaintSignclosedInfo record);
+    boolean insert(ComplaintSignclosedInfo record,
+               Map<String,Integer> colorNameMap,
+               Map<String,Integer> fittingsNameMap,
+               Map<String,Integer> alreadyColorMap,
+               Map<String,Integer> alreadyFittingsMap);
     /**
      * 查询单个签收记录
      * @return

+ 2 - 1
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java

@@ -1,6 +1,7 @@
 package com.iamberry.rst.faces.cm;
 
 import com.iamberry.rst.core.cm.BackGoods;
+import com.iamberry.rst.core.cm.CustomerCommon;
 import com.iamberry.rst.core.cm.CustomerInfo;
 import com.iamberry.rst.core.cm.Reissue;
 import com.iamberry.rst.core.page.PagedResult;
@@ -45,7 +46,7 @@ public interface CustomerService {
      * @param customerInfo
      * @return
      */
-    CustomerInfo getCustomerInfo(CustomerInfo customerInfo);
+    CustomerCommon getCustomerInfo(CustomerInfo customerInfo);
 
     /**
      * 获取售后退货信息

+ 12 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductService.java

@@ -85,4 +85,16 @@ public interface ProductService {
      * @return
      */
     List<Product> listProductAndColorAndfittings(Product product);
+
+    /**
+     * 根据颜色id查询产品信息
+     * @return
+     */
+    Product getProductById(Integer colorId);
+
+    /**
+     * 根据配件id查询产品信息
+     * @return
+     */
+    Product getProductByFittingsId(Integer fittingsId);
 }

+ 122 - 8
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintSignclosedInfoServiceImpl.java

@@ -2,30 +2,144 @@ package com.iamberry.rst.service.cm;
 
 
 import com.github.pagehelper.PageHelper;
-import com.iamberry.rst.core.cm.ComplaintDetectInfo;
-import com.iamberry.rst.core.cm.ComplaintQuestionInfo;
-import com.iamberry.rst.core.cm.ComplaintSignclosedInfo;
+import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
 import com.iamberry.rst.faces.cm.ComplaintSignclosedInfoService;
-import com.iamberry.rst.service.cm.mapper.ComplaintQuestionInfoMapper;
-import com.iamberry.rst.service.cm.mapper.ComplaintSignclosedInfoMapper;
+import com.iamberry.rst.service.cm.mapper.*;
+import com.iamberry.rst.service.product.mapper.ProductMapper;
 import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedInfoService {
     @Autowired
     private ComplaintSignclosedInfoMapper complaintSignclosedInfoMapper;
-
+    @Autowired
+    private ProductMapper productMapper;
+    @Autowired
+    private AwaitingSignclosedProductMapper awaitingSignclosedProductMapper;
+    @Autowired
+    private ComplaintSignclosedProductInfoMapper complaintSignclosedProductInfoMapper;
+    @Autowired
+    private FittingsInfoMapper fittingsInfoMapper;
 
     @Override
-    public int insert(ComplaintSignclosedInfo record) {
-        return complaintSignclosedInfoMapper.insert(record);
+    @Transactional
+    public boolean insert(ComplaintSignclosedInfo record,
+                      Map<String,Integer> colorNameMap,
+                      Map<String,Integer> fittingsNameMap,
+                      Map<String,Integer> alreadyColorMap,
+                      Map<String,Integer> alreadyFittingsMap) {
+        boolean msg = true;
+        int num = complaintSignclosedInfoMapper.insert(record);
+        if(num < 1){
+            msg = false;
+        }else{
+            if(colorNameMap != null || colorNameMap.size() != 0){
+                for (Map.Entry<String,Integer> entry : colorNameMap.entrySet()) {
+                    AwaitingSignclosedProductInfo awaitingSignclosedInfo = new AwaitingSignclosedProductInfo();
+                    //根据颜色id获取产品信息获取产品信息
+                    Product product = productMapper.getProductById(Integer.valueOf(entry.getKey()));
+                    if(product == null){
+                        return false;
+                    }
+                    awaitingSignclosedInfo.setSignclosedId(record.getSignclosedId());
+                    awaitingSignclosedInfo.setProductName(product.getProductName());
+                    awaitingSignclosedInfo.setProductNum(entry.getValue());
+                    awaitingSignclosedInfo.setSignclosedProductType(1);
+                    awaitingSignclosedInfo.setSignclosedProductId(product.getProductId());
+                    awaitingSignclosedInfo.setSignclosedProductColor(Integer.valueOf(entry.getKey()));
+                    awaitingSignclosedInfo.setSignclosedCreateTime(new Date());
+                    awaitingSignclosedProductMapper.insert(awaitingSignclosedInfo);
+                 }
+            }
+            if(fittingsNameMap != null || fittingsNameMap.size() != 0){
+                for (Map.Entry<String,Integer> entry : fittingsNameMap.entrySet()) {
+                    AwaitingSignclosedProductInfo awaitingSignclosedInfo = new AwaitingSignclosedProductInfo();
+                    //根据配件id获取配件信息
+                    FittingsInfo fittingsInfo = fittingsInfoMapper.getFittingsById(Integer.valueOf(entry.getKey()));
+                    if(fittingsInfo == null){
+                        return false;
+                    }
+                    awaitingSignclosedInfo.setSignclosedId(record.getSignclosedId());
+                    awaitingSignclosedInfo.setProductName(fittingsInfo.getFittingsName());
+                    awaitingSignclosedInfo.setProductNum(entry.getValue());
+                    awaitingSignclosedInfo.setSignclosedProductType(2);
+                    awaitingSignclosedInfo.setSignclosedProductId(fittingsInfo.getProductId());
+                    awaitingSignclosedInfo.setSignclosedProductColor(Integer.valueOf(entry.getKey()));
+                    awaitingSignclosedInfo.setSignclosedCreateTime(new Date());
+                    awaitingSignclosedProductMapper.insert(awaitingSignclosedInfo);
+                }
+            }
+            if(alreadyColorMap != null || alreadyColorMap.size() != 0){
+                for (Map.Entry<String,Integer> entry : alreadyColorMap.entrySet()) {
+                    SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
+                    //根据颜色id获取产品信息获取产品信息
+                    Product product = productMapper.getProductById(Integer.valueOf(entry.getKey()));
+                    if(product == null){
+                        return false;
+                    }
+                    signclosedProductInfo.setSignclosedId(record.getSignclosedId());
+                    signclosedProductInfo.setProductName(product.getProductName());
+                    signclosedProductInfo.setProductNum(entry.getValue());
+                    signclosedProductInfo.setSignclosedProductType(1);
+                    signclosedProductInfo.setSignclosedProductId(product.getProductId());
+                    signclosedProductInfo.setSignclosedProductColor(Integer.valueOf(entry.getKey()));
+                    signclosedProductInfo.setSignclosedCreateTime(new Date());
+                    complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
+                }
+            }
+            if(alreadyFittingsMap != null || alreadyFittingsMap.size() != 0){
+                for (Map.Entry<String,Integer> entry : alreadyFittingsMap.entrySet()) {
+                    SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
+                    //根据配件id获取配件信息
+                    FittingsInfo fittingsInfo = fittingsInfoMapper.getFittingsById(Integer.valueOf(entry.getKey()));
+                    if(fittingsInfo == null){
+                        return false;
+                    }
+                    signclosedProductInfo.setSignclosedId(record.getSignclosedId());
+                    signclosedProductInfo.setProductName(fittingsInfo.getFittingsName());
+                    signclosedProductInfo.setProductNum(entry.getValue());
+                    signclosedProductInfo.setSignclosedProductType(2);
+                    signclosedProductInfo.setSignclosedProductId(fittingsInfo.getProductId());
+                    signclosedProductInfo.setSignclosedProductColor(Integer.valueOf(entry.getKey()));
+                    signclosedProductInfo.setSignclosedCreateTime(new Date());
+                    complaintSignclosedProductInfoMapper.insert(signclosedProductInfo);
+                }
+            }
+        }
+        return msg;
+    }
+
+    private Integer addSifnclosed(Map<String,Integer> Map,Integer signclosedId) {
+        Integer msg = 0;
+        for (Map.Entry<String, Integer> entry : Map.entrySet()) {
+            AwaitingSignclosedProductInfo awaitingSignclosedInfo = new AwaitingSignclosedProductInfo();
+            //根据颜色id获取产品信息获取产品信息
+            Product product = productMapper.getProductById(Integer.valueOf(entry.getKey()));
+            if (product == null) {
+                return 0;
+            }
+            awaitingSignclosedInfo.setSignclosedId(signclosedId);
+            awaitingSignclosedInfo.setProductName(product.getProductName());
+            awaitingSignclosedInfo.setProductNum(entry.getValue());
+            awaitingSignclosedInfo.setSignclosedProductType(1);
+            awaitingSignclosedInfo.setSignclosedProductId(product.getProductId());
+            awaitingSignclosedInfo.setSignclosedProductColor(Integer.valueOf(entry.getKey()));
+            awaitingSignclosedInfo.setSignclosedCreateTime(new Date());
+            msg = awaitingSignclosedProductMapper.insert(awaitingSignclosedInfo);
+
+        }
+        return msg;
     }
 
     @Override

+ 65 - 19
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -147,31 +147,77 @@ public class CustomerServiceImpl implements CustomerService {
     }
 
     @Override
-    public CustomerInfo getCustomerInfo(CustomerInfo customerInfo) {
+    public CustomerCommon getCustomerInfo(CustomerInfo customerInfo) {
+        CustomerCommon customerCommon = new CustomerCommon();
         //查询客诉列表
         List<CustomerInfo> customerList = customerInfoMapper.listCustomer(customerInfo);
         if (customerList == null || customerList.size() == 0) {
             return null;
         }
         CustomerInfo customer = customerList.get(0);
-
-        //查询售后维修集合
-        Repair repairInfo = new Repair();
-        repairInfo.setRepairState(1);
-        List<Repair> repairList = repairMapper.listRepair(repairInfo);
-        //查询售后退货集合
-        BackGoods backGoodsInfo = new BackGoods();
-        backGoodsInfo.setBackGoodsState(1);
-        List<BackGoods> backGoodsList = backGoodsMapper.listBackGoods(backGoodsInfo);
-        //查询售后无理由退货集合
-        NoreasonBack noreasonBackInfo = new NoreasonBack();
-        noreasonBackInfo.setNoreasonBackState(1);
-        List<NoreasonBack> noreasonBackList = noreasonBackMapper.listNoreasonBack(noreasonBackInfo);
-        //查询售后补发集合
-        Reissue reissueInfo = new Reissue();
-        reissueInfo.setReissueState(1);
-        List<Reissue> reissueList = reissueMapper.listReissue(reissueInfo);
-        return customer;
+        switch (customer.getCustomerIsSolve().intValue()) {
+            case 3://换新
+                //查询售后换新集合
+                Renewed renewedInfo = new Renewed();
+                renewedInfo.setRenewedState(1);
+                renewedInfo.setCustomerId(customerInfo.getCustomerId());
+                List<Renewed> renewedList = renewedMapper.listRenewed(renewedInfo);
+                if (renewedList == null || renewedList.size() == 0) {
+                    return null;
+                }
+                renewedInfo = renewedList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(3,renewedInfo);
+                break;
+            case 4://维修
+                //查询售后维修集合
+                Repair repairInfo = new Repair();
+                repairInfo.setRepairState(1);
+                repairInfo.setCustomerId(customerInfo.getCustomerId());
+                List<Repair> repairList = repairMapper.listRepair(repairInfo);
+                if (repairList == null || repairList.size() == 0) {
+                    return null;
+                }
+                repairInfo = repairList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(4,repairInfo);
+                break;
+            case 5://补发
+                //查询售后补发集合
+                Reissue reissueInfo = new Reissue();
+                reissueInfo.setReissueState(1);
+                reissueInfo.setCustomerId(customerInfo.getCustomerId());
+                List<Reissue> reissueList = reissueMapper.listReissue(reissueInfo);
+                if (reissueList == null || reissueList.size() == 0) {
+                    return null;
+                }
+                reissueInfo = reissueList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(5,reissueInfo);
+                break;
+            case 6://退货
+                //查询售后退货集合
+                BackGoods backGoodsInfo = new BackGoods();
+                backGoodsInfo.setBackGoodsState(1);
+                backGoodsInfo.setCustomerId(customerInfo.getCustomerId());
+                List<BackGoods> backGoodsList = backGoodsMapper.listBackGoods(backGoodsInfo);
+                if (backGoodsList == null || backGoodsList.size() == 0) {
+                    return null;
+                }
+                backGoodsInfo = backGoodsList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(6,backGoodsInfo);
+                break;
+            case 7://无理由退货
+                //查询售后无理由退货集合
+                NoreasonBack noreasonBackInfo = new NoreasonBack();
+                noreasonBackInfo.setNoreasonBackState(1);
+                noreasonBackInfo.setCustomerId(customerInfo.getCustomerId());
+                List<NoreasonBack> noreasonBackList = noreasonBackMapper.listNoreasonBack(noreasonBackInfo);
+                if (noreasonBackList == null || noreasonBackList.size() == 0) {
+                    return null;
+                }
+                noreasonBackInfo = noreasonBackList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(7,noreasonBackInfo);
+                break;
+        }
+        return customerCommon;
     }
 
     @Override

+ 1 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintSignclosedInfoMapper.xml

@@ -169,7 +169,7 @@
     </where>
   </select>
 
-  <insert id="insert" parameterType="ComplaintSignclosedInfo" >
+  <insert id="insert" parameterType="ComplaintSignclosedInfo" useGeneratedKeys="true" keyProperty="signclosedId" >
     insert into tb_rst_complaint_signclosed (signclosed_id, signclosed_type, signclosed_type_name, 
       machine_no, signclosed_logistics, signclosed_logistics_number, 
       signclosed_send_name, signclosed_send_tel, 

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

@@ -40,6 +40,14 @@
       *
     from
       tb_rst_noreason_back
+    <where>
+      <if test="customerId != null and customerId != ''">
+        customer_id = #{customerId}
+      </if>
+      <if test="noreasonBackState != null and noreasonBackState != ''">
+        and noreason_back_state = #{noreasonBackState}
+      </if>
+    </where>
   </select>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >

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

@@ -98,6 +98,14 @@
       *
     from
       tb_rst_renewed
+    <where>
+      <if test="customerId != null and customerId != ''">
+        customer_id = #{customerId}
+      </if>
+      <if test="renewedState != null and renewedState != ''">
+        and renewed_state = #{renewedState}
+      </if>
+    </where>
   </select>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >

+ 11 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java

@@ -132,4 +132,15 @@ public class ProductServiceImpl implements ProductService {
     public List<Product> listProductAndColorAndfittings(Product product) {
         return productMapper.listProductAndColorAndfittings(product);
     }
+
+    @Override
+    public Product getProductById(Integer colorId) {
+        return productMapper.getProductById(colorId);
+    }
+
+    @Override
+    public Product getProductByFittingsId(Integer fittingsId) {
+        return productMapper.getProductByFittingsId(fittingsId);
+    }
+
 }

+ 11 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductMapper.java

@@ -66,6 +66,17 @@ public interface ProductMapper {
      * @return
      */
     List<Product> listProductAndColorAndfittings(Product product);
+    /**
+     * 根据颜色查询产品信息
+     * @return
+     */
+    Product getProductById(Integer colorId);
+
+    /**
+     * 根据配件id查询产品信息
+     * @return
+     */
+    Product getProductByFittingsId(Integer fittingsId);
 
 
 }

+ 20 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml

@@ -165,4 +165,24 @@
         WHERE
         product_id  = #{productId}
     </select>
+
+    <!--根据颜色查询产品信息 -->
+    <select id="getProductById" resultType="Product" parameterType="Integer">
+        SELECT
+            pi.*
+        FROM
+            tb_rst_product_color pc LEFT JOIN tb_rst_product_info pi on pc.color_product_id = pi.product_id
+        WHERE
+        pc.color_id = #{colorId}
+    </select>
+
+    <!--根据配件id查询产品信息 -->
+    <select id="getProductByFittingsId" resultType="Product" parameterType="Integer">
+        SELECT
+        pi.*
+        FROM
+        tb_rst_product_fittings pf LEFT JOIN tb_rst_product_info pi on pf.product_id = pi.product_id
+        WHERE
+         pf.fittings_id = #{fittingsId}
+    </select>
 </mapper>

+ 4 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -229,6 +229,10 @@ public class AdminCustomerController {
         if (!StringUtils.isNotEmpty(customerId)) {
             return mv;
         }
+        CustomerInfo customerInfo = new CustomerInfo();
+        customerInfo.setCustomerId(Integer.parseInt(customerId));
+        CustomerCommon customerCommon = customerService.getCustomerInfo(customerInfo);
+        mv.addObject("customerCommon",customerCommon);
         return mv;
     }
 

+ 71 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -24,7 +24,10 @@ import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Created by wxm on 2017/8/29.
@@ -95,6 +98,74 @@ public class AdminSignclosedController {
         return mv;
     }
 
+    /**
+     * 添加签收信息
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("signclosed:add:signclosed")
+    @ResponseBody
+    @RequestMapping("/add_signclosed")
+    public ResponseJson addSignclosed(HttpServletRequest request,ComplaintSignclosedInfo signclosedInfo) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(signclosedInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+
+        /**寄回产品**/
+        String[] colorName = request.getParameterValues("colorName");
+        String[] fittingsName = request.getParameterValues("fittingsName");
+        /**签收产品**/
+        String[] alreadyColorName = request.getParameterValues("alreadyColorName");
+        String[] alreadyFittingsName = request.getParameterValues("alreadyFittingsName");
+
+        Map<String,Integer> colorNameMap = new HashMap<>();
+        if(colorName != null && colorName.length> 0){
+            for (int i = 0;i<colorName.length;i++){
+                colorNameMap.put(colorName[i],Integer.valueOf(request.getParameter("colorId"+colorName[i])));
+            }
+        }
+        Map<String,Integer> fittingsNameMap = new HashMap<>();
+        if(fittingsName != null && fittingsName.length> 0){
+            for (int i = 0;i<fittingsName.length;i++){
+                fittingsNameMap.put(fittingsName[i],Integer.valueOf(request.getParameter("fittingsId"+fittingsName[i])));
+            }
+        }
+        Map<String,Integer> alreadyColorMap = new HashMap<>();
+        if(alreadyColorName != null && alreadyColorName.length> 0){
+            for (int i = 0;i<alreadyColorName.length;i++){
+                alreadyColorMap.put(alreadyColorName[i],Integer.valueOf(request.getParameter("alreadyColorId"+alreadyColorName[i])));
+            }
+        }
+        Map<String, Integer> alreadyFittingsMap = new HashMap<>();
+        if(alreadyFittingsName != null && alreadyFittingsName.length> 0) {
+            for (int i = 0; i < alreadyFittingsName.length; i++) {
+                alreadyFittingsMap.put(alreadyFittingsName[i], Integer.valueOf(request.getParameter("alreadyFittingsId" + alreadyFittingsName[i])));
+            }
+        }
+        String signclosedDate = request.getParameter("signclosed_date");
+        if(signclosedDate != null){
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            signclosedInfo.setSignclosedDate(format.parse(signclosedDate));
+        }
+        if(signclosedInfo.getSignclosedState() == 2){
+            signclosedInfo.setSignclosedObjectsState(3);
+        }
+        boolean num = complaintSignclosedInfoService.insert(signclosedInfo,colorNameMap,fittingsNameMap,alreadyColorMap,alreadyFittingsMap);
+
+
+        if (!num) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 
 }
 

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/PtsCodeController.java

@@ -87,7 +87,7 @@ public class PtsCodeController {
             if(phones.get(i).length() != 11){
                 return "快递公司出错,请检查文档内的数据是否正常!";
             }
-            String text = MessageFormat.format(SEND_NOTICE_INFORM, autograph);
+            String text = MessageFormat.format(SEND_NOTICE_INFORM2, autograph);
             msg = smsService.sendOtherCMS(phones.get(i),text);
             if(msg.equals("SUCCESS")){
                 successNumber++;

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/utils/StitchAttrUtil.java

@@ -8,7 +8,7 @@ import java.util.*;
 
 public class StitchAttrUtil {
 
-    public final static String noProperty[] = {"serialVersionUID"};
+    public final static String noProperty[] = {"serialVersionUID","awaitingSignclosedProductInfoList","signclosedProductInfoList"};
     public static Set<String> propertySet = new HashSet<String>(Arrays.asList(noProperty));
 
     /**

+ 117 - 391
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl

@@ -58,19 +58,19 @@
 </nav>
 <article class="page-container" style="padding: 10px;">
     <div class="pd-20 cl">
-        <form action="" method="post" class="form form-horizontal" id="form-article-add">
+        <form action="" method="post" class="form form-horizontal" id="form-signclosed-add">
             <div class="row cl">
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收类型:</label>
 				<div class="radio-box">
-                        <input type="radio" id="tel-1" name="signclosedType" datatype="*"  checked nullmsg="请选择签收类型!">
+                        <input type="radio" id="tel-1" name="signclosedType" value="1" datatype="*"  checked nullmsg="请选择签收类型!">
                         <label for="tel-1">客诉寄回</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-2" name="signclosedType">
+                        <input type="radio" id="tel-2" name="signclosedType" value="2">
                         <label for="tel-2">代理商退货</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-3" name="signclosedType">
+                        <input type="radio" id="tel-3" name="signclosedType" value="3">
                         <label for="tel-3">其他</label>
                         <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="选择其他时有值" id="signclosedTypeName" name="signclosedTypeName">
                     </div>
@@ -91,13 +91,12 @@
                         <#if (productList?size > 0)>
                             <#list productList as product>
                             <tr >
-
-
                                 <td>${product.productName!''}</td>
                                 <td>
                                     <#if (product.colorList?size > 0)>
                                         <#list product.colorList as colorList>
-                                        ${colorList.colorName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                            <input type="checkbox" id="" value="${colorList.colorId!''}" name="colorName" datatype="*">${colorList.colorName!''}
+                                            <input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="colorId${colorList.colorId!''}" name="colorId${colorList.colorId!''}"><br>
                                         </#list>
                                     <#else>
                                         暂无颜色,请先添加产品颜色
@@ -106,7 +105,8 @@
                                 <td>
                                     <#if (product.fittingsList?size > 0)>
                                         <#list product.fittingsList as fittingsList>
-                                        ${fittingsList.fittingsName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                        <input type="checkbox" id="" value="${fittingsList.fittingsId!''}" name="fittingsName" datatype="*">${fittingsList.fittingsName!''}
+                                        <input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="fittingsId${fittingsList.fittingsId!''}" name="fittingsId${fittingsList.fittingsId!''}"><br>
                                         </#list>
                                     <#else>
                                         暂无配件,请先添加配件
@@ -196,7 +196,8 @@
                             <td>
                                 <#if (product.colorList?size > 0)>
                                     <#list product.colorList as colorList>
-                                    ${colorList.colorName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                        <input type="checkbox" id="" value="${colorList.colorId!''}" name="alreadyColorName" datatype="*">${colorList.colorName!''}
+                                        <input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="alreadyColorId${colorList.colorId!''}" name="alreadyColorId${colorList.colorId!''}"><br>
                                     </#list>
                                 <#else>
                                 暂无颜色,请先添加产品颜色
@@ -205,7 +206,8 @@
                             <td>
                                 <#if (product.fittingsList?size > 0)>
                                     <#list product.fittingsList as fittingsList>
-                                    ${fittingsList.fittingsName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                        <input type="checkbox" id="" value="${fittingsList.fittingsId!''}" name="alreadyFittingsName" datatype="*">${fittingsList.fittingsName!''}
+                                        <input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="alreadyFittingsId${fittingsList.fittingsId!''}" name="alreadyFittingsId${fittingsList.fittingsId!''}"><br>
                                     </#list>
                                 <#else>
                                     暂无配件,请先添加配件
@@ -228,11 +230,11 @@
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否少配件:</label>
                 <div class="formControls col-5 col-sm-5 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" id="tel-4" name="signclosedIsFittings" datatype="*" checked  >
+                        <input type="radio" id="tel-4" name="signclosedIsFittings" value="1" datatype="*" checked  >
                         <label for="tel-4">缺少配件</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-5" name="signclosedIsFittings" datatype="*">
+                        <input type="radio" id="tel-5" name="signclosedIsFittings" value="2" datatype="*">
                         <label for="tel-5">不缺配件</label>
                     </div>
                 </div>
@@ -240,7 +242,7 @@
             <div class="row cl">
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收日期:</label>
                 <div class="formControls col-5 col-sm-5 skin-minimal">
-                   <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="签收日期" id="signclosedDate" name="signclosedDate">
+                   <input type="text" style="width: 150px;margin-left: 10px;" class="input-text my-input-date" placeholder="签收日期" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" id="signclosed_date" name="signclosed_date" readonly="readonly"/>
                 </div>
             </div>
 
@@ -248,11 +250,11 @@
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否品检:</label>
                 <div class="formControls col-5 col-sm-5 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" id="tel-6" name="signclosedIsQuality" datatype="*" checked  >
+                        <input type="radio" id="tel-6" name="signclosedIsQuality" value="1" datatype="*" checked  >
                         <label for="tel-6">需要品检</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-7" name="signclosedIsQuality" datatype="*">
+                        <input type="radio" id="tel-7" name="signclosedIsQuality" value="2" datatype="*">
                         <label for="tel-7">不需要品检</label>
                     </div>
                 </div>
@@ -261,16 +263,41 @@
                 <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否已转入:</label>
                 <div class="formControls col-5 col-sm-5 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" id="tel-8" name="signclosedIsInto" datatype="*" checked  >
+                        <input type="radio" id="tel-8" name="signclosedIsInto" value="1" datatype="*" checked  >
                         <label for="tel-8">已转入品检</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-9" name="signclosedIsInto" datatype="*">
+                        <input type="radio" id="tel-9" name="signclosedIsInto" value="2" datatype="*">
                         <label for="tel-9">未转入品检</label>
                     </div>
                 </div>
             </div>
-
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否已经签收:</label>
+                <div class="formControls col-5 col-sm-5 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="tel-10" name="signclosedState" onclick="show();" value="1" datatype="*" checked  >
+                        <label for="tel-8">已签收</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-11" name="signclosedState" onclick="hide();" value="2" datatype="*">
+                        <label for="tel-9">未签收</label>
+                    </div>
+                </div>
+            </div>
+            <div class="row cl" id="objectsStateId">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>物件状态:</label>
+                <div class="formControls col-5 col-sm-5 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="tel-12" name="signclosedObjectsState" value="1" datatype="*" checked  >
+                        <label for="tel-8">正常签收</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-13" name="signclosedObjectsState" value="2" datatype="*">
+                        <label for="tel-9">物件不对</label>
+                    </div>
+                </div>
+            </div>
             <div class="row cl">
                 <label class="form-label col-3 col-sm-3">备注:</label>
                 <div class="formControls col-5 col-sm-5">
@@ -279,7 +306,7 @@
             </div>
             <div class="row cl">
                 <div class="col-2 col-sm-2 col-offset-3">
-                    <button onClick="save_submit();" class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
+                    <button onClick="add();" class="btn btn-block btn-primary size-XL" type="button">确认录入</button>
                 </div>
             </div>
         </form>
@@ -295,416 +322,115 @@
 <#--<script type="text/javascript" src="${path}/common/lib/cm.lib/dimensions.js"></script>-->
 <script type="text/javascript" src="${path}/common/lib/cm.lib/suggest.js"></script>
 <script type="text/javascript">
-    $(function(){
-    });
-
-    $(document).on('click', '.dalog-ask .answer', function() {
-        $("#answer-textarea").text($(this).find("span").text());
-    });
-
-</script>
-<script type="text/javascript">
-
-    /*处理结果的执行状态*/
-    var isSolve = {
-        solved : [],
-        noSolved : [],
-        renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
-        maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
-        reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
-        backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
-        noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
+    function hide() {
+        $("#objectsStateId").hide();
+    }
+    function show() {
+        $("#objectsStateId").show();
     }
 
-    /*全局标识当前状态  type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货*/
-    var allCustomerType = 1;
-
-    /*初始化页面参数*/
-    $(function () {
-
-        /*初始化问题分类*/
-        initComplaintTypeInfo();
-
-        /*初始化客服*/
-        initSysAdmin();
-
-        /*初始化产品类型 --  客诉头部的产品类型单选 */
-        initProduceType();
-
-        /*初始化选择处理结果 -- type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货 */
-        initProcessResult(1);
-
-        /*监听处理结果选择事件*/
-        $("[name='customerIsSolve']").change(function(){
-            initProcessResult(parseInt($(this).val()));
-            allCustomerType = parseInt($(this).val());
-        })
-
-        /*监听问题类型 选择事件*/
-        $("[name='complaintId']").change(function(){
-            initComplaintSmallClassInfo($(this).val());
-        })
+    $(function(){
+        var province = listProvince(null,null);
+        var provinceHtml = '';
+        for(var i=0;i<province.length;i++){
+                provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
+        }
+        $("#province").html(provinceHtml);
 
-        /*监听问题关键字搜索*/
-        $(document).on('click', '#search_button', function() {
-            initComplaintQuestionInfo();
-        });
+       var city = listCity(null,null);
+        var cityHtml = '';
+        for(var i=0;i<city.length;i++){
+            cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
+        }
+        $("#city").html(cityHtml);
 
-        /*搜索订单事件*/
-        $(document).on('click', '#selectOrder', function() {
-            selectOrder();
-        });
 
         /*监听省选择事件*/
         $(document).on('change', '#province', function() {
             var proId = $("#province").val();
-            var cityId = setCity("",proId,2)
-            setDistrict("",cityId,2)
-        });
-
-        /*监听市选择事件*/
-        $(document).on('change', '#city', function() {
-            var city = $("#city").val();
-            setDistrict("",city,2)
-        });
-
-        /* 初始化单选框样式 */
-        initCheck();
-
-    })
-
-    /*初始化单选框样式*/
-    function initCheck(){
-        $('.skin-minimal input').iCheck({
-            checkboxClass: 'icheckbox-blue',
-            radioClass: 'iradio-blue',
-            increaseArea: '20%'
-        });
-    }
-
-
-
-    /*初始化产品类型 --  客诉头部的产品类型单选*/
-    function initProduceType(){
-        var html = "";
-        $.ajax({
-            type: "POST",
-            data: {
-            },
-            url: "${path}/admin/customer/select_produce_type",
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    var check = "checked";
-                    for(var i=0;i<data.returnMsg.productTypeList.length;i++){
-                        var produce = data.returnMsg.productTypeList[i];
-                        html += ' <div class="radio-box">' +
-                                '<input type="radio" id="tel-3" name="produceType" datatype="*" value="'+ produce.typeId +'"  '+ check +' nullmsg="请选择产品类型!" >' +
-                                ' <label for="tel-3">'+ produce.typeName +'</label>' +
-                                ' </div>';
-                        check = "";
-                    }
-                }else{
-                    html = '';
-                }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
+            var city = listCity(proId,null);
+            var cityHtml = '';
+            for(var i=0;i<city.length;i++){
+                cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
             }
+            $("#city").html(cityHtml);
         });
-        $("#produceTypeHtml").html(html);
-    }
-
-
+    });
 
 
-    /**
-     * 设置地址
-     */
-    function setAdress(){
-        var addres = $("#addressInfo").val();
+    function  add() {
 
-        $("#addrssMsg").html("");
-        if(addres == null){
-            $("#addrssMsg").html("*未能获取到地址,请手动选择地址");
+        var signclosedType = $("#signclosedType").val();
+        if( signclosedType == 3){
+            var signclosedTypeName = $("#signclosedTypeName").val();
+            if( signclosedTypeName == null || signclosedTypeName == "" ) {
+                layer.msg('类型为其他时需填值', {icon: 5, time: 1000});
+                return;
+            }
+        }
+        var signclosedLogisticsNumber = $("#signclosedLogisticsNumber").val();
+        if( signclosedLogisticsNumber == null || signclosedLogisticsNumber == "" ){
+            layer.msg('物流单号不能为空',{icon: 5,time:1000});
             return;
         }
-        var addresList = addres.split("-");
-        if(addresList[0] == null || addresList[1]==null || addresList[2]==null || addresList[3]==null){
-            $("#addrssMsg").html("*未能获取到地址,请手动选择地址");
+        if( signclosedLogisticsNumber.length > 300 ){
+            layer.msg('物流单号长度不得大于20个字符',{icon: 5,time:1000});
             return;
         }
-        var proId = setPro(getAddress(addresList[0],0),1);
-        var cityId = setCity(getAddress(addresList[1],1),proId,1);
-        setDistrict(getAddress(addresList[2],2),cityId,1);
-        $("#sendAddress").val(addresList[3]);
-    }
-
-    /***
-     * 删除 “省”,“市”,“区”关键字
-     * type : 0:省   2:市   3:区
-     */
-    function getAddress(addrss,type) {
-        var abbreviation = "";
-        if(addrss == ""){
-            abbreviation = "";
-        }else{
-            switch(type)
-            {
-                case 0:
-                    var proReg = new RegExp("省","g");
-                    abbreviation = addrss.replace(proReg,"");
-                    break;
-                case 1:
-                    var cityReg = new RegExp("市","g");
-                    abbreviation = addrss.replace(cityReg,"");
-                    break;
-                case 2:
-                    var districtReg = new RegExp("市","g");
-                    abbreviation = addrss.replace(districtReg,"");
-                    break;
-                default:
-                    break;
-            }
+        var signclosedSendName = $("#signclosedSendName").val();
+        if( signclosedSendName == null || signclosedSendName == "" ){
+            layer.msg('寄件人姓名不能为空',{icon: 5,time:1000});
+            return;
         }
-        return abbreviation
-    }
-
-    /**
-     * 设置省
-     * type  1:搜索订单赋值   2:只查询全部,默认第一个
-     */
-    function setPro(provinceName,type) {
-        var proId = '';
-        var province = listProvince();
-        var selectPro = {};
-        if(type == 1){
-            selectPro = listProvince("",provinceName);
-        }else if(type == 2){
-            selectPro = null;
+        if( signclosedSendName.length > 10 ){
+            layer.msg('寄件人姓名长度不得大于10个字符',{icon: 5,time:1000});
+            return;
         }
-        if(province!=null){
-            var provinceHtml = ''
-            for(var i=0;i<province.length;i++){
-                if(selectPro!= null && province[i].provinceId == selectPro[0].provinceId){
-                    proId = selectPro[0].provinceId;
-                    provinceHtml += '<option value="'+ province[i].provinceId +'" selected>'+ province[i].province +'</option>';
-                }else{
-                    provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
-                }
-            }
-            $("#province").html(provinceHtml);
+        var signclosedSendTel = $("#signclosedSendTel").val();
+        if( signclosedSendTel == null || signclosedSendTel == "" ){
+            layer.msg('请输入寄件人电话',{icon: 5,time:1000});
+            return;
         }
-        return proId;
-    }
-
-    /**
-     * 设置市
-     * type  1:搜索订单赋值   2:只查询全部,默认第一个
-     */
-    function setCity(cityName,proId,type) {
-        var cityId = '';
-        var city = listCity(proId,"");
-        var selectCity = {};
-        if(type == 1){
-            selectCity = listCity(proId,cityName);
-        }else if(type == 2){
-            selectCity = null;
-            cityId = city[0].cityId;
+        if( signclosedSendTel.length > 11 ){
+            layer.msg('寄件人电话长度不得大于11个字符',{icon: 5,time:1000});
+            return;
         }
-
-        if(city!=null){
-            var cityHtml = ''
-            for(var i=0;i<city.length;i++){
-                if(selectCity != null && city[i].cityId == selectCity[0].cityId){
-                    cityId = city[i].cityId;
-                    cityHtml += '<option value="'+ city[i].cityId +'" selected>'+ city[i].city +'</option>';
-                }else{
-                    cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
-                }
-            }
-            $("#city").html(cityHtml);
+        var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
+        if(!myreg.test(signclosedSendTel)){
+            layer.msg('寄件人电话格式不正确',{icon: 5,time:1000});
+            return;
         }
-        return cityId;
-    }
 
-    /**
-     * 设置区
-     * type  1:搜索订单赋值   2:只查询全部,默认第一个
-     */
-    function setDistrict(districtName,cityId,type) {
-        var district = listDistrict(cityId,"");
-        var selectDistrict = {};
-        if(type == 1){
-            selectDistrict = listDistrict(cityId,districtName);
-        }else if(type == 2){
-            selectDistrict = null;
-        }
-        if(district!=null){
-            var districtHtml = ''
-            for(var i=0;i<district.length;i++){
-                if(selectDistrict != null && district[i].districtId == selectDistrict[0].districtId){
-                    districtHtml += '<option value="'+ district[i].districtId +'" selected>'+ district[i].district +'</option>';
-                }else{
-                    districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
-                }
+        var signclosedDesc = $("#signclosedDesc").val();
+        if( signclosedDesc != null || signclosedDesc == "" ){
+            if( signclosedDesc.length > 300 ){
+                layer.msg('备注长度不得大于150个字符',{icon: 5,time:1000});
+                return;
             }
-            $("#district").html(districtHtml);
         }
-    }
 
-    /**
-     * 展示产品
-     * @param produceList
-     */
-    function setProduce(orderItemList) {
-        var html = "";
-        $.ajax({
-            type: "POST",
-            data: {
-            },
-            url: "${path}/admin/customer/select_produce",
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    for(var i=0;i<data.returnMsg.productList.length;i++){
-                        var product = data.returnMsg.productList[i];    //所有产品
-                        var produceFittings = getProduceFittings(product.productId);  //获取该产品的所有配件
-                        var colorList = product.colorList;  //该产品的所有颜色
-
-                        var isColorSelect = false;
-                        var selectColor = new Array();    //颜色选择html和颜色数量对应 对象
-                        if(colorList != null){
-                            for(var m=0;m<orderItemList.length;m++){
-                                var colorNumber = 1;
-                                var colorHtml = '';
-                                for(var j=0;j<colorList.length;j++){
-                                    var colors = {};
-                                    if(colorList[j].colorId == orderItemList[m].itemColorId){
-                                        colorHtml += '<option value="'+ colorList[j].colorId +'" selected>'+ colorList[j].colorName +'</option>';
-                                        isColorSelect = true;
-                                        colorNumber = orderItemList[m].itemNum;
-                                    }else{
-                                        colorHtml += '<option value="'+ colorList[j].colorId +'">'+ colorList[j].colorName +'</option>';
-                                    }
-                                }
-                                colors.colorNumber = colorNumber;
-                                colors.colorHtml = colorHtml;
-                                selectColor.push(colors);
-                            }
-                        }
-
-                        var fittingsHtml = '';
-                        if(produceFittings != null){
-                            for(var k=0;k<produceFittings.length;k++){
-                                fittingsHtml += '<div class="check-box">' +
-                                        '<input type="checkbox" id="checkbox-2" name="ck-produce-fittings" value="'+ produceFittings[k].fittingsId +'">' +
-                                        '<label for="checkbox-2">'+ produceFittings[k].fittingsName +'</label>' +
-                                        '<input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="produceFittings">' +
-                                        '</div>';
-                            }
-                        }
-
-                        var isChecked = '';
-                        if(isColorSelect){
-                            isChecked = 'checked';
-                        }
-                        for(var f=0;f<selectColor.length;f++){
-                            html += '<div class="skin-minimal">' +
-                                    '        <div class="check-box">' +
-                                    '            <input type="checkbox" name="ck-produce" id="checkbox-'+ i +'" '+ isChecked +'>' +
-                                    '' +
-                                    '           <label for="checkbox-'+ i +'" name="produceName">'+ convertUndefinedToEmpty(product.typeName) +'</label> -' +
-                                    '           <input type="hidden" name="productType" value="">' +
-                                    '' +
-                                    '            <label for="checkbox-'+ i +'">'+ convertUndefinedToEmpty(product.productName) +'</label>' +
-                                    '           <input type="hidden" name="productId" value="">' +
-                                    '' +
-                                    '            <select class="select colorId" name="colorId" style="width: 100px;">' +
-                                    selectColor[f].colorHtml +
-                                    '            </select>' +
-                                    '            <input type="text" class="input-text" style="width: 40px;text-align: center;" value="'+ selectColor[f].colorNumber +'" placeholder="" id="" name="produceNumber">' +
-                                    '        </div>' +
-                                    fittingsHtml +
-                                    '    </div>';
-
-                            if(!isColorSelect){
-                                break;
-                            }
-                        }
-                    }
-                }else{
-                    html = '';
-                }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
-            }
-        });
-        $("#produceSelect").html(html);
 
-        initCheck(); //因为需要展示产品,所以再次初始化多选框
-
-        setBackProduct();  //设置寄回产品
-
-        monitorProduct();   //监听产品变化
-    }
 
-    /*获取产品配件*/
-    function getProduceFittings(productId){
-        var produceFittings;
         $.ajax({
-            type: "get",
-            data: {
-                productId : productId
-            },
-            url: "${path}/admin/customer/select_produce_fittings",
+            cache: true,
+            type: "POST",
+            url: "${path}/admin/signclosed/add_signclosed",
+            data:$('#form-signclosed-add').serialize(),// 你的formid
             async: false,
             success: function(data){
                 if (data.returnCode == 200) {
-                    produceFittings = data.returnMsg.produceFittingsList;
+                    layer.msg('添加成功',{icon: 1,time:1000},function () {
+                        location.replace(location.href);
+                    });
+                } else {
+                    layer.msg('添加失败',{icon: 5,time:1000});
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
             }
         });
-        return produceFittings;
-    }
-
-    /*监听产品变化*/
-    function monitorProduct(){
-        /*产品的多选框*/
-        $("#produceSelect").find("input[name='ck-produce']").change(function (){
-            setBackProduct();
-        })
-        /*选择产品颜色*/
-        $("#produceSelect").find(".colorId").change(function (){
-            setBackProduct();
-        })
-        /*产品数量*/
-        $("#produceSelect").find("input[name='produceNumber']").blur(function (){
-            setBackProduct();
-        })
-        /*配件数量*/
-        $("#produceSelect").find("input[name='produceFittings']").blur(function (){
-            setBackProduct();
-        })
-        /*配件多选框*/
-        $("#produceSelect").find("input[name='ck-produce-fittings']").click(function (){
-            setBackProduct();
-        })
-    }
-
-    /*设置寄回产品*/
-    function setBackProduct() {
-        $("#produceSelect").find(".skin-minimal").each(function (){
-            var isChecked = $(this).find("input[name='ck-produce']").attr('checked');
-            var produceName =  $(this).find("input[name='produceName']").eq(0).html();
-            alert(isChecked + "--" +produceName);
-//            if(){
-//                html = '<div class="update-parts" style="margin-bottom: 10px;"><span>红色净水机(wx-1)x 1台</span><span>水箱 x 1件</span><span>t1 x 1件</span><span>t2 x 1件</span></div>';
-//            }
-        })
     }
-    
 </script>
 <!--/请在上方写此页面业务相关的脚本-->
 </body>