|
@@ -1,8 +1,12 @@
|
|
|
package com.qy.worksheetsystem.service.impl;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import com.kingdee.shr.api.OSFWSClient;
|
|
|
import com.qy.worksheetsystem.model.entity.JobBooking;
|
|
|
import com.qy.worksheetsystem.model.mapper.PersonWorkMapper;
|
|
|
|
|
@@ -13,6 +17,7 @@ import com.qy.worksheetsystem.util.SnowflakeUtils;
|
|
|
import com.qy.worksheetsystem.vo.WorkHoursReport;
|
|
|
import com.qy.worksheetsystem.vo.WorkHoursReportEntry;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -41,10 +46,14 @@ public class PersonWorkServiceImpl implements PersonWorkService {
|
|
|
private PersonWorkMapper personWorkMapper;
|
|
|
@Resource
|
|
|
private PersonService personService;
|
|
|
-
|
|
|
@Resource
|
|
|
private ProjectMapper projectMapper;
|
|
|
|
|
|
+ @Value("${HR.ais.url}")
|
|
|
+ private String url;
|
|
|
+ @Value("${HR.ais.serviceName}")
|
|
|
+ private String serviceName;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Map<String,Object> insertWork(Map<String,Object> param){
|
|
@@ -167,8 +176,35 @@ public class PersonWorkServiceImpl implements PersonWorkService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public int submitWork(String number, String id){
|
|
|
-
|
|
|
+ OSFWSClient client = new OSFWSClient();
|
|
|
+ Map<String,Object> map = Maps.newHashMap();
|
|
|
+ map.put("billId",id);// 单据id
|
|
|
+ map.put("status","1");// 单据id
|
|
|
+ String str = client.proceedOSF(url,serviceName,map);
|
|
|
+ if(StrUtil.isNotBlank(str)){
|
|
|
+ JSONObject j = JSONUtil.parseObj(str);
|
|
|
+ String code = j.getStr("code");
|
|
|
+ if("200".equals(code)){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public int revocaWork(String number, String id){
|
|
|
+ OSFWSClient client = new OSFWSClient();
|
|
|
+ Map<String,Object> map = Maps.newHashMap();
|
|
|
+ map.put("billId",id);// 单据id
|
|
|
+ map.put("status","2");// 单据id
|
|
|
+ String str = client.proceedOSF(url,serviceName,map);
|
|
|
+ if(StrUtil.isNotBlank(str)){
|
|
|
+ JSONObject j = JSONUtil.parseObj(str);
|
|
|
+ String code = j.getStr("code");
|
|
|
+ if("200".equals(code)){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
return 0;
|
|
|
}
|
|
|
-
|
|
|
}
|