Commit 9cc8324f authored by gaodongdong's avatar gaodongdong

删除沉余代码

parent b9d57abb
package com.yeejoin.amos.boot.module.jcs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum OrgPersonEnum {
公司("COMPANY", "244", "公司"),
部门("DEPARTMENT", "245", "部门"),
人员("PERSON", "246", "人员");
private String key;
private String code;
private String name;
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto; import java.lang.reflect.Method;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService; import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo; import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
...@@ -26,25 +44,6 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo; ...@@ -26,25 +44,6 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 机构/部门/人员表 服务实现类 * 机构/部门/人员表 服务实现类
* *
...@@ -58,10 +57,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -58,10 +57,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
AlertFormValueServiceImpl alertFormValueServiceImpl; AlertFormValueServiceImpl alertFormValueServiceImpl;
@Autowired @Autowired
AlertFormServiceImpl alertFormServiceImpl; AlertFormServiceImpl alertFormServiceImpl;
@Autowired
AlertFormValueServiceImpl iAlertFromValueService;
@Autowired
AlertFormServiceImpl iAlertFormServiceImpl;
@Override @Override
public String selectUpUnitByParam(String id) { public String selectUpUnitByParam(String id) {
...@@ -69,10 +64,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -69,10 +64,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
@SuppressWarnings("unchecked")
public List<OrgMenuVo> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception { public List<OrgMenuVo> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception {
List<OrgMenuVo> resultList = new ArrayList<>(); List<OrgMenuVo> resultList = new ArrayList<>();
Class clazz = Class.forName(packageURL); Class<?> clazz = Class.forName(packageURL);
Method IDMethodNameme = null; Method IDMethodNameme = null;
switch (IDHierarchy) { switch (IDHierarchy) {
case 1: case 1:
...@@ -178,7 +172,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -178,7 +172,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception { public List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception {
List<Map<String, Object>> companyPersonMsg = new ArrayList<>(); List<Map<String, Object>> companyPersonMsg = new ArrayList<>();
for (int i = 0; i < ids.size(); i++) { for (int i = 0; i < ids.size(); i++) {
Map<String, Object> columnMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
// 查询出单位基本信息 // 查询出单位基本信息
OrgUsr company = getById(ids.get(i)); OrgUsr company = getById(ids.get(i));
...@@ -192,7 +185,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -192,7 +185,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
downUnitColumnMap.put("is_delete", CommonConstant.IS_DELETE_00); downUnitColumnMap.put("is_delete", CommonConstant.IS_DELETE_00);
downUnitColumnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_COMPANY); downUnitColumnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_COMPANY);
downUnitColumnMap.put("parent_id", company.getSequenceNbr()); downUnitColumnMap.put("parent_id", company.getSequenceNbr());
QueryWrapper downUnitWrapper = new QueryWrapper<OrgUsr>(); QueryWrapper<OrgUsr> downUnitWrapper = new QueryWrapper<OrgUsr>();
downUnitWrapper.allEq(downUnitColumnMap); downUnitWrapper.allEq(downUnitColumnMap);
List<OrgUsr> downList = list(downUnitWrapper); List<OrgUsr> downList = list(downUnitWrapper);
if (downList.size() == 0) { if (downList.size() == 0) {
...@@ -204,10 +197,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -204,10 +197,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, Object> countPerson = new HashMap<>(); Map<String, Object> countPerson = new HashMap<>();
countPerson.put("parent_id", company.getSequenceNbr()); countPerson.put("parent_id", company.getSequenceNbr());
countPerson.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON); countPerson.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
QueryWrapper personNumWrapper = new QueryWrapper<Integer>(); QueryWrapper<OrgUsr> personNumWrapper = new QueryWrapper<OrgUsr>();
personNumWrapper.allEq(countPerson); personNumWrapper.allEq(countPerson);
resultMap.put("personNum", count(personNumWrapper)); resultMap.put("personNum", count(personNumWrapper));
QueryWrapper companyWrapper = new QueryWrapper<AlertFormValue>(); QueryWrapper<AlertFormValue> companyWrapper = new QueryWrapper<AlertFormValue>();
companyWrapper.eq("alert_called_id", company.getSequenceNbr()); companyWrapper.eq("alert_called_id", company.getSequenceNbr());
List<Map<String, Object>> personList = new ArrayList<>(); List<Map<String, Object>> personList = new ArrayList<>();
if (alertFormValueServiceImpl.list(companyWrapper).size() != 0) { if (alertFormValueServiceImpl.list(companyWrapper).size() != 0) {
...@@ -215,7 +208,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -215,7 +208,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, Object> phone = new HashMap<>(); Map<String, Object> phone = new HashMap<>();
phone.put("alert_called_id", company.getSequenceNbr()); phone.put("alert_called_id", company.getSequenceNbr());
phone.put("field_code", "companyPhone"); phone.put("field_code", "companyPhone");
QueryWrapper phoneWrapper = new QueryWrapper<AlertFormValue>(); QueryWrapper<AlertFormValue> phoneWrapper = new QueryWrapper<AlertFormValue>();
phoneWrapper.allEq(phone); phoneWrapper.allEq(phone);
AlertFormValue phoneValue = alertFormValueServiceImpl.getOne(phoneWrapper); AlertFormValue phoneValue = alertFormValueServiceImpl.getOne(phoneWrapper);
if (phoneValue == null) { if (phoneValue == null) {
...@@ -244,8 +237,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -244,8 +237,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<Map<String, Object>> listPerson(String parentId) { public List<Map<String, Object>> listPerson(String parentId) {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
map.put("fields", alertFormServiceImpl.queryListByFormId("246")); map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
map.put("bizOrgType", "PERSON"); map.put("bizOrgType", OrgPersonEnum.人员.getKey());
map.put("parentId", parentId); map.put("parentId", parentId);
List<Map<String, Object>> list = this.baseMapper.selectPersonAllList(map); List<Map<String, Object>> list = this.baseMapper.selectPersonAllList(map);
return list == null ? new ArrayList<Map<String, Object>>() : list; return list == null ? new ArrayList<Map<String, Object>>() : list;
...@@ -259,7 +252,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -259,7 +252,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize)); pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
} }
QueryWrapper<OrgUsr> orgUsrQueryWrapper = new QueryWrapper<>(); QueryWrapper<OrgUsr> orgUsrQueryWrapper = new QueryWrapper<>();
orgUsr.setBizOrgType("PERSON"); orgUsr.setBizOrgType(OrgPersonEnum.人员.getKey());
Class<? extends OrgUsr> aClass = orgUsr.getClass(); Class<? extends OrgUsr> aClass = orgUsr.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> { Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try { try {
...@@ -289,8 +282,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -289,8 +282,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, Object> map = Bean.BeantoMap(orgUsr); Map<String, Object> map = Bean.BeantoMap(orgUsr);
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize()); map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize()); map.put("pageSize", pageBean.getSize());
map.put("fields", alertFormServiceImpl.queryListByFormId("246")); map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
map.put("bizOrgType", "PERSON"); map.put("bizOrgType", OrgPersonEnum.人员.getKey());
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map); List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
pageBean.setRecords(list); pageBean.setRecords(list);
...@@ -300,8 +293,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -300,8 +293,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public List<FormValue> getFormValue(Long id) throws Exception { public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据 // 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id); List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList(); List<FormValue> formValue = new ArrayList<>();
for (AlertFormValueVo alertFormValue : list) { for (AlertFormValueVo alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) { if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(), FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
...@@ -318,8 +311,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -318,8 +311,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<FormValue> getFormValueDetail(Long id) throws Exception { public List<FormValue> getFormValueDetail(Long id) throws Exception {
// 动态表单数据 // 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id); List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList(); List<FormValue> formValue = new ArrayList<>();
for (AlertFormValueVo alertFormValue : list) { for (AlertFormValueVo alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(), FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getIsBlock()); alertFormValue.getFieldValue(), alertFormValue.getIsBlock());
...@@ -380,10 +373,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -380,10 +373,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 保存动态表单数据 // 保存动态表单数据
alertFormValueServiceImpl.updateBatchById(alertFromValuelist); alertFormValueServiceImpl.updateBatchById(alertFromValuelist);
} else { } else {
// 填充主键
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
// 保存动态表单数据 // 保存动态表单数据
alertFormValueServiceImpl.saveBatch(alertFromValuelist); alertFormValueServiceImpl.saveBatch(alertFromValuelist);
} }
...@@ -391,12 +380,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -391,12 +380,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception { public Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception {
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper<AlertForm> queryWrapper = new QueryWrapper<AlertForm>();
queryWrapper.eq("alert_type_code",246); queryWrapper.eq("alert_type_code",OrgPersonEnum.人员.getCode());
List<AlertForm> alertForms = iAlertFormServiceImpl.list(queryWrapper); List<AlertForm> alertForms = alertFormServiceImpl.list(queryWrapper);
// 动态表单数据 // 动态表单数据
List<AlertFormValueVo> list = iAlertFromValueService.listByCalledId(id); List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList();
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result = Bean.BeantoMap(orgUsr); result = Bean.BeantoMap(orgUsr);
// 放入所有动态表单数据 // 放入所有动态表单数据
...@@ -477,18 +465,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -477,18 +465,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public IPage bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception { public IPage<OrgUsr> bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception {
Map<String, Object> columnMap = new HashMap<>(); Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00); columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", bizOrgType); columnMap.put("biz_org_type", bizOrgType);
Page<OrgUsr> pageBean = new Page(); Page<OrgUsr> pageBean = new Page<OrgUsr>();
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) { if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE); pageBean = new Page<>(0, Long.MAX_VALUE);
} else { } else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize)); pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
} }
QueryWrapper queryWrapper = new QueryWrapper<OrgUsr>(); QueryWrapper<OrgUsr> queryWrapper = new QueryWrapper<OrgUsr>();
queryWrapper.allEq(columnMap); queryWrapper.allEq(columnMap);
queryWrapper.orderByAsc("sequence_nbr"); queryWrapper.orderByAsc("sequence_nbr");
return page(pageBean, queryWrapper); return page(pageBean, queryWrapper);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment