diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java index e24c7e9bb..234728c57 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/MaterialPropertyController.java @@ -3,10 +3,12 @@ package com.jsh.erp.controller; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.base.BaseController; import com.jsh.erp.base.TableDataInfo; -import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.datasource.entities.MaterialProperty; import com.jsh.erp.service.materialProperty.MaterialPropertyService; -import com.jsh.erp.utils.*; +import com.jsh.erp.utils.BaseResponseInfo; +import com.jsh.erp.utils.Constants; +import com.jsh.erp.utils.ErpInfo; +import com.jsh.erp.utils.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -15,7 +17,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,7 +59,7 @@ public class MaterialPropertyController extends BaseController { public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search, HttpServletRequest request)throws Exception { String name = StringUtil.getInfo(search, "name"); - List list = materialPropertyService.select(name); + List list = materialPropertyService.select(name); return getDataTable(list); } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/OrganizationController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/OrganizationController.java index 339a7dd09..bce838751 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/OrganizationController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/OrganizationController.java @@ -4,13 +4,12 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.constants.BusinessConstants; -import com.jsh.erp.constants.ExceptionConstants; import com.jsh.erp.datasource.entities.Organization; import com.jsh.erp.datasource.vo.TreeNode; -import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.service.organization.OrganizationService; import com.jsh.erp.service.user.UserService; import com.jsh.erp.utils.BaseResponseInfo; +import com.jsh.erp.utils.ErpInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -20,13 +19,15 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.text.SimpleDateFormat; +import java.util.HashMap; import java.util.List; +import java.util.Map; + +import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; +import static com.jsh.erp.utils.ResponseJsonUtil.returnStr; /** - * create by: cjl - * description: - * - * create time: 2019/3/6 10:54 + * create by: jsh */ @RestController @RequestMapping(value = "/organization") @@ -40,6 +41,66 @@ public class OrganizationController { @Resource private UserService userService; + @GetMapping(value = "/info") + @ApiOperation(value = "根据id获取信息") + public String getList(@RequestParam("id") Long id, + HttpServletRequest request) throws Exception { + Organization organization = organizationService.getOrganization(id); + Map objectMap = new HashMap<>(); + if(organization != null) { + objectMap.put("info", organization); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @PostMapping(value = "/add") + @ApiOperation(value = "新增") + public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int insert = organizationService.insertOrganization(obj, request); + return returnStr(objectMap, insert); + } + + @PutMapping(value = "/update") + @ApiOperation(value = "修改") + public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int update = organizationService.updateOrganization(obj, request); + return returnStr(objectMap, update); + } + + @DeleteMapping(value = "/delete") + @ApiOperation(value = "删除") + public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int delete = organizationService.deleteOrganization(id, request); + return returnStr(objectMap, delete); + } + + @DeleteMapping(value = "/deleteBatch") + @ApiOperation(value = "批量删除") + public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int delete = organizationService.batchDeleteOrganization(ids, request); + return returnStr(objectMap, delete); + } + + @GetMapping(value = "/checkIsNameExist") + @ApiOperation(value = "检查名称是否存在") + public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int exist = organizationService.checkIsNameExist(id, name); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + /** * 根据id来查询机构信息 * @param id diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/PlatformConfigController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/PlatformConfigController.java index 549a31322..7ee2ac568 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/PlatformConfigController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/PlatformConfigController.java @@ -1,25 +1,28 @@ package com.jsh.erp.controller; import com.alibaba.fastjson.JSONObject; +import com.jsh.erp.base.BaseController; +import com.jsh.erp.base.TableDataInfo; import com.jsh.erp.datasource.entities.PlatformConfig; -import com.jsh.erp.datasource.entities.User; import com.jsh.erp.service.platformConfig.PlatformConfigService; -import com.jsh.erp.service.user.UserService; import com.jsh.erp.utils.BaseResponseInfo; +import com.jsh.erp.utils.Constants; import com.jsh.erp.utils.ErpInfo; +import com.jsh.erp.utils.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; +import java.util.List; import java.util.Map; import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; +import static com.jsh.erp.utils.ResponseJsonUtil.returnStr; /** * @author ji|sheng|hua 管伊佳erp QQ7827-18920 @@ -27,12 +30,67 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; @RestController @RequestMapping(value = "/platformConfig") @Api(tags = {"平台参数"}) -public class PlatformConfigController { +public class PlatformConfigController extends BaseController { private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class); @Resource private PlatformConfigService platformConfigService; + @GetMapping(value = "/info") + @ApiOperation(value = "根据id获取信息") + public String getList(@RequestParam("id") Long id, + HttpServletRequest request) throws Exception { + PlatformConfig platformConfig = platformConfigService.getPlatformConfig(id); + Map objectMap = new HashMap<>(); + if(platformConfig != null) { + objectMap.put("info", platformConfig); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/list") + @ApiOperation(value = "获取信息列表") + public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search, + HttpServletRequest request)throws Exception { + String platformKey = StringUtil.getInfo(search, "platformKey"); + List list = platformConfigService.select(platformKey); + return getDataTable(list); + } + + @PostMapping(value = "/add") + @ApiOperation(value = "新增") + public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int insert = platformConfigService.insertPlatformConfig(obj, request); + return returnStr(objectMap, insert); + } + + @PutMapping(value = "/update") + @ApiOperation(value = "修改") + public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int update = platformConfigService.updatePlatformConfig(obj, request); + return returnStr(objectMap, update); + } + + @DeleteMapping(value = "/delete") + @ApiOperation(value = "删除") + public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int delete = platformConfigService.deletePlatformConfig(id, request); + return returnStr(objectMap, delete); + } + + @DeleteMapping(value = "/deleteBatch") + @ApiOperation(value = "批量删除") + public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int delete = platformConfigService.batchDeletePlatformConfig(ids, request); + return returnStr(objectMap, delete); + } + /** * 获取平台名称 * @param request diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/RoleController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/RoleController.java index 5f155d261..edc05e072 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/RoleController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/RoleController.java @@ -2,10 +2,17 @@ package com.jsh.erp.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.jsh.erp.base.BaseController; +import com.jsh.erp.base.TableDataInfo; +import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.datasource.entities.Role; +import com.jsh.erp.datasource.entities.RoleEx; import com.jsh.erp.service.role.RoleService; import com.jsh.erp.service.userBusiness.UserBusinessService; +import com.jsh.erp.utils.Constants; import com.jsh.erp.utils.ErpInfo; +import com.jsh.erp.utils.ParamUtils; +import com.jsh.erp.utils.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -14,11 +21,13 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; +import static com.jsh.erp.utils.ResponseJsonUtil.returnStr; /** * @author ji sheng hua jshERP @@ -26,7 +35,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson; @RestController @RequestMapping(value = "/role") @Api(tags = {"角色管理"}) -public class RoleController { +public class RoleController extends BaseController { private Logger logger = LoggerFactory.getLogger(RoleController.class); @Resource @@ -35,6 +44,76 @@ public class RoleController { @Resource private UserBusinessService userBusinessService; + @GetMapping(value = "/info") + @ApiOperation(value = "根据id获取信息") + public String getList(@RequestParam("id") Long id, + HttpServletRequest request) throws Exception { + Role role = roleService.getRole(id); + Map objectMap = new HashMap<>(); + if(role != null) { + objectMap.put("info", role); + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/list") + @ApiOperation(value = "获取信息列表") + public TableDataInfo getList(@RequestParam(value = Constants.SEARCH, required = false) String search, + HttpServletRequest request)throws Exception { + String name = StringUtil.getInfo(search, "name"); + String description = StringUtil.getInfo(search, "description"); + List list = roleService.select(name, description); + return getDataTable(list); + } + + @PostMapping(value = "/add") + @ApiOperation(value = "新增") + public String addResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int insert = roleService.insertRole(obj, request); + return returnStr(objectMap, insert); + } + + @PutMapping(value = "/update") + @ApiOperation(value = "修改") + public String updateResource(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int update = roleService.updateRole(obj, request); + return returnStr(objectMap, update); + } + + @DeleteMapping(value = "/delete") + @ApiOperation(value = "删除") + public String deleteResource(@RequestParam("id") Long id, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int delete = roleService.deleteRole(id, request); + return returnStr(objectMap, delete); + } + + @DeleteMapping(value = "/deleteBatch") + @ApiOperation(value = "批量删除") + public String batchDeleteResource(@RequestParam("ids") String ids, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int delete = roleService.batchDeleteRole(ids, request); + return returnStr(objectMap, delete); + } + + @GetMapping(value = "/checkIsNameExist") + @ApiOperation(value = "检查名称是否存在") + public String checkIsNameExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int exist = roleService.checkIsNameExist(id, name); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + /** * 角色对应应用显示 * @param request diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/PlatformConfigMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/PlatformConfigMapperEx.java index a6dabf273..e958b7bab 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/PlatformConfigMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/PlatformConfigMapperEx.java @@ -9,11 +9,6 @@ import java.util.List; public interface PlatformConfigMapperEx { List selectByConditionPlatformConfig( - @Param("platformKey") String platformKey, - @Param("offset") Integer offset, - @Param("rows") Integer rows); - - Long countsByPlatformConfig( @Param("platformKey") String platformKey); } \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java index 5124f6368..1c19ea7cd 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java @@ -11,12 +11,6 @@ import java.util.List; public interface RoleMapperEx { List selectByConditionRole( - @Param("name") String name, - @Param("description") String description, - @Param("offset") Integer offset, - @Param("rows") Integer rows); - - Long countsByRole( @Param("name") String name, @Param("description") String description); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelComponent.java b/jshERP-boot/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelComponent.java index a24bfbad1..489a59c73 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelComponent.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelComponent.java @@ -2,8 +2,6 @@ package com.jsh.erp.service.orgaUserRel; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.service.ICommonQuery; -import com.jsh.erp.service.organization.OrganizationResource; -import com.jsh.erp.service.organization.OrganizationService; import org.springframework.stereotype.Service; import javax.annotation.Resource; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationComponent.java b/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationComponent.java deleted file mode 100644 index 57681316b..000000000 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationComponent.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.jsh.erp.service.organization; - -import com.alibaba.fastjson.JSONObject; -import com.jsh.erp.service.ICommonQuery; -import com.jsh.erp.utils.Constants; -import com.jsh.erp.utils.QueryUtils; -import com.jsh.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -/** - * Description - * - * @Author: cjl - * @Date: 2019/3/6 15:09 - */ -@Service(value = "organization_component") -@OrganizationResource -public class OrganizationComponent implements ICommonQuery { - @Resource - private OrganizationService organizationService; - - @Override - public Object selectOne(Long id) throws Exception { - return organizationService.getOrganization(id); - } - - @Override - public List select(Map parameterMap)throws Exception { - return getOrganizationList(parameterMap); - } - private List getOrganizationList(Map map)throws Exception { - return null; - } - @Override - public Long counts(Map parameterMap)throws Exception { - return null; - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - return organizationService.insertOrganization(obj,request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return organizationService.updateOrganization(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return organizationService.deleteOrganization(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return organizationService.batchDeleteOrganization(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return organizationService.checkIsNameExist(id, name); - } -} diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationResource.java b/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationResource.java deleted file mode 100644 index f84d766a7..000000000 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationResource.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.jsh.erp.service.organization; - -import com.jsh.erp.service.ResourceInfo; - -import java.lang.annotation.*; - -/** - * Description - * 机构 - * @Author: cjl - * @Date: 2019/3/6 15:10 - */ -@ResourceInfo(value = "organization") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface OrganizationResource { -} diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationService.java index 09dd15fb3..16dd0d716 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/organization/OrganizationService.java @@ -3,7 +3,6 @@ package com.jsh.erp.service.organization; import com.alibaba.fastjson.JSONObject; import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.constants.ExceptionConstants; -import com.jsh.erp.datasource.entities.MaterialProperty; import com.jsh.erp.datasource.entities.Organization; import com.jsh.erp.datasource.entities.OrganizationExample; import com.jsh.erp.datasource.entities.User; @@ -29,10 +28,7 @@ import java.util.Date; import java.util.List; /** - * Description - * - * @Author: cjl - * @Date: 2019/3/6 15:10 + * @Author: jsh */ @Service public class OrganizationService { diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigComponent.java b/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigComponent.java deleted file mode 100644 index 48dbeb1de..000000000 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigComponent.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.jsh.erp.service.platformConfig; - -import com.alibaba.fastjson.JSONObject; -import com.jsh.erp.service.ICommonQuery; -import com.jsh.erp.utils.Constants; -import com.jsh.erp.utils.QueryUtils; -import com.jsh.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "platformConfig_component") -@PlatformConfigResource -public class PlatformConfigComponent implements ICommonQuery { - - @Resource - private PlatformConfigService platformConfigService; - - @Override - public Object selectOne(Long id) throws Exception { - return platformConfigService.getPlatformConfig(id); - } - - @Override - public List select(Map map)throws Exception { - return getPlatformConfigList(map); - } - - private List getPlatformConfigList(Map map)throws Exception { - String search = map.get(Constants.SEARCH); - String platformKey = StringUtil.getInfo(search, "platformKey"); - return platformConfigService.select(platformKey, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map)throws Exception { - String search = map.get(Constants.SEARCH); - String platformKey = StringUtil.getInfo(search, "platformKey"); - return platformConfigService.countPlatformConfig(platformKey); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - return platformConfigService.insertPlatformConfig(obj, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return platformConfigService.updatePlatformConfig(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return platformConfigService.deletePlatformConfig(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return platformConfigService.batchDeletePlatformConfig(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return 0; - } - -} diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigResource.java b/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigResource.java deleted file mode 100644 index 85322830a..000000000 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigResource.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.jsh.erp.service.platformConfig; - -import com.jsh.erp.service.ResourceInfo; - -import java.lang.annotation.*; - -/** - * @author jishenghua qq752718920 2020-10-16 22:26:27 - */ -@ResourceInfo(value = "platformConfig") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface PlatformConfigResource { -} diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigService.java index 337a92894..7ed1f19bf 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/platformConfig/PlatformConfigService.java @@ -8,6 +8,7 @@ import com.jsh.erp.datasource.mappers.PlatformConfigMapper; import com.jsh.erp.datasource.mappers.PlatformConfigMapperEx; import com.jsh.erp.exception.JshException; import com.jsh.erp.service.user.UserService; +import com.jsh.erp.utils.PageUtils; import com.jsh.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,11 +58,12 @@ public class PlatformConfigService { return list; } - public List select(String platformKey, int offset, int rows)throws Exception { + public List select(String platformKey)throws Exception { List list=null; try{ if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { - list = platformConfigMapperEx.selectByConditionPlatformConfig(platformKey, offset, rows); + PageUtils.startPage(); + list = platformConfigMapperEx.selectByConditionPlatformConfig(platformKey); } }catch(Exception e){ JshException.readFail(logger, e); @@ -69,18 +71,6 @@ public class PlatformConfigService { return list; } - public Long countPlatformConfig(String platformKey)throws Exception { - Long result=null; - try{ - if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { - result = platformConfigMapperEx.countsByPlatformConfig(platformKey); - } - }catch(Exception e){ - JshException.readFail(logger, e); - } - return result; - } - @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int insertPlatformConfig(JSONObject obj, HttpServletRequest request) throws Exception{ PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleComponent.java b/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleComponent.java deleted file mode 100644 index bf0ff52f6..000000000 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleComponent.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.jsh.erp.service.role; - -import com.alibaba.fastjson.JSONObject; -import com.jsh.erp.service.ICommonQuery; -import com.jsh.erp.utils.Constants; -import com.jsh.erp.utils.QueryUtils; -import com.jsh.erp.utils.StringUtil; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -@Service(value = "role_component") -@RoleResource -public class RoleComponent implements ICommonQuery { - - @Resource - private RoleService roleService; - - @Override - public Object selectOne(Long id) throws Exception { - return roleService.getRole(id); - } - - @Override - public List select(Map map)throws Exception { - return getRoleList(map); - } - - private List getRoleList(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - String description = StringUtil.getInfo(search, "description"); - return roleService.select(name, description, QueryUtils.offset(map), QueryUtils.rows(map)); - } - - @Override - public Long counts(Map map) throws Exception{ - String search = map.get(Constants.SEARCH); - String name = StringUtil.getInfo(search, "name"); - String description = StringUtil.getInfo(search, "description"); - return roleService.countRole(name, description); - } - - @Override - public int insert(JSONObject obj, HttpServletRequest request)throws Exception { - return roleService.insertRole(obj, request); - } - - @Override - public int update(JSONObject obj, HttpServletRequest request)throws Exception { - return roleService.updateRole(obj, request); - } - - @Override - public int delete(Long id, HttpServletRequest request)throws Exception { - return roleService.deleteRole(id, request); - } - - @Override - public int deleteBatch(String ids, HttpServletRequest request)throws Exception { - return roleService.batchDeleteRole(ids, request); - } - - @Override - public int checkIsNameExist(Long id, String name)throws Exception { - return roleService.checkIsNameExist(id, name); - } - -} diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleResource.java b/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleResource.java deleted file mode 100644 index 050bf0e1d..000000000 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleResource.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.jsh.erp.service.role; - -import com.jsh.erp.service.ResourceInfo; - -import java.lang.annotation.*; - -/** - * @author jishenghua qq752718920 2018-10-7 15:26:27 - */ -@ResourceInfo(value = "role") -@Inherited -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface RoleResource { -} diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java index c21c9770b..16695e82e 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java @@ -11,6 +11,7 @@ import com.jsh.erp.datasource.mappers.RoleMapperEx; import com.jsh.erp.exception.JshException; import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.user.UserService; +import com.jsh.erp.utils.PageUtils; import com.jsh.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,10 +95,11 @@ public class RoleService { return list; } - public List select(String name, String description, int offset, int rows)throws Exception { + public List select(String name, String description)throws Exception { List list=null; try{ - list=roleMapperEx.selectByConditionRole(name, description, offset, rows); + PageUtils.startPage(); + list=roleMapperEx.selectByConditionRole(name, description); for(RoleEx roleEx: list) { String priceLimit = roleEx.getPriceLimit(); if(StringUtil.isNotEmpty(priceLimit)) { @@ -117,16 +119,6 @@ public class RoleService { return list; } - public Long countRole(String name, String description)throws Exception { - Long result=null; - try{ - result=roleMapperEx.countsByRole(name, description); - }catch(Exception e){ - JshException.readFail(logger, e); - } - return result; - } - @Transactional(value = "transactionManager", rollbackFor = Exception.class) public int insertRole(JSONObject obj, HttpServletRequest request)throws Exception { Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); diff --git a/jshERP-boot/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml index 534c09d7a..e77c4393f 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml @@ -1,6 +1,7 @@ + - + \ No newline at end of file diff --git a/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml index 68bd0a9da..8b9c354fa 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml @@ -17,25 +17,8 @@ and description like #{bindDescription} order by sort asc, id desc - - limit #{offset},#{rows} - - - + update jsh_role set delete_flag='1'