2024-08-25 08:42:26 +00:00
|
|
|
package com.bocloud.sms.service;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.bocloud.sms.entity.User;
|
|
|
|
import com.bocloud.sms.enums.YkInfo;
|
|
|
|
import com.bocloud.sms.interfaces.IndexService;
|
|
|
|
import com.bocloud.sms.repository.UserRepository;
|
2024-08-26 02:00:17 +00:00
|
|
|
import com.bocloud.sms.utils.YkUtil;
|
2024-08-25 08:42:26 +00:00
|
|
|
import com.megatron.common.model.GeneralResult;
|
|
|
|
import com.megatron.common.model.Pager;
|
|
|
|
import com.megatron.common.model.RequestContext;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
@Service("IndexService")
|
|
|
|
@Slf4j
|
|
|
|
public class IndexServiceImpl implements IndexService {
|
|
|
|
|
|
|
|
@Autowired
|
2024-08-26 02:00:17 +00:00
|
|
|
private YkUtil ykUtil;
|
2024-08-25 08:42:26 +00:00
|
|
|
@Autowired
|
|
|
|
private UserRepository userRepository;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public GeneralResult doneWorkOrder(Pager pager, RequestContext requestContext) {
|
|
|
|
try {
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
User user = userRepository.query(requestContext.getTarget());
|
|
|
|
param.put("userId",user.getUserId());
|
|
|
|
param.put("page",pager.getPage());
|
|
|
|
param.put("limit",pager.getRows());
|
2024-08-26 02:00:17 +00:00
|
|
|
String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class);
|
2024-08-25 08:42:26 +00:00
|
|
|
|
|
|
|
log.info("result");
|
|
|
|
JSONArray dataArray = JSONArray.parseArray(result);
|
|
|
|
return new GeneralResult(true, dataArray,"查询成功");
|
|
|
|
} catch (Exception e) {
|
2024-08-25 08:48:37 +00:00
|
|
|
log.info("查询失败",e);
|
2024-08-25 08:42:26 +00:00
|
|
|
return new GeneralResult(false, "查询失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|