20240411最新备份

main
howec 1 year ago
parent 1cbe1badfc
commit 0715f14549

@ -8,7 +8,6 @@ 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;
@ -36,6 +35,7 @@ public class EmployeeSelfServiceController {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
if("1000000000".equals(resJsonObject.getString("code"))) {
JSONArray dataArrayOne = resJsonObject.getJSONArray("data");
//先给query接口加字段isExamine默认false不审核
if(dataArrayOne!=null && dataArrayOne.size() > 0) {
for(int i = 0; i<dataArrayOne.size();i++) {
JSONObject jsonObjectone = dataArrayOne.getJSONObject(i);
@ -64,9 +64,19 @@ public class EmployeeSelfServiceController {
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");
JSONArray afterdata = new JSONArray();
JSONArray changedataArray = dataObj21.getJSONArray("changedata");
if(changedataArray!=null && changedataArray.size()>0) {
for(int i = 0;i<changedataArray.size();i++) {
JSONObject changeobj = changedataArray.getJSONObject(i);
JSONArray afterdata1 = changeobj.getJSONArray("afterData");
if(afterdata1!=null &&afterdata1.size()>0) {
for(int i1 = 0;i1 < afterdata1.size();i1++) {
JSONObject jsonObjecti1 = afterdata1.getJSONObject(i1);
afterdata.add(jsonObjecti1);
}
}
}
}
if(afterdata != null && afterdata.size() > 0) {
dataArrayOne = resJsonObject.getJSONArray("data");
@ -84,8 +94,12 @@ public class EmployeeSelfServiceController {
JSONObject afertObj = afterdata.getJSONObject(x);
String columnValue = afertObj.getString("columnValue");
String columnKey = afertObj.getString("columnKey");
String columnLabel = afertObj.getString("columnLabel");
if(columnKey!=null && columnKey.length()>0 && columnKey.equals(re5.getString("key"))) {
re5.put("isExamine",true);
//将待审核的内容覆盖的原值,前端展示
re5.put("isExamine",true);//isExaminetrue为待审核状态
re5.put("label",columnLabel);
re5.put("value",columnValue);
}
}
}
@ -130,6 +144,22 @@ public class EmployeeSelfServiceController {
return resJsonObject;
}
@WeaPermission(publicPermission = true)
@PostMapping("/persondata/query1")
public JSONObject persondataQuery1(
@RequestBody String body
) throws Exception {
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,r3.toJSONString());
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}
/**
* use:
*/
@ -307,7 +337,10 @@ public class EmployeeSelfServiceController {
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 type = "";
if(obj2.containsKey("type")) {
type = obj2.getString("type");
}
String file_state = obj2.getString("file_state");
//仅checkstatus==0待审核时才展示
if("0".equals(checkstatus)) {
@ -317,13 +350,26 @@ public class EmployeeSelfServiceController {
y2.put("path","");
y2.put("file_state",file_state);
y2.put("isExamine",true);
if(dataObject.containsKey(type)) {
if("0".equals(file_state)) {//新增
if(dataObject.containsKey(type)) {
JSONArray b1 = dataObject.getJSONArray(type);
b1.add(y2);
}else {
JSONArray b2 = new JSONArray();
b2.add(y2);
dataObject.put(type,b2);
}
}else {//删除
JSONArray b1 = dataObject.getJSONArray(type);
b1.add(y2);
}else {
JSONArray b2 = new JSONArray();
b2.add(y2);
dataObject.put(type,b2);
for(int u = 0;u<b1.size();u++) {
JSONObject u1 = b1.getJSONObject(u);
String filenameu = u1.getString("name");
if(filenameu.equals(file_name)) {
u1.put("isExamine",true);
u1.put("file_state",file_state);
u1.put("pk",pk_annex_approve);
}
}
}
}
}
@ -336,6 +382,28 @@ public class EmployeeSelfServiceController {
}
}
/**
* use:
*/
@WeaPermission(publicPermission = true)
@PostMapping("/attachment/query1")
public JSONObject attachmentQuery1(
@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/query";
String rs11 = nccApiUtil.doJsonPost(url,token,requestbody.toJSONString());
try {
JSONObject resJsonObject = JSONObject.parseObject(rs11);
return resJsonObject;
}catch (Exception e) {
throw new Exception(rs11);
}
}
/**

@ -202,7 +202,7 @@ public class PayslipPageController {
return WeaResult.success(result);
}else {
JSONArray result = new JSONArray();
String sql = "select pk_defdoc,defdocname,enablestate,pid from ec_ebuilder_designer.uf_ncc_defdoc where doclistpk = '"+dataSourcePk+"'";
String sql = "select 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);
Map<String, Object> singlemap = null;
if(CollectionUtil.isNotEmpty(rs)) {

@ -84,8 +84,8 @@
// 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");
// r3.put("pk_psndoc","0001A2100000007KUXWS");
// r3.put("tableCode","bd_psndoc");
// NccApiUtil nccApiUtil = new NccApiUtil();
// nccApiUtil.init();
// String token = nccApiUtil.getToken();
@ -122,9 +122,19 @@
// 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");
// JSONArray afterdata = new JSONArray();
// JSONArray changedataArray = dataObj21.getJSONArray("changedata");
// if(changedataArray!=null && changedataArray.size()>0) {
// for(int i = 0;i<changedataArray.size();i++) {
// JSONObject changeobj = changedataArray.getJSONObject(i);
// JSONArray afterdata1 = changeobj.getJSONArray("afterData");
// if(afterdata1!=null &&afterdata1.size()>0) {
// for(int i1 = 0;i1 < afterdata1.size();i1++) {
// JSONObject jsonObjecti1 = afterdata1.getJSONObject(i1);
// afterdata.add(jsonObjecti1);
// }
// }
// }
// }
// if(afterdata != null && afterdata.size() > 0) {
// dataArrayOne = resJsonObject.getJSONArray("data");

Loading…
Cancel
Save