| | |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.pentaho.reporting.libraries.formula.function.text.StringCountFunction; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | 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(nowVersion.getVersion()); |
| | | }else if(version.equalsIgnoreCase(Constant.MAX)){ |
| | | findMax = true; |
| | | version = String.valueOf(maintainService.getMaxVersion(tableName).getVersion()); |
| | | Maintain maxVersion = maintainService.getMaxVersion(tableName); |
| | | if (maxVersion == null) { |
| | | return Result.success(null); |
| | | } |
| | | 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) |
| | |
| | | return masterDataService.delete(tableName, whereSegment); |
| | | } |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | |
| | | } |