|
@@ -3,11 +3,16 @@ package com.jeeplus.test.cw.reimbursementApproval.approvalType.service;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.jeeplus.core.domain.BaseEntity;
|
|
import com.jeeplus.core.domain.BaseEntity;
|
|
|
|
+import com.jeeplus.sys.service.dto.OfficeDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
|
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO;
|
|
|
|
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper;
|
|
import com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper;
|
|
|
|
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientContact;
|
|
|
|
+import org.apache.commons.compress.utils.Lists;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -37,7 +42,25 @@ public class CwReimbursementTypeService {
|
|
|
|
|
|
wrapper.eq(BaseEntity::getDelFlag, 0);
|
|
wrapper.eq(BaseEntity::getDelFlag, 0);
|
|
wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
|
|
wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
|
|
- return mapper.selectList(wrapper);
|
|
|
|
|
|
+ return mapper.findList(wrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据id查询项目详情
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public CwReimbursementTypeInfo getById(String id) {
|
|
|
|
+ CwReimbursementTypeInfo info = mapper.getById(id);
|
|
|
|
+ if(null != info.getOfficeDTOList() && info.getOfficeDTOList().size()>0){
|
|
|
|
+ List<String> officeIdList = Lists.newArrayList();
|
|
|
|
+ for (OfficeDTO office : info.getOfficeDTOList()) {
|
|
|
|
+ officeIdList.add(office.getId());
|
|
|
|
+ }
|
|
|
|
+ info.setOfficeIdList(officeIdList);
|
|
|
|
+ }
|
|
|
|
+ return info;
|
|
}
|
|
}
|
|
|
|
|
|
public List<CwReimbursementTypeInfo> bxList(CwReimbursementTypeInfo info) {
|
|
public List<CwReimbursementTypeInfo> bxList(CwReimbursementTypeInfo info) {
|
|
@@ -53,7 +76,6 @@ public class CwReimbursementTypeService {
|
|
if (info.getSort() != null) {
|
|
if (info.getSort() != null) {
|
|
wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
|
|
wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
|
|
}
|
|
}
|
|
- wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "1");
|
|
|
|
|
|
|
|
wrapper.eq(BaseEntity::getDelFlag, 0);
|
|
wrapper.eq(BaseEntity::getDelFlag, 0);
|
|
wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
|
|
wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
|
|
@@ -68,7 +90,6 @@ public class CwReimbursementTypeService {
|
|
if (info.getSort() != null) {
|
|
if (info.getSort() != null) {
|
|
wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
|
|
wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
|
|
}
|
|
}
|
|
- wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "2");
|
|
|
|
|
|
|
|
wrapper.eq(BaseEntity::getDelFlag, 0);
|
|
wrapper.eq(BaseEntity::getDelFlag, 0);
|
|
wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
|
|
wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
|
|
@@ -124,18 +145,14 @@ public class CwReimbursementTypeService {
|
|
UserDTO userDto = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDto = UserUtils.getCurrentUserDTO();
|
|
info.setUpdateBy(userDto.getId());
|
|
info.setUpdateBy(userDto.getId());
|
|
info.setUpdateDate(new Date());
|
|
info.setUpdateDate(new Date());
|
|
- //父级
|
|
|
|
- if (info.getParentId().equals("0")){
|
|
|
|
- //修改所有子集的业务类型
|
|
|
|
- List<String> childId = mapper.getChildId(info.getId());
|
|
|
|
- childId.forEach(chidId->{
|
|
|
|
- //修改子级的子级
|
|
|
|
- mapper.updateChildBusType(chidId,info.getBusinessType());
|
|
|
|
- });
|
|
|
|
- //修改子级
|
|
|
|
- mapper.updateChildBusType(info.getId(),info.getBusinessType());
|
|
|
|
|
|
+ //对关联的公司id进行处理
|
|
|
|
+ if (null != info.getOfficeIdList() && info.getOfficeIdList().size()>0) {
|
|
|
|
+ //首先删除原有关联信息
|
|
|
|
+ mapper.deleteReimbursementTypeOfficeInfo(info.getId());
|
|
|
|
+ //将新的关联信息进行保存
|
|
|
|
+ mapper.saveReimbursementTypeOfficeInfo(info.getId(),info.getOfficeIdList());
|
|
|
|
+ info.setOfficeIdList(null);
|
|
}
|
|
}
|
|
-
|
|
|
|
mapper.updateById(info);
|
|
mapper.updateById(info);
|
|
return "操作完成";
|
|
return "操作完成";
|
|
}
|
|
}
|