| | |
| | | } |
| | | @RequestMapping(value = "/img/{modelId}", method = RequestMethod.GET) |
| | | public void image(@PathVariable String modelId, HttpServletResponse response) { |
| | | String filePath = basePath + modelId +"/"+ modelId + ".png"; |
| | | File file = new File(filePath); |
| | | FileInputStream fileInputStream = null; |
| | | InputStream is = repositoryService.getModelImg(modelId); |
| | | |
| | | response.setHeader("Content-Type", "image/png"); |
| | | try{ |
| | | fileInputStream = new FileInputStream(file); |
| | | OutputStream outputStream = response.getOutputStream(); |
| | | byte[] b = new byte[1024]; |
| | | int len; |
| | | while ((len = fileInputStream.read(b, 0, 1024)) != -1) { |
| | | while ((len = is.read(b, 0, 1024)) != -1) { |
| | | outputStream.write(b, 0, len); |
| | | } |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | finally { |
| | | if (fileInputStream != null) { |
| | | if (is != null) { |
| | | try { |
| | | fileInputStream.close(); |
| | | is.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | HttpSession session = request.getSession(); |
| | | //todo 判断当前task是否是当前人能审批的 |
| | | |
| | | taskService.setSession(session); |
| | | ActivitiStatus status = flows.getStatus(); |
| | |
| | | List<SysMenu> sysMenus = menuService.selectBatchIds(byParentId);
|
| | | o.fluentPut("menuList", sysMenus);
|
| | | }
|
| | |
|
| | |
|
| | | List<SysAssembleDb> dbList = dbService.selectList(new EntityWrapper<SysAssembleDb>().eq(Constant.PARENT_ID, record.getId()));
|
| | | o.fluentPut("dbList", dbList);
|
| | |
|
| | |
| | | IFlowsService flowsService; |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Autowired |
| | | IMasterAuthorService masterAuthorService; |
| | | |
| | | @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) |
| | | public Result get(@PathVariable String id) { |
| | |
| | | if (StringUtils.isEmpty(flowId)) { |
| | | continue; |
| | | } |
| | | |
| | | boolean author = masterAuthorService.checkMaintainAuthor(userId, maintain.getId()); |
| | | if (!author) { |
| | | continue; |
| | | } |
| | | Flows flows = flowsService.selectById(maintain.getFlowId()); |
| | | if (flows.getStatus().equals(ActivitiStatus.close)) { |
| | | continue; |
| | |
| | | package com.highdatas.mdm.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.highdatas.mdm.entity.Maintain; |
| | | import com.highdatas.mdm.entity.MaintainField; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.entity.MenuMapping; |
| | | import com.highdatas.mdm.mapper.TableInfoMapper; |
| | | import com.highdatas.mdm.pojo.CodeMsg; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.service.IMaintainFieldService; |
| | | import com.highdatas.mdm.service.IMaintainService; |
| | | import com.highdatas.mdm.service.IMenuMappingService; |
| | | import com.highdatas.mdm.service.ISysFieldService; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.Comparator; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | ISysFieldService fieldService; |
| | | @Autowired |
| | | TableInfoMapper tableInfoMapper; |
| | | @Autowired |
| | | IMenuMappingService menuMappingService; |
| | | |
| | | @RequestMapping(value = "/getMaintainList/{tableName}", method = RequestMethod.GET) |
| | | @RequestMapping(value = "/getMaintainListByMenu/{menuId}", method = RequestMethod.GET) |
| | | public Result getMaintainListByTable(@PathVariable String menuId) { |
| | | MenuMapping menuMapping = menuMappingService.selectOne(new EntityWrapper<MenuMapping>().eq("menu_id", menuId).orderBy("create_time")); |
| | | if (menuMapping == null){ |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | String tableName = menuMapping.getTableName(); |
| | | |
| | | JSONArray array = maintainFieldService.getMaintainListByTable(tableName); |
| | | return Result.success(array); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getMaintainListByTable/{tableName}", method = RequestMethod.GET) |
| | | public Result deleteModel(@PathVariable String tableName) { |
| | | List<MaintainField> maintainFieldList = maintainFieldService.selectList(new EntityWrapper<MaintainField>().eq("table_name", tableName).orderBy("order_no")); |
| | | int preOrderNo = -1; |
| | |
| | | resultMap.put(maintainField.getId(), maintainList); |
| | | preOrderNo = orderNo; |
| | | } |
| | | return Result.success(resultMap); |
| | | Set<String> keySet = resultMap.keySet(); |
| | | JSONArray array = new JSONArray(); |
| | | for (String s : keySet) { |
| | | List<Maintain> maintainList = resultMap.get(s); |
| | | Maintain max = maintainList.stream().max(new Comparator<Maintain>() { |
| | | @Override |
| | | public int compare(Maintain o1, Maintain o2) { |
| | | return o1.getOrderNo() - o2.getOrderNo(); |
| | | } |
| | | }).get(); |
| | | Maintain min = maintainList.stream().min(new Comparator<Maintain>() { |
| | | @Override |
| | | public int compare(Maintain o1, Maintain o2) { |
| | | return o1.getOrderNo() - o2.getOrderNo(); |
| | | } |
| | | }).get(); |
| | | JSONObject object = new JSONObject(); |
| | | object.fluentPut("maintainFieldId", s); |
| | | object.fluentPut("version", MessageFormat.format(Constant.extent, min.getVersion(), max.getVersion())); |
| | | |
| | | array.add(object); |
| | | } |
| | | return Result.success(array); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/getFieldByMaintainFieldId/{id}", method = RequestMethod.GET) |
| | | public Result getFieldByMaintainFieldId(@PathVariable String id) { |
| | | List<SysField> result; |
| | | if (Constant.Default.equalsIgnoreCase(id)) { |
| | | result = fieldService.getFieldByMaintainField(null); |
| | | } |
| | | if (Constant.All.equalsIgnoreCase(id)) { |
| | | |
| | | } |
| | | result = fieldService.getFieldByMaintainField(id); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.highdatas.mdm.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.highdatas.mdm.entity.MasterAuthor; |
| | | import com.highdatas.mdm.entity.MasterAuthorDetail; |
| | | import com.highdatas.mdm.entity.TUser; |
| | | import com.highdatas.mdm.entity.TUserRole; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.highdatas.mdm.entity.*; |
| | | import com.highdatas.mdm.pojo.CodeMsg; |
| | | import com.highdatas.mdm.pojo.MasterAuthorType; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.service.IMasterAuthorDetailService; |
| | | import com.highdatas.mdm.service.IMasterAuthorService; |
| | | import com.highdatas.mdm.service.ITUserRoleService; |
| | | import com.highdatas.mdm.service.*; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | IMasterAuthorDetailService authorDetailService; |
| | | @Autowired |
| | | ITUserRoleService userRoleService; |
| | | @Autowired |
| | | IMenuMappingService menuMappingService; |
| | | @Autowired |
| | | ISysMenuService menuService; |
| | | |
| | | public static final String masterAuthorType = "masterAuthorType"; |
| | | public static final String masterId = "masterId"; |
| | | public static final String tableName = "table_name"; |
| | | public static final String characterId = "characterId"; |
| | | public static final String character_id = "character_id"; |
| | | public static final String fields = "fields"; |
| | | private String maintainFieldId = "maintainFieldId"; |
| | | private String maintain_field_id = "maintain_field_id"; |
| | | |
| | | @RequestMapping(value = "/addOrUpdate", method = RequestMethod.POST) |
| | | public Result deleteModel(@RequestBody MasterAuthor masterAuthor) { |
| | |
| | | }else { |
| | | masterAuthor.setId(DbUtils.getUUID()).setCreateTime(new Date()); |
| | | } |
| | | |
| | | String menuId = masterAuthor.getMenuId(); |
| | | String tableName = menuMappingService.getTableNameByMenu(menuId); |
| | | masterAuthor.setTableName(tableName); |
| | | //delete pre |
| | | boolean delete = authorDetailService.delete(new EntityWrapper<MasterAuthorDetail>().eq(Constant.PARENT_ID, masterAuthor.getId())); |
| | | if (!delete){ |
| | |
| | | }else { |
| | | return Result.error(CodeMsg.UPDATE_ERROR); |
| | | } |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/get/{characterId}", method = RequestMethod.GET) |
| | |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | }else if (type.equals(MasterAuthorType.user) && masterAuthorList.isEmpty()){ |
| | | //user 获取角色 多脚色混合 |
| | | TUser user = DbUtils.getUser(request); |
| | | String userId = user.getUserId(); |
| | | String userId = characterId; |
| | | List<TUserRole> tUserRoles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq(Constant.USERID, userId)); |
| | | List<String> roleIdList = tUserRoles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | return authorService.merageRoleAuthor(roleIdList); |
| | | HashMap<String, MasterAuthor> tableMasterAuthor = authorService.merageRoleAuthor(roleIdList); |
| | | if (tableMasterAuthor == null) { |
| | | Result.success(null); |
| | | } |
| | | JSONObject object = new JSONObject(); |
| | | ArrayList<MasterAuthor> list = new ArrayList(tableMasterAuthor.values()); |
| | | |
| | | object.fluentPut("type", MasterAuthorType.role); |
| | | object.fluentPut("author",list); |
| | | |
| | | Set<String> collect = list.stream().map(masterAuthor -> masterAuthor.getMenuId()).collect(Collectors.toSet()); |
| | | LinkedHashSet<String> menuIds= new LinkedHashSet<>(collect); |
| | | LinkedHashSet<String> byParentId = menuService.getByParentId(menuIds); |
| | | List<SysMenu> sysMenus = menuService.selectBatchIds(byParentId); |
| | | object.fluentPut("audit",sysMenus); |
| | | return Result.success(object); |
| | | } |
| | | |
| | | for (MasterAuthor masterAuthor : masterAuthorList) { |
| | |
| | | masterAuthor.setFields(masterAuthorDetails); |
| | | } |
| | | |
| | | return Result.success(masterAuthorList); |
| | | JSONObject object = new JSONObject(); |
| | | Set<String> collect = masterAuthorList.stream().map(masterAuthor -> masterAuthor.getMenuId()).collect(Collectors.toSet()); |
| | | LinkedHashSet<String> menuIds= new LinkedHashSet<>(collect); |
| | | LinkedHashSet<String> byParentId = menuService.getByParentId(menuIds); |
| | | List<SysMenu> sysMenus = menuService.selectBatchIds(byParentId); |
| | | |
| | | object.fluentPut("type", MasterAuthorType.user); |
| | | object.fluentPut("author",masterAuthorList); |
| | | object.fluentPut("audit",sysMenus); |
| | | return Result.success(object); |
| | | } |
| | | |
| | | @RequestMapping(value = "/delete/{characterId}", method = RequestMethod.GET) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/delete/menu/{menuId}", method = RequestMethod.GET) |
| | | public Result deleteTable(@PathVariable String menuId, @RequestParam String characterId, @RequestParam MasterAuthorType type, HttpServletRequest request){ |
| | | String maintainFieldId = request.getParameter(this.maintainFieldId); |
| | | Wrapper<MasterAuthor> masterAuthorWrapper = new EntityWrapper<MasterAuthor>() |
| | | .eq(Constant.TYPE, type) |
| | | .eq(character_id, characterId) |
| | | .eq("menu_id", menuId); |
| | | if (!StringUtils.isEmpty(maintainFieldId)) { |
| | | masterAuthorWrapper.eq(this.maintain_field_id, maintainFieldId); |
| | | } |
| | | |
| | | List<MasterAuthor> masterAuthorList = authorService.selectList(masterAuthorWrapper); |
| | | if (masterAuthorList.isEmpty()) { |
| | | return Result.success(null); |
| | | } |
| | | boolean partDel = false; |
| | | if (masterAuthorList.size() == 1 && !StringUtils.isEmpty(maintainFieldId)) { |
| | | // 只有一个且删除 字段版本 保留本条 |
| | | partDel = true; |
| | | } |
| | | boolean delete = false; |
| | | for (MasterAuthor masterAuthor : masterAuthorList) { |
| | | delete = authorDetailService.delete(new EntityWrapper<MasterAuthorDetail>().eq(Constant.PARENT_ID, masterAuthor.getId())); |
| | | if (delete) { |
| | | if (partDel) { |
| | | delete = masterAuthor.setMaintainFieldId(null).updateById(); |
| | | }else { |
| | | delete = masterAuthor.deleteById(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (delete) { |
| | | return Result.success(CodeMsg.DELETE_SUCCESS); |
| | | }else { |
| | | return Result.error(CodeMsg.DELETE_ERROR); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/addRole/{roleId}", method = RequestMethod.GET) |
| | | public Result addRole(@PathVariable String roleId, HttpServletRequest request){ |
| | | TUser user = DbUtils.getUser(request); |
| | |
| | | List<String> roleIdList = tUserRoles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | roleIdList.add(roleId); |
| | | |
| | | return authorService.merageRoleAuthor(roleIdList); |
| | | HashMap<String, MasterAuthor> tableMasterAuthor = authorService.merageRoleAuthor(roleIdList); |
| | | if (tableMasterAuthor == null) { |
| | | Result.success(null); |
| | | } |
| | | return Result.success(tableMasterAuthor.values()); |
| | | } |
| | | } |
| | |
| | | package com.highdatas.mdm.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.highdatas.mdm.entity.MasterAuthor; |
| | | import com.highdatas.mdm.entity.MasterAuthorDetail; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.entity.TUserRole; |
| | | import com.highdatas.mdm.pojo.CodeMsg; |
| | | import com.highdatas.mdm.pojo.MasterAuthorType; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.service.*; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/masterAuthor/detail") |
| | | public class MasterAuthorDetailController { |
| | | @Autowired |
| | | IMasterAuthorService masterAuthorService; |
| | | @Autowired |
| | | IMasterAuthorDetailService masterAuthorDetailService; |
| | | @Autowired |
| | | ISysFieldService fieldService; |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Autowired |
| | | IMenuMappingService menuMappingService; |
| | | @Autowired |
| | | ITUserRoleService userRoleService; |
| | | |
| | | @RequestMapping(value = "/delete/{id}", method = RequestMethod.GET) |
| | | public Result addRole(@PathVariable String id,@RequestParam String field){ |
| | | MasterAuthor masterAuthor = masterAuthorService.selectById(id); |
| | | if (masterAuthor == null) { |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | boolean delete = masterAuthorDetailService.delete(new EntityWrapper<MasterAuthorDetail>() |
| | | .eq(Constant.PARENT_ID, masterAuthor.getId()).eq(Constant.FIELD, field)); |
| | | if (delete) { |
| | | return Result.success(CodeMsg.DELETE_SUCCESS); |
| | | }else { |
| | | return Result.error(CodeMsg.DELETE_ERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/getFieldByMaintainFieldId/{id}", method = RequestMethod.GET) |
| | | public Result getFieldByMaintainFieldId(@PathVariable String id, @RequestParam MasterAuthorType type, @RequestParam String characterId, HttpServletRequest request) { |
| | | List<SysField> result; |
| | | |
| | | String menuId = request.getParameter("menuId"); |
| | | String tableName = menuMappingService.getTableNameByMenu(menuId); |
| | | if (Constant.Default.equalsIgnoreCase(id)) { |
| | | if (StringUtils.isEmpty(tableName)) { |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | result = fieldService.getDefaultTableField(tableName); |
| | | }else if (Constant.All.equalsIgnoreCase(id)) { |
| | | if (StringUtils.isEmpty(tableName)) { |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | result = fieldService.getTotalTableField(tableName); |
| | | }else { |
| | | result = fieldService.getFieldByMaintainField(id); |
| | | } |
| | | JSONObject resultObj = new JSONObject(); |
| | | MasterAuthor masterAuthor = masterAuthorService.selectOne(new EntityWrapper<MasterAuthor>() |
| | | .eq(Constant.TYPE, type) |
| | | .eq("character_id", characterId).eq("maintain_field_id", id)); |
| | | |
| | | if (masterAuthor == null && type.equals(MasterAuthorType.user)) { |
| | | List<TUserRole> tUserRoles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq(Constant.USERID, characterId)); |
| | | List<String> roleIdList = tUserRoles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | HashMap<String, MasterAuthor> tableMasterAuthor = masterAuthorService.merageRoleAuthor(roleIdList); |
| | | String key = DbUtils.getFieldRedisKey(tableName, id); |
| | | masterAuthor = tableMasterAuthor.get(key); |
| | | } |
| | | |
| | | if (masterAuthor == null) { |
| | | |
| | | resultObj.fluentPut("unchecked", result); |
| | | return Result.success(resultObj); |
| | | } |
| | | List<MasterAuthorDetail> fields = masterAuthorDetailService.selectList(new EntityWrapper<MasterAuthorDetail>().eq(Constant.PARENT_ID, masterAuthor.getId())); |
| | | if (fields != null) { |
| | | List<String> checkedFieldStrList = fields.stream().map(masterAuthorDetail -> masterAuthorDetail.getField()).collect(Collectors.toList()); |
| | | result = result.stream().filter(sysField -> !checkedFieldStrList.contains(sysField.getField())).collect(Collectors.toList()); |
| | | } |
| | | resultObj.fluentPut("unchecked", result); |
| | | resultObj.fluentPut("checked", fields); |
| | | return Result.success(resultObj); |
| | | } |
| | | } |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.text.MessageFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | IMaintainService maintainService; |
| | | @Autowired |
| | | IMaintainDetailService maintainDetailService; |
| | | |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Autowired |
| | | IMenuMappingService menuMappingService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | IMasterModifiedService masterModifiedService; |
| | | @Autowired |
| | | IMasterAuthorService masterAuthorService; |
| | | |
| | | @RequestMapping(value = "{tableName}/uploaded", method = RequestMethod.GET) |
| | | public Result get(@PathVariable String tableName, HttpServletRequest request) { |
| | |
| | | } |
| | | version = String.valueOf(maxVersion.getVersion()); |
| | | } |
| | | |
| | | masterAuthorService.getFilter() |
| | | if (StringUtils.isEmpty(fields)) { |
| | | if (StringUtils.isEmpty(pageSizeStr)) { |
| | | return masterDataService.selectListByPageByVersion(tableName, whereSegment,pageNo,version, findMax); |
| | |
| | | version = String.valueOf(maintainService.getNowVersion(tableName).getVersion()); |
| | | } |
| | | if (StringUtils.isEmpty(whereSegment)) { |
| | | return masterDataService.selectList(tableName); |
| | | return masterDataService.selectList(tableName,Constant.WHERE_DEFAULT, version); |
| | | } |
| | | return masterDataService.selectList(tableName,whereSegment); |
| | | return masterDataService.selectList(tableName,whereSegment, version); |
| | | } |
| | | |
| | | @RequestMapping(value = "{maintainId}/modify/{operateStr}", method = RequestMethod.POST) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "{tableName}/getFieldVal/{field}", method = RequestMethod.GET) |
| | | public Result getFieldVal(@PathVariable String tableName, @PathVariable String field) { |
| | | return masterDataService.getFieldValByTable(tableName,field); |
| | | @RequestMapping(value = "/getValByMaintainFieldId/{maintainFieldId}", method = RequestMethod.GET) |
| | | public Result getValByMaintainFieldId(@PathVariable String maintainFieldId,@RequestParam String menuId, @RequestParam String field, HttpServletRequest request) { |
| | | String tableName = menuMappingService.getTableNameByMenu(menuId); |
| | | if (StringUtils.isEmpty(tableName)) { |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | if (maintainFieldId.equalsIgnoreCase(Constant.All)) { |
| | | Set<String> fieldValList = masterDataService.getFieldValByTable(tableName, field); |
| | | return Result.success(fieldValList); |
| | | } |
| | | |
| | | Set<String> fieldValByMaintainField = masterDataService.getFieldValByMaintainField(maintainFieldId, field, tableName); |
| | | |
| | | return Result.success(fieldValByMaintainField); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public Result<Object> update(@RequestParam String data) throws Exception { |
| | | boolean updated =menuMappingService.update(data); |
| | | if (updated) { |
| | | return Result.success("更新成功", null); |
| | | return Result.success(data); |
| | | } else { |
| | | return Result.error(CodeMsg.UPDATE_ERROR); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | IMaintainService maintainService; |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Autowired |
| | | IMasterAuthorService masterAuthorService; |
| | | |
| | | @RequestMapping(value = "/all", method = RequestMethod.GET) |
| | | public Result<List<SysMenu>> getAll() { |
| | | EntityWrapper<SysMenu> sysMenuEntityWrapper = new EntityWrapper<>(); |
| | | sysMenuEntityWrapper.orderBy("parent_id, order_no"); |
| | | return Result.success(menuService.selectList(sysMenuEntityWrapper)) ; |
| | | } |
| | | |
| | | @RequestMapping(value = "/author/all", method = RequestMethod.GET) |
| | | public Result<List<SysMenu>> getAllBak(HttpServletRequest request) { |
| | | TUser user = DbUtils.getUser(request); |
| | | List<SysMenu> menu = masterAuthorService.getMenu(user.getUserId()); |
| | | return Result.success(menu) ; |
| | | } |
| | | |
| | | @RequestMapping(value = "/audit", method = RequestMethod.GET) |
| | |
| | | menu.setMenuType(menuType); |
| | | boolean inserted = menuService.insert(menu); |
| | | if (inserted) { |
| | | return Result.success("插入成功", null); |
| | | return Result.success(menu); |
| | | } else { |
| | | return Result.error(CodeMsg.INSERT_ERROR); |
| | | } |
| | |
| | | // } |
| | | // } |
| | | |
| | | return Result.success(CodeMsg.SUCCESS); |
| | | return Result.success(menu); |
| | | } |
| | | |
| | | @RequestMapping(value = "/update", method = RequestMethod.GET) |
| | |
| | | List<SysMenu> sysMenus = menuService.selectList(menuEntityWrapper); |
| | | return Result.success(sysMenus); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.FieldStrategy; |
| | | import com.highdatas.mdm.pojo.MasterAuthorType; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | @TableField("character_id") |
| | | private String characterId; |
| | | |
| | | @TableField("maintain_field_id") |
| | | @TableField("menu_id") |
| | | private String menuId; |
| | | |
| | | @TableField(value = "maintain_field_id", strategy = FieldStrategy.IGNORED) |
| | | private String maintainFieldId; |
| | | |
| | | |
| | |
| | | |
| | | private transient List<MasterAuthorDetail> fields; |
| | | |
| | | public String getMenuId() { |
| | | return menuId; |
| | | } |
| | | |
| | | public MasterAuthor setMenuId(String menuId) { |
| | | this.menuId = menuId; |
| | | return this; |
| | | } |
| | | |
| | | public Boolean getFieldAuto() { |
| | | return fieldAuto; |
| | | } |
| | |
| | | Integer insertRecordFromStandrad(@Param("tableName")String tableName, @Param("recordTableName")String recordTableName, @Param("tempFieldList")String tempFieldList); |
| | | |
| | | Map<String,String> selectActMemberShip(@Param("userId")String userId, @Param("roleId")String roleId); |
| | | |
| | | List<Map<String, Object>> getOneTempFieldDataByMaintainExtent(@Param("tableName")String tableName, @Param("tempTableName")String tempTableName,@Param("field")String field, @Param("fromOrderNo")Integer fromOrderNo, @Param("toOrderNo")Integer toOrderNo); |
| | | List<Map<String, Object>> getTempDataByMaintainExtent(@Param("tableName")String tableName, @Param("tempTableName")String tempTableName,@Param("fromOrderNo")Integer fromOrderNo, @Param("toOrderNo")Integer toOrderNo); |
| | | } |
| | | |
| | |
| | | processDiagramCanvas.drawActivityMarkers((int)graphicInfo.getX(), (int)graphicInfo.getY(), (int)graphicInfo.getWidth(), (int)graphicInfo.getHeight(), multiInstanceSequential, multiInstanceParallel, collapsed); |
| | | } |
| | | |
| | | if (highLightedActivities.contains(flowNode.getId())) { |
| | | if (highLightedActivities != null && highLightedActivities.contains(flowNode.getId())) { |
| | | processDiagramCanvas.drawHighLight((int)graphicInfo.getX(), (int)graphicInfo.getY(), (int)graphicInfo.getWidth(), (int)graphicInfo.getHeight()); |
| | | } |
| | | |
| | | } |
| | | |
| | | for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) { |
| | | boolean highLighted = highLightedFlows.contains(sequenceFlow.getId()); |
| | | boolean highLighted = false; |
| | | if (highLightedFlows != null) { |
| | | highLighted = highLightedFlows.contains(sequenceFlow.getId()); |
| | | } |
| | | |
| | | String defaultFlow = null; |
| | | if (flowNode instanceof Activity) |
| | | defaultFlow = ((Activity)flowNode).getDefaultFlow(); |
| | |
| | | |
| | | MaintainField createNowVerion(String tableName, String maintainId, String userId); |
| | | |
| | | ActivitiStatus getStatusByBusinessId(String maintainFieldId); |
| | | ActivitiStatus getStatusByBusinessId(String businssId); |
| | | |
| | | boolean isNextAudit(Flows flows, String userId); |
| | | |
| | |
| | | package com.highdatas.mdm.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.highdatas.mdm.entity.Maintain; |
| | | import com.highdatas.mdm.entity.MaintainField; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.pojo.ActivitiStatus; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | MaintainField getNextMaintain(String tableName, String userId); |
| | | |
| | | |
| | | List<Maintain> getMaintainByMaintainField(String maintainFieldId, String tableName); |
| | | |
| | | boolean checkNowVersion(String id); |
| | | boolean checkFirstVersion(String id); |
| | |
| | | void dealFlow(String maintainId, ActivitiStatus status); |
| | | |
| | | int getUnFlowCount(String tableName, String userId); |
| | | |
| | | JSONArray getMaintainListByTable(String tableName); |
| | | |
| | | } |
| | |
| | | import com.highdatas.mdm.entity.MasterAuthor; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IMasterAuthorService extends IService<MasterAuthor> { |
| | | |
| | | Result merageRoleAuthor(List<String> roleIds); |
| | | HashMap<String, MasterAuthor> merageRoleAuthor(List<String> roleIds); |
| | | |
| | | List<SysMenu> getMenu(String userId); |
| | | |
| | | |
| | | List<SysField> getField(String userId); |
| | | List<SysField> getField(String userId, String maintainFieldId, String maintainId); |
| | | |
| | | boolean checkMaintainAuthor(String userId, String maintainId); |
| | | |
| | | String getFilter(String userId, String maintainId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.highdatas.mdm.entity.MenuMapping; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | |
| | | boolean update(String json); |
| | | |
| | | Result getMapping(HttpSession session, String id); |
| | | |
| | | SysMenu getMenuByTableName(String tableName); |
| | | |
| | | String getTableNameByMenu(String menuId); |
| | | } |
| | |
| | | package com.highdatas.mdm.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.highdatas.mdm.entity.MaintainField; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | |
| | |
| | | |
| | | List<SysField> getFieldByMaintain(String maintainId); |
| | | |
| | | MaintainField getMaintainFieldByMaintain(String maintainId); |
| | | |
| | | List<SysField> getFieldByTable(String tableName); |
| | | |
| | | |
| | |
| | | package com.highdatas.mdm.service; |
| | | |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | |
| | | import java.util.LinkedHashSet; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | LinkedHashSet<String> getByParentId(LinkedHashSet<String> parentIdSet); |
| | | |
| | | } |
| | |
| | | import com.highdatas.mdm.pojo.SysAssembleUpdateType; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author kimi |
| | |
| | | |
| | | Result selectListByPageByVersion(String tableName, String whereSegment, Integer pageNo, String version, boolean findMax); |
| | | |
| | | List<Map<String, Object>> selectListByVersion(String tableName, List<String> fieldList, String whereSegment, String version, boolean findMax); |
| | | |
| | | Result selectListByPageByVersion(String tableName, List<String> fieldList, String whereSegment, Integer pageNo, Integer pageSize, String version, boolean findMax); |
| | | |
| | | Maintain uploadedData(String tableName, SysAssembleUpdateType uploadType, String userId); |
| | | |
| | | Result getFieldValByTable(String tableName, String field); |
| | | Result getFieldValByMaintainField(String maintainFieldId, String field); |
| | | Set<String> getFieldValByTable(String tableName, String field); |
| | | Set<String> getFieldValByMaintainField(String maintainFieldId, String field, String tableName); |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | |
| | | public boolean updateProcessDefStatus(String type, String modelId); |
| | | public void getModelXml(HttpServletResponse response,String modelId) throws IOException; |
| | | |
| | | InputStream getModelImg(String modelId); |
| | | } |
| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.node.ObjectNode; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.process.canvas.ProcessDiagramGenerator; |
| | | import com.highdatas.mdm.util.WorkflowUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.activiti.bpmn.converter.BpmnXMLConverter; |
| | |
| | | import org.activiti.editor.constants.ModelDataJsonConstants; |
| | | import org.activiti.editor.language.json.converter.BpmnJsonConverter; |
| | | import org.activiti.engine.ActivitiException; |
| | | import org.activiti.engine.HistoryService; |
| | | import org.activiti.engine.RepositoryService; |
| | | import org.activiti.engine.repository.Deployment; |
| | | import org.activiti.engine.repository.Model; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ClassUtils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @Autowired |
| | | RepositoryService service; |
| | | @Autowired |
| | | HistoryService historyService; |
| | | |
| | | @Autowired |
| | | ObjectMapper objectMapper; |
| | | @Value("${img.url}") |
| | | String basePath; |
| | |
| | | response.flushBuffer(); |
| | | } |
| | | |
| | | @Override |
| | | public InputStream getModelImg(String modelId) { |
| | | InputStream resource = null; |
| | | try{ |
| | | Model model = service.createModelQuery().modelId(modelId).singleResult(); |
| | | JsonNode editorNode = new ObjectMapper().readTree(service.getModelEditorSource(model.getId())); |
| | | BpmnJsonConverter jsonConverter = new BpmnJsonConverter(); |
| | | BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode); |
| | | ProcessDiagramGenerator diagramGenerator = new ProcessDiagramGenerator(); |
| | | resource = diagramGenerator.generateDiagram(bpmnModel, "png",null,null, "宋体","宋体" ,null, null,0); |
| | | return resource; |
| | | } |
| | | catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | finally { |
| | | if (resource != null) { |
| | | try { |
| | | resource.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public boolean updateProcessDefStatus(String type, String modelId) { |
| | | Model model = service.createModelQuery().modelId(modelId).singleResult(); |
| | | ProcessDefinition processDefinition = service.createProcessDefinitionQuery().deploymentId(model.getDeploymentId()).singleResult(); |
| | |
| | | package com.highdatas.mdm.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.highdatas.mdm.entity.Flows; |
| | | import com.highdatas.mdm.entity.Maintain; |
| | | import com.highdatas.mdm.entity.MaintainField; |
| | |
| | | import com.highdatas.mdm.pojo.Operate; |
| | | import com.highdatas.mdm.service.IFlowsService; |
| | | import com.highdatas.mdm.service.IMaintainFieldService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.highdatas.mdm.service.IMaintainService; |
| | | import com.highdatas.mdm.service.ISysFieldService; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Connection; |
| | | import java.sql.PreparedStatement; |
| | | import java.sql.SQLException; |
| | | import java.text.MessageFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | nowMaintain.setId(DbUtils.getUUID()); |
| | | } |
| | | return nowMaintain; |
| | | } |
| | | |
| | | @Override |
| | | public List<Maintain> getMaintainByMaintainField(String maintainFieldId, String tableName) { |
| | | HashMap<String, List<Maintain>> resultMap = getMaintainFieldMapByTable(tableName); |
| | | if (resultMap == null) { |
| | | return null; |
| | | } |
| | | return resultMap.get(maintainFieldId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return cnt; |
| | | } |
| | | |
| | | @Override |
| | | public JSONArray getMaintainListByTable(String tableName) { |
| | | HashMap<String, List<Maintain>> resultMap = getMaintainFieldMapByTable(tableName); |
| | | |
| | | Set<String> keySet = resultMap.keySet(); |
| | | JSONArray array = new JSONArray(); |
| | | for (String s : keySet) { |
| | | List<Maintain> list = resultMap.get(s); |
| | | Maintain max = list.stream().max(new Comparator<Maintain>() { |
| | | @Override |
| | | public int compare(Maintain o1, Maintain o2) { |
| | | return o1.getOrderNo() - o2.getOrderNo(); |
| | | } |
| | | }).get(); |
| | | Maintain min = list.stream().min(new Comparator<Maintain>() { |
| | | @Override |
| | | public int compare(Maintain o1, Maintain o2) { |
| | | return o1.getOrderNo() - o2.getOrderNo(); |
| | | } |
| | | }).get(); |
| | | JSONObject object = new JSONObject(); |
| | | object.fluentPut("maintainFieldId", s); |
| | | object.fluentPut("version", MessageFormat.format(Constant.extent, min.getVersion(), max.getVersion())); |
| | | |
| | | array.add(object); |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | private HashMap<String, List<Maintain>> getMaintainFieldMapByTable(String tableName) { |
| | | List<Maintain> maintainList = maintainService.selectList(new EntityWrapper<Maintain>().eq("table_name", tableName).isNotNull("flow_id").orderBy("order_no")); |
| | | HashMap<String, List<Maintain>> resultMap = new HashMap<>(); |
| | | for (Maintain maintain : maintainList) { |
| | | ActivitiStatus status = flowsService.getStatusByBusinessId(maintain.getId()); |
| | | if (!status.equals(ActivitiStatus.open)) { |
| | | continue; |
| | | } |
| | | MaintainField maintainFieldByMaintain = fieldService.getMaintainFieldByMaintain(maintain.getId()); |
| | | List<Maintain> list = resultMap.get(maintainFieldByMaintain.getId()); |
| | | if (list == null) { |
| | | list = new ArrayList<>(); |
| | | } |
| | | list.add(maintain); |
| | | resultMap.put(maintainFieldByMaintain.getId(), list); |
| | | } |
| | | return resultMap; |
| | | } |
| | | } |
| | |
| | | package com.highdatas.mdm.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.highdatas.mdm.entity.MasterAuthor; |
| | | import com.highdatas.mdm.entity.MasterAuthorDetail; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.highdatas.mdm.controller.MasterAuthorController; |
| | | import com.highdatas.mdm.entity.*; |
| | | import com.highdatas.mdm.mapper.MasterAuthorMapper; |
| | | import com.highdatas.mdm.pojo.MasterAuthorType; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.service.IMasterAuthorDetailService; |
| | | import com.highdatas.mdm.service.IMasterAuthorService; |
| | | import com.highdatas.mdm.service.*; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.ContentBuilder; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public static final String characterId = "characterId"; |
| | | @Autowired |
| | | IMasterAuthorDetailService authorDetailService; |
| | | @Autowired |
| | | ITUserRoleService userRoleService; |
| | | @Autowired |
| | | ISysMenuService menuService; |
| | | @Autowired |
| | | ISysFieldService fieldService; |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Autowired |
| | | IMaintainService maintainService; |
| | | |
| | | @Override |
| | | public Result merageRoleAuthor(List<String> roleIds) { |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(this.characterId, roleIds)); |
| | | public HashMap<String, MasterAuthor> merageRoleAuthor(List<String> roleIds) { |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds)); |
| | | HashMap<String, MasterAuthor> resultMap = new HashMap<>(); |
| | | |
| | | for (MasterAuthor masterAuthor : masterAuthors) { |
| | |
| | | resultMap.put(key, preMerageMasterAuthor); |
| | | } |
| | | } |
| | | return Result.success(resultMap.values()); |
| | | return resultMap; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysMenu> getMenu(String userId) { |
| | | return null; |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.user).eq(MasterAuthorController.character_id, userId)); |
| | | if (masterAuthors.size() == 0) { |
| | | //user 获取role |
| | | List<TUserRole> roles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq("user_id", userId)); |
| | | List<String> roleIds = roles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds)); |
| | | } |
| | | List<String> menuIds = masterAuthors.stream().map(masterAuthor -> masterAuthor.getMenuId()).collect(Collectors.toList()); |
| | | LinkedHashSet<String> strings = new LinkedHashSet<>(menuIds); |
| | | LinkedHashSet<String> byParentId = menuService.getByParentId(strings); |
| | | List<SysMenu> sysMenus = menuService.selectBatchIds(byParentId); |
| | | return sysMenus; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysField> getField(String userId) { |
| | | public List<SysField> getField(String userId, String maintainFieldId, String maintainId) { |
| | | if (maintainFieldId.equalsIgnoreCase(Constant.All)) { |
| | | List<SysField> total = fieldService.getFieldByMaintain(maintainId); |
| | | return total; |
| | | } |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.user).eq(this.characterId, userId).eq("maintain_field_id", maintainFieldId)); |
| | | if (masterAuthors.size() == 0) { |
| | | //user 获取role |
| | | List<TUserRole> roles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq("user_id", userId)); |
| | | List<String> roleIds = roles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(this.characterId, roleIds).eq("maintain_field_id", maintainFieldId)); |
| | | } |
| | | if (masterAuthors.isEmpty()) { |
| | | return null; |
| | | } |
| | | List<String> authorIds = masterAuthors.stream().map(masterAuthor -> masterAuthor.getId()).collect(Collectors.toList()); |
| | | List<MasterAuthorDetail> masterAuthorDetails = authorDetailService.selectList(new EntityWrapper<MasterAuthorDetail>().in(Constant.PARENT_ID, authorIds)); |
| | | Set<String> codes = masterAuthorDetails.stream().map(masterAuthorDetail -> masterAuthorDetail.getField()).collect(Collectors.toSet()); |
| | | if (codes.isEmpty()) { |
| | | return null; |
| | | } |
| | | Wrapper<SysField> wrapper = new EntityWrapper<SysField>().in(Constant.FIELD, codes); |
| | | |
| | | if (maintainFieldId.equalsIgnoreCase(Constant.Default)) { |
| | | wrapper.eq("maintain_field_id", maintainFieldId); |
| | | }else { |
| | | wrapper.isNull("maintain_field_id"); |
| | | } |
| | | List<SysField> fieldList = fieldService.selectList(wrapper); |
| | | |
| | | |
| | | |
| | | return fieldList; |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkMaintainAuthor(String userId, String maintainId) { |
| | | Maintain maintain = maintainService.selectById(maintainId); |
| | | if (maintain == null) { |
| | | return false; |
| | | } |
| | | int checked = selectCount(new EntityWrapper<MasterAuthor>() |
| | | .eq(Constant.TYPE, MasterAuthorType.user) |
| | | .eq(MasterAuthorController.character_id, userId) |
| | | .eq("table_name", maintain.getTableName()) |
| | | .eq("maintain_field_id", Constant.All)); |
| | | if(checked > 0) { |
| | | return true; |
| | | } |
| | | MaintainField maintainField = fieldService.getMaintainFieldByMaintain(maintainId); |
| | | if (maintainField == null) { |
| | | return false; |
| | | } |
| | | //get user author |
| | | checked = selectCount(new EntityWrapper<MasterAuthor>() |
| | | .eq(Constant.TYPE, MasterAuthorType.user) |
| | | .eq(MasterAuthorController.character_id, userId) |
| | | .eq("table_name", maintain.getTableName()) |
| | | .eq("maintain_field_id", maintainField.getId())); |
| | | if (checked > 0) { |
| | | return true; |
| | | } |
| | | List<TUserRole> roles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq("user_id", userId)); |
| | | Set<String> collect = roles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toSet()); |
| | | checked = selectCount(new EntityWrapper<MasterAuthor>() |
| | | .eq(Constant.TYPE, MasterAuthorType.role) |
| | | .in(MasterAuthorController.character_id, collect) |
| | | .eq("table_name", maintain.getTableName()) |
| | | .eq("maintain_field_id", maintainField.getId())); |
| | | if (checked > 0) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String getFilter(String userId, String maintainId) { |
| | | MaintainField maintainField = fieldService.getMaintainFieldByMaintain(maintainId); |
| | | if (maintainField) |
| | | if (maintainFieldId.equalsIgnoreCase(Constant.All)) { |
| | | return Constant.WHERE_DEFAULT; |
| | | } |
| | | List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.user).eq(this.characterId, userId).eq("maintain_field_id", maintainFieldId)); |
| | | if (masterAuthors.size() == 0) { |
| | | //user 获取role |
| | | List<TUserRole> roles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq("user_id", userId)); |
| | | List<String> roleIds = roles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList()); |
| | | masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(this.characterId, roleIds).eq("maintain_field_id", maintainFieldId)); |
| | | } |
| | | if (masterAuthors.isEmpty()){ |
| | | return Constant.WHERE_DEFAULTUN; |
| | | } |
| | | List<String> authorIds = masterAuthors.stream().map(masterAuthor -> masterAuthor.getId()).collect(Collectors.toList()); |
| | | List<MasterAuthorDetail> masterAuthorDetails = authorDetailService.selectList(new EntityWrapper<MasterAuthorDetail>().in(Constant.PARENT_ID, authorIds)); |
| | | if (masterAuthorDetails.isEmpty()) { |
| | | return Constant.WHERE_DEFAULTUN; |
| | | } |
| | | HashMap<String, List<String>> segmentMap = new HashMap<>(); |
| | | HashMap<String, Boolean> segmentAllMap = new HashMap<>(); |
| | | |
| | | for (MasterAuthorDetail detail : masterAuthorDetails) { |
| | | String field = detail.getField(); |
| | | Boolean all = detail.getAll(); |
| | | if (!(segmentAllMap.containsKey(field) && segmentAllMap.get(field))) { |
| | | segmentAllMap.put(field, all); |
| | | } |
| | | |
| | | Boolean preAll = segmentAllMap.get(field); |
| | | if (preAll && segmentMap.containsKey(field)) { |
| | | segmentMap.remove(field); |
| | | } |
| | | |
| | | String val = detail.getVal(); |
| | | List<String> split = DbUtils.split(val); |
| | | segmentMap.put(field,split); |
| | | } |
| | | ContentBuilder builder = new ContentBuilder(Constant.AND); |
| | | Set<String> keySet = segmentMap.keySet(); |
| | | for (String code : keySet) { |
| | | List<String> vals = segmentMap.get(code); |
| | | String val = vals.stream() |
| | | .filter(s -> !StringUtils.isEmpty(s)) |
| | | .map(s -> DbUtils.quotedStr(s)).collect(Collectors.joining(Constant.COMMA)); |
| | | String format = MessageFormat.format(Constant.MYSQL_UUID, code, val); |
| | | builder.append(format); |
| | | } |
| | | String filter = builder.toString(); |
| | | return filter; |
| | | } |
| | | |
| | | private MasterAuthor merage(MasterAuthor preMerageMasterAuthor, MasterAuthor masterAuthor) { |
| | | // table name masterField 一样 只有字段不同了 |
| | |
| | | IFlowsService flowsService; |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | @Autowired |
| | | IMaintainFieldService maintainFieldService; |
| | | @Resource |
| | | protected DataSource dataSource; |
| | | |
| | |
| | | return selectListByPageByVersion(tableName, null,whereSegment, pageNo, null,version, findMax); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectListByVersion(String tableName, List<String> fieldList, String whereSegment, String version, boolean findMax) { |
| | | Maintain maintainFromVersion = maintainService.getMaintainFromVersion(tableName, version); |
| | | Maintain nowVersionMaintain = maintainService.getNowVersion(tableName); |
| | | boolean isMax = maintainService.checkdMaxVersion(maintainFromVersion.getId()); |
| | | boolean isNow = maintainService.checkNowVersion(maintainFromVersion.getId()); |
| | | boolean isFirst = maintainService.checkFirstVersion(maintainFromVersion.getId()); |
| | | |
| | | Integer fromVersionOrderNo = maintainFromVersion.getOrderNo(); |
| | | Integer nowVersionOrderNo = 0; |
| | | if (nowVersionMaintain != null) { |
| | | nowVersionOrderNo = nowVersionMaintain.getOrderNo(); |
| | | } |
| | | |
| | | String tableTempName = tableName + Constant.RECORD; |
| | | List<Map<String, Object>> result = null; |
| | | |
| | | String fields; |
| | | String tempFields; |
| | | String Hfields; |
| | | String A1fields; |
| | | String A2fields; |
| | | |
| | | String tempHfields; |
| | | if (fieldList == null || fieldList.size() == 0) { |
| | | fields = getFields(tableName, maintainFromVersion); |
| | | Hfields = getFields(tableName,Constant.H, maintainFromVersion); |
| | | A1fields = getFields(tableName,Constant.A1, maintainFromVersion); |
| | | A2fields = getFields(tableName,Constant.A2, maintainFromVersion); |
| | | tempFields = getTempFields(tableName, maintainFromVersion); |
| | | tempHfields = getTempFields(tableName, Constant.H, maintainFromVersion); |
| | | } else { |
| | | fields = fieldList.stream().collect(Collectors.joining(Constant.COMMA)); |
| | | Hfields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.H, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A1fields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A2fields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A2, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | tempFields = fieldList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | tempHfields = fieldList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.H,s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | } |
| | | if (isNow && !findMax){ |
| | | result = mapper.selectByPage(tableName, fields, whereSegment, null); |
| | | } |
| | | else if (isMax && findMax) { |
| | | ContentBuilder builder = new ContentBuilder(Constant.COMMA); |
| | | if (nowVersionMaintain == null) { |
| | | builder.append(DbUtils.quotedStr(maintainFromVersion.getId())); |
| | | }else { |
| | | List<String> maintainIds = maintainService.getCompareVersionMaintains(nowVersionMaintain, maintainFromVersion); |
| | | long con = maintainIds.stream().map(s -> builder.append(DbUtils.quotedStr(s))).count(); |
| | | } |
| | | |
| | | result = mapper.selectByPageByMaxVersion(tableName,tableTempName,fields,tempFields, Hfields, A1fields, A2fields, tempHfields, fromVersionOrderNo, nowVersionOrderNo, DbUtils.quotedStr(maintainFromVersion.getId()), whereSegment, null); |
| | | |
| | | }else { |
| | | result = mapper.selectByPageByVersion(tableName,tableTempName,fields,tempFields, Hfields, A1fields, A2fields, tempHfields, nowVersionOrderNo, fromVersionOrderNo, DbUtils.quotedStr(maintainFromVersion.getId()), whereSegment, null); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | @Override |
| | | public Result selectListByPageByVersion(String tableName, List<String> fieldList, String whereSegment, Integer pageNo, Integer pageSize, String version, boolean findMax) { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result getFieldValByTable(String tableName, String field) { |
| | | public Set<String> getFieldValByTable(String tableName, String field) { |
| | | //查缓存 |
| | | String key = DbUtils.getFieldRedisKey(tableName,field); |
| | | String redisVal = redisClient.getRedisVal(key); |
| | | if (!StringUtils.isEmpty(redisVal)) { |
| | | List<String> valList = DbUtils.split(redisVal); |
| | | if (valList != null) { |
| | | return Result.success(valList); |
| | | return new HashSet<String>(valList); |
| | | } |
| | | } |
| | | // 读数据库 |
| | | String tempTableName = tableName + Constant.RECORD; |
| | | List<Map<String, Object>> maps = mapper.selectByPage(tableName, MessageFormat.format(Constant.DISTINCT, field), Constant.WHERE_DEFAULT, null); |
| | | |
| | | List<Map<String, Object>> tempMaps = mapper.selectByPage(tempTableName, MessageFormat.format(Constant.DISTINCT, field), Constant.WHERE_DEFAULT, null); |
| | | maps.addAll(tempMaps); |
| | | if (maps.size() == 0) { |
| | | return null; |
| | | } |
| | | Set<String> result = maps.stream() |
| | | .filter(one -> one != null) |
| | | .map(one -> one.get(field)) |
| | | .filter(o -> o != null) |
| | | .map(o -> o.toString()).collect(Collectors.toSet()); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Result getFieldValByMaintainField(String tableName, String field) { |
| | | public Set<String> getFieldValByMaintainField(String maintainFieldId, String field, String tableName) { |
| | | //查缓存 |
| | | MaintainField maintainField = maintainFieldService.selectById(maintainFieldId); |
| | | |
| | | String key = DbUtils.getFieldRedisKey(tableName,field); |
| | | String redisVal = redisClient.getRedisVal(key); |
| | | if (!StringUtils.isEmpty(redisVal)) { |
| | | List<String> valList = DbUtils.split(redisVal); |
| | | if (valList != null) { |
| | | return Result.success(valList); |
| | | HashSet<String> strings = new HashSet<>(valList); |
| | | return strings; |
| | | } |
| | | } |
| | | // 读数据库 |
| | | |
| | | List<Maintain> list = maintainFieldService.getMaintainByMaintainField(maintainFieldId, tableName); |
| | | Maintain max = list.stream().max(new Comparator<Maintain>() { |
| | | @Override |
| | | public int compare(Maintain o1, Maintain o2) { |
| | | return o1.getOrderNo() - o2.getOrderNo(); |
| | | } |
| | | }).get(); |
| | | Maintain min = list.stream().min(new Comparator<Maintain>() { |
| | | @Override |
| | | public int compare(Maintain o1, Maintain o2) { |
| | | return o1.getOrderNo() - o2.getOrderNo(); |
| | | } |
| | | }).get(); |
| | | ArrayList<String> fieldList = new ArrayList<>(); |
| | | fieldList.add(field); |
| | | fieldList.add(Constant.ID); |
| | | List<Map<String, Object>> maps = selectListByVersion(tableName, fieldList, Constant.WHERE_DEFAULT, max.getVersion(), false); |
| | | String tempTableName = tableName + Constant.RECORD; |
| | | List<Map<String, Object>> tempVals = mapper.getOneTempFieldDataByMaintainExtent(DbUtils.quotedStr(tableName), tempTableName, field, min.getOrderNo(), max.getOrderNo()); |
| | | maps.addAll(tempVals); |
| | | if (maps.size() == 0) { |
| | | return null; |
| | | } |
| | | Set<String> result = maps.stream() |
| | | .filter(one -> one != null) |
| | | .map(one -> one.get(field)) |
| | | .filter(o -> o != null) |
| | | .map(o -> o.toString()).collect(Collectors.toSet()); |
| | | String val = result.stream().collect(Collectors.joining(Constant.SEMICOLON)); |
| | | redisClient.putRedisVal(key, val); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | mapping.put("version", resultMaintain.getVersion()); |
| | | mapping.put("maintainId", resultMaintain.getId()); |
| | | } |
| | | |
| | | return Result.success(mapping); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public SysMenu getMenuByTableName(String tableName) { |
| | | MenuMapping menuMapping = selectOne(new EntityWrapper<MenuMapping>().eq("table_name", tableName).orderBy("create_time desc")); |
| | | if (menuMapping == null) { |
| | | return null; |
| | | } |
| | | String menuId = menuMapping.getMenuId(); |
| | | SysMenu sysMenu = menuService.selectById(menuId); |
| | | return sysMenu; |
| | | } |
| | | |
| | | @Override |
| | | public String getTableNameByMenu(String menuId) { |
| | | MenuMapping menuMapping = selectOne(new EntityWrapper<MenuMapping>().eq("menu_id", menuId).orderBy("create_time desc")); |
| | | if (menuMapping == null) { |
| | | return null; |
| | | } |
| | | return menuMapping.getTableName(); |
| | | |
| | | } |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | TableInfoMapper tableInfoMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<SysField> getFieldByMaintain(String maintainId) { |
| | | public MaintainField getMaintainFieldByMaintainId(String maintainId) { |
| | | MaintainField maintainField; |
| | | List<SysField> fieldList = null; |
| | | |
| | |
| | | //对应版本找不到 往前找 |
| | | String maintainFieldId = maintainFieldMapper.getMappedMatintainId(DbUtils.quotedStr(maintain.getTableName()), maintain.getOrderNo()); |
| | | if (StringUtils.isEmpty(maintainFieldId)) { |
| | | fieldList = this.selectList(new EntityWrapper<SysField>().eq("table_name", maintain.getTableName()).isNull("maintain_field_id").orderBy("order_no")); |
| | | return fieldList; |
| | | return null; |
| | | } |
| | | maintainField = maintainFieldService.selectById(maintainFieldId); |
| | | if (maintainField == null){ |
| | | //无对应版本 |
| | | } |
| | | return maintainField; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<SysField> getFieldByMaintain(String maintainId) { |
| | | List<SysField> fieldList; |
| | | Maintain maintain = maintainService.selectById(maintainId); |
| | | if (maintain == null) { |
| | | return null; |
| | | } |
| | | |
| | | MaintainField maintainField = getMaintainFieldByMaintain(maintainId); |
| | | if (maintainField == null && Constant.Default.equalsIgnoreCase(maintainField.getId())) { |
| | | |
| | | fieldList = this.selectList(new EntityWrapper<SysField>().eq("table_name", maintain.getTableName()).isNull("maintain_field_id").orderBy("order_no")); |
| | | return fieldList; |
| | | } |
| | | } |
| | | |
| | | String maintainFieldId = maintainField.getId(); |
| | | String tableName = maintainField.getTableName(); |
| | | //TODO 判断版本 |
| | |
| | | maintainField = maintainFieldService.selectOne(new EntityWrapper<MaintainField>().eq("table_name", maintain.getTableName()).eq("order_no", preNo)); |
| | | fieldList = this.selectList(new EntityWrapper<SysField>().eq("maintain_field_id", maintainField.getId()).eq("table_name", tableName).orderBy("order_no")); |
| | | return fieldList; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public MaintainField getMaintainFieldByMaintain(String maintainId) { |
| | | MaintainField maintainField; |
| | | List<SysField> fieldList = null; |
| | | |
| | | if (StringUtils.isEmpty(maintainId)) { |
| | | return null; |
| | | } |
| | | Maintain maintain = maintainService.selectById(maintainId); |
| | | if (maintain == null) { |
| | | return null; |
| | | } |
| | | |
| | | maintainField = maintainFieldService.selectOne(new EntityWrapper<MaintainField>().eq("maintain_id", maintainId).orderBy("order_no desc, create_time desc")); |
| | | if (maintainField == null) { |
| | | //对应版本找不到 往前找 |
| | | String maintainFieldId = maintainFieldMapper.getMappedMatintainId(DbUtils.quotedStr(maintain.getTableName()), maintain.getOrderNo()); |
| | | if (StringUtils.isEmpty(maintainFieldId)) { |
| | | return new MaintainField().setId(Constant.Default); |
| | | } |
| | | maintainField = maintainFieldService.selectById(maintainFieldId); |
| | | if (maintainField == null){ |
| | | return new MaintainField().setId(Constant.Default); |
| | | } |
| | | } |
| | | |
| | | String maintainFieldId = maintainField.getId(); |
| | | String tableName = maintainField.getTableName(); |
| | | |
| | | ActivitiStatus status = flowsService.getStatusByBusinessId(maintainFieldId); |
| | | if (status != null && status.equals(ActivitiStatus.open)) { |
| | | return maintainFieldService.selectById(maintainField); |
| | | } |
| | | |
| | | // 当前版本正在审批 找前一版本 |
| | | Integer maintainFieldOrderNo = maintainField.getOrderNo(); |
| | | if (maintainFieldOrderNo < 1) { |
| | | return new MaintainField().setId(Constant.Default); |
| | | }else { |
| | | Integer preNo = maintainFieldOrderNo - 1; |
| | | maintainField = maintainFieldService.selectOne(new EntityWrapper<MaintainField>().eq("table_name", maintain.getTableName()).eq("order_no", preNo)); |
| | | return maintainField; |
| | | } |
| | | |
| | | |
| | |
| | | //没有中文名称的 应该属于系统自留字段 如id |
| | | continue; |
| | | } |
| | | String alias = fieldList.stream().map(SysField::getAlias).collect(Collectors.joining(Constant.SEMICOLON)); |
| | | HashSet<SysField> strings = new HashSet<SysField>(fieldList); |
| | | String alias = strings.stream().map(SysField::getAlias).collect(Collectors.joining(Constant.SEMICOLON)); |
| | | SysField sysField = new SysField().setField(fieldName).setAlias(alias); |
| | | result.add(sysField); |
| | | } |
| | |
| | | package com.highdatas.mdm.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.highdatas.mdm.mapper.SysMenuMapper; |
| | | import com.highdatas.mdm.service.ISysMenuService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | return parentIdSet; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public static final String COMMA = " , "; |
| | | public static final String COMMA_TRIM = ","; |
| | | public static final String WHERE_DEFAULT = " 1 = 1 "; |
| | | public static final String WHERE_DEFAULTUN = " 1 <> 1 "; |
| | | public static final String SEGMENT_COMMON = "value = {0}"; |
| | | public static final String SEGMENT_STRING = "value = '{0}'"; |
| | | public static final String EQUAL = " = "; |
| | |
| | | String StructureMenu = "StructureMenu"; |
| | | String tableName = "tableName"; |
| | | String Alias = "{0}.{1}"; |
| | | String extent = "{0}~{1}"; |
| | | String FieldAsAlias = "{0} AS {1}"; |
| | | String caseWhen = " case when a2.{0} != null then a2.{0} else a1.{0} end as {0}"; |
| | | String H = "h"; |
| | |
| | | String Default = "default"; |
| | | String USERID = "user_id"; |
| | | String FIELD = "field"; |
| | | String DISTINCT = "distinct {0}"; |
| | | String InSql = "{0} in ( {1} )"; |
| | | } |
| | |
| | | public static TUser getUser(HttpServletRequest request) { |
| | | return (TUser) request.getSession().getAttribute(Constant.USER); |
| | | } |
| | | |
| | | public static ArrayList<String> getRoleByUser(String userId) { |
| | | ArrayList<String> roleIds = new ArrayList<>(); |
| | | roleIds.add("ROO1"); |
| | | return roleIds; |
| | | } |
| | | } |
| | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/data_admin?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true |
| | | url: jdbc:mysql://localhost:3306/mdm?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: 123456 |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | |
| | | unbigdata: |
| | | db: |
| | | host: localhost |
| | | url: jdbc:mysql://localhost:3306/data_admin?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true |
| | | url: jdbc:mysql://localhost:3306/mdm?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true |
| | | type: MYSQL |
| | | port: 3306 |
| | | schema: mdm |
| | |
| | | spring: |
| | | profiles: |
| | | active: |
| | | dev |
| | | prod |
| | | |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | |
| | | <select id="selectActMemberShip" parameterType="java.util.Map" resultType="java.util.Map"> |
| | | select * from act_id_membership where USER_ID_ = #{userId} and GROUP_ID_ = #{roleId} |
| | | </select> |
| | | |
| | | <select id="getOneTempFieldDataByMaintainExtent" statementType="STATEMENT" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT DISTINCT ${field} FROM ${tempTableName} t WHERE EXISTS ( |
| | | SELECT pre_merge_id FROM ( SELECT pre_merge_id FROM maintain_detail WHERE EXISTS ( |
| | | SELECT id FROM ( SELECT id FROM `maintain` WHERE |
| | | table_name = ${tableName} |
| | | AND order_no >= ${fromOrderNo} |
| | | AND order_no < ${toOrderNo} |
| | | ) a |
| | | WHERE |
| | | a.id = maintain_detail.parent_id ) |
| | | ) a |
| | | WHERE t.id = a.pre_merge_id) |
| | | |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getTempDataByMaintainExtent" statementType="STATEMENT" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT * FROM ${tempTableName} t WHERE EXISTS ( |
| | | SELECT pre_merge_id FROM ( SELECT pre_merge_id FROM maintain_detail WHERE EXISTS ( |
| | | SELECT id FROM ( SELECT id FROM `maintain` WHERE |
| | | table_name = ${tableName} |
| | | AND order_no >= ${fromOrderNo} |
| | | AND order_no < ${toOrderNo} |
| | | ) a |
| | | WHERE |
| | | a.id = maintain_detail.parent_id ) |
| | | ) a |
| | | WHERE t.id = a.pre_merge_id) |
| | | |
| | | ]]> |
| | | </select> |
| | | </mapper> |