Commit 70077aa4 by huangjinxin

feat:工作队支持修改归属站点

1 parent 5703ce12
...@@ -12,6 +12,7 @@ import com.dituhui.pea.order.entity.OrgWarehouseInfoEntity; ...@@ -12,6 +12,7 @@ import com.dituhui.pea.order.entity.OrgWarehouseInfoEntity;
import com.dituhui.pea.order.service.BusinessTeamService; import com.dituhui.pea.order.service.BusinessTeamService;
import com.dituhui.pea.order.service.CommonService; import com.dituhui.pea.order.service.CommonService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
...@@ -173,6 +174,9 @@ public class BusinessTeamServiceImpl implements BusinessTeamService { ...@@ -173,6 +174,9 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
if (req.getWarehouseId() != null) { if (req.getWarehouseId() != null) {
entity.setWarehouseId(req.getWarehouseId()); entity.setWarehouseId(req.getWarehouseId());
} }
if (StringUtils.isNotBlank(req.getGroupId())) {
entity.setGroupId(req.getGroupId());
}
entity.setUpdateTime(LocalDateTime.now()); entity.setUpdateTime(LocalDateTime.now());
orgTeamDao.save(entity); orgTeamDao.save(entity);
...@@ -215,19 +219,19 @@ public class BusinessTeamServiceImpl implements BusinessTeamService { ...@@ -215,19 +219,19 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
} }
// 遍历新的关系映射,创建新的关系 // 遍历新的关系映射,创建新的关系
for (OrgTeamEngineerEntity newRelation : newRelationsMap.values()) { for (OrgTeamEngineerEntity newRelation : newRelationsMap.values()) {
if (!existingRelations.contains(newRelation)) { if (!existingRelations.contains(newRelation)) {
// 检查是否存在,已经存在的,只需要set status=1就可以了 // 检查是否存在,已经存在的,只需要set status=1就可以了
OrgTeamEngineerEntity exist = orgTeamEngineerDao.findByTeamIdAndEngineerCode(newRelation.getTeamId(), OrgTeamEngineerEntity exist = orgTeamEngineerDao.findByTeamIdAndEngineerCode(newRelation.getTeamId(),
newRelation.getEngineerCode()); newRelation.getEngineerCode());
if (null != exist && exist.getId() != null) { if (null != exist && exist.getId() != null) {
exist.setStatus(1); exist.setStatus(1);
orgTeamEngineerDao.save(exist); orgTeamEngineerDao.save(exist);
} else { } else {
orgTeamEngineerDao.save(newRelation); orgTeamEngineerDao.save(newRelation);
} }
} }
} }
} }
@Override @Override
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!