Browse Source

新增发送短信功能

liujiankang 6 years ago
parent
commit
4138fd3bea

+ 0 - 24
watero-rst-interface/pom.xml

@@ -24,28 +24,4 @@
             <version>1.0.0</version>
         </dependency>
     </dependencies>
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-                <filtering>false</filtering>
-            </resource>
-        </resources>
-        <finalName>watero-rst-service</finalName>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.3</version>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>

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

@@ -772,6 +772,7 @@ LEFT JOIN tb_rst_cm_relation cr ON cr.customer_id = c.customer_id
 LEFT JOIN tb_rst_cm_proc_method cpm ON cpm.proc_method_id = cr.proc_method_id
 LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
 LEFT JOIN tb_rst_cm_sendback_info csi ON csi.relation_id = cr.relation_id
+where si.store_id = 23
 </select>
   <!-- 退换货统计sql start -->
   <!-- 总销量 -->

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

@@ -1705,6 +1705,9 @@
             <if test="smsSignatureId != null and smsSignatureId != '' ">
                 smsSignature_id = #{smsSignatureId}
             </if>
+            <if test="smsTemplateId != null and smsTemplateId != '' ">
+                smsTemplate_id = #{smsTemplateId}
+            </if>
         </where>
     </select>
 </mapper>

+ 23 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminSalesOrderController.java

@@ -1594,6 +1594,28 @@ public class AdminSalesOrderController {
         return responseJson;
 
     }
+    /**
+     * 根据模板id查询模板
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/get_templatesOne")
+    public ResponseJson getTemplatesOne(HttpServletRequest request,Integer smsTemplateId) throws Exception {
+        ResponseJson responseJson = ResponseJson.getSUCCESS();
+        if (smsTemplateId == null) {
+            return new ResponseJson(500, "未获取到参数!", 500);
+        }
+        //查询签名
+        SmsTemplateInfo smsTemplateInfo = new SmsTemplateInfo();
+        smsTemplateInfo.setSmsTemplateId(smsTemplateId);
+        List<SmsTemplateInfo> templates = salesOrderService.listSmsTemplateInfo(smsTemplateInfo);
+        responseJson.addResponseKeyValue("templates",templates);
+        responseJson.addResponseKeyValue("templatesOne",templates.get(0).getSmsTemplateInfo());
+        responseJson.addResponseKeyValue("templatesDesc",templates.get(0).getSmsTemplateDesc());
+        return responseJson;
+
+    }
 
     /**
      * 发送短信
@@ -1602,6 +1624,7 @@ public class AdminSalesOrderController {
      * @return
      */
     @ResponseBody
+    @RequiresPermissions("salesOrder:select:sendSms")
     @RequestMapping("/send_afterSales_sms")
     public ResponseJson sendAfterSalesSms(HttpServletRequest request, SmsSignatureInfo smsSignatureInfo,SmsTemplateInfo smsTemplateInfo,String phone) throws Exception {
         if (smsSignatureInfo.getSmsSignatureId() == null || smsTemplateInfo.getSmsTemplateInfo() == null|| phone == null) {

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

@@ -162,6 +162,8 @@
             <th width="80">购买日期</th>
             <#--<th width="60">区域</th>
             <th width="60">TDS</th>-->
+            <th width="80">仓库</th>
+            <th width="80">维修</th>
             <th width="80">物流单号</th>
             <th width="80">处理结果</th>
             <#--<th width="80">需要回访</th>-->
@@ -229,6 +231,8 @@
                             <td>${(customer.salesTime?string("yyyy-MM-dd"))!''}</td>
                             <#--<td>${customer.customerArea!''}</td>
                             <td>进${customer.customerInTDS!'0'}PPM<br/>出${customer.customerOutTDS!'0'}PPM</td>-->
+                            <td></td>
+                            <td></td>
                             <td>
                         <#if customer.sendbackInfoList?? &&  (customer.sendbackInfoList?size > 0) >
                             寄回:

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl

@@ -111,7 +111,7 @@
                 <input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${salesOrder.salesAddressInfo!}" placeholder="收货人地址" name="salesAddressInfo" id="salesAddressInfo">
                 <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 30px;" id="">搜索</button>
                 <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 30px;" id="order_excel">下载Efast格式订单</button>
-                <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 30px;" id="send_sms" onclick="sendEms();">发送售后短信</button>
+                <#--<button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 30px;" id="send_sms" onclick="sendEms();">发送售后短信</button>-->
             </div>
         </form>
     </div>

+ 19 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/send_sms.ftl

@@ -80,14 +80,14 @@
                             </#list>
                         </select>
 				    </span>
-                    <span id="spanid" style="color: #D6E6DA">${templatesOne!''}</span>
+                    <span id="spanid" style="color: #8B9496">${templatesOne!''}</span>
                 </div>
             </div>
             <div class="row cl" id="" style="">
                 <label class="form-label col-1 col-sm-1"style="float: left;text-align: right;">短信内容:</label>
                 <div class="formControls col-9 col-sm-9"style="float: left;">
                     <textarea name="smsTemplateInfo" id="smsTemplateInfo" cols="" rows="2"  class="textarea">${templatesOne!''}</textarea>
-                    <span id="spanidtwo" style="color: #D6E6DA">${templatesDesc!''}</span>
+                    <span id="spanidtwo" style="color: #8B9496">${templatesDesc!''}</span>
                 </div>
             </div>
             <div class="row cl" id="" style="">
@@ -131,6 +131,23 @@
             }
         });
     });
+    $("#templateId").change(function (){
+        $("#smsTemplateInfo").val($("#templateId").find("option:selected").text());
+        $("#spanid").html($("#templateId").find("option:selected").text());
+        $.ajax({
+            type:'POST',
+            url: '${path}/admin/salesOrder/get_templatesOne',
+            data:{
+                "smsTemplateId" : $("#templateId").val()
+            },
+            dataType: 'json',
+            success:function(res) {
+                if(res.resultCode == 200 && res.returnCode == 200){
+                    $("#spanidtwo").html(res.returnMsg.templatesDesc);
+                }
+            }
+        });
+    });
 
     function send() {
        var phone = $("#phone").val();