51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
|
package com.bocloud.sms.service;
|
||
|
|
||
|
import com.alibaba.fastjson.JSONArray;
|
||
|
import com.alibaba.fastjson.JSONObject;
|
||
|
import com.bocloud.cmp.boot.controller.IndexController;
|
||
|
import com.bocloud.sms.entity.Department;
|
||
|
import com.bocloud.sms.entity.User;
|
||
|
import com.bocloud.sms.enums.YkInfo;
|
||
|
import com.bocloud.sms.interfaces.IndexService;
|
||
|
import com.bocloud.sms.repository.UserRepository;
|
||
|
import com.bocloud.sms.utils.YkUtils;
|
||
|
import com.megatron.common.model.GeneralResult;
|
||
|
import com.megatron.common.model.Pager;
|
||
|
import com.megatron.common.model.RequestContext;
|
||
|
import com.megatron.common.utils.MapTools;
|
||
|
import lombok.extern.slf4j.Slf4j;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.stereotype.Service;
|
||
|
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
|
||
|
@Service("IndexService")
|
||
|
@Slf4j
|
||
|
public class IndexServiceImpl implements IndexService {
|
||
|
|
||
|
@Autowired
|
||
|
private YkUtils ykUtils;
|
||
|
@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());
|
||
|
String result = ykUtils.call(YkInfo.getTaskList, param, JSONArray.class);
|
||
|
|
||
|
log.info("result");
|
||
|
JSONArray dataArray = JSONArray.parseArray(result);
|
||
|
return new GeneralResult(true, dataArray,"查询成功");
|
||
|
} catch (Exception e) {
|
||
|
log.info("查询失败");
|
||
|
return new GeneralResult(false, "查询失败");
|
||
|
}
|
||
|
}
|
||
|
}
|