feat: 迁移企业标准库 国内外标准库 懒加载 树结构

This commit is contained in:
super_liu
2021-07-21 19:14:22 +08:00
parent 706b6ce264
commit 4dfb0039ad
17 changed files with 810 additions and 12 deletions
@@ -1,12 +1,28 @@
package com.adc.da.slrs.sarBussionessStand.controller;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.adc.da.sys.util.LoginUserUtil;
import com.adc.da.http.PageInfo;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.util.utils.StringUtils;
import com.adc.da.utils.util.SarAdvanceSearchUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import java.util.List;
/**
* <p>
* 企业标准信息表 前端控制器
@@ -20,4 +36,48 @@ import com.adc.da.base.web.BaseController;
@RequestMapping("/${restPath}/lawss/sarBussionessStand")
public class SarBussionessStandController extends BaseController<SarBussionessStand> {
@Autowired
private ISarBussionessStandService sarBussionessStandEOService;
@Autowired
private ITsResourceService iTsResourceService;
/**
* 自定义分页查询列表
* @param page 标准信息
* @return
* @author gaoyan
* date 2018-09-04
*/
@ApiOperation(value = "|SarBussionessStandEO|自定义分页查询列表")
@GetMapping("/getSarBussionStandPage")
//@RequiresPermissions("lawss:sarBussionessStand:getSarBussionStandPage")
public ResponseMessage<PageInfo<SarBussionessStand>> getSarBussionStandPage(SarBussionessStandEOPage page) throws Exception {
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
String advanceStr = SarAdvanceSearchUtil.createSql(searchList);
if (StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
page.setAdvanceSearchStr(null);
}
}
page.setUserId(LoginUserUtil.getUserId());
if(StringUtils.isNotBlank(page.getPaixu())){
String sql = page.getPaixu()+" "+page.getShunxu();
page.setSql(sql);
}else{
page.setOrderBy("SAR_BUSSIONESS_STAND.issue_time is null,SAR_BUSSIONESS_STAND.issue_time desc,SAR_BUSSIONESS_STAND.id");
}
List<String> getMenuIdList = iTsResourceService.queryRoleMenuIdList("BUSINESS_STAND",page.getMenuId());
if(getMenuIdList != null && !getMenuIdList.isEmpty()){
page.setMenuRoleList(getMenuIdList);
List<SarBussionessStand> rows = sarBussionessStandEOService.getSarBussionStandPage(page);
return Result.success(getPageInfo(page.getPager(), rows));
} else {
return Result.success(getPageInfo(page.getPager(), null));
}
}
}
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarBussionessStand.dao;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -14,7 +15,13 @@ import java.util.List;
* @author super_liu
* @since 2021-07-13
*/
@Repository
public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage);
int getBussionessStandInfoCount(SarBussionessStandEOPage page);
List<SarBussionessStand> getBussionessStandInfoPage(SarBussionessStandEOPage page);
}
@@ -17,4 +17,6 @@ import java.util.List;
public interface ISarBussionessStandService extends IService<SarBussionessStand> {
List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage);
List<SarBussionessStand> getSarBussionStandPage(SarBussionessStandEOPage page) throws Exception;
}
@@ -1,13 +1,28 @@
package com.adc.da.slrs.sarBussionessStand.service.impl;
import com.adc.da.common.SelectionTypeEnum;
import com.adc.da.person.service.IPersonCollectEOService;
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Clob;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
@@ -20,6 +35,110 @@ import java.util.List;
@Service
public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStandDao, SarBussionessStand> implements ISarBussionessStandService {
@Autowired
private ITsUserService tsUserService;
@Autowired
private ITsResourceService iTsResourceService;
@Autowired
private SysInfoEOService sysInfoEOService;
@Autowired
private IPersonCollectEOService personCollectEOService;
@Autowired
private SarBussStandAttrInfoDao sarBussStandAttrInfoEODao;
@Override
public List<SarBussionessStand> getSarBussionStandPage(SarBussionessStandEOPage page) throws Exception {
if (StringUtils.isNotBlank(page.getMenuId())) {
List<String> getMenuIdList = tsUserService.getResourceId(new TsResource());
// List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType() + "_STAND", null);
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
}
}
Integer rowCount = this.baseMapper.getBussionessStandInfoCount(page);
page.getPager().setRowCount(rowCount);
List<SarBussionessStand> sarlist = this.baseMapper.getBussionessStandInfoPage(page);
attrInfo(sarlist);
return sarlist;
}
/***
* @Description: 处理属性表数据
* @Param: [sarlist]
* @Return: void
*/
public void attrInfo (List<SarBussionessStand> sarlist) throws Exception {
for(SarBussionessStand row : sarlist){
attrInfoDetails(row);
}
}
public void attrInfoDetails (SarBussionessStand row) throws Exception {
String fieldInfo = InitStandAttrUtil.queryFieldBuss;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
row.setCollectId(collectId);
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarBussStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId());
if (InitStandAttrUtil.clobFieldListBuss != null && !InitStandAttrUtil.clobFieldListBuss.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldListBuss) {
Clob clobValue = (Clob) getAttrMap.get(clobField);
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
getAttrMap.put(clobField,fieldValue);
}
}
// 组织机构和人员
Map<String,Object> newMap = new HashMap<>();
if(getAttrMap != null){
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
Object value1 = entry.getValue();
if (value1 != null && value1.toString().equals("\"null\"")){
entry.setValue("");
}
if ("SVPPS".equals(name)) {
Object value = entry.getValue();
if (value != null && StringUtils.isNotBlank(value.toString())) {
value = sysInfoEOService.getSvppsNamesByIds(value.toString());
}
newMap.put(name + "Name",value);
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
String value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getOrgNamesByIds(value);
newMap.put(name + "Name",value);
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getUserNamesByIds(value);
newMap.put(name + "Name",value);
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
value = sysInfoEOService.getRoleNamesByIds(value);
newMap.put(name + "Name",value);
}
}
}
getAttrMap.putAll(newMap);
}
row.setAttrInfoMap(getAttrMap);
}
}
@Override
public List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage){
return this.baseMapper.queryByList(sarBussionessStandEOPage);