0301备份

main
howec 1 year ago
parent a8bee65e79
commit 7a2665f4e5

@ -2,57 +2,139 @@ package com.weaver.seconddev.sxjg.controller;
/**
*
*/
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.weaver.common.authority.annotation.WeaPermission;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.seconddev.sxjg.util.NccApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/papi/secondev/sxjg/employself")
@RequestMapping("/papi/secondev/nccloud/api/hrtrn/openAPI")
@Slf4j
public class EmployeeSelfServiceController {
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/persondata/query")
public JSONObject persondataQuery(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/persondata/query";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/findInfos")
public WeaResult<Map<String,String>> check(
@RequestParam("userPk") String userPk
@PostMapping("/psninfoconf/list")
public JSONObject psninfoconfList(
@RequestBody String body
) throws Exception {
Map<String,String> rs = new HashMap<>();
JSONObject r1 = new JSONObject();
JSONArray r2 = new JSONArray();
JSONObject r3 = new JSONObject();
r3.put("pk_psndoc","0001A2100000003FMWBU");
r2.add(r3);
r1.put("data",r2);
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoconf/list";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:<>
*/
@WeaPermission(publicPermission = true)
@PostMapping("/psninfoconf/check")
public JSONObject psninfoconfCheck(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/payslipSync/entry";
String rs11 = nccApiUtil.doJsonPost(url,token,r1.toJSONString());
return WeaResult.success(rs);
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoconf/check";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
@Test
public void test111() throws Exception {
/**
* use:-
*/
@WeaPermission(publicPermission = true)
@PostMapping("/psninfoedit/save")
public JSONObject psninfoeditSave(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
JSONObject rucan = new JSONObject();
rucan.put("pk_psndoc","0001B2100000007DN287");
rucan.put("tableCode","bd_psndoc");
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/persondata/query";
String rs11 = nccApiUtil.doJsonPost(url,token,rucan.toJSONString());
System.out.println(rs11);
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoedit/save";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/psninfoedit/approvelist")
public JSONObject psninfoeditApprovelist(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoedit/approvelist";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/psninfoedit/retractapprove")
public JSONObject psninfoeditRetractapprove(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoedit/retractapprove";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/psninfoedit/approveDetailVO")
public JSONObject psninfoeditApproveDetailVO(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoedit/approveDetailVO";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
}

@ -1,8 +1,10 @@
package com.weaver.seconddev.sxjg.controller;
/**
*
* outkey
* nc
*/
import com.alibaba.fastjson.JSON;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
@ -12,10 +14,7 @@ import com.weaver.seconddev.sxjg.config.EbDbDataSourceConfigResp;
import com.weaver.seconddev.sxjg.util.NccApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.*;
@ -27,6 +26,19 @@ public class PayslipPageController {
private JdbcTemplate jdbcTemplateresp = new JdbcTemplate(EbDbDataSourceConfigResp.dbDataSource());
//根据人员id获取人员outkey字段
@WeaPermission(publicPermission = true)
@GetMapping("/getUserOutKey")
public String getUserOutKeyById(@RequestParam("id")String id) {
String sql = "select outkey from eteams.employee where id = "+id;
String currentOutkey = "";
try {
Map<String, Object> map = jdbcTemplateresp.queryForMap(sql);
currentOutkey = String.valueOf(map.get("outkey"));
}catch (Exception e){};
return currentOutkey;
}
@WeaPermission(publicPermission = true)
@PostMapping("/getPayslipageInfo")
public WeaResult<JSONObject> getPayslipageInfo(
@ -101,7 +113,7 @@ public class PayslipPageController {
rsf.put("data",r);
return WeaResult.success(rsf);
}else {
return WeaResult.fail(rsf.getString("msg"));
return WeaResult.fail(rsf.getString("message"));
}
}
@ -138,4 +150,36 @@ public class PayslipPageController {
}catch (Exception e){};
return flag;
}
//跟据doclistpk获取基础数据集合
@WeaPermission(publicPermission = true)
@GetMapping("/getDataSourceList")
public WeaResult<JSONArray> getDataSourceList(@RequestParam("dataSourcePk")String dataSourcePk) {
JSONArray result = new JSONArray();
String sql = "select pk_defdoc,defdocname,enablestate,pid from ec_ebuilder_designer.uf_ncc_defdoc where doclistpk = '"+dataSourcePk+"'";
List<Map<String, Object>> rs = jdbcTemplateresp.queryForList(sql);
Map<String, Object> singlemap = null;
if(CollectionUtil.isNotEmpty(rs)) {
for(Map<String, Object> rsmap : rs) {
JSONObject rsobj = new JSONObject();
String pk_defdoc = String.valueOf(rsmap.get("pk_defdoc"));
String defdocname = String.valueOf(rsmap.get("defdocname"));
String enablestate = String.valueOf(rsmap.get("enablestate"));
String parentdoc = String.valueOf(rsmap.get("pid"));
rsobj.put("pkvalue",pk_defdoc);
rsobj.put("pkname",defdocname);
rsobj.put("enablestate",enablestate);
if(!("null".equals(parentdoc))) {
sql = "select pk_defdoc from ec_ebuilder_designer.uf_ncc_defdoc where id = '"+parentdoc+"'";
singlemap = jdbcTemplateresp.queryForMap(sql);
String singlepkdoc = String.valueOf(singlemap.get("pk_defdoc"));
rsobj.put("parentpkvlaue",singlepkdoc);
}else {
rsobj.put("parentpkvlaue",parentdoc);
}
result.add(rsobj);
}
}
return WeaResult.success(result);
}
}

@ -6,29 +6,30 @@ import com.weaver.seconddev.sxjg.util.NccApiUtil;
import org.junit.Test;
public class TestDd {
// @Test
// public void test() throws Exception {
// String str = "{\"data\":[{\"waflag\":\"Y\",\"begindate\":\"2024-01-25\",\"wa_prmlv\":\"01&服务类\",\"pk_wa_item_showname\":\"基本工资标准\",\"pk_wa_grd_showname\":\"陕建集团总部技能操作通道基本薪资规则\",\"negotiation_wage\":\"N\",\"nmoney\":\"8000.00\",\"psnName\":\"孟立超1\",\"psnCode\":\"00105895\"},{\"waflag\":\"Y\",\"begindate\":\"2024-01-25\",\"wa_prmlv\":\"\",\"pk_wa_item_showname\":\"绩效工资标准\",\"pk_wa_grd_showname\":\"\",\"negotiation_wage\":\"Y\",\"nmoney\":\"9000.00\",\"psnName\":\"孟立超1\",\"psnCode\":\"00105895\"}],\"state\":\"2\",\"pk_org\":\"0001A21000000000IR6D\"}";
// NccApiUtil nccApiUtil = new NccApiUtil();
// nccApiUtil.init();
// String token = nccApiUtil.getToken();
// String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrwa/customermanage/adjust/import";
// String rs11 = nccApiUtil.doJsonPost(url,token,str);
// }
@Test
public void test1() throws Exception {
JSONObject r1 = new JSONObject();
JSONArray r2 = new JSONArray();
JSONObject r3 = new JSONObject();
r3.put("pk_psndoc","0001A2100000006CWEBW");
r2.add(r3);
r1.put("data",r2);
public void test() throws Exception {
String str = "{\"data\":[{\"waflag\":\"Y\",\"begindate\":\"2024-01-25\",\"wa_prmlv\":\"01&服务类\",\"pk_wa_item_showname\":\"基本工资标准\",\"pk_wa_grd_showname\":\"陕建集团总部技能操作通道基本薪资规则\",\"negotiation_wage\":\"N\",\"nmoney\":\"8000.00\",\"psnName\":\"孟立超1\",\"psnCode\":\"00105895\"},{\"waflag\":\"Y\",\"begindate\":\"2024-01-25\",\"wa_prmlv\":\"\",\"pk_wa_item_showname\":\"绩效工资标准\",\"pk_wa_grd_showname\":\"\",\"negotiation_wage\":\"Y\",\"nmoney\":\"9000.00\",\"psnName\":\"孟立超1\",\"psnCode\":\"00105895\"}],\"state\":\"2\",\"pk_org\":\"0001A21000000000IR6D\"}";
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/payslipSync/entry";
String rs11 = nccApiUtil.doJsonPost(url,token,r1.toJSONString());
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrwa/customermanage/adjust/import";
String rs11 = nccApiUtil.doJsonPost(url,token,str);
System.out.println(rs11);
JSONObject rsf = JSONObject.parseObject(rs11);
}
// @Test
// public void test1() throws Exception {
// JSONObject r1 = new JSONObject();
// JSONArray r2 = new JSONArray();
// JSONObject r3 = new JSONObject();
// r3.put("pk_psndoc","0001A2100000006CWEBW");
// r2.add(r3);
// r1.put("data",r2);
// NccApiUtil nccApiUtil = new NccApiUtil();
// nccApiUtil.init();
// String token = nccApiUtil.getToken();
// String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/payslipSync/entry";
// String rs11 = nccApiUtil.doJsonPost(url,token,r1.toJSONString());
// System.out.println(rs11);
// JSONObject rsf = JSONObject.parseObject(rs11);
// }
}

Loading…
Cancel
Save