20240403最新备份

main
howec 1 year ago
parent 34262ef429
commit 1cbe1badfc

@ -2,11 +2,18 @@ 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.seconddev.sxjg.util.NccApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.*;
@RestController
@RequestMapping("/papi/secondev/nccloud/api/hrtrn/openAPI")
@ -20,13 +27,106 @@ public class EmployeeSelfServiceController {
public JSONObject persondataQuery(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
JSONObject r3 = 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());
String rs11 = nccApiUtil.doJsonPost(url,token,r3.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
if("1000000000".equals(resJsonObject.getString("code"))) {
JSONArray dataArrayOne = resJsonObject.getJSONArray("data");
if(dataArrayOne!=null && dataArrayOne.size() > 0) {
for(int i = 0; i<dataArrayOne.size();i++) {
JSONObject jsonObjectone = dataArrayOne.getJSONObject(i);
JSONArray dataArrayTwo = jsonObjectone.getJSONArray("data");
if(dataArrayTwo!=null && dataArrayTwo.size() >0) {
for(int j = 0; j<dataArrayTwo.size();j++) {
JSONObject re3 = dataArrayTwo.getJSONObject(j);
for(Map.Entry<String, Object> re4 : re3.entrySet()){
String key = re4.getKey();
JSONObject re5 = re3.getJSONObject(key);
re5.put("isExamine",false);
}
}
}
}
}
nccApiUtil = new NccApiUtil();
nccApiUtil.init();
token = nccApiUtil.getToken();
url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoedit/approveDetailVO";
rs11 = nccApiUtil.doJsonPost(url,token,r3.toJSONString());
JSONObject resJsonObject2= JSONObject.parseObject(rs11);
if("1000000000".equals(resJsonObject2.getString("code"))) {
JSONObject dataObj2 = resJsonObject2.getJSONObject("data");
if(dataObj2.containsKey("data")) {
JSONObject dataObj21 = dataObj2.getJSONObject("data");
//如果是基本信息查询
if("bd_psndoc".equals(r3.getString("tableCode"))) {
JSONArray afterdata = null;
if(dataObj21 != null && dataObj21.containsKey("afterData") && dataObj21.get("afterData") != null) {
afterdata = dataObj21.getJSONArray("afterData");
}
if(afterdata != null && afterdata.size() > 0) {
dataArrayOne = resJsonObject.getJSONArray("data");
if(dataArrayOne!=null && dataArrayOne.size() > 0) {
for(int i = 0; i<dataArrayOne.size();i++) {
JSONObject jsonObjectone = dataArrayOne.getJSONObject(i);
JSONArray dataArrayTwo = jsonObjectone.getJSONArray("data");
if(dataArrayTwo!=null && dataArrayTwo.size() >0) {
for(int j = 0; j<dataArrayTwo.size();j++) {
JSONObject re3 = dataArrayTwo.getJSONObject(j);
for(Map.Entry<String, Object> re4 : re3.entrySet()){
String key = re4.getKey();
JSONObject re5 = re3.getJSONObject(key);
for(int x = 0;x < afterdata.size();x ++) {
JSONObject afertObj = afterdata.getJSONObject(x);
String columnValue = afertObj.getString("columnValue");
String columnKey = afertObj.getString("columnKey");
if(columnKey!=null && columnKey.length()>0 && columnKey.equals(re5.getString("key"))) {
re5.put("isExamine",true);
}
}
}
}
}
}
}
}
}else {//子级信息查询
if(dataObj21.containsKey("changeTypeMap")){
JSONObject changeData= dataObj21.getJSONObject("changeTypeMap");
List<String> shhs = new ArrayList<>();
for(String key : changeData.keySet()) {
shhs.add(key);
}
if(shhs!=null && shhs.size()>0) {
if(dataArrayOne!=null && dataArrayOne.size() > 0) {
for(int i = 0; i<dataArrayOne.size();i++) {
JSONObject jsonObjectone = dataArrayOne.getJSONObject(i);
String rowDataPk = jsonObjectone.getString("rowDataPk");
if(shhs.contains(rowDataPk)) {
JSONArray dataArrayTwo = jsonObjectone.getJSONArray("data");
if(dataArrayTwo!=null && dataArrayTwo.size() >0) {
for(int j = 0; j<dataArrayTwo.size();j++) {
JSONObject re3 = dataArrayTwo.getJSONObject(j);
for(Map.Entry<String, Object> re4 : re3.entrySet()){
String key = re4.getKey();
JSONObject re5 = re3.getJSONObject(key);
re5.put("isExamine",true);
}
}
}
}
}
}
}
}
}
}
}
}
return resJsonObject;
}
@ -137,4 +237,279 @@ public class EmployeeSelfServiceController {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/psninfoconf/querytablecodeisuserd")
public JSONObject queryTablecodeisuserd(
@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/psninfoconf/querytablecodeisuserd";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/attachment/query")
public JSONObject attachmentQuery(
@RequestBody String body
) throws Exception {
JSONObject requestbody = JSONObject.parseObject(body);
String pk1 = requestbody.getString("pk");
JSONObject inter2 = new JSONObject();
inter2.put("pk_psndoc",pk1);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/attachment/query";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
String code = resJsonObject.getString("code");
if("1000000000".equals(code)) {
//详情接口合并
NccApiUtil nccApiUtil2 = new NccApiUtil();
nccApiUtil2.init();
String token2 = nccApiUtil2.getToken();
String url2 = nccApiUtil2.getBaseUrl()+"nccloud/api/hrtrn/openAPI/attachment/unreviewed";
String rs12 = nccApiUtil2.doJsonPost(url2,token2,inter2.toJSONString());
JSONObject resJsonObject2 = JSONObject.parseObject(rs12);
String code2 = resJsonObject2.getString("code");
JSONObject dataObject = resJsonObject.getJSONObject("data");
if(dataObject.keySet()!=null && dataObject.keySet().size()>0) {
for(String key1 : dataObject.keySet()) {
JSONArray keysz1 = dataObject.getJSONArray(key1);
for(int i = 0; i<keysz1.size();i++) {
JSONObject one = keysz1.getJSONObject(i);
one.put("isExamine",false);
one.put("file_state","0");
}
}
}
//拼接待审核
if("1000000000".equals(code2)) {
JSONArray data2 = resJsonObject2.getJSONArray("data");
if(data2!=null && data2.size()>0) {
for(int i = 0; i < data2.size(); i++) {
JSONObject obj2 = data2.getJSONObject(i);
JSONObject y2 = new JSONObject();
String pk_annex_approve = obj2.getString("pk_annex_approve");
String file_name = obj2.getString("file_name");
String checkstatus = obj2.getString("checkstatus");
String type = obj2.getString("type");
String file_state = obj2.getString("file_state");
//仅checkstatus==0待审核时才展示
if("0".equals(checkstatus)) {
y2.put("pk",pk_annex_approve);
y2.put("type",type);
y2.put("name",file_name);
y2.put("path","");
y2.put("file_state",file_state);
y2.put("isExamine",true);
if(dataObject.containsKey(type)) {
JSONArray b1 = dataObject.getJSONArray(type);
b1.add(y2);
}else {
JSONArray b2 = new JSONArray();
b2.add(y2);
dataObject.put(type,b2);
}
}
}
}
}
}
return resJsonObject;
}catch (Exception e) {
throw new Exception(rs11);
}
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/attachment/download")
public JSONObject attachmentDownload(
@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/attachment/download";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}catch (Exception e) {
throw new Exception(rs11);
}
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@GetMapping("/attachment/download1")
public void attachmentDownload1(
@RequestParam("fullPath") String fullPath,
HttpServletResponse response
) throws Exception {
JSONObject requestbody = new JSONObject();
requestbody.put("fullPath",fullPath);
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/attachment/download";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject2 = JSONObject.parseObject(rs11);
if(resJsonObject2.getBoolean("success")) {
JSONObject resJsonObject = resJsonObject2.getJSONObject("data");
String bytes = resJsonObject.getString("bytes");
byte [] liufile = Base64.getDecoder().decode(bytes);
String filenames = resJsonObject.getString("name");
response.setContentType("application/x-download");
String fileName = URLEncoder.encode(filenames, "UTF-8");
response.setCharacterEncoding("UTF-8");
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
try {
ServletOutputStream out = response.getOutputStream();
out.write(liufile,0,liufile.length);
out.close();
out.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
}catch (Exception e) {
throw new Exception(rs11);
}
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/attachment/receive")
public JSONObject attachmentReceive(
@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/attachment/receive";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}catch (Exception e) {
throw new Exception(rs11);
}
}
// @WeaPermission(publicPermission = true)
// @PostMapping("/attachment/upload")
// public JSONObject attachmentUpload(
// @RequestParam("file") MultipartFile[] file,
// @RequestParam("pk_psndoc") String pk_psndoc,
// @RequestParam("file_state") String file_state,
// @RequestParam("type") String type,
// @RequestParam("file_type") String file_type,
// @RequestParam("file_name") String file_name
// ) throws Exception {
// JSONObject rs = new JSONObject();
// if (file.isEmpty()) {
// rs.put("status",false);
// rs.put("msg","文件为空,请重新上传");
// return rs;
// }
// // 获取文件名
// String fileName = file.getOriginalFilename();
// // 获取文件的字节内容
// byte[] bytes = file.getBytes();
// String filebase64str = Base64.getEncoder().encodeToString(bytes);
// JSONObject send = new JSONObject();
// send.put("pk_psndoc",pk_psndoc);
// JSONArray data = new JSONArray();
// JSONObject dataObject = new JSONObject();
// dataObject.put("file_name",file_name);
// dataObject.put("file_state",file_state);
// dataObject.put("filebytes",filebase64str);
// dataObject.put("type",type);
// dataObject.put("file_type",file_type);
// data.add(dataObject);
// send.put("data",data);
// NccApiUtil nccApiUtil = new NccApiUtil();
// nccApiUtil.init();
// String token = nccApiUtil.getToken();
// String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/attachment/receive";
// String rs11 = nccApiUtil.doJsonPost(url,token,send.toJSONString());
// try {
// JSONObject resJsonObject = JSONObject.parseObject(rs11);
// return resJsonObject;
// }catch (Exception e) {
// throw new Exception(rs11);
// }
// }
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/attachment/unreviewed")
public JSONObject attachmentUnreviewed(
@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/attachment/unreviewed";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}catch (Exception e) {
throw new Exception(rs11);
}
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/attachment/cancel")
public JSONObject attachmentCancel(
@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/attachment/cancel";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}catch (Exception e) {
throw new Exception(rs11);
}
}
}

@ -20,6 +20,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
@RestController
@ -154,6 +156,7 @@ public class PayslipPageController {
return flag;
}
//跟据doclistpk获取基础数据集合
@WeaPermission(publicPermission = true)
@GetMapping("/getDataSourceList")
@ -161,7 +164,7 @@ public class PayslipPageController {
@RequestParam(value = "type",required = false,defaultValue = "0") Integer type) throws JsonProcessingException {
if(type == 10) {//籍贯省市区
JSONArray result = new JSONArray();
String sql = "select id,pk_defdoc,defdocname,enablestate,pid from ec_ebuilder_designer.uf_ncc_defdoc where doclistpk = '"+dataSourcePk+"'";
String sql = "select id,pk_defdoc,defdocname,enablestate,pid from ec_ebuilder_designer.uf_ncc_defdoc where doclistpk = '"+dataSourcePk+"' order by defdoccode ASC";
List<Map<String, Object>> rs = jdbcTemplateresp.queryForList(sql);
List<ProvinceCityNode> data = new ArrayList<>();
if(CollectionUtil.isNotEmpty(rs)) {

@ -1,267 +1,368 @@
package com.weaver.seconddev.sxjg.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.Feature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.weaver.seconddev.sxjg.util.NccApiUtil;
import com.weaver.seconddev.sxjg.util.ProvinceCityNode;
import org.junit.Test;
import java.text.SimpleDateFormat;
import java.util.*;
public class PayslipPageTestController {
@org.junit.Test
public void test() throws Exception {
Map<String,String> rs = new HashMap<>();
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());
JSONObject rsf = JSONObject.parseObject(rs11, Feature.OrderedField);
if("1000000000".equals(rsf.getString("code"))) {
JSONArray dataarr = rsf.getJSONArray("data");
JSONArray dataguolv = new JSONArray();
if(dataarr.size()>0) {
for(int i = 0; i <dataarr.size();i++) {
JSONObject ra = dataarr.getJSONObject(i);
Boolean flag= judegNy(ra,"2024-02","2024-02","陕西建工集团数字科技有限公司(在册)薪资方案");
if(flag) {
dataguolv.add(ra);
}
}
}
//按照日期排序
List<JSONObject> list = new ArrayList<>();
for (int i=0; i < dataguolv.size(); i++) {
list.add(dataguolv.getJSONObject(i));
}
// 创建日期比较器
Comparator<JSONObject> dateComparator = new Comparator<JSONObject>() {
@Override
public int compare(JSONObject obj1, JSONObject obj2) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Date date1 = sdf.parse(obj1.getString("year"));
Date date2 = sdf.parse(obj2.getString("year"));
return date2.compareTo(date1);
} catch (Exception e) {
e.printStackTrace();
return -1;
}
}
};
// 根据日期进行排序
Collections.sort(list, dateComparator);
String s = JSON.toJSONString(list);
System.out.println(s);
// 将排好序的 List 转换为 JSONArray
JSONArray r = new JSONArray();
for(JSONObject js : list) {
r.add(js);
}
System.out.println(r.toJSONString());
rsf.put("data",r);
}else {
}
}
public void test1() throws Exception {
Map<String,String> rs = new HashMap<>();
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/psninfoconf/list";
String rs11 = nccApiUtil.doJsonPost(url,token,r1.toJSONString());
JSONObject rsf = JSONObject.parseObject(rs11, Feature.OrderedField);
if("1000000000".equals(rsf.getString("code"))) {
JSONArray dataarr = rsf.getJSONArray("data");
JSONArray dataguolv = new JSONArray();
if(dataarr.size()>0) {
for(int i = 0; i <dataarr.size();i++) {
JSONObject ra = dataarr.getJSONObject(i);
Boolean flag= judegNy(ra,"2024-02","2024-02","陕西建工集团数字科技有限公司(在册)薪资方案");
if(flag) {
dataguolv.add(ra);
}
}
}
//按照日期排序
List<JSONObject> list = new ArrayList<>();
for (int i=0; i < dataguolv.size(); i++) {
list.add(dataguolv.getJSONObject(i));
}
// 创建日期比较器
Comparator<JSONObject> dateComparator = new Comparator<JSONObject>() {
@Override
public int compare(JSONObject obj1, JSONObject obj2) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Date date1 = sdf.parse(obj1.getString("year"));
Date date2 = sdf.parse(obj2.getString("year"));
return date2.compareTo(date1);
} catch (Exception e) {
e.printStackTrace();
return -1;
}
}
};
// 根据日期进行排序
Collections.sort(list, dateComparator);
String s = JSON.toJSONString(list);
System.out.println(s);
// 将排好序的 List 转换为 JSONArray
JSONArray r = new JSONArray();
for(JSONObject js : list) {
r.add(js);
}
System.out.println(r.toJSONString());
rsf.put("data",r);
}else {
}
}
/**
*
*/
private boolean judegNy(JSONObject obj, String beingdate1, String enddate1, String name){
String ny1 = obj.getString("year");
boolean flag = false;
ny1 = ny1+"-05";
beingdate1 = beingdate1+"-05";
enddate1 = enddate1+"-05";
String famc = obj.getString("name");//方案名称
// 定义要转换的字符串格式
try {
boolean flag2 = false;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date ny = dateFormat.parse(ny1);
Date beingdate = dateFormat.parse(beingdate1);
Date enddate = dateFormat.parse(enddate1);
long ny2 =ny.getTime();
long beingdate2 =beingdate.getTime();
long enddate2 =enddate.getTime();
if(ny2>=beingdate2 && ny2<=enddate2) {
flag2 = true;
}
if((!"null".equals(name)) && flag2) {
if(famc.equals(name)) {
flag = true;
}
}else {
flag = flag2;
}
}catch (Exception e){};
return flag;
}
@Test
public void tp() throws JsonProcessingException {
List<Map<String, Object>> rs = getMuneTree();
ObjectMapper objectMapper = new ObjectMapper();
// 将 List<Map<String, Object>> 转换为 JSON
String json = objectMapper.writeValueAsString(rs);
System.out.println(json);
}
/**
*
*
* @return
*/
public List<Map<String, Object>> getMuneTree() {
// 获取数据库中带有有父子关系的数据
List<ProvinceCityNode> data = new ArrayList<>();
ProvinceCityNode provinceCityNode11 = new ProvinceCityNode("1","null","pk11","第一级1");
ProvinceCityNode provinceCityNode12 = new ProvinceCityNode("2","null","pk12","第一级2");
ProvinceCityNode provinceCityNode13 = new ProvinceCityNode("3","null","pk13","第一级3");
ProvinceCityNode provinceCityNode14 = new ProvinceCityNode("4","null","pk14","第一级4");
ProvinceCityNode provinceCityNode111 = new ProvinceCityNode("11","1","pk111","第一级11");
ProvinceCityNode provinceCityNode112 = new ProvinceCityNode("12","1","pk112","第一级12");
ProvinceCityNode provinceCityNode113 = new ProvinceCityNode("13","1","pk113","第一级13");
ProvinceCityNode provinceCityNode121 = new ProvinceCityNode("15","2","pk211","第一级21");
ProvinceCityNode provinceCityNode122 = new ProvinceCityNode("16","2","pk212","第一级22");
ProvinceCityNode provinceCityNode123 = new ProvinceCityNode("17","2","pk213","第一级23");
ProvinceCityNode provinceCityNode1111 = new ProvinceCityNode("1111","11","pk111","第一级1111");
ProvinceCityNode provinceCityNode1112 = new ProvinceCityNode("1112","11","pk111","第一级1112");
ProvinceCityNode provinceCityNode1113 = new ProvinceCityNode("1113","11","pk111","第一级1113");
data.add(provinceCityNode11);
data.add(provinceCityNode12);
data.add(provinceCityNode13);
data.add(provinceCityNode14);
data.add(provinceCityNode111);
data.add(provinceCityNode112);
data.add(provinceCityNode113);
data.add(provinceCityNode121);
data.add(provinceCityNode122);
data.add(provinceCityNode123);
data.add(provinceCityNode1111);
data.add(provinceCityNode1112);
data.add(provinceCityNode1113);
//创建一个List集合来存放最终的树状结构数据
List<Map<String, Object>> menuList = new ArrayList<>();
// 先存入最顶级的树0代表没有父级即最顶级然后通过最顶级的id递归获取子级
for (ProvinceCityNode entity : data) {
Map<String, Object> map = new HashMap<>();
if (entity.parentid ==null || "null".equals(entity.parentid) || "".equals(entity.parentid) || "0".equals(entity.parentid)) {
map.put("id", entity.id);
map.put("value", entity.value);
map.put("isLeaf", entity.isLeaf);
map.put("parentid", entity.parentid);
map.put("loading", entity.loading);
map.put("label", entity.label);
map.put("disabled", entity.disabled);
map.put("children", getChildren(data, entity.id));
menuList.add(map);
}
}
return menuList;
}
/**
* id
* @param data
* @param id id
* @return id
*/
public List<Map<String, Object>> getChildren(List<ProvinceCityNode> data, String id) {
List<Map<String, Object>> list = new ArrayList<>();
if (data == null || data.size() == 0 || id == null) {
return list;
}
for (ProvinceCityNode entity : data) {
Map<String, Object> map = new HashMap<>();
//如果本级id与数据的父id相同就说明是子父级关系
if (id.equals(entity.parentid)) {
map.put("id", entity.id);
map.put("value", entity.value);
map.put("isLeaf", entity.isLeaf);
map.put("parentid", entity.parentid);
map.put("loading", entity.loading);
map.put("label", entity.label);
map.put("disabled", entity.disabled);
map.put("children", getChildren(data, entity.id));
list.add(map);
}
}
return list;
}
}
//package com.weaver.seconddev.sxjg.controller;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.alibaba.fastjson.parser.Feature;
//import com.fasterxml.jackson.core.JsonProcessingException;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.weaver.common.authority.annotation.WeaPermission;
//import com.weaver.seconddev.sxjg.util.NccApiUtil;
//import com.weaver.seconddev.sxjg.util.ProvinceCityNode;
//import org.junit.Test;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//
//import javax.servlet.http.HttpServletResponse;
//import java.text.SimpleDateFormat;
//import java.util.*;
//
//public class PayslipPageTestController {
// @org.junit.Test
// public void test() throws Exception {
// Map<String,String> rs = new HashMap<>();
// 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());
// JSONObject rsf = JSONObject.parseObject(rs11, Feature.OrderedField);
// if("1000000000".equals(rsf.getString("code"))) {
// JSONArray dataarr = rsf.getJSONArray("data");
// JSONArray dataguolv = new JSONArray();
// if(dataarr.size()>0) {
// for(int i = 0; i <dataarr.size();i++) {
// JSONObject ra = dataarr.getJSONObject(i);
// Boolean flag= judegNy(ra,"2024-02","2024-02","陕西建工集团数字科技有限公司(在册)薪资方案");
// if(flag) {
// dataguolv.add(ra);
// }
// }
// }
// //按照日期排序
// List<JSONObject> list = new ArrayList<>();
// for (int i=0; i < dataguolv.size(); i++) {
// list.add(dataguolv.getJSONObject(i));
// }
// // 创建日期比较器
// Comparator<JSONObject> dateComparator = new Comparator<JSONObject>() {
// @Override
// public int compare(JSONObject obj1, JSONObject obj2) {
// try {
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
// Date date1 = sdf.parse(obj1.getString("year"));
// Date date2 = sdf.parse(obj2.getString("year"));
// return date2.compareTo(date1);
// } catch (Exception e) {
// e.printStackTrace();
// return -1;
// }
// }
// };
// // 根据日期进行排序
// Collections.sort(list, dateComparator);
// String s = JSON.toJSONString(list);
// System.out.println(s);
// // 将排好序的 List 转换为 JSONArray
// JSONArray r = new JSONArray();
// for(JSONObject js : list) {
// r.add(js);
// }
// System.out.println(r.toJSONString());
// rsf.put("data",r);
// }else {
// }
// }
//
// @Test
// public void test1() throws Exception {
// Map<String,String> rs = new HashMap<>();
// JSONObject r3 = new JSONObject();
// r3.put("pk_psndoc","0001A2100000006CWEBW");
// r3.put("tableCode","hi_psndoc_linkman");
// 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,r3.toJSONString());
// JSONObject resJsonObject = JSONObject.parseObject(rs11);
// if("1000000000".equals(resJsonObject.getString("code"))) {
// JSONArray dataArrayOne = resJsonObject.getJSONArray("data");
// if(dataArrayOne!=null && dataArrayOne.size() > 0) {
// for(int i = 0; i<dataArrayOne.size();i++) {
// JSONObject jsonObjectone = dataArrayOne.getJSONObject(i);
// JSONArray dataArrayTwo = jsonObjectone.getJSONArray("data");
// if(dataArrayTwo!=null && dataArrayTwo.size() >0) {
// for(int j = 0; j<dataArrayTwo.size();j++) {
// JSONObject re3 = dataArrayTwo.getJSONObject(j);
// for(Map.Entry<String, Object> re4 : re3.entrySet()){
// String key = re4.getKey();
// JSONObject re5 = re3.getJSONObject(key);
// re5.put("isExamine",false);
// }
// }
// }
// }
// }
// nccApiUtil = new NccApiUtil();
// nccApiUtil.init();
// token = nccApiUtil.getToken();
// url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/psninfoedit/approveDetailVO";
// rs11 = nccApiUtil.doJsonPost(url,token,r3.toJSONString());
// JSONObject resJsonObject2= JSONObject.parseObject(rs11);
// if("1000000000".equals(resJsonObject2.getString("code"))) {
// JSONObject dataObj2 = resJsonObject2.getJSONObject("data");
// if(dataObj2.containsKey("data")) {
// JSONObject dataObj21 = dataObj2.getJSONObject("data");
// //如果是基本信息查询
// if("bd_psndoc".equals(r3.getString("tableCode"))) {
// JSONArray afterdata = null;
// if(dataObj21 != null && dataObj21.containsKey("afterData") && dataObj21.get("afterData") != null) {
// afterdata = dataObj21.getJSONArray("afterData");
// }
// if(afterdata != null && afterdata.size() > 0) {
// dataArrayOne = resJsonObject.getJSONArray("data");
// if(dataArrayOne!=null && dataArrayOne.size() > 0) {
// for(int i = 0; i<dataArrayOne.size();i++) {
// JSONObject jsonObjectone = dataArrayOne.getJSONObject(i);
// JSONArray dataArrayTwo = jsonObjectone.getJSONArray("data");
// if(dataArrayTwo!=null && dataArrayTwo.size() >0) {
// for(int j = 0; j<dataArrayTwo.size();j++) {
// JSONObject re3 = dataArrayTwo.getJSONObject(j);
// for(Map.Entry<String, Object> re4 : re3.entrySet()){
// String key = re4.getKey();
// JSONObject re5 = re3.getJSONObject(key);
// for(int x = 0;x < afterdata.size();x ++) {
// JSONObject afertObj = afterdata.getJSONObject(x);
// String columnValue = afertObj.getString("columnValue");
// String columnKey = afertObj.getString("columnKey");
// if(columnKey!=null && columnKey.length()>0 && columnKey.equals(re5.getString("key"))) {
// re5.put("isExamine",true);
// }
// }
// }
// }
// }
// }
// }
// }
// System.out.println(1);
// }else {//子级信息查询
//
// }
// }
// }
// }
// }
//
// /**
// * 判断年月在日期之间
// */
// private boolean judegNy(JSONObject obj, String beingdate1, String enddate1, String name){
// String ny1 = obj.getString("year");
// boolean flag = false;
// ny1 = ny1+"-05";
// beingdate1 = beingdate1+"-05";
// enddate1 = enddate1+"-05";
// String famc = obj.getString("name");//方案名称
// // 定义要转换的字符串格式
// try {
// boolean flag2 = false;
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
// Date ny = dateFormat.parse(ny1);
// Date beingdate = dateFormat.parse(beingdate1);
// Date enddate = dateFormat.parse(enddate1);
// long ny2 =ny.getTime();
// long beingdate2 =beingdate.getTime();
// long enddate2 =enddate.getTime();
// if(ny2>=beingdate2 && ny2<=enddate2) {
// flag2 = true;
// }
// if((!"null".equals(name)) && flag2) {
// if(famc.equals(name)) {
// flag = true;
// }
// }else {
// flag = flag2;
// }
// }catch (Exception e){};
// return flag;
// }
//
// @Test
// public void tp() throws JsonProcessingException {
//
// List<Map<String, Object>> rs = getMuneTree();
// ObjectMapper objectMapper = new ObjectMapper();
//
// // 将 List<Map<String, Object>> 转换为 JSON
// String json = objectMapper.writeValueAsString(rs);
//
// System.out.println(json);
//
// }
// /**
// * 将有父子关系的数据转换成树形结构数据
// *
// * @return 最终的树状结构的集合数据
// */
// public List<Map<String, Object>> getMuneTree() {
// // 获取数据库中带有有父子关系的数据
// List<ProvinceCityNode> data = new ArrayList<>();
// ProvinceCityNode provinceCityNode11 = new ProvinceCityNode("1","null","pk11","第一级1");
// ProvinceCityNode provinceCityNode12 = new ProvinceCityNode("2","null","pk12","第一级2");
// ProvinceCityNode provinceCityNode13 = new ProvinceCityNode("3","null","pk13","第一级3");
// ProvinceCityNode provinceCityNode14 = new ProvinceCityNode("4","null","pk14","第一级4");
// ProvinceCityNode provinceCityNode111 = new ProvinceCityNode("11","1","pk111","第一级11");
// ProvinceCityNode provinceCityNode112 = new ProvinceCityNode("12","1","pk112","第一级12");
// ProvinceCityNode provinceCityNode113 = new ProvinceCityNode("13","1","pk113","第一级13");
// ProvinceCityNode provinceCityNode121 = new ProvinceCityNode("15","2","pk211","第一级21");
// ProvinceCityNode provinceCityNode122 = new ProvinceCityNode("16","2","pk212","第一级22");
// ProvinceCityNode provinceCityNode123 = new ProvinceCityNode("17","2","pk213","第一级23");
// ProvinceCityNode provinceCityNode1111 = new ProvinceCityNode("1111","11","pk111","第一级1111");
// ProvinceCityNode provinceCityNode1112 = new ProvinceCityNode("1112","11","pk111","第一级1112");
// ProvinceCityNode provinceCityNode1113 = new ProvinceCityNode("1113","11","pk111","第一级1113");
// data.add(provinceCityNode11);
// data.add(provinceCityNode12);
// data.add(provinceCityNode13);
// data.add(provinceCityNode14);
// data.add(provinceCityNode111);
// data.add(provinceCityNode112);
// data.add(provinceCityNode113);
// data.add(provinceCityNode121);
// data.add(provinceCityNode122);
// data.add(provinceCityNode123);
// data.add(provinceCityNode1111);
// data.add(provinceCityNode1112);
// data.add(provinceCityNode1113);
// //创建一个List集合来存放最终的树状结构数据
// List<Map<String, Object>> menuList = new ArrayList<>();
// // 先存入最顶级的树0代表没有父级即最顶级然后通过最顶级的id递归获取子级
// for (ProvinceCityNode entity : data) {
// Map<String, Object> map = new HashMap<>();
// if (entity.parentid ==null || "null".equals(entity.parentid) || "".equals(entity.parentid) || "0".equals(entity.parentid)) {
// map.put("id", entity.id);
// map.put("value", entity.value);
// map.put("isLeaf", entity.isLeaf);
// map.put("parentid", entity.parentid);
// map.put("loading", entity.loading);
// map.put("label", entity.label);
// map.put("disabled", entity.disabled);
// map.put("children", getChildren(data, entity.id));
// menuList.add(map);
// }
// }
// return menuList;
// }
// /**
// * 递归处理通过id获取子级查询子级下的子级
// * @param data 数据库的原始数据
// * @param id 主id
// * @return 该id下得子级
// */
// public List<Map<String, Object>> getChildren(List<ProvinceCityNode> data, String id) {
// List<Map<String, Object>> list = new ArrayList<>();
// if (data == null || data.size() == 0 || id == null) {
// return list;
// }
// for (ProvinceCityNode entity : data) {
// Map<String, Object> map = new HashMap<>();
// //如果本级id与数据的父id相同就说明是子父级关系
// if (id.equals(entity.parentid)) {
// map.put("id", entity.id);
// map.put("value", entity.value);
// map.put("isLeaf", entity.isLeaf);
// map.put("parentid", entity.parentid);
// map.put("loading", entity.loading);
// map.put("label", entity.label);
// map.put("disabled", entity.disabled);
// map.put("children", getChildren(data, entity.id));
// list.add(map);
// }
// }
// return list;
// }
//
//// /**
//// * use:个人附件下载接口
//// */
// @Test
// public void attachmentDownload1(
// ) throws Exception {
// JSONObject requestbody = new JSONObject();
// requestbody.put("pk","0001A2100000007KUXWS");
// String pk1 = requestbody.getString("pk");
// JSONObject inter2 = new JSONObject();
// inter2.put("pk_psndoc",pk1);
// NccApiUtil nccApiUtil = new NccApiUtil();
// nccApiUtil.init();
// String token = nccApiUtil.getToken();
// String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/attachment/query";
// String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
// try {
// JSONObject resJsonObject = JSONObject.parseObject(rs11);
// String code = resJsonObject.getString("code");
// if ("1000000000".equals(code)) {
// //详情接口合并
// NccApiUtil nccApiUtil2 = new NccApiUtil();
// nccApiUtil2.init();
// String token2 = nccApiUtil2.getToken();
// String url2 = nccApiUtil2.getBaseUrl() + "nccloud/api/hrtrn/openAPI/attachment/unreviewed";
// String rs12 = nccApiUtil2.doJsonPost(url2, token2, inter2.toJSONString());
// JSONObject resJsonObject2 = JSONObject.parseObject(rs12);
// String code2 = resJsonObject2.getString("code");
// JSONObject dataObject = resJsonObject.getJSONObject("data");
// if (dataObject.keySet() != null && dataObject.keySet().size() > 0) {
// for (String key1 : dataObject.keySet()) {
// JSONArray keysz1 = dataObject.getJSONArray(key1);
// for (int i = 0; i < keysz1.size(); i++) {
// JSONObject one = keysz1.getJSONObject(i);
// one.put("isExamine", false);
// one.put("file_state", "0");
// }
// }
// }
// //拼接待审核
// if ("1000000000".equals(code2)) {
// JSONArray data2 = resJsonObject2.getJSONArray("data");
// if (data2 != null && data2.size() > 0) {
// for (int i = 0; i < data2.size(); i++) {
// JSONObject obj2 = data2.getJSONObject(i);
// JSONObject y2 = new JSONObject();
// String pk_annex_approve = obj2.getString("pk_annex_approve");
// String file_name = obj2.getString("file_name");
// String checkstatus = obj2.getString("checkstatus");
// String type = obj2.getString("type");
// String file_state = obj2.getString("file_state");
// //仅checkstatus==0待审核时才展示
// if ("0".equals(checkstatus)) {
// y2.put("pk", pk_annex_approve);
// y2.put("type", type);
// y2.put("name", file_name);
// y2.put("path", "");
// y2.put("file_state", file_state);
// y2.put("isExamine", true);
// if (dataObject.containsKey(type)) {
// JSONArray b1 = dataObject.getJSONArray(type);
// b1.add(y2);
// } else {
// JSONArray b2 = new JSONArray();
// b2.add(y2);
// dataObject.put(type, b2);
// }
// }
// }
// }
// }
// }
// }finally {
//
// }
// }
//}

@ -78,9 +78,19 @@ public class PersonDdToNcc implements EsbServerlessRpcRemoteInterface {
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrtrn/openAPI/transfer/sync";
String rs11 = nccApiUtil.doJsonPost(url,token,jsonObject.toJSONString());
NccResultUtil rs = new NccResultUtil(rs11);
String rs11 = "";
NccResultUtil rs = null;
if(!judgeInterfaceStatus(bsid)) {//接口一 并没有执行成功过
log.error("howec-3-7:接口一并没有被执行过,执行接口一");
rs11 = nccApiUtil.doJsonPost(url,token,jsonObject.toJSONString());
rs = new NccResultUtil(rs11);
}else {//接口1已经执行成功过
log.error("howec-3-7:接口一已经被成功执行过,直接执行接口二");
rs = new NccResultUtil();
rs.setResult(true);
}
if(rs.getResult()) {
updateJkZt(bsid);//更新【接口1】成功
//同步明细
JSONObject r1 = new JSONObject();
String state = "2";
@ -118,6 +128,32 @@ public class PersonDdToNcc implements EsbServerlessRpcRemoteInterface {
}
}
/**
* @use:2
*/
private void updateJkZt(String bsid) {
String sql = "select dataid from wfc_form_data wfd where requestid = "+bsid;
Map<String, Object> rs = jdbcTemplateresp.queryForMap(sql);
long dataid = (long)rs.get("dataid");
//更新【接口状态字段为2---【接口一】已经执行成功】
sql = "update hi_stapply set jkzt = '2' where id = "+dataid;
jdbcTemplateresp.update(sql);
}
/**
* id2
*/
private boolean judgeInterfaceStatus(String bsid) {
String sql = "select dataid from wfc_form_data wfd where requestid = "+bsid;
Map<String, Object> rs = jdbcTemplateresp.queryForMap(sql);
long dataid = (long)rs.get("dataid");
//更新【接口状态字段为2---【接口一】已经执行成功】
sql = "select jkzt from hi_stapply where id = "+dataid;
rs = jdbcTemplateresp.queryForMap(sql);
String status = String.valueOf(rs.get("jkzt"));
return ("2".equals(status));
}
private JSONArray getDataArray(String bsid,String username,String usercode) {
JSONArray jsonArray = new JSONArray();
String sql = "select dataid from wfc_form_data wfd where requestid = "+bsid;

@ -53,9 +53,19 @@ public class PersonJxToNcc implements EsbServerlessRpcRemoteInterface {
nccApiUtil.init();
String token = nccApiUtil.getToken();
String url = nccApiUtil.getBaseUrl()+"nccloud/api/hrhi/openAPI/userinf/internshipinf";
String rs11 = nccApiUtil.doJsonPost(url,token,jsonArray.toJSONString());
NccResultUtil rs = new NccResultUtil(rs11);
String rs11 = "";
NccResultUtil rs = null;
if(!judgeInterfaceStatus(bsid)) {//接口一 并没有执行成功过
log.error("howec-3-7:接口一并没有被执行过,执行接口一");
rs11 = nccApiUtil.doJsonPost(url,token,jsonArray.toJSONString());
rs = new NccResultUtil(rs11);
}else {//接口1已经执行成功过
log.error("howec-3-7:接口一已经被成功执行过,直接执行接口二");
rs = new NccResultUtil();
rs.setResult(true);
}
if(rs.getResult()) {
updateJkZt(bsid);//更新【接口1】成功
//同步明细
JSONObject r1 = new JSONObject();
String state = "2";
@ -93,6 +103,32 @@ public class PersonJxToNcc implements EsbServerlessRpcRemoteInterface {
}
}
/**
* @use:2
*/
private void updateJkZt(String bsid) {
String sql = "select dataid from wfc_form_data wfd where requestid = "+bsid;
Map<String, Object> rs = jdbcTemplateresp.queryForMap(sql);
long dataid = (long)rs.get("dataid");
//更新【接口状态字段为2---【接口一】已经执行成功】
sql = "update hi_regapply set jkzt = '2' where id = "+dataid;
jdbcTemplateresp.update(sql);
}
/**
* id2
*/
private boolean judgeInterfaceStatus(String bsid) {
String sql = "select dataid from wfc_form_data wfd where requestid = "+bsid;
Map<String, Object> rs = jdbcTemplateresp.queryForMap(sql);
long dataid = (long)rs.get("dataid");
//更新【接口状态字段为2---【接口一】已经执行成功】
sql = "select jkzt from hi_regapply where id = "+dataid;
rs = jdbcTemplateresp.queryForMap(sql);
String status = String.valueOf(rs.get("jkzt"));
return ("2".equals(status));
}
private JSONArray getDataArray(String bsid, String username, String usercode) {
JSONArray jsonArray = new JSONArray();
String sql = "select dataid from wfc_form_data wfd where requestid = "+bsid;

@ -59,7 +59,7 @@ public class SunCompanyDpToNcc implements EsbServerlessRpcRemoteInterface {
String usercode = (String)params.get("usercode");
String applyer = (String) params.get("applyer");
String usedate = (String) params.get("usedate");
String zryda = "";
String zryda = "";
try {
//同步明细

@ -8,7 +8,7 @@ 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\"}";
String str = "{\"data\":[{\"waflag\":\"Y\",\"begindate\":\"2024-03-18\",\"wa_prmlv\":\"\",\"pk_wa_item_showname\":\"基本工资标准\",\"pk_wa_grd_showname\":\"\",\"negotiation_wage\":\"Y\",\"vnote\":\"1\",\"nmoney\":\"1.00\",\"psnName\":\"许轲\",\"psnCode\":\"00058978\"},{\"waflag\":\"Y\",\"begindate\":\"2024-03-18\",\"wa_prmlv\":\"13&4档\",\"pk_wa_item_showname\":\"效益工资标准\",\"pk_wa_grd_showname\":\"陕建六建集团效益工资标准\",\"negotiation_wage\":\"N\",\"vnote\":\"2\",\"nmoney\":\"1304.00\",\"psnName\":\"许轲\",\"psnCode\":\"00058978\"}],\"state\":\"2\",\"pk_org\":\"0001A21000000000IR6D\"}";
NccApiUtil nccApiUtil = new NccApiUtil();
nccApiUtil.init();
String token = nccApiUtil.getToken();

@ -58,7 +58,7 @@ public class ZhiGongnbdpToNcc implements EsbServerlessRpcRemoteInterface {
String usercode = (String)params.get("usercode");
String applyer = (String) params.get("applyer");
String usedate = (String) params.get("usedate");
String zryda = "";
String zryda = "";
try {
//同步明细

@ -0,0 +1,40 @@
package com.weaver.seconddev.sxjg.util;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class FileUtils{
/**
*
*
* @param request
* @param fileName
* @return
*/
public static String setFileDownloadHeader(HttpServletRequest request, String fileName)throws UnsupportedEncodingException {
final String agent = request.getHeader("USER-AGENT");
String filename = fileName;
//根据浏览器进行文件名的替换
if(agent.contains("MSIE")){
//IE浏览器
filename = URLEncoder.encode(filename,"utf-8");
filename = filename.replace("+"," ");
}else if(agent.contains("Firefox")){
//火狐浏览器
filename = new String(fileName.getBytes(),"ISO8859-1");
}else if(agent.contains("Chrome")){
//谷歌浏览器
filename = URLEncoder.encode(filename,"utf-8");
}else{
// 其它浏览器
filename = URLEncoder.encode(filename, "utf-8");
}
return filename;
}
}

@ -6,6 +6,10 @@ public class NccResultUtil {
private Boolean result;
private String description;
public NccResultUtil() {
}
public NccResultUtil(String rs) {
JSONObject rs1 = JSONObject.parseObject(rs);
if(rs1.getBoolean("success")) {

@ -13,6 +13,7 @@ sxjgncc.b6=uf_rcrt_entry1404
sxjgncc.b7=uf_rcrt_entry1452
sxjgncc.b8=uf_rcrt_entry1498
sxjgncc.b9=uf_rcrt_entry1561
sxjgncc.b10=uf_rcrt_entry1615
sxjgncc.b11=uf_rcrt_entry1662
#子企业内部调配报到联系单定薪表

Loading…
Cancel
Save