Browse Source

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

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java
liujiankang 5 years ago
parent
commit
803da930aa

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

@@ -227,7 +227,9 @@ public class AdminCustomerController {
         complaintSmallClassInfo.setComplaintId(complaintQuestionInfo.getComplaintId());
         List<ComplaintSmallClassInfo> complaintSmallClassInfoList = complaintSmallClassInfoService.listComplaintSmallClassInfo(complaintSmallClassInfo);
         //查询问题大类
+        ProductType pType = productService.getProductType(customerInfo.getCustomerId());
         ComplaintTypeInfo complaintTypeInfo = new ComplaintTypeInfo();
+        complaintTypeInfo.setComplaintType(pType.getComplaintType());
         List<ComplaintTypeInfo> complaintTypeInfoList = complaintTypeInfoService.listComplaintTypeInfo(complaintTypeInfo);
 
         mv.addObject("cmRelation", cmRelation);

+ 6 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintQuestionInfoController.java

@@ -55,6 +55,12 @@ public class ComplaintQuestionInfoController {
             Integer complaintConsultingType = Integer.valueOf(complaintConsultingTypeOther);
             complaintTypeInfo.setComplaintConsultingType(complaintConsultingType);
         }
+        String complaintType =  request.getParameter("complaintType");
+
+        if (complaintType != null && !"".equals(complaintType)) {
+            Integer type = Integer.valueOf(complaintType);
+            complaintTypeInfo.setComplaintType(type);
+        }
 
         List<ComplaintTypeInfo> complaintTypeInfoList = complaintTypeInfoService.listComplaintTypeInfo(complaintTypeInfo);
 

+ 42 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java

@@ -5,6 +5,7 @@ import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.core.fm.ComplaintDetectInfo;
 import com.iamberry.rst.core.order.EfastOrder;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.order.ProductType;
@@ -15,6 +16,7 @@ import com.iamberry.rst.core.sys.Relu;
 import com.iamberry.rst.core.sys.SysConfig;
 import com.iamberry.rst.faces.address.AddressService;
 import com.iamberry.rst.faces.cm.*;
+import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.sms.MessageService;
@@ -23,6 +25,7 @@ import com.iamberry.rst.faces.sys.SysConfigService;
 import com.iamberry.rst.faces.sys.SysService;
 import com.iamberry.rst.service.cm.mapper.CustomerInfoMapper;
 import com.iamberry.rst.service.sms.mapper.MessageMapper;
+import com.iamberry.rst.util.SmsConfig;
 import com.iamberry.rst.utils.EfastUtil;
 import com.iamberry.rst.utils.KuaiDi100;
 import com.iamberry.wechat.tools.DateTimeUtil;
@@ -82,6 +85,8 @@ public class MQTask implements InitializingBean {
 	@Autowired
 	private  CmRelationService cmRelationService;
 	@Autowired
+	private ComplaintDetectInfoService complaintDetectInfoService;
+	@Autowired
 	private  EfastUtil efastUtil;
 
 	private Object lock = new Object();
@@ -554,4 +559,41 @@ public class MQTask implements InitializingBean {
 		}
 	}
 
+	/**
+	 * 查询维修超时数据并短信通知
+	 */
+	@Scheduled(cron = "0 0 9 * * ?")//每天上午午9点触发
+/*	@Scheduled(cron = "0 0/1 * * * ?")//每2分钟执行一次*/
+	public void detectTimeoutNotice() throws Exception {
+		logger.info("---------------- 询维修超时数据并短信通知开始 ---------------");
+		//待检测即将超时数据
+		List<ComplaintDetectInfo>  listMaintenanceCut = complaintDetectInfoService.listMaintenanceCutNotice();
+		//待维修即将超时数据
+		List<ComplaintDetectInfo>  listCompleteCut = complaintDetectInfoService.listCompleteCutNotice();
+		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+		if(listMaintenanceCut != null && listMaintenanceCut.size() > 0){
+			for(ComplaintDetectInfo info : listMaintenanceCut){
+				if(info.getDetectNumber() != null && info.getMaintenanceCutTime() != null){
+					//发送短信通知维修检测人员
+					String text = MessageFormat.format(SmsConfig.DETECTION_TIMEOUT_NOTIFICATION, info.getDetectNumber(),"检测超时",format.format(info.getMaintenanceCutTime()));
+					String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
+					logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送检测即将超时数据维修人员:"+result);
+				}
+
+			}
+		}
+		if(listCompleteCut != null && listCompleteCut.size() > 0){
+			for(ComplaintDetectInfo info : listCompleteCut){
+				//发送短信通知维修检测人员
+				if(info.getDetectNumber() != null && info.getCompleteCutTime() != null){
+					String text = MessageFormat.format(SmsConfig.DETECTION_TIMEOUT_NOTIFICATION, info.getDetectNumber(),"维修超时",format.format(info.getCompleteCutTime()));
+					String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
+					logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送维修即将超时数据维修人员:"+result);
+				}
+			}
+		}
+
+		logger.info("---------------- 询维修超时数据并短信通知结束 ---------------");
+	}
+
 }

+ 1 - 0
watero-rst-web/src/main/resources/platform.properties

@@ -67,6 +67,7 @@ CUSTOMER_PHONE=15207170059
 CUSTOMER_EXCHANGE=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u8bf7\u5f00\u59cb{1}\uff0c\u6b64\u4e3a\u6362\u8d27\u673a\u5668\uff0c\u8bf7\u5f00\u59cb\u5904\u7406\uff1b
 CUSTOMER_RETURN=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u8bf7\u5f00\u59cb{1}\uff0c\u6b64\u4e3a\u9000\u8d27\u673a\u5668\uff0c\u8bf7\u5f00\u59cb\u5904\u7406\uff1b
 CUSTOMER_CONTACT=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u5ba2\u670d\u5df2\u7ecf\u786e\u8ba4\uff0c\u7ef4\u4fee\u7f16\u53f7\u4e3a{1}\uff0c\u8bf7\u6253\u5370\u6b64\u673a\u5668\u7ef4\u4fee\u5361\u5e76\u5f00\u59cb\u68c0\u6d4b\uff1b
+DETECTION_TIMEOUT_NOTIFICATION=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u5373\u5c06{1}\uff0c\u622a\u6b62\u65e5\u671f\uff1a{2}\uff0c\u5982\u5df2\u68c0\u6d4b\u5b8c\u6210\u8bf7\u5c3d\u5feb\u5f55\u5165\u5230\u7cfb\u7edf
 #---SMS end---#
 
 # token

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

@@ -37,7 +37,7 @@
     <aop:aspectj-autoproxy proxy-target-class="true"/>
 
 	<!-- 开启注解启动定时器 -->
-    <!--<task:annotation-driven/>-->
+    <task:annotation-driven/>
 
 	<!-- DataSource -->
 	<import resource="classpath:watero-rst-db.xml"/>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

@@ -833,7 +833,7 @@
         initProduceType();
 
         /*初始化问题分类*/
-        initComplaintTypeInfo();
+        initComplaintTypeInfo(null);
 
         /*初始化客服*/
         initSysAdmin();

+ 6 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl

@@ -162,7 +162,7 @@
                 <div class="formControls col-10 col-sm-10 skin-minimal" id="produceTypeHtml">
                     <#list typeList as type>
                         <div class="radio-box" style="width: 180px;">
-                            <input type="radio" id="produceType-${type_index}" name="typeId" typeCompany="${type.typeCompany}"  value="${type.typeId!''}" <#if customerInfo.typeId == type.typeId>checked</#if> >
+                            <input type="radio" id="produceType-${type_index}" name="typeId" typeCompany="${type.typeCompany}"  complaintType="${type.complaintType}" value="${type.typeId!''}" <#if customerInfo.typeId == type.typeId>checked</#if> >
                             <label for="produceType-${type_index}">${type.typeName!''}</label>
                         </div>
                     </#list>
@@ -908,6 +908,7 @@
         $("input[name='typeId']").change(function (){
             var typeId = parseInt($(this).val());
             var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
+            var complaintType = parseInt($("input:radio[name='typeId']:checked").attr("complaintType"));
             $("#selectCompany").val(typeCompany);
             $("#companyId").val(typeCompany);
             var isShowTDS = 2;//是否展示tds 1是 2否
@@ -954,14 +955,15 @@
                 $("#tdsId").hide();
             }
 
-            for(var i=0;i<productTypeArray.length;i++){
+            /*for(var i=0;i<productTypeArray.length;i++){
                 var array = productTypeArray[i];
                 if(typeId == array[0]){
                     customerTypeId = array[1];
                 }
-            }
+            }*/
+            initComplaintTypeInfo(complaintType);
+            /*initComplaintSmallClassInfo(customerTypeId);*/
             $("#complaintId").val(customerTypeId);
-            initComplaintSmallClassInfo(customerTypeId);
         });
 
         /*监听处理结果选择事件*/

File diff suppressed because it is too large
+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl


+ 16 - 10
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -345,7 +345,7 @@ function initProduceType(){
                 for(var i=0;i<data.returnMsg.productTypeList.length;i++){
                     var produce = data.returnMsg.productTypeList[i];
                     html += ' <div class="radio-box"  style="width: 180px;">' +
-                        '<input type="radio" class="single_loading"  id="produce-type-'+ i +'" name="typeId" typeCompany="'+ produce.typeCompany +'"  datatype="*" value="'+ produce.typeId +'"  '+ check +' nullmsg="请选择产品类型!" >' +
+                        '<input type="radio" class="single_loading"  id="produce-type-'+ i +'" name="typeId" typeCompany="'+ produce.typeCompany +'" complaintType="'+ produce.complaintType +'"  datatype="*" value="'+ produce.typeId +'"  '+ check +' nullmsg="请选择产品类型!" >' +
                         ' <label for="produce-type-'+ i +'">'+ produce.typeName +'</label>' +
                         ' </div>';
                     check = "";
@@ -360,6 +360,7 @@ function initProduceType(){
             $("input[name='typeId']").change(function (){
                 var typeId = parseInt($(this).val());
                 var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
+                var complaintType = parseInt($("input:radio[name='typeId']:checked").attr("complaintType"));
                 $("#selectCompany").val(typeCompany);
                 $("#companyId").val(typeCompany);
                 var isOrder = 1;
@@ -406,14 +407,15 @@ function initProduceType(){
                     $("#tdsId").hide();
                 }
 
-                for(var i=0;i<productTypeArray.length;i++){
+                /*for(var i=0;i<productTypeArray.length;i++){
                     var array = productTypeArray[i];
                     if(typeId == array[0]){
                         customerTypeId = array[1];
                     }
-                }
-               $("#complaintId").val(customerTypeId);
-                initComplaintSmallClassInfo(customerTypeId);
+                }*/
+                initComplaintTypeInfo(complaintType);
+                /*initComplaintSmallClassInfo(customerTypeId);*/
+                $("#complaintId").val(customerTypeId);
 
             });
             /*当前第一个默认选中上朵电动牙刷  isNeedSelectOrder = 2  默认不需要选择订单*/
@@ -539,14 +541,18 @@ function otherHied(customerInfoType){
 }
 
 /*初始化问题大类*/
-function initComplaintTypeInfo() {
+function initComplaintTypeInfo(complaintType) {
     //默认为售前咨询
     //var customerCounselTypeOverall = allCustomerInfoType;
     var customerCounselTypeOverall = null;
+    if(complaintType == null){
+        complaintType = 2;
+    }
     $.ajax({
         type: "POST",
         data: {
-            complaintConsultingType : customerCounselTypeOverall
+            complaintConsultingType : customerCounselTypeOverall,
+            complaintType : complaintType
         },
         url: url_path + "/admin/complaintQuestion/list_complaintType",
         async: true,
@@ -566,10 +572,10 @@ function initComplaintTypeInfo() {
             }
             $("[name='complaintId']").html(html);
 
-            if(isEmpty(customerTypeId) ){
+            /*if(isEmpty(customerTypeId) ){
                 $("[name='complaintId']").val(customerTypeId);
-            }
-            initComplaintSmallClassInfo(customerTypeId);
+            }*/
+            initComplaintSmallClassInfo(id);
         },
         error: function(XmlHttpRequest, textStatus, errorThrown){
         }