Commit a2995816 authored by suhuiguang's avatar suhuiguang

1.维保公司修改

parent 1cd43584
...@@ -166,4 +166,8 @@ public interface IMaintenanceCompanyService { ...@@ -166,4 +166,8 @@ public interface IMaintenanceCompanyService {
List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type); List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type);
List<MaintenanceCompany> findByCodeAndType(String code, String type); List<MaintenanceCompany> findByCodeAndType(String code, String type);
List<MaintenanceCompany> findPersonByAmosOrgId(String code, String userId);
MaintenanceCompany getOne(Long parentId);
} }
...@@ -108,8 +108,8 @@ public interface IOrgUsrService { ...@@ -108,8 +108,8 @@ public interface IOrgUsrService {
* @throws Exception * @throws Exception
*/ */
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception; Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg(); List<OrgUsr> selectCompanyDepartmentMsg();
...@@ -145,7 +145,9 @@ public interface IOrgUsrService { ...@@ -145,7 +145,9 @@ public interface IOrgUsrService {
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception; OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception; List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
List<Map<String, Object>> selectForShowByListIdUser(List<Long> ids) throws Exception; List<Map<String, Object>> selectForShowByListIdUser(List<Long> ids) throws Exception;
/** /**
* * @param null * * @param null
* *
...@@ -185,7 +187,7 @@ public interface IOrgUsrService { ...@@ -185,7 +187,7 @@ public interface IOrgUsrService {
List<Map<String, Object>> getparent(); List<Map<String, Object>> getparent();
List<OrgUsrExcelDto> exportToExcel( Map par); List<OrgUsrExcelDto> exportToExcel(Map par);
UserUnitDto getUserUnit(String userId); UserUnitDto getUserUnit(String userId);
...@@ -226,7 +228,7 @@ public interface IOrgUsrService { ...@@ -226,7 +228,7 @@ public interface IOrgUsrService {
* *
* @param orgUserId * @param orgUserId
* @return * @return
* @exception * @throws
*/ */
AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception; AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception;
...@@ -235,12 +237,13 @@ public interface IOrgUsrService { ...@@ -235,12 +237,13 @@ public interface IOrgUsrService {
* *
* @param orgUserIds * @param orgUserIds
* @return * @return
* @exception * @throws
*/ */
List<String> getAmosIdListByOrgUserId(String orgUserIds) throws Exception; List<String> getAmosIdListByOrgUserId(String orgUserIds) throws Exception;
/** /**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name * 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
*
* @param ids * @param ids
* @return * @return
*/ */
...@@ -253,11 +256,11 @@ public interface IOrgUsrService { ...@@ -253,11 +256,11 @@ public interface IOrgUsrService {
OrgUsr selectByAmosOrgId(Long id); OrgUsr selectByAmosOrgId(Long id);
public List<OrgUsr> getPersonListByParentIds(List<String> ids) ; List<OrgUsr> getPersonListByParentIds(List<String> ids);
List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList);
public OrgUsr getDetailById( Long id); List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList);
OrgUsr getDetailById(Long id);
/** /**
......
...@@ -33,14 +33,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -33,14 +33,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -118,7 +111,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -118,7 +111,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.setType(maintenanceCompany.getType().toUpperCase()); maintenanceCompany.setType(maintenanceCompany.getType().toUpperCase());
maintenanceCompany.setIsDelete(false); maintenanceCompany.setIsDelete(false);
this.save(maintenanceCompany); this.save(maintenanceCompany);
if (maintenanceCompany.getAttachments().isEmpty()){ if (maintenanceCompany.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments()); sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments());
} }
return maintenanceCompany; return maintenanceCompany;
...@@ -153,7 +146,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -153,7 +146,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.setParentId(parentId); maintenanceCompany.setParentId(parentId);
maintenanceCompany.setIsDelete(false); maintenanceCompany.setIsDelete(false);
this.save(maintenanceCompany); this.save(maintenanceCompany);
if (maintenanceCompany.getAttachments().isEmpty()){ if (maintenanceCompany.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments()); sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments());
} }
return maintenanceCompany; return maintenanceCompany;
...@@ -187,7 +180,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -187,7 +180,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.setParentId(parentId); maintenanceCompany.setParentId(parentId);
maintenanceCompany.setIsDelete(false); maintenanceCompany.setIsDelete(false);
this.save(maintenanceCompany); this.save(maintenanceCompany);
if (maintenanceCompany.getAttachments().isEmpty()){ if (maintenanceCompany.getAttachments().isEmpty()) {
sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments()); sourceFileService.saveAttachments(maintenanceCompany.getSequenceNbr(), maintenanceCompany.getAttachments());
} }
return maintenanceCompany; return maintenanceCompany;
...@@ -201,10 +194,10 @@ public class MaintenanceCompanyServiceImpl ...@@ -201,10 +194,10 @@ public class MaintenanceCompanyServiceImpl
} }
// 新增删除维保单位逻辑,BUG 2500 单位下有子单位或者人员时应无法直接删除. by litw satrt // 新增删除维保单位逻辑,BUG 2500 单位下有子单位或者人员时应无法直接删除. by litw satrt
LambdaQueryWrapper<MaintenanceCompany> wrapperCompany = new LambdaQueryWrapper<MaintenanceCompany>(); LambdaQueryWrapper<MaintenanceCompany> wrapperCompany = new LambdaQueryWrapper<MaintenanceCompany>();
wrapperCompany.eq(MaintenanceCompany::getParentId,sequenceNbr); wrapperCompany.eq(MaintenanceCompany::getParentId, sequenceNbr);
wrapperCompany.eq(MaintenanceCompany::getIsDelete,false); wrapperCompany.eq(MaintenanceCompany::getIsDelete, false);
int count = maintenanceCompanyMapper.selectCount(wrapperCompany); int count = maintenanceCompanyMapper.selectCount(wrapperCompany);
if(count > 0) { if (count > 0) {
throw new BadRequest("单位下有子单位或者人员,无法删除"); throw new BadRequest("单位下有子单位或者人员,无法删除");
} }
...@@ -273,7 +266,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -273,7 +266,7 @@ public class MaintenanceCompanyServiceImpl
dynamicFormList.forEach(r -> { dynamicFormList.forEach(r -> {
MaintenanceCompany detail = maintenanceCompanyMap.get(Long.parseLong(r.get("instanceId").toString())); MaintenanceCompany detail = maintenanceCompanyMap.get(Long.parseLong(r.get("instanceId").toString()));
if (!ObjectUtils.isEmpty(detail)) { if (!ObjectUtils.isEmpty(detail)) {
if(detail.getParentId()!=null) { if (detail.getParentId() != null) {
MaintenanceCompany map = maintenanceCompanyMapper.selectById(detail.getParentId()); MaintenanceCompany map = maintenanceCompanyMapper.selectById(detail.getParentId());
r.put("parentName", map.getName()); r.put("parentName", map.getName());
} }
...@@ -282,7 +275,8 @@ public class MaintenanceCompanyServiceImpl ...@@ -282,7 +275,8 @@ public class MaintenanceCompanyServiceImpl
}); });
return dynamicFormList; return dynamicFormList;
} }
public List<Map<String, Object>> getAllMaintenanceEexcleList(String maintenanceType,Map parms) {
public List<Map<String, Object>> getAllMaintenanceEexcleList(String maintenanceType, Map parms) {
String type = null; String type = null;
switch (maintenanceType.toUpperCase()) { switch (maintenanceType.toUpperCase()) {
case PERSON: case PERSON:
...@@ -301,13 +295,13 @@ public class MaintenanceCompanyServiceImpl ...@@ -301,13 +295,13 @@ public class MaintenanceCompanyServiceImpl
LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>(); LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>();
wrapper.eq(MaintenanceCompany::getType, maintenanceType.toUpperCase()); wrapper.eq(MaintenanceCompany::getType, maintenanceType.toUpperCase());
wrapper.eq(MaintenanceCompany::getIsDelete, false); wrapper.eq(MaintenanceCompany::getIsDelete, false);
if(parms!=null && parms.size()>0) { if (parms != null && parms.size() > 0) {
String name =parms.containsKey("name")?parms.get("name").toString():null; String name = parms.containsKey("name") ? parms.get("name").toString() : null;
String parentId =parms.containsKey("parentId")?parms.get("parentId").toString():null; String parentId = parms.containsKey("parentId") ? parms.get("parentId").toString() : null;
if(name!=null) { if (name != null) {
wrapper.like(MaintenanceCompany::getName, name); wrapper.like(MaintenanceCompany::getName, name);
} }
if(parentId!=null) { if (parentId != null) {
wrapper.eq(MaintenanceCompany::getParentId, parentId); wrapper.eq(MaintenanceCompany::getParentId, parentId);
} }
...@@ -319,18 +313,19 @@ public class MaintenanceCompanyServiceImpl ...@@ -319,18 +313,19 @@ public class MaintenanceCompanyServiceImpl
dynamicFormList.forEach(r -> { dynamicFormList.forEach(r -> {
MaintenanceCompany detail = maintenanceCompanyMap.get(Long.parseLong(r.get("instanceId").toString())); MaintenanceCompany detail = maintenanceCompanyMap.get(Long.parseLong(r.get("instanceId").toString()));
if (!ObjectUtils.isEmpty(detail)) { if (!ObjectUtils.isEmpty(detail)) {
if(detail.getParentId()!=null && detail.getName()!=null) { if (detail.getParentId() != null && detail.getName() != null) {
MaintenanceCompany map = maintenanceCompanyMapper.selectById(detail.getParentId()); MaintenanceCompany map = maintenanceCompanyMapper.selectById(detail.getParentId());
r.put("parentName", map.getName()); r.put("parentName", map.getName());
r.putAll(Bean.BeantoMap(detail)); r.putAll(Bean.BeantoMap(detail));
} }
} }
}); });
return dynamicFormList.stream().filter(i-> i.containsKey("name")).collect(Collectors.toList()); return dynamicFormList.stream().filter(i -> i.containsKey("name")).collect(Collectors.toList());
} }
@Override @Override
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map map) { public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map map) {
List<Map<String, Object>> list = this.getAllMaintenanceEexcleList(PERSON,map); List<Map<String, Object>> list = this.getAllMaintenanceEexcleList(PERSON, map);
return JSONArray.parseArray(JSONArray.toJSONString(list), MaintenancePersonExcleDto.class); return JSONArray.parseArray(JSONArray.toJSONString(list), MaintenancePersonExcleDto.class);
} }
...@@ -352,6 +347,19 @@ public class MaintenanceCompanyServiceImpl ...@@ -352,6 +347,19 @@ public class MaintenanceCompanyServiceImpl
return Lists.newArrayList(); return Lists.newArrayList();
} }
@Override
public List<MaintenanceCompany> findPersonByAmosOrgId(String code, String userId) {
LambdaQueryWrapper<MaintenanceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(MaintenanceCompany::getType, code);
queryWrapper.eq(MaintenanceCompany::getAmosId, userId);
return this.baseMapper.selectList(queryWrapper);
}
@Override
public MaintenanceCompany getOne(Long parentId) {
return this.getById(parentId);
}
/** /**
* 维保单位人员信息分頁信息显示时的字段过滤 * 维保单位人员信息分頁信息显示时的字段过滤
* *
...@@ -407,7 +415,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -407,7 +415,7 @@ public class MaintenanceCompanyServiceImpl
} }
mainTableList = this.checkMaintenanceCompanyList(wrapper, paramsMap); mainTableList = this.checkMaintenanceCompanyList(wrapper, paramsMap);
/*BUG 2503 人员头像存在附件中,获取附件信息返回前端 start*/ /*BUG 2503 人员头像存在附件中,获取附件信息返回前端 start*/
for (MaintenanceCompany m:mainTableList for (MaintenanceCompany m : mainTableList
) { ) {
m.setAttachments(sourceFileService.getAttachments(m.getSequenceNbr())); m.setAttachments(sourceFileService.getAttachments(m.getSequenceNbr()));
} }
...@@ -523,7 +531,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -523,7 +531,7 @@ public class MaintenanceCompanyServiceImpl
parentCode = parent.getCode(); parentCode = parent.getCode();
} }
// 旧父节点的code // 旧父节点的code
if(company.getCode() != null){ if (company.getCode() != null) {
String oldParentCode = company.getCode().substring(0, company.getCode().length() - TreeParser.CODE_LENGTH); String oldParentCode = company.getCode().substring(0, company.getCode().length() - TreeParser.CODE_LENGTH);
List<MaintenanceCompany> children = List<MaintenanceCompany> children =
list(new LambdaQueryWrapper<MaintenanceCompany>().eq(MaintenanceCompany::getIsDelete, false).likeRight(MaintenanceCompany::getCode, company.getCode()).ne(MaintenanceCompany::getSequenceNbr, company.getSequenceNbr())); list(new LambdaQueryWrapper<MaintenanceCompany>().eq(MaintenanceCompany::getIsDelete, false).likeRight(MaintenanceCompany::getCode, company.getCode()).ne(MaintenanceCompany::getSequenceNbr, company.getSequenceNbr()));
...@@ -721,9 +729,9 @@ public class MaintenanceCompanyServiceImpl ...@@ -721,9 +729,9 @@ public class MaintenanceCompanyServiceImpl
/** /**
* 复制map对象 * 复制map对象
* *
* @explain 将paramsMap中的键值对全部拷贝到resultMap中;
* @param paramsMap 被拷贝对象 * @param paramsMap 被拷贝对象
* @param resultMap 拷贝后的对象 * @param resultMap 拷贝后的对象
* @explain 将paramsMap中的键值对全部拷贝到resultMap中;
*/ */
private static void mapCopy(Map paramsMap, Map resultMap) { private static void mapCopy(Map paramsMap, Map resultMap) {
if (resultMap == null) { if (resultMap == null) {
......
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