|
|
@ -24,6 +24,7 @@ import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.dao.IcEventDao; |
|
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
|
import com.epmet.dto.CustomerDTO; |
|
|
|
import com.epmet.dto.IcEventDTO; |
|
|
|
import com.epmet.dto.IssueProjectCategoryDictDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
@ -31,10 +32,7 @@ import com.epmet.dto.form.demand.DemandRecId; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.enums.EcEventProcessStatusEnum; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetHeartOpenFeignClient; |
|
|
|
import com.epmet.feign.GovIssueOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.feign.*; |
|
|
|
import com.epmet.resi.group.constant.TopicConstant; |
|
|
|
import com.epmet.service.*; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
@ -49,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
import java.util.function.Function; |
|
|
@ -88,6 +87,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
private IcEventReplyService icEventReplyService; |
|
|
|
@Autowired |
|
|
|
private IcEventOperationLogService icEventOperationLogService; |
|
|
|
@Autowired |
|
|
|
private OperCrmOpenFeignClient crmOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@ -759,5 +760,49 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 定时任务自动评价 |
|
|
|
* @param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2022/5/18 16:35 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void autoEvaluation(AutoEvaluationFormDTO formDTO) { |
|
|
|
List<String> customerIds = new ArrayList<>(); |
|
|
|
if (StringUtils.isBlank(formDTO.getCustomerId())){ |
|
|
|
Result<List<CustomerDTO>> allCustomerList = crmOpenFeignClient.getAllCustomerList(); |
|
|
|
if (!allCustomerList.success()){ |
|
|
|
throw new EpmetException("查询所有客户失败"); |
|
|
|
} |
|
|
|
List<CustomerDTO> data = allCustomerList.getData(); |
|
|
|
customerIds.addAll(data.stream().map(m -> m.getId()).collect(Collectors.toList())); |
|
|
|
}else { |
|
|
|
customerIds.add(formDTO.getCustomerId()); |
|
|
|
} |
|
|
|
customerIds.forEach(c -> { |
|
|
|
autoEvaluationDispose(c); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Desc: 处理未评价的icEvent |
|
|
|
* @param customerId |
|
|
|
* @author zxc |
|
|
|
* @date 2022/5/18 16:52 |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void autoEvaluationDispose(String customerId){ |
|
|
|
Integer no = NumConstant.ONE; |
|
|
|
Integer size = NumConstant.ONE_HUNDRED; |
|
|
|
List<String> ids = new ArrayList<>(); |
|
|
|
do { |
|
|
|
int start = (no - NumConstant.ONE) * size; |
|
|
|
ids = baseDao.getAutoEvaluationIds(customerId,start,size); |
|
|
|
// 批量更新
|
|
|
|
baseDao.updateAutoEvaluation(ids); |
|
|
|
no++; |
|
|
|
}while (ids.size() == size); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |