diff --git a/src/main/java/com/bonus/aqgqj/basis/controller/CustomController.java b/src/main/java/com/bonus/aqgqj/basis/controller/CustomController.java index 34486aa..09dcb9c 100644 --- a/src/main/java/com/bonus/aqgqj/basis/controller/CustomController.java +++ b/src/main/java/com/bonus/aqgqj/basis/controller/CustomController.java @@ -46,7 +46,7 @@ public class CustomController { @PostMapping(value = "getList") @DecryptAndVerify(decryptedClass = BaseCustom.class)//加解密统一管理 - @LogAnnotation(operModul = "基础管理-客户管理", operation = "查询用列表", operDesc = "系统级事件",operType="查询") + @LogAnnotation(operModul = "基础管理-单位管理", operation = "查询单位列表", operDesc = "系统级事件",operType="查询") @PreAuthorize("@pms.hasPermission('base:custom:query')" ) public ServerResponse listCustoms(EncryptedReq data) { PageHelper.startPage(data.getData().getPage(), data.getData().getLimit()); @@ -68,25 +68,18 @@ public class CustomController { return customService.getCustomId(data.getData()); } -// @PostMapping(value = "addCustom") -// @DecryptAndVerify(decryptedClass = BaseCustom.class)//加解密统一管理 -// @LogAnnotation(operModul = "系统管理-任务管理", operation = "新增任务", operDesc = "业务级事件",operType="新增") -// @PreAuthorize("@pms.hasPermission('sys:task:update')") -// public ServerResponse addCustom(EncryptedReq data) { -// return customService.addCustom(data.getData()); -// } @PostMapping(value = "updateCustom") @DecryptAndVerify(decryptedClass = BaseCustom.class)//加解密统一管理 - @LogAnnotation(operModul = "基础管理-客户管理", operation = "修改客户", operDesc = "系统级事件",operType="修改") + @LogAnnotation(operModul = "基础管理-客户管理", operation = "修改单位客户", operDesc = "系统级事件",operType="修改") @PreAuthorize("@pms.hasPermission('base:custom:add')") public ServerResponse updateCustom(EncryptedReq data) { try { // int status = data.getData().getCustomStatus(); BaseCustom u = customService.getCustom(data.getData().getCustomName(),data.getData().getCustomId()); if (u != null) { - return ServerResponse.createErroe("客户名称 “"+data.getData().getCustomName() + "” 已存在"); + return ServerResponse.createErroe("单位客户名称 “"+data.getData().getCustomName() + "” 已存在"); } // if(StringHelper.isNotEmpty(data.getData().getCustomPhone())){ // BaseCustom u2 = customService.getCustomPhone(data.getData().getCustomPhone(),data.getData().getCustomId()); @@ -110,7 +103,7 @@ public class CustomController { try { BaseCustom u = customService.getAdd(data.getData().getCustomName()); if (u != null) { - return ServerResponse.createErroe("客户名称 “"+data.getData().getCustomName() + "” 已存在"); + return ServerResponse.createErroe("单位客户名称 “"+data.getData().getCustomName() + "” 已存在"); } customService.add(data.getData()); Long id = customService.getCustomNewId(data.getData().getCustomName()); @@ -129,9 +122,9 @@ public class CustomController { public ServerResponse delCustom(EncryptedReq data) { try { if (customService.delCustom(data.getData().getCustomId())== 1){ - return ServerResponse.createBySuccessMsg("注销成功"); + return ServerResponse.createBySuccessMsg("删除成功"); }else { - return ServerResponse.createErroe("注销失败"); + return ServerResponse.createErroe("删除失败"); } }catch (Exception e){ log.error(e.toString(),e); @@ -171,9 +164,9 @@ public class CustomController { @PreAuthorize("@pms.hasPermission('base:custom:add')") public ServerResponse addDeptCustom(EncryptedReq data) { try { - BaseCustom u = customService.getAddDept(data.getData().getCustomId(),data.getData().getCustomName()); + BaseCustom u = customService.getAddDept(data.getData()); if (u != null) { - return ServerResponse.createErroe("客户名称 “"+data.getData().getCustomName() + "” 已存在"); + return ServerResponse.createErroe("部门客户名称 “"+data.getData().getCustomName() + "” 已存在"); } customService.addDept(data.getData()); return ServerResponse.createBySuccessMsg("添加成功"); @@ -182,4 +175,38 @@ public class CustomController { } return ServerResponse.createErroe("添加失败"); } + + @PostMapping(value = "getListDept") + @DecryptAndVerify(decryptedClass = BaseCustom.class)//加解密统一管理 + @LogAnnotation(operModul = "基础管理-部门管理", operation = "查询部门列表", operDesc = "系统级事件",operType="查询") + @PreAuthorize("@pms.hasPermission('base:custom:query')" ) + public ServerResponse listCustomsDept(EncryptedReq data) { + PageHelper.startPage(data.getData().getPage(), data.getData().getLimit()); + try { + List list = customService.listDept(data.getData()); + PageInfo pageInfo = new PageInfo<>(list); + return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit()); + } catch (Exception e) { + log.error(e.toString(),e); + } + return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit()); + } + + @PostMapping(value = "updateDeptCustom") + @DecryptAndVerify(decryptedClass = BaseCustom.class)//加解密统一管理 + @LogAnnotation(operModul = "基础管理-部门管理", operation = "修改部门客户", operDesc = "系统级事件",operType="修改") + @PreAuthorize("@pms.hasPermission('base:custom:add')") + public ServerResponse updateDeptCustom(EncryptedReq data) { + try { + BaseCustom u = customService.getDeptCustom(data.getData().getCustomName(),data.getData().getCustomId()); + if (u != null) { + return ServerResponse.createErroe("部门客户名称 “"+data.getData().getCustomName() + "” 已存在"); + } + customService.updateCustom(data.getData()); + return ServerResponse.createBySuccessMsg("操作成功"); + }catch (Exception e){ + log.error(e.toString(),e); + } + return ServerResponse.createErroe("操作失败"); + } } diff --git a/src/main/java/com/bonus/aqgqj/basis/dao/CustomDao.java b/src/main/java/com/bonus/aqgqj/basis/dao/CustomDao.java index 9bc4930..e322d0a 100644 --- a/src/main/java/com/bonus/aqgqj/basis/dao/CustomDao.java +++ b/src/main/java/com/bonus/aqgqj/basis/dao/CustomDao.java @@ -13,10 +13,25 @@ public interface CustomDao { List list(BaseCustom custom); + /** + * 查找部门列表 + * @param custom + * @return + */ + List listDept(BaseCustom custom); + BaseCustom getCustomId(BaseCustom custom); BaseCustom getCustom(String customName,Long customId); + /** + * 查询该条部门客户信息 + * @param customName + * @param customId + * @return + */ + BaseCustom getDeptCustom(String customName,Long customId); + BaseCustom getCustomPid(int pId,Long customId); BaseCustom getCustomPhone(String customPhone,Long customId); @@ -25,7 +40,7 @@ public interface CustomDao { BaseCustom getAdd(String customName); - BaseCustom getAddDept(Long customId, String customName); + BaseCustom getAddDept(BaseCustom data); int add(BaseCustom custom); diff --git a/src/main/java/com/bonus/aqgqj/basis/service/CustomService.java b/src/main/java/com/bonus/aqgqj/basis/service/CustomService.java index 155f95f..78272ba 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/CustomService.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/CustomService.java @@ -14,10 +14,25 @@ public interface CustomService { List list(BaseCustom custom); + /** + * 查找部门列表 + * @param custom + * @return + */ + List listDept(BaseCustom custom); + ServerResponse getCustomId(BaseCustom custom); BaseCustom getCustom(String customName,Long customId); + /** + * 查询该条部门客户信息 + * @param customName + * @param customId + * @return + */ + BaseCustom getDeptCustom(String customName,Long customId); + BaseCustom getCustomPid(int pId,Long customId); BaseCustom getCustomPhone(String customPhone,Long customId); @@ -36,7 +51,7 @@ public interface CustomService { List customList(String name); - BaseCustom getAddDept(Long customId, String customName); + BaseCustom getAddDept(BaseCustom data); Long getCustomNewId(String customName); diff --git a/src/main/java/com/bonus/aqgqj/basis/service/impl/CustomServiceImpl.java b/src/main/java/com/bonus/aqgqj/basis/service/impl/CustomServiceImpl.java index e6b54b9..d5a7f89 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/impl/CustomServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/impl/CustomServiceImpl.java @@ -31,6 +31,16 @@ public class CustomServiceImpl implements CustomService { return customDao.list(custom); } + /** + * 查找部门列表 + * @param custom + * @return + */ + @Override + public List listDept(BaseCustom custom) { + return customDao.listDept(custom); + } + @Override public ServerResponse getCustomId(BaseCustom custom) { try{ @@ -51,6 +61,22 @@ public class CustomServiceImpl implements CustomService { return null; } + /** + * 查询该条部门客户信息 + * @param customName + * @param customId + * @return + */ + @Override + public BaseCustom getDeptCustom(String customName,Long customId) { + try{ + return customDao.getDeptCustom(customName,customId); + }catch (Exception e){ + log.error(e.toString(),e); + } + return null; + } + @Override public BaseCustom getCustomPid(int pId,Long customId) { try{ @@ -91,9 +117,9 @@ public class CustomServiceImpl implements CustomService { } @Override - public BaseCustom getAddDept(Long customId,String customName) { + public BaseCustom getAddDept(BaseCustom data) { try{ - return customDao.getAddDept(customId,customName); + return customDao.getAddDept(data); }catch (Exception e){ log.error(e.toString(),e); } diff --git a/src/main/resources/mappers/basis/CustomMapper.xml b/src/main/resources/mappers/basis/CustomMapper.xml index 21236c6..761f721 100644 --- a/src/main/resources/mappers/basis/CustomMapper.xml +++ b/src/main/resources/mappers/basis/CustomMapper.xml @@ -26,6 +26,18 @@ order by id ASC + + + + select id,custom_name,custom_type,custom_user,custom_phone from tb_custom - where custom_name = #{customName} and dept_id = 0 + where custom_name = #{customName} and dept_id = 0 and del_flag = 0 - - - - - - - -
@@ -35,17 +27,6 @@
- - - - - - - - - - -
diff --git a/src/main/resources/static/pages/basis/customAddForm.html b/src/main/resources/static/pages/basis/customAddForm.html index 87e9dc7..f67e3ab 100644 --- a/src/main/resources/static/pages/basis/customAddForm.html +++ b/src/main/resources/static/pages/basis/customAddForm.html @@ -18,15 +18,13 @@
- - - - - - - - - +
+ +
+ +
+
@@ -35,17 +33,6 @@
- - - - - - - - - - -
diff --git a/src/main/resources/static/pages/basis/customList.html b/src/main/resources/static/pages/basis/customList.html index 69fa7a3..03e19b4 100644 --- a/src/main/resources/static/pages/basis/customList.html +++ b/src/main/resources/static/pages/basis/customList.html @@ -20,7 +20,7 @@
- +
diff --git a/src/main/resources/static/pages/primaryData/child/primaryDataList.html b/src/main/resources/static/pages/primaryData/child/primaryDataList.html index df5eb0d..29ce626 100644 --- a/src/main/resources/static/pages/primaryData/child/primaryDataList.html +++ b/src/main/resources/static/pages/primaryData/child/primaryDataList.html @@ -2,15 +2,15 @@ - - - - - - - - - + + + + + + + + + 试验 @@ -38,5 +38,5 @@
- + \ No newline at end of file