浏览代码

修改bug

xian 4 年之前
父节点
当前提交
d879b545fc

+ 3 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/sys/SysServiceImpl.java

@@ -1,6 +1,7 @@
 package com.iamberry.rst.service.sys;
 
 import com.github.pagehelper.PageHelper;
+import com.iamberry.redis.RedisUtils;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.*;
@@ -106,7 +107,8 @@ public class SysServiceImpl implements SysService {
         if (addCount <= 0) {
             throw new RuntimeException("ADD_ERROR");
         }
-
+        // 删除REDIS缓存
+        RedisUtils.del("DEPART_STORE_" + adminId);
         return 1;
     }
 

+ 25 - 9
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminAfterSaleController.java

@@ -23,6 +23,7 @@ import com.iamberry.rst.faces.cm.StoreInfoService;
 import com.iamberry.rst.faces.cm.StoreShipService;
 import com.iamberry.rst.faces.fm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.order.LogisticsInfoService;
+import com.iamberry.rst.faces.order.OrderDepartService;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.pts.MachineService;
 import com.iamberry.rst.faces.pts.ProduceService;
@@ -93,6 +94,8 @@ public class AdminAfterSaleController {
 
     @Autowired
     private CompanyInfoService companyInfoService;
+    @Autowired
+    private OrderDepartService orderDepartService;
 
 
     @RequiresPermissions("afterSales:SysAfterSales")
@@ -196,20 +199,33 @@ public class AdminAfterSaleController {
                                          @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
                                          @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
                                          ComplaintDetectInfo detect) {
-        // 查询当前管理员所属的公司的店铺
-        StoreInfo store = new StoreInfo();
-        store.setCompanyId(AdminUtils.getLoginAdmin().getAdminPcId());
-        List<StoreInfo> storeInfos = storeInfoService.listStore(store);
         if (detect == null) {
             detect = new ComplaintDetectInfo();
         }
-        if (storeInfos != null && !storeInfos.isEmpty()) {
-            Integer[] temp = new Integer[storeInfos.size()];
-            for (int i = 0; i < storeInfos.size(); i++) {
-                temp[i] = storeInfos.get(i).getStoreId();
+        List<StoreInfo> storeInfos = new ArrayList<>();
+        if (AdminUtils.getLoginAdmin().getAdminPcId() != null) {
+            // 查询当前管理员所属的公司的店铺
+            StoreInfo store = new StoreInfo();
+            store.setCompanyId(AdminUtils.getLoginAdmin().getAdminPcId());
+            storeInfos = storeInfoService.listStore(store);
+            if (storeInfos != null && !storeInfos.isEmpty()) {
+                Integer[] temp = new Integer[storeInfos.size()];
+                for (int i = 0; i < storeInfos.size(); i++) {
+                    temp[i] = storeInfos.get(i).getStoreId();
+                }
+                detect.setStoreIds(temp);
+            }
+        } else {
+            // 查询业务员管理的公司
+            Integer[] storeIds = orderDepartService.getDepartStoreIds(AdminUtils.getLoginAdminId());
+            if(storeIds.length > 0){
+                for (Integer id : storeIds) {
+                    storeInfos.add(storeInfoService.getStoreInfoById(id));
+                }
+                detect.setStoreIds(storeIds);
             }
-            detect.setStoreIds(temp);
         }
+
         // 设置查询数据
         ModelAndView mv = new ModelAndView("yulia/list");
         mv.addObject("page", complaintDetectInfoService.listAfterSales(new PageRequest<>(detect, pageNO, pageSize, true)));

+ 2 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/sys/SysController.java

@@ -286,7 +286,8 @@ public class SysController {
                 for (StoreInfo si : storeInfoList) {
                     for (int i = 0; i < storeIds.length; i++) {
                         if(Objects.equals(si.getStoreId(),storeIds[i])){
-                            si.setIsSelectDepart(1); //   1:选中  2:未选中
+                            //   1:选中  2:未选中
+                            si.setIsSelectDepart(1);
                         }
                     }
                 }

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

@@ -274,7 +274,7 @@
                                 <#if customer.beenScrappedNum??><#if customer.beenScrappedNum gt 0 >已报废:<span class="c-success">${customer.beenScrappedNum}</span><br></#if></#if>
                                 <#if customer.beenRenovatedNum??><#if customer.beenRenovatedNum gt 0 >已翻新:<span class="c-success">${customer.beenRenovatedNum}</span></#if></#if>
                                 <#if customer.waitConfirmPay??><#if customer.waitConfirmPay gt 0 >待确认翻新:<span class="c-success">${customer.waitConfirmPay}</span></#if></#if>
-                                <#if customer.waitRenovate??><#if customer.waitRenovate gt 0 >待放心:<span class="c-success">${customer.waitRenovate}</span></#if></#if>
+                                <#if customer.waitRenovate??><#if customer.waitRenovate gt 0 >待翻新:<span class="c-success">${customer.waitRenovate}</span></#if></#if>
                                 <#if customer.finishRenovate??><#if customer.finishRenovate gt 0 >已翻新:<span class="c-success">${customer.finishRenovate}</span></#if></#if>
                                 <#if customer.noRenovate??><#if customer.noRenovate gt 0 >原机退回:<span class="c-success">${customer.noRenovate}</span></#if></#if>
                             </td>

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

@@ -1299,6 +1299,10 @@
                                         <input type="radio" id="tel-005" name="detectProcessingResults_3" value="27">
                                         <label for="tel-005">不翻新(原机退回)</label>
                                     </div>
+                                    <div class="radio-box">
+                                        <input type="radio" id="tel-003" name="detectProcessingResults_3" checked value="31">
+                                        <label for="tel-003">付费维修</label>
+                                    </div>
                                 </div>
                             </div>
                             <div class="row cl" id="updateDetect_wu_gu_zhang" style="display: none;">

+ 47 - 22
watero-rst-web/src/main/webapp/WEB-INF/views/sys/edit_permission.ftl

@@ -61,7 +61,17 @@
         <ul id="Huifold1" class="Huifold">
             <#list companyInfoList as company>
                 <li class="item company_list">
-                    <h4><label class="permission-class"><input type="checkbox" class="company_checkbox" len="${company.storeInfoList?size}" value="${company.companyId}" id="permission-${company.companyId}">${company.companyName}</label><b>+</b></h4>
+                    <h4>
+                        <label class="permission-class">
+                            <input
+                                    type="checkbox"
+                                    class="company_checkbox"
+                                    len="${company.storeInfoList?size}"
+                                    value="${company.companyId}"
+                                    id="permission-${company.companyId}">${company.companyName}
+                        </label>
+                        <b>+</b>
+                    </h4>
                     <div class="info">
                         <table class="table table-border table-bordered">
                             <thead>
@@ -71,7 +81,16 @@
                                 <#list company.storeInfoList as store>
                                 <tr>
                                     <th>
-                                        <label><input type="checkbox" len="0" id="permission-input-${store.storeId!''}" class="ermissions ermissions-${store.storeId!''} store_once" name="haveId" <#if store.isSelectDepart??><#if store.isSelectDepart == 1>checked="checked"</#if></#if> value="${store.storeId}">选中</label>
+                                        <label>
+                                            <input
+                                                    type="checkbox"
+                                                    len="0"
+                                                    id="permission-input-${store.storeId!''}"
+                                                    class="ermissions ermissions-${store.storeId!''} store_once"
+                                                    name="haveId"
+                                                    <#if store.isSelectDepart??><#if store.isSelectDepart == 1>checked="checked"</#if></#if>
+                                                    value="${store.storeId}">选中
+                                        </label>
                                     </th>
                                     <td>${store.storeName!""}</td>
                                     <td>${store.storeRemark!""}</td>
@@ -113,39 +132,39 @@
 
         // 表单提交
         $("#btn-sub").click(function(){
-            var array = new Array();
-            var ps = $(".check-permission");
-            var j = 0;
-            for (var i = 0; i < ps.length; i++) {
+            let array = [];
+            let ps = $(".check-permission");
+            let j = 0;
+            for (let i = 0; i < ps.length; i++) {
                 if (ps[i].checked) {
                     array[j] = $(ps[i]).attr("val");
                     j ++;
                 }
             }
 
-            if (array.length == 0) {
+            if (array.length === 0) {
                 layer.msg('您没有提管理员选择权限,如果想管理员看不见菜单,请禁用管理员用户!',{icon: 5,time:4500});
                 return false;
             }
 
             //勾选的销售公司
-            var companyIds = "";
+            let companyIds = "";
             //勾选的店铺
-            var storeIds = "";
+            let storeIds = "";
 
             $(".company_checkbox").each(function () {
-                var companyId = $(this).val();
+                let companyId = $(this).val();
                 if($(this).is(':checked')){
-                    if(companyIds == ""){
+                    if(companyIds === ""){
                         companyIds = companyId;
                     }else{
                         companyIds += "," + companyId
                     }
                 }else{
                     $(this).parents(".company_list").find(".store_once").each(function () {
-                        var storeId = $(this).val();
+                        let storeId = $(this).val();
                         if($(this).is(':checked')){
-                            if(storeIds == ""){
+                            if(storeIds === ""){
                                 storeIds = storeId
                             }else{
                                 storeIds += "," + storeId
@@ -153,7 +172,7 @@
                         }
                     })
                 }
-            })
+            });
 
             $.post(root_path + "/admin/sys/edit_permission",{"adminId":$("#hidden-adminid-input").val(), "perms":array, "companyIds":companyIds, "storeIds":storeIds},function(result){
                 if (result.returnCode != 200 || result.returnCode != 200) {
@@ -265,8 +284,9 @@
 
         //选择销售公司,对应的店铺都选中
         $(".company_checkbox").click(function(event) {
-            var $company_list_context = $(this).parents(".company_list");
-            if($(this).is(':checked')){//取消选中
+            var $company_list_context = $(this).parent().parent().parent();
+            if($(this).is(':checked')){
+                //取消选中
                 $company_list_context.find(".store_once").prop("checked",true);
             }else{
                 $company_list_context.find(".store_once").removeAttr("checked");
@@ -282,12 +302,17 @@
     function controlCheck() {
         //初始化销售公司是否都选择了
         $(".company_list").each(function () {
-            var flag = true;
-            $(this).find(".store_once").each(function () {
-                if(!$(this).is(':checked')) {
-                    flag = false;
-                }
-            })
+            let flag = true;
+            let onces = $(this).find(".store_once");
+            if (onces.length <= 0) {
+                flag = false;
+            } else {
+                onces.each(function () {
+                    if(!$(this).is(':checked')) {
+                        flag = false;
+                    }
+                });
+            }
             if(flag){
                 $(this).find(".company_checkbox").prop("checked",true);
             }else{

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/yulia/list.ftl

@@ -38,7 +38,7 @@
             <select class="select" name="storeId" id="storeId" style="height: 31px;width:8%">
                 <option value="">店铺信息</option>
                 <#list stores as s>
-                    <option value="${(s.storeId)!}" <#if (req.storeId)?? && req.storeId == s.storeId>selected</#if>>${(s.storeName)!}</option>
+                    <option value="${(s.storeId)!}" <#if (req.storeId)??><#if (req.storeId == s.storeId)>selected</#if></#if>>${(s.storeName)!}</option>
                 </#list>
             </select>
             <input type="text" class="input-text" style="width:8%;margin-top: -3px;" value="${(req.machineNo)!}" placeholder="机器条码" id="machineNo" name="machineNo">