|
@@ -228,10 +228,28 @@ public class ServiceCategoryAdminController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("serviceCategoryAddSupplier.html")
|
|
|
- public ModelAndView serviceCategoryAddSupplier() {
|
|
|
+ public ModelAndView serviceCategoryAddSupplier(Integer nowId) {
|
|
|
ModelAndView result = new ModelAndView();
|
|
|
List<ServiceCategory> findall = iServiceCategoryService.listSupplierServiceType();//查询经销商一级服务
|
|
|
|
|
|
+ /*根据传来的nowId查询当前数据的父类id*/
|
|
|
+ Integer nowPId = iServiceCategoryService.listByNowId(nowId);
|
|
|
+ result.addObject("nowPId",nowId);
|
|
|
+ /*如果根据当前nowId查出其有父类,则根据其父类id查询父类是否还是父类*/
|
|
|
+ if (nowPId != null){
|
|
|
+ Integer nowGPId = iServiceCategoryService.listByNowPId(nowPId);
|
|
|
+ if (nowGPId == 0){
|
|
|
+ result.addObject("nowGPId",nowPId);
|
|
|
+ }else {
|
|
|
+ result.addObject("nowGPId",nowGPId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 查询选中当前级别数据
|
|
|
+ List<ServiceCategory> categoryList = iServiceCategoryService.listServiceCategoryByPid(nowPId);
|
|
|
+ result.addObject("categoryList",categoryList);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
result.addObject("findall", findall);
|
|
|
return result;
|
|
@@ -255,6 +273,23 @@ public class ServiceCategoryAdminController {
|
|
|
return am;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 经销商修改页面根据二级,三级显示修改内容
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("twoOrThree.html")
|
|
|
+ public AjaxMessage<Object> twoOrThree(String id){
|
|
|
+ AjaxMessage<Object> am = new AjaxMessage<>();
|
|
|
+ int rows = iServiceCategoryService.listByPId(Integer.valueOf(id));//根据修改界面传来的id,查询有没有父类id是该id的信息,有则说明修改页面选中的是二类
|
|
|
+ if (rows > 0){
|
|
|
+ am.setIs(true);
|
|
|
+ }else {
|
|
|
+ am.setIs(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ return am;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -427,9 +462,20 @@ public class ServiceCategoryAdminController {
|
|
|
ServiceCategory service = iServiceCategoryService.selectByKey(id);
|
|
|
result.addObject("service", service);
|
|
|
|
|
|
+ int rows = iServiceCategoryService.listByPId(service.getId()); //判断要修改的是二级还是三级
|
|
|
+ if (rows > 0){
|
|
|
+ List<ServiceCategory> findSecondService = iServiceCategoryService.findSecondService(String.valueOf(service.getpId()));//二级pid---一级id
|
|
|
+ result.addObject("first",findSecondService);
|
|
|
+ }else { //三级
|
|
|
+ List<ServiceCategory> findSecondService1 = iServiceCategoryService.findSecondService(String.valueOf(service.getpId()));//根据三级pid--二级id
|
|
|
|
|
|
- int rows = iServiceCategoryService.listByPId(service.getpId());
|
|
|
- /*判断选中的服务是否是三级服务名称 rows>0(三级服务) 修改界面 二级分类需要展示*/
|
|
|
+ result.addObject("two",findSecondService1);//二级名称
|
|
|
+ List<ServiceCategory> findSecondService = iServiceCategoryService.findSecondService(String.valueOf(service.getpId()));//根据三级pid--二级id---二级pid---一级id
|
|
|
+ result.addObject("first",findSecondService);//一级名称
|
|
|
+ }
|
|
|
+
|
|
|
+ /* int rows = iServiceCategoryService.listByPId(service.getpId());
|
|
|
+ *//*判断选中的服务是否是三级服务名称 rows>0(三级服务) 修改界面 二级分类需要展示*//*
|
|
|
if (rows >0){
|
|
|
List<ServiceCategory> findSecondService = iServiceCategoryService.findSecondService(String.valueOf(service.getpId()));//根据三级服务名称的父类id查询id是此父类id的信息
|
|
|
result.addObject("second",findSecondService);
|
|
@@ -443,7 +489,7 @@ public class ServiceCategoryAdminController {
|
|
|
List<ServiceCategory> serviceCategory2 = iServiceCategoryService.findSecondService(serviceCategory.get(0).getpId().toString());
|
|
|
result.addObject("second",serviceCategory2);
|
|
|
result.addObject("three",serviceCategory);
|
|
|
- }
|
|
|
+ }*/
|
|
|
return result;
|
|
|
}
|
|
|
|