|
|
@ -39,6 +39,7 @@ import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.service.PatrolRoutineWorkService; |
|
|
|
import com.epmet.service.PatrolRoutineWorkTypeService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -76,6 +77,11 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public void add(PatrolRoutineWorkFormDTO formDTO) { |
|
|
|
if (formDTO.getWorkTypeList().toString().contains("02") |
|
|
|
&& (formDTO.getIsKeyPeopleLocate() == null || StringUtils.isBlank(formDTO.getKeyPeopleStatus()))){ |
|
|
|
log.warn("add patrolRoutineWork fail,param is error,param:{}", JSON.toJSONString(formDTO)); |
|
|
|
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode()); |
|
|
|
} |
|
|
|
PatrolRoutineWorkEntity entity = ConvertUtils.sourceToTarget(formDTO, PatrolRoutineWorkEntity.class); |
|
|
|
|
|
|
|
CustomerGridFormDTO gridFormDTO = new CustomerGridFormDTO(); |
|
|
@ -110,7 +116,7 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW |
|
|
|
typeEntity.setRoutineWorkId(entity.getId()); |
|
|
|
typeEntity.setWorkTypeCode(code); |
|
|
|
StringBuilder pids = pidsMap.get(code); |
|
|
|
typeEntity.setAllPCode(pids.length() == 0 ? NumConstant.ZERO_STR : pids.toString()); |
|
|
|
typeEntity.setAllPCode(pids.length() == NumConstant.ZERO ? NumConstant.ZERO_STR : pids.toString()); |
|
|
|
workTypeList.add(typeEntity); |
|
|
|
}); |
|
|
|
patrolRoutineWorkTypeService.insertBatch(workTypeList); |
|
|
@ -131,8 +137,8 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW |
|
|
|
StringBuilder pidSb = result.get(pid); |
|
|
|
if (pidSb == null) { |
|
|
|
pidSb = new StringBuilder(); |
|
|
|
} else if (pidSb.indexOf(pid) == -1) { |
|
|
|
if (pidSb.length() > 0) { |
|
|
|
} else if (pidSb.indexOf(pid) == NumConstant.ONE_NEG) { |
|
|
|
if (pidSb.length() > NumConstant.ZERO) { |
|
|
|
pidSb.append(StrConstant.COLON); |
|
|
|
} |
|
|
|
pidSb.append(pid); |
|
|
|