Merge branch 'develop_migration' into 'develop_master'
feat: There is no way the Buss advanced query See merge request !124
This commit is contained in:
+149
@@ -123,6 +123,155 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
@Autowired
|
||||
private SarBussStandAttrInfoDao sarBussStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private SarBussStandItemsDao sarBussStandItemsEODao;
|
||||
|
||||
@Autowired
|
||||
private StandLawsSearchService standLawsSearchService;
|
||||
|
||||
public ResponseMessage<SarBussionessStand> deleteSarBussionessStand(SarBussionessStandEOPage page) throws Exception {
|
||||
SarBussionessStand sarStandardsInfoEO = new SarBussionessStand();
|
||||
sarStandardsInfoEO.setValidFlag(1);
|
||||
sarStandardsInfoEO.setModifyTime(new Date());
|
||||
for (String id : page.getIdlist()) {
|
||||
//删除标准表
|
||||
sarStandardsInfoEO.setId(id);
|
||||
sarBussionessStandEODao.updateByPrimaryKeySelective(sarStandardsInfoEO);
|
||||
// 删除标准属性表
|
||||
sarBussStandAttrInfoEODao.deleteStandAttrByStandId(id);
|
||||
// 删除条款
|
||||
sarBussStandItemsEODao.deleteByStandIdAndFileType(id,null);
|
||||
// 删除标准台账表
|
||||
// sarBusSarCompileEODao.deleteByBussStandId(id);
|
||||
//删除收藏表中数据
|
||||
personCollectEODao.deleteByResId(id);
|
||||
// 删除分享表中数据
|
||||
// personShareEODao.deleteByResId(id);
|
||||
//删除标准关联的value表
|
||||
sarBussStandValEODao.deleteDataByStandId(id);
|
||||
List<SarBussStandFile> listFile = sarBussStandFileEODao.selectFileByStandId(id);
|
||||
if (listFile != null) {
|
||||
if (!listFile.isEmpty()) {
|
||||
for (int f = 0; f < listFile.size(); f++) {
|
||||
sarBussStandFileEODao.deleteByPrimaryKey(listFile.get(f).getId());
|
||||
//删除文件信息表数据
|
||||
// sarFileInfoEODao.deleteByfileId(listFile.get(f).getId());
|
||||
//删除转换表ot_convert数据
|
||||
otConvertEODao.deleteByAttId(listFile.get(f).getAttId());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(elasflag) {
|
||||
//删除成功后,将索引中对应数据删除
|
||||
StandLawsEO standLawsEO = new StandLawsEO();
|
||||
standLawsEO.setId(sarStandardsInfoEO.getId());
|
||||
standLawsEO.setType("bussstand");
|
||||
standLawsSearchService.deleteStandLawsSearch(standLawsEO);
|
||||
}
|
||||
|
||||
}
|
||||
return Result.success("0", "删除成功", sarStandardsInfoEO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SarBussionessStand> getSarBussionessStand(String exportType, String exportContent,String userId) throws Exception {
|
||||
SarBussionessStandEOPage page = new SarBussionessStandEOPage();
|
||||
if ("apart".equals(exportType)) {
|
||||
page.setIdlist(exportContent.split(","));
|
||||
} else {
|
||||
JSONObject jsonObject = JSONObject.fromObject(exportContent);
|
||||
page = (SarBussionessStandEOPage)JSONObject.toBean(jsonObject, SarBussionessStandEOPage.class);
|
||||
page.setPage(1);
|
||||
page.setPageSize(10000);
|
||||
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
List<SarAdvanceSearchVO> searchList = com.alibaba.fastjson.JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
|
||||
String advanceStr = SarAdvanceSearchUtil.createSql(searchList);
|
||||
if (com.adc.da.util.utils.StringUtils.isNotBlank(advanceStr)) {
|
||||
page.setAdvanceSearchStr(advanceStr);
|
||||
} else {
|
||||
page.setAdvanceSearchStr(null);
|
||||
}
|
||||
}
|
||||
List<String> getMenuIdList = new ArrayList<>();
|
||||
if(userId != null){
|
||||
getMenuIdList= tsUserService.getResourceUserId(userId);
|
||||
}
|
||||
// List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType() + "_STAND", null);
|
||||
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
// List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList("BUSINESS_STAND",page.getMenuId());
|
||||
if(getMenuIdList != null && !getMenuIdList.isEmpty()) {
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
}
|
||||
List<String> ids = sarMenuEOService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
}
|
||||
page.setOrderBy("SAR_BUSSIONESS_STAND.issue_time is null,SAR_BUSSIONESS_STAND.issue_time desc,SAR_BUSSIONESS_STAND.id");
|
||||
if(userId != null){
|
||||
page.setUserId(userId);
|
||||
}else {
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
}
|
||||
List<SarBussionessStand> getList = sarBussionessStandEODao.getSarBussionessStand(page);
|
||||
attrInfoShow(getList);
|
||||
return getList;
|
||||
}
|
||||
|
||||
public void attrInfoShow (List<SarBussionessStand> sarlist) throws Exception {
|
||||
for(SarBussionessStand row : sarlist){
|
||||
attrInfoDetails(row);
|
||||
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
||||
Map<String, Object> getNewMap = new LinkedHashMap<>();
|
||||
if (getAttrMap != null && getAttrMap.size() > 0) {
|
||||
String svppsTip = "";
|
||||
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
String value = "";
|
||||
if ("SVPPS".equals(name)) {
|
||||
Object svpps = entry.getValue();
|
||||
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
|
||||
svppsTip = svpps.toString();
|
||||
}
|
||||
if (StringUtils.isNotBlank(svppsTip)) {
|
||||
svppsTip = sysInfoEOService.getSvppsNamesTipByIds(svppsTip);
|
||||
}
|
||||
value = String.valueOf(getAttrMap.get("SVPPSName"));
|
||||
entry.setValue(value);
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.fileFieldListBuss != null && InitStandAttrUtil.fileFieldListBuss.size() > 0 && InitStandAttrUtil.fileFieldListBuss.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
|
||||
entry.setValue(fileObj);
|
||||
}
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
|
||||
if("ZYQCR".equals(name)||"QTQCR".equals(name)){
|
||||
if(getAttrMap.get(name + "Name")!=null && !getAttrMap.get(name + "Name").equals("")){
|
||||
value = String.valueOf(getAttrMap.get(name + "Name"));
|
||||
}
|
||||
}else{
|
||||
value = String.valueOf(getAttrMap.get(name + "Name"));
|
||||
}
|
||||
} else {
|
||||
List<String> valArr = Arrays.asList(value.split(","));
|
||||
value = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
}
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
getAttrMap.put("SVPPSTips",svppsTip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SarBussionessStand updateSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception {
|
||||
String standId = sarBussionessStandEO.getId();
|
||||
SarBussionessStand beforeStandEO = this.baseMapper.selectByPrimaryKey(standId);
|
||||
|
||||
Reference in New Issue
Block a user