Commit a81bbd7f by huangjinxin

fix:小组数据同步优化

1 parent ecbf6aa3
...@@ -22,6 +22,8 @@ public enum BeanOrgLevelEnum implements IResult { ...@@ -22,6 +22,8 @@ public enum BeanOrgLevelEnum implements IResult {
STATION("STATION", "分站"), STATION("STATION", "分站"),
GROUP("GROUP", "小组"),
PERIPHERY("PERIPHERY", "外围"), PERIPHERY("PERIPHERY", "外围"),
REPAIR_CENTER("REPAIR_CENTER", "寄修中心"), REPAIR_CENTER("REPAIR_CENTER", "寄修中心"),
......
...@@ -495,6 +495,9 @@ public class BeanRemoteServiceImpl { ...@@ -495,6 +495,9 @@ public class BeanRemoteServiceImpl {
if (data.getDeptType().equals(BeanOrgLevelEnum.STATION.getCode())) { if (data.getDeptType().equals(BeanOrgLevelEnum.STATION.getCode())) {
groupEntity.setKind(1); groupEntity.setKind(1);
} }
if (data.getDeptType().equals(BeanOrgLevelEnum.GROUP.getCode())) {
groupEntity.setKind(3);
}
groupEntity.setCategory(1); groupEntity.setCategory(1);
groupEntity.setBsDeptId(data.getBsDeptId()); groupEntity.setBsDeptId(data.getBsDeptId());
orgGroupDao.save(groupEntity); orgGroupDao.save(groupEntity);
......
...@@ -273,6 +273,9 @@ public class FendanServiceImpl implements FendanService { ...@@ -273,6 +273,9 @@ public class FendanServiceImpl implements FendanService {
List<OrgTeamEntity> teamList = orgTeamDao.findByTeamIdIn(teamIdList); List<OrgTeamEntity> teamList = orgTeamDao.findByTeamIdIn(teamIdList);
Map<String, OrgTeamEntity> teamMap = teamList.stream().collect(Collectors.toMap(OrgTeamEntity::getTeamId, e -> e)); Map<String, OrgTeamEntity> teamMap = teamList.stream().collect(Collectors.toMap(OrgTeamEntity::getTeamId, e -> e));
List<OrgGroupEntity> orgGroupList = orgGroupDao.findByTeamIdIn(teamIdList); List<OrgGroupEntity> orgGroupList = orgGroupDao.findByTeamIdIn(teamIdList);
if (CollectionUtils.isEmpty(orgGroupList)) {
return Result.failed(StatusCodeEnum.FENDAN_TEAM_UNMATCHED);
}
for (OrgGroupEntity orgGroupEntity : orgGroupList) { for (OrgGroupEntity orgGroupEntity : orgGroupList) {
OrgGroupInfo orgGroup = BeanUtil.copyProperties(orgGroupEntity, OrgGroupInfo.class); OrgGroupInfo orgGroup = BeanUtil.copyProperties(orgGroupEntity, OrgGroupInfo.class);
MapBlockInfoEntity allLayer = null; MapBlockInfoEntity allLayer = null;
......
...@@ -170,6 +170,7 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -170,6 +170,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
@Override @Override
@Transactional @Transactional
public Result<?> orderStageChanged(OrderDTO.StageChangeRequest request) { public Result<?> orderStageChanged(OrderDTO.StageChangeRequest request) {
log.info("[orderStageChanged] orderId:{}, req: {}", request.getOrderId(), JSONObject.toJSONString(request));
final String orderId = request.getOrderId(); final String orderId = request.getOrderId();
OrderInfoEntity orderInfo = orderInfoDao.getByOrderId(orderId); OrderInfoEntity orderInfo = orderInfoDao.getByOrderId(orderId);
//判断是否是正常流程,正常流程只需要更新状态 //判断是否是正常流程,正常流程只需要更新状态
...@@ -249,6 +250,7 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -249,6 +250,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return this.orderReschedule(reschedule); return this.orderReschedule(reschedule);
} }
log.info("[orderStageChanged] orderId:{}, 操作成功", request.getOrderId());
return Result.success(null); return Result.success(null);
} }
...@@ -485,6 +487,7 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -485,6 +487,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
// 登记事件 // 登记事件
commonService.addOrderEvent(req.getOrderId(), "", req.getOperator(), req.getOperator(), OrderEventEnum.recontracting.getEvent(), String.format(OrderEventEnum.recontracting.getMsg(), engineerName + "-" + (ObjectUtil.isNotNull(orgTeamEntity) ? orgTeamEntity.getTeamName() : ""), ObjectUtil.isNotNull(orgGroupEntity) ? orgGroupEntity.getGroupName() : "", req.getExpectBegin(), req.getReschedulingReason()), StringUtils.isNotBlank(req.getReschedulingReason()) ? "改约原因:" + req.getReschedulingReason() : ""); commonService.addOrderEvent(req.getOrderId(), "", req.getOperator(), req.getOperator(), OrderEventEnum.recontracting.getEvent(), String.format(OrderEventEnum.recontracting.getMsg(), engineerName + "-" + (ObjectUtil.isNotNull(orgTeamEntity) ? orgTeamEntity.getTeamName() : ""), ObjectUtil.isNotNull(orgGroupEntity) ? orgGroupEntity.getGroupName() : "", req.getExpectBegin(), req.getReschedulingReason()), StringUtils.isNotBlank(req.getReschedulingReason()) ? "改约原因:" + req.getReschedulingReason() : "");
log.info("[orderReschedule] orderId:{}, 操作成功", req.getOrderId());
return Result.success(null); return Result.success(null);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!