提交修改
This commit is contained in:
commit
a9122bf56a
@ -109,7 +109,7 @@ public class DingTalkUtil {
|
||||
req.setHttpMethod("GET");
|
||||
OapiGettokenResponse rsp = client.execute(req);
|
||||
String resultStr = rsp.getBody();
|
||||
logger.info("钉钉请求返回", rsp.getBody());
|
||||
logger.info("钉钉请求返回{}", rsp.getBody());
|
||||
JSONObject dataObj = JSON.parseObject(resultStr);
|
||||
|
||||
String tenant_access_token = dataObj.getString("access_token");
|
||||
@ -143,6 +143,7 @@ public class DingTalkUtil {
|
||||
req.setId("1");
|
||||
req.setHttpMethod("GET");
|
||||
OapiDepartmentListResponse rsp = client.execute(req, accessToken);
|
||||
logger.info("钉钉请求返回{}", rsp.getBody());
|
||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||
if(json.getInteger("errcode") == 0){
|
||||
JSONArray array = json.getJSONArray("department");
|
||||
@ -198,6 +199,7 @@ public class DingTalkUtil {
|
||||
for(long page = 0; isNext; page++){
|
||||
req.setOffset(page);
|
||||
OapiUserListbypageResponse rsp = client.execute(req, accessToken);
|
||||
logger.info("钉钉请求返回{}", rsp.getBody());
|
||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||
if(json.getInteger("errcode") == 0){
|
||||
JSONArray array = json.getJSONArray("userlist");
|
||||
@ -309,6 +311,7 @@ public class DingTalkUtil {
|
||||
obj1.setActionCard(obj2);
|
||||
req.setMsg(obj1);
|
||||
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, token);
|
||||
logger.info("钉钉请求返回{}", rsp.getBody());
|
||||
//插入数据库
|
||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||
if(json.getIntValue("errcode") == 0){
|
||||
@ -339,6 +342,7 @@ public class DingTalkUtil {
|
||||
req.setCode(code);
|
||||
req.setHttpMethod("GET");
|
||||
OapiUserGetuserinfoResponse rsp = client.execute(req, token);
|
||||
logger.info("钉钉请求返回{}", rsp.getBody());
|
||||
JSONObject json = JSONObject.parseObject(rsp.getBody());
|
||||
if(json.getIntValue("errcode") == 0){
|
||||
String employeeId = json.getString("userid");
|
||||
|
||||
@ -444,7 +444,7 @@ public class ResultRecordController extends AbstractController {
|
||||
return R.error("权重不能大于" + compare);
|
||||
}
|
||||
} else { // 添加验证
|
||||
if (req.getWeight().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() >= compare) {
|
||||
if (req.getWeight().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() > compare) {
|
||||
return R.error("权重不能大于" + compare);
|
||||
}
|
||||
}
|
||||
@ -457,7 +457,7 @@ public class ResultRecordController extends AbstractController {
|
||||
return R.error("权重之和不能大于" + compare);
|
||||
}
|
||||
} else { //添加验证
|
||||
if (new BigDecimal(sum).add(req.getWeight()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() >= compare) {
|
||||
if (new BigDecimal(sum).add(req.getWeight()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() > compare) {
|
||||
return R.error("权重之和不能大于" + compare);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user