Compare commits
10 Commits
30fa6ee4ef
...
54270dd8d4
Author | SHA1 | Date |
---|---|---|
|
54270dd8d4 | |
|
290b081039 | |
|
26f4432a6c | |
|
b5ba6250e4 | |
|
0a39995ce0 | |
|
2ac318e680 | |
|
cdcdbdd804 | |
|
89a52f79ca | |
|
30a5ae7f0d | |
|
13b4d92f6f |
|
@ -0,0 +1,20 @@
|
||||||
|
package nccloud.openapi;
|
||||||
|
|
||||||
|
|
||||||
|
public class ArriveResourcesTest extends nccloud.openapi.BaseOpenApiTest {
|
||||||
|
public void save() {
|
||||||
|
String url = "/nccloud/api/pu/arrive/saveFromOrder";
|
||||||
|
|
||||||
|
try {
|
||||||
|
String result = requestOpenApiByJSON(url, "resources/Arrive.json");
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ArriveResourcesTest test = new ArriveResourcesTest();
|
||||||
|
test.save();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,406 @@
|
||||||
|
package nccloud.openapi;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import nc.ws.opm.pub.utils.security.SecurityUtil;
|
||||||
|
import nccloud.openapi.BaseOpenApiTest.HttpClientWapper.Response;
|
||||||
|
import org.apache.commons.httpclient.Header;
|
||||||
|
import org.apache.commons.httpclient.HttpClient;
|
||||||
|
import org.apache.commons.httpclient.NameValuePair;
|
||||||
|
import org.apache.commons.httpclient.methods.GetMethod;
|
||||||
|
import org.apache.commons.httpclient.methods.PostMethod;
|
||||||
|
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||||
|
import org.apache.commons.httpclient.util.EncodingUtil;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
import sun.misc.BASE64Decoder;
|
||||||
|
import sun.misc.BASE64Encoder;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.*;
|
||||||
|
import java.security.spec.X509EncodedKeySpec;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 审批流程接口测试
|
||||||
|
* @author:guoxqc@yonyou.com
|
||||||
|
* @date:2020年10月23日
|
||||||
|
*/
|
||||||
|
public class BaseOpenApiTest {
|
||||||
|
// public static final String BASE_URL_DEV="http://192.168.82.5:9999";
|
||||||
|
public static final String BASE_URL_DEV = "http://127.0.0.1:8088";
|
||||||
|
// public static final String BASE_URL_DEV = "http://192.168.82.104:7788";
|
||||||
|
// public static final String BASE_URL_DEV="http://192.168.82.1:9081";
|
||||||
|
// public static final String BASE_URL_DEV="http://172.23.17.146:8001";
|
||||||
|
/**
|
||||||
|
* APP ID
|
||||||
|
*/
|
||||||
|
public static final String CLIENT_ID;
|
||||||
|
/**
|
||||||
|
* APP Secret
|
||||||
|
*/
|
||||||
|
public static final String CLIENT_SECRET;
|
||||||
|
/**
|
||||||
|
* 公钥
|
||||||
|
*/
|
||||||
|
public static final String PUBLIC_KEY;
|
||||||
|
/**
|
||||||
|
* 账套编码
|
||||||
|
*/
|
||||||
|
public static final String BIZ_CENTER;
|
||||||
|
/**
|
||||||
|
* 用户编码
|
||||||
|
*/
|
||||||
|
public static final String USER_CODE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
ResourceBundle config = ResourceBundle.getBundle("nccloud.openapi.config");
|
||||||
|
CLIENT_ID = config.getString("client_id");
|
||||||
|
CLIENT_SECRET = config.getString("client_secret");
|
||||||
|
PUBLIC_KEY = config.getString("pub_key");
|
||||||
|
BIZ_CENTER = config.getString("biz_center");
|
||||||
|
USER_CODE = config.getString("user_code");
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpClientWapper client = new HttpClientWapper();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public String requestOpenApi(String url, Map<String, Object> param) throws Exception {
|
||||||
|
return requestOpenApi(url, new JSONObject(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public String requestOpenApi(String url, JSONObject param) throws Exception {
|
||||||
|
return requestOpenApi(url, param.toJSONString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url
|
||||||
|
* @param fileName
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public String requestOpenApiByJSON(String url, String fileName) throws Exception {
|
||||||
|
ClassPathResource classPathResorce = new ClassPathResource(fileName, this.getClass());
|
||||||
|
StringBuffer data = new StringBuffer();
|
||||||
|
try {
|
||||||
|
InputStream in = classPathResorce.getInputStream();
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "utf-8"));
|
||||||
|
String line = reader.readLine();
|
||||||
|
while (StringUtils.isNotEmpty(line)) {
|
||||||
|
data.append(line);
|
||||||
|
line = reader.readLine();
|
||||||
|
}
|
||||||
|
} catch (IOException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
return requestOpenApi(url, data.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String requestOpenApi(String url, String param) throws Exception {
|
||||||
|
String accessToken = this.getAccessTokenByClient();
|
||||||
|
System.out.println(param.replace(" ", ""));
|
||||||
|
String sign = digest(CLIENT_ID + PUBLIC_KEY);
|
||||||
|
List<Header> headers = new ArrayList<Header>();
|
||||||
|
headers.add(new Header("Content-Type", "application/json;charset=UTF-8"));
|
||||||
|
headers.add(new Header("signature", sign));
|
||||||
|
headers.add(new Header("ucg_flag", "y"));
|
||||||
|
headers.add(new Header("access_token", accessToken));
|
||||||
|
headers.add(new Header("client_id", CLIENT_ID));
|
||||||
|
Response response;
|
||||||
|
try {
|
||||||
|
response = client.post(BASE_URL_DEV + url, headers.toArray(new Header[headers.size()]), null, param);
|
||||||
|
// System.out.println(response.getData());
|
||||||
|
return response.getData();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
return e.getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param seed 种子,用于生成公钥
|
||||||
|
* @param src 明文
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
* @description RSA加密
|
||||||
|
*/
|
||||||
|
public String pubEncrypt(String seed, String src) throws Exception {
|
||||||
|
String target = null;
|
||||||
|
ByteArrayOutputStream out = null;
|
||||||
|
try {
|
||||||
|
Key key = genPublicKey(PUBLIC_KEY);
|
||||||
|
Cipher cipher = Cipher.getInstance("RSA");
|
||||||
|
cipher.init(1, key);
|
||||||
|
byte[] data = src.getBytes();
|
||||||
|
int inputLen = data.length;
|
||||||
|
out = new ByteArrayOutputStream();
|
||||||
|
int offSet = 0;
|
||||||
|
int i = 0;
|
||||||
|
while (inputLen - offSet > 0) {
|
||||||
|
byte[] cache;
|
||||||
|
;
|
||||||
|
if (inputLen - offSet > 117) {
|
||||||
|
cache = cipher.doFinal(data, offSet, 117);
|
||||||
|
} else {
|
||||||
|
cache = cipher.doFinal(data, offSet, inputLen - offSet);
|
||||||
|
}
|
||||||
|
out.write(cache, 0, cache.length);
|
||||||
|
i++;
|
||||||
|
offSet = i * 117;
|
||||||
|
}
|
||||||
|
target = new BASE64Encoder().encodeBuffer(out.toByteArray());
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new Exception("加密失败" + e.getMessage());
|
||||||
|
} finally {
|
||||||
|
if (out != null) {
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
* @description 信息摘要
|
||||||
|
*/
|
||||||
|
public static String digest(String str) {
|
||||||
|
String encodestr = "";
|
||||||
|
try {
|
||||||
|
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
|
||||||
|
messageDigest.update(str.getBytes(StandardCharsets.UTF_8));
|
||||||
|
encodestr = byte2Hex(messageDigest.digest());
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return encodestr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String byte2Hex(byte[] bytes) {
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
String temp = null;
|
||||||
|
for (int i = 0; i < bytes.length; i++) {
|
||||||
|
temp = Integer.toHexString(bytes[i] & 0xFF);
|
||||||
|
if (temp.length() == 1) {
|
||||||
|
stringBuffer.append("0");
|
||||||
|
}
|
||||||
|
stringBuffer.append(temp);
|
||||||
|
}
|
||||||
|
return stringBuffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param PUBLIC_KEY
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
* @description 根据种子生成密钥对
|
||||||
|
*/
|
||||||
|
public static Key genPublicKey(String seed) throws Exception {
|
||||||
|
Key key = null;
|
||||||
|
try {
|
||||||
|
byte[] keyBytes = new BASE64Decoder().decodeBuffer(seed);
|
||||||
|
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
||||||
|
X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes);
|
||||||
|
key = keyFactory.generatePublic(x509KeySpec);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new Exception("无效的密钥 " + e.getMessage());
|
||||||
|
}
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Http请求包装类
|
||||||
|
*
|
||||||
|
* @author guoxiangqiao
|
||||||
|
* @date 2019年12月11日
|
||||||
|
*/
|
||||||
|
public class HttpClientWapper {
|
||||||
|
public static final int HTTP_STATUS_SUCCESS = 200;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* post请求
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param headers
|
||||||
|
* @param requestBody
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Response post(String url, Header[] headers, NameValuePair[] requestBody, String requestEntityStr) throws Exception {
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
PostMethod postMethod = new PostMethod(url);
|
||||||
|
if (headers != null) {
|
||||||
|
for (Header header : headers) {
|
||||||
|
postMethod.setRequestHeader(header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requestBody != null) {
|
||||||
|
postMethod.setRequestBody(requestBody);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(requestEntityStr)) {
|
||||||
|
StringRequestEntity requestEntity = new StringRequestEntity(requestEntityStr, null, "utf-8");
|
||||||
|
postMethod.setRequestEntity(requestEntity);
|
||||||
|
}
|
||||||
|
int httpStatus = client.executeMethod(postMethod);
|
||||||
|
String result = this.getResponseBodyAsString(postMethod);
|
||||||
|
return new Response(httpStatus, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponseBodyAsString(PostMethod postMethod) throws IOException {
|
||||||
|
byte[] rawdata = null;
|
||||||
|
rawdata = postMethod.getResponseBody();
|
||||||
|
return rawdata != null ? EncodingUtil.getString(rawdata, "utf-8") : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
* @description Map转URL参数
|
||||||
|
* @author guoxqc@yonyou.com
|
||||||
|
* @date 2020年10月22日
|
||||||
|
*/
|
||||||
|
public String getURLParam(Map<String, Object> params) {
|
||||||
|
StringBuffer paramStr = new StringBuffer();
|
||||||
|
if (!params.isEmpty()) {
|
||||||
|
for (Entry<String, Object> kv : params.entrySet()) {
|
||||||
|
paramStr.append(kv.getKey());
|
||||||
|
paramStr.append("=");
|
||||||
|
paramStr.append(kv.getValue());
|
||||||
|
paramStr.append("&");
|
||||||
|
}
|
||||||
|
paramStr.deleteCharAt(paramStr.length() - 1);
|
||||||
|
}
|
||||||
|
return paramStr.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get请求
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param headers
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Response get(String url, Header[] headers, NameValuePair[] params) throws Exception {
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
GetMethod getMethod = new GetMethod(url);
|
||||||
|
if (params != null) {
|
||||||
|
getMethod.setQueryString(params);
|
||||||
|
}
|
||||||
|
if (headers != null) {
|
||||||
|
for (Header header : headers) {
|
||||||
|
getMethod.setRequestHeader(header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int httpStatus = client.executeMethod(getMethod);
|
||||||
|
String result = getMethod.getResponseBodyAsString();
|
||||||
|
return new Response(httpStatus, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取url查询参数
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getQueryString(NameValuePair[] params) {
|
||||||
|
GetMethod getMethod = new GetMethod();
|
||||||
|
getMethod.setQueryString(params);
|
||||||
|
return getMethod.getQueryString();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Response {
|
||||||
|
private int httpStatus;
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
public int getHttpStatus() {
|
||||||
|
return httpStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHttpStatus(int httpStatus) {
|
||||||
|
this.httpStatus = httpStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Response(int httpStatus, String data) {
|
||||||
|
super();
|
||||||
|
this.httpStatus = httpStatus;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Response() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSHA256(String str, String key) throws Exception {
|
||||||
|
byte[] salt = new byte[16];
|
||||||
|
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
|
||||||
|
random.setSeed(key.getBytes());
|
||||||
|
random.nextBytes(salt);
|
||||||
|
String salt_value = new BASE64Encoder().encodeBuffer(salt);
|
||||||
|
return digest(str + salt_value.replaceAll("\r|\n", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
* @description 获取AccessToken
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("static-access")
|
||||||
|
public String getAccessTokenByClient() throws Exception {
|
||||||
|
String url = BASE_URL_DEV + "/nccloud/opm/accesstoken";
|
||||||
|
List<Header> headers = new ArrayList<Header>();
|
||||||
|
headers.add(new Header("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
||||||
|
// 获取信息摘要
|
||||||
|
String signature = getSHA256(CLIENT_ID + CLIENT_SECRET + PUBLIC_KEY, PUBLIC_KEY);
|
||||||
|
// 使用PUBLIC_KEY生成公钥,对CLIENT_SECRET加密
|
||||||
|
SecurityUtil securityUtil = new SecurityUtil();
|
||||||
|
String CLIENT_SECRETEn = URLEncoder.encode(securityUtil.pubEncrypt(PUBLIC_KEY, CLIENT_SECRET), "utf-8");
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("client_id", CLIENT_ID);
|
||||||
|
params.put("userCode", USER_CODE);
|
||||||
|
params.put("grant_type", "client_credentials");
|
||||||
|
params.put("biz_center", BIZ_CENTER);
|
||||||
|
params.put("signature", signature);
|
||||||
|
params.put("client_secret", CLIENT_SECRETEn);
|
||||||
|
try {
|
||||||
|
Response response = client.post(url, headers.toArray(new Header[headers.size()]), null, client.getURLParam(params));
|
||||||
|
System.out.println(response.getData());
|
||||||
|
JSONObject result = JSONObject.parseObject(response.getData());
|
||||||
|
boolean success = result.getBoolean("success");
|
||||||
|
if (success) {
|
||||||
|
return result.getJSONObject("data").getString("access_token");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
package nc.bs.cm.meascostcontrast;
|
package nc.bs.cm.meascostcontrast;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import nc.bd.framework.base.CMArrayUtil;
|
import nc.bd.framework.base.CMArrayUtil;
|
||||||
import nc.bd.framework.db.CMSqlBuilder;
|
import nc.bd.framework.db.CMSqlBuilder;
|
||||||
import nc.cmpub.business.util.CMUtil;
|
import nc.cmpub.business.util.CMUtil;
|
||||||
|
@ -29,6 +27,8 @@ import nc.vo.resa.costcenter.CostCenterVO;
|
||||||
import nc.vo.resa.factor.FactorAsoaVO;
|
import nc.vo.resa.factor.FactorAsoaVO;
|
||||||
import nc.vo.resa.factor.FactorVO;
|
import nc.vo.resa.factor.FactorVO;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位成本对比表-主查询的sql构造类
|
* 单位成本对比表-主查询的sql构造类
|
||||||
*
|
*
|
||||||
|
@ -143,9 +143,9 @@ public class MeasCostQuerySQLBuilder {
|
||||||
|
|
||||||
// todo
|
// todo
|
||||||
sql.append(",");
|
sql.append(",");
|
||||||
sql.append("nvl(cost_factor.project_code,'--') projectcode");
|
sql.append("nvl(cost_factor.project_code,'') projectcode");
|
||||||
sql.append(",");
|
sql.append(",");
|
||||||
sql.append("nvl(cost_factor.project_name,'--') projectname");
|
sql.append("nvl(cost_factor.project_name,'') projectname");
|
||||||
|
|
||||||
// 显示明细区分
|
// 显示明细区分
|
||||||
String[] showDetailDiff = MeasCostUtil.getShowDetailDiff(conditionMap);
|
String[] showDetailDiff = MeasCostUtil.getShowDetailDiff(conditionMap);
|
||||||
|
@ -1098,9 +1098,9 @@ public class MeasCostQuerySQLBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// INNER JOIN bd_project bd_project ON cm_costobject.cprojectid = bd_project.pk_project
|
// INNER JOIN bd_project bd_project ON cm_costobject.cprojectid = bd_project.pk_project
|
||||||
// Áª²éÏîÄ¿±í
|
// 联查项目表 不是所有的物料都启用项目,所以用leftjoin
|
||||||
// todo
|
// todo
|
||||||
sql.innerjoin(ProjectHeadVO.getDefaultTableName());
|
sql.append(" left join " +ProjectHeadVO.getDefaultTableName());
|
||||||
sql.append(" ");
|
sql.append(" ");
|
||||||
sql.append(ProjectHeadVO.getDefaultTableName());
|
sql.append(ProjectHeadVO.getDefaultTableName());
|
||||||
sql.on(ProjectHeadVO.getDefaultTableName(), "pk_project", "cm_costobject", "cprojectid");
|
sql.on(ProjectHeadVO.getDefaultTableName(), "pk_project", "cm_costobject", "cprojectid");
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding='gb2312'?>
|
||||||
|
<module displayname="gl" name="gl">
|
||||||
|
<dependencies>
|
||||||
|
</dependencies>
|
||||||
|
</module>
|
|
@ -0,0 +1,292 @@
|
||||||
|
package nccloud.web.gl.accountrep.action;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import nc.bs.logging.Logger;
|
||||||
|
import nc.vo.pub.BusinessException;
|
||||||
|
import nccloud.framework.core.exception.ExceptionUtils;
|
||||||
|
import nccloud.framework.service.ServiceLocator;
|
||||||
|
import nccloud.framework.web.action.itf.ICommonAction;
|
||||||
|
import nccloud.framework.web.container.IRequest;
|
||||||
|
import nccloud.framework.web.container.SessionContext;
|
||||||
|
import nccloud.framework.web.json.JsonFactory;
|
||||||
|
import nccloud.pubitf.gl.account.IAccountReportWebService;
|
||||||
|
|
||||||
|
public class AccountBalanceTotalQueryAction implements ICommonAction {
|
||||||
|
public AccountBalanceTotalQueryAction() {
|
||||||
|
}
|
||||||
|
public Object doAction(IRequest request) {
|
||||||
|
String json = request.read();
|
||||||
|
Logger.info("busiParam:" + json);
|
||||||
|
Map<String, Object> paraMap = (Map) JsonFactory.create().fromJson(json, Map.class);
|
||||||
|
this.setAppcode(paraMap);
|
||||||
|
|
||||||
|
try {
|
||||||
|
return this.doQuery(getParaMap(paraMap));
|
||||||
|
} catch (BusinessException e) {
|
||||||
|
ExceptionUtils.wrapException(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Object doQuery(Map<String, Object> paraMap) throws BusinessException {
|
||||||
|
|
||||||
|
// 科目余额表数据
|
||||||
|
Map<String, Object> result = ((IAccountReportWebService) ServiceLocator.find(IAccountReportWebService.class)).queryAccBalance((Map<String, Object>) paraMap.get("second"));
|
||||||
|
// 科目辅助余额表数据
|
||||||
|
Map<String, Object> result1 = ((IAccountReportWebService) ServiceLocator.find(IAccountReportWebService.class)).querySubjAssBalanceBooks((Map<String, Object>) paraMap.get("first"));
|
||||||
|
List<Map<String, Object>> data = (List<Map<String, Object>>) result.get("data");
|
||||||
|
List<Map<String, Object>> data1 = (List<Map<String, Object>>) result1.get("data");
|
||||||
|
|
||||||
|
// 过滤掉 data1 中 assname 为空的数据
|
||||||
|
data1 = data1.stream()
|
||||||
|
.filter(item -> item.get("assname") != null && !item.get("assname").toString().trim().isEmpty())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 创建一个映射,根据 acccode 快速查找 data 中的元素
|
||||||
|
Map<String, Map<String, Object>> dataMap = data.stream()
|
||||||
|
.collect(Collectors.toMap(item -> (String) item.get("acccode"), item -> item));
|
||||||
|
for (Map<String, Object> item : data) {
|
||||||
|
String endorint = (String) item.get("endorint");
|
||||||
|
BigDecimal endlocamount = parseEndlocamount((String) item.get("endlocamount")) ;
|
||||||
|
if ("贷".equals(endorint)) {
|
||||||
|
item.put("endlocamount", endlocamount.negate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 构造新的 Map,存储每个父级科目的期末余额之和
|
||||||
|
Map<String, BigDecimal> sumMap = new HashMap<>();
|
||||||
|
|
||||||
|
// 构造新的列表
|
||||||
|
List<Map<String, Object>> mergedList = new ArrayList<>();
|
||||||
|
DecimalFormat decimalFormat = new DecimalFormat("#,##0.00");
|
||||||
|
List<BigDecimal> bigDecimals = new ArrayList<>();
|
||||||
|
for (Map<String, Object> item : data1) {
|
||||||
|
Map<String, Object> linkMap = (Map<String, Object>) item.get("link");
|
||||||
|
String acccode = (String) linkMap.get("acccode");
|
||||||
|
|
||||||
|
String accname = (String) item.get("accname");
|
||||||
|
String parentAcccode = acccode;
|
||||||
|
Map<String, Object> parentItem = dataMap.get(parentAcccode);
|
||||||
|
|
||||||
|
if (parentItem != null) {
|
||||||
|
String endlocamountStr = (String) item.get("endlocamount");
|
||||||
|
String endorint = (String) item.get("endorint");
|
||||||
|
BigDecimal endlocamount = parseEndlocamount(endlocamountStr);
|
||||||
|
// 构造新的 Map
|
||||||
|
Map<String, Object> newItem = new HashMap<>();
|
||||||
|
newItem.put("endlocamount", decimalFormat.format(endlocamount));
|
||||||
|
|
||||||
|
// 根据 endorint 调整 endlocamount 的符号
|
||||||
|
if ("贷".equals(endorint)) {
|
||||||
|
endlocamount = endlocamount.negate();
|
||||||
|
}
|
||||||
|
bigDecimals.add(endlocamount);
|
||||||
|
// 更新 sumMap
|
||||||
|
sumMap.put(parentAcccode, sumMap.getOrDefault(parentAcccode, BigDecimal.ZERO).add(endlocamount));
|
||||||
|
|
||||||
|
newItem.put("pacccode", parentAcccode);
|
||||||
|
newItem.put("pendorint", parentItem.get("endorint"));
|
||||||
|
newItem.put("paccname", parentItem.get("accname"));
|
||||||
|
newItem.put("pendlocamount", parentItem.get("endlocamount"));
|
||||||
|
newItem.put("acccode", acccode);
|
||||||
|
newItem.put("accname", accname); // 假设 data1 中没有 accname,使用父级的 accname
|
||||||
|
newItem.put("assname", item.get("assname"));
|
||||||
|
newItem.put("endorint", item.get("endorint"));
|
||||||
|
// newItem.put("endlocamount", decimalFormat.format(endlocamount));
|
||||||
|
mergedList.add(newItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BigDecimal sum=BigDecimal.valueOf(0);
|
||||||
|
for (BigDecimal bigDecimal : bigDecimals){
|
||||||
|
sum=sum.add(bigDecimal);
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> toBeRemoved = new ArrayList<>();
|
||||||
|
// 计算每个父级科目的 endlocamount 和所有关联 data1 中 endlocamount 的差值
|
||||||
|
for (Map<String, Object> item : mergedList) {
|
||||||
|
String parentAcccode = (String) item.get("pacccode");
|
||||||
|
BigDecimal endlocamount =BigDecimal.ZERO;
|
||||||
|
if( item.get("pendlocamount") instanceof String){
|
||||||
|
String endlocamountStr = (String) item.get("pendlocamount");
|
||||||
|
endlocamount = parseEndlocamount(endlocamountStr);
|
||||||
|
}else if( item.get("pendlocamount") instanceof BigDecimal){
|
||||||
|
endlocamount = (BigDecimal) item.get("pendlocamount");
|
||||||
|
}
|
||||||
|
|
||||||
|
// BigDecimal endlocamount = (BigDecimal) item.get("pendlocamount");
|
||||||
|
BigDecimal sumEndlocamount = sumMap.get(parentAcccode);
|
||||||
|
BigDecimal difference = sumEndlocamount.subtract(endlocamount);
|
||||||
|
if (difference.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
toBeRemoved.add(item);
|
||||||
|
} else {
|
||||||
|
if(endlocamount.compareTo(BigDecimal.ZERO) < 0){
|
||||||
|
item.put("pendlocamount",decimalFormat.format(endlocamount.negate()) );
|
||||||
|
}else{
|
||||||
|
item.put("pendlocamount",decimalFormat.format(endlocamount) );
|
||||||
|
}
|
||||||
|
item.put("difference", decimalFormat.format(difference));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mergedList.removeAll(toBeRemoved);
|
||||||
|
for (int i = 1; i < mergedList.size(); i++) {
|
||||||
|
mergedList.get(i).put("pacccode", "");
|
||||||
|
mergedList.get(i).put("paccname", "");
|
||||||
|
mergedList.get(i).put("pendlocamount", "");
|
||||||
|
mergedList.get(i).put("difference", "");
|
||||||
|
}
|
||||||
|
//{"busiParamJson":"{\"pk_accountingbook\":[\"1001A110000000001PFH\"],\"pk_unit\":[],\"multbusi\":false,\"usesubjversion\":\"N\",\"versiondate\":\"2025-01-02\",\"startlvl\":\"1\",\"endlvl\":\"1\",\"isleave\":true,\"isoutacc\":\"N\",\"startyear\":\"2024\",\"endyear\":\"2024\",\"startperiod\":\"12\",\"endperiod\":\"12\",\"startdate\":\"2024-12-01\",\"endtdate\":\"2024-12-31\",\"includeuntally\":\"N\",\"includeerror\":\"N\",\"includeplcf\":\"Y\",\"includerc\":\"N\",\"pk_currtype\":\"本币\",\"returncurr\":\"1\",\"mutibook\":\"N\",\"showzerooccur\":\"N\",\"showzerobalanceoccur\":\"Y\",\"sumbysubjtype\":\"N\",\"showupsubj\":\"N\",\"currplusacc\":\"Y\",\"balanceori\":\"-1\",\"twowaybalance\":\"N\",\"istree\":\"Y\",\"qryObjs\":[],\"pk_accasoa\":[\"1001A1100000000017SV\"]}","sysParamJson":{"busiaction":"科目辅助余额表-查询","appcode":"20028003","tabid":"","ts":1735815136860,"from":"","pagecs":1735804016325}}
|
||||||
|
|
||||||
|
// 输出合并后的列表
|
||||||
|
for (Map<String, Object> item : mergedList) {
|
||||||
|
System.out.println(item);
|
||||||
|
}
|
||||||
|
return mergedList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析 endlocamount 字符串为 double 类型
|
||||||
|
private static BigDecimal parseEndlocamount(String endlocamountStr) {
|
||||||
|
if (endlocamountStr == null || endlocamountStr.isEmpty()) {
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
// 去除逗号
|
||||||
|
endlocamountStr = endlocamountStr.replace(",", "");
|
||||||
|
try {
|
||||||
|
return BigDecimal.valueOf(Double.parseDouble(endlocamountStr));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private Map<String,Object> getParaMap(Map<String, Object> params) {
|
||||||
|
// 获取传入的参数
|
||||||
|
List<String> pkAccountingBook = (List<String>) params.get("pk_accountingbook");
|
||||||
|
//1001A1100000000017TP
|
||||||
|
List<String> pkAccasoa = (List<String>) params.get("pk_accasoa");
|
||||||
|
// pkAccasoa.add("1001A1100000000017TP");
|
||||||
|
String startYear = (String) params.get("startyear");
|
||||||
|
String endYear = (String) params.get("endyear");
|
||||||
|
String startPeriod = (String) params.get("startperiod");
|
||||||
|
String endPeriod = (String) params.get("endperiod");
|
||||||
|
String startDate = (String) params.get("startdate");
|
||||||
|
String endDate = (String) params.get("enddate");
|
||||||
|
String isleave = (String) params.get("isleave");
|
||||||
|
|
||||||
|
// 创建第一个 Map 对象
|
||||||
|
Map<String, Object> firstBusiParamJson = new HashMap<>();
|
||||||
|
firstBusiParamJson.put("pk_accountingbook", pkAccountingBook);
|
||||||
|
firstBusiParamJson.put("pk_unit", new ArrayList<String>(){});
|
||||||
|
firstBusiParamJson.put("multbusi", false);
|
||||||
|
firstBusiParamJson.put("usesubjversion", "N");
|
||||||
|
// 获取当前日期
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
// 格式化日期为 "yyyy-MM-dd" 格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
String formattedDate = currentDate.format(formatter);
|
||||||
|
|
||||||
|
// 设置 versiondate 为当前日期
|
||||||
|
firstBusiParamJson.put("versiondate", formattedDate);
|
||||||
|
firstBusiParamJson.put("startlvl", "1");
|
||||||
|
firstBusiParamJson.put("endlvl", "1");
|
||||||
|
firstBusiParamJson.put("isleave", isleave);
|
||||||
|
firstBusiParamJson.put("isoutacc", "N");
|
||||||
|
firstBusiParamJson.put("startyear", startYear);
|
||||||
|
firstBusiParamJson.put("endyear", endYear);
|
||||||
|
firstBusiParamJson.put("startperiod", startPeriod);
|
||||||
|
firstBusiParamJson.put("endperiod", endPeriod);
|
||||||
|
firstBusiParamJson.put("startdate", startDate);
|
||||||
|
firstBusiParamJson.put("enddate", endDate);
|
||||||
|
firstBusiParamJson.put("includeuntally", "N");
|
||||||
|
firstBusiParamJson.put("includeerror", "N");
|
||||||
|
firstBusiParamJson.put("includeplcf", "Y");
|
||||||
|
firstBusiParamJson.put("includerc", "N");
|
||||||
|
firstBusiParamJson.put("pk_currtype", "本币");
|
||||||
|
firstBusiParamJson.put("returncurr", "1");
|
||||||
|
firstBusiParamJson.put("mutibook", "N");
|
||||||
|
firstBusiParamJson.put("showzerooccur", "N");
|
||||||
|
firstBusiParamJson.put("showzerobalanceoccur", "Y");
|
||||||
|
firstBusiParamJson.put("sumbysubjtype", "N");
|
||||||
|
firstBusiParamJson.put("showupsubj", "N");
|
||||||
|
firstBusiParamJson.put("currplusacc", "Y");
|
||||||
|
firstBusiParamJson.put("balanceori", "-1");
|
||||||
|
firstBusiParamJson.put("twowaybalance", "N");
|
||||||
|
firstBusiParamJson.put("istree", "Y");
|
||||||
|
firstBusiParamJson.put("qryObjs", new ArrayList<String>(){});
|
||||||
|
firstBusiParamJson.put("pk_accasoa", pkAccasoa);
|
||||||
|
|
||||||
|
// firstBusiParamJson.put("pk_accasoa", pkAccasoa);//1001A1100000000017SV
|
||||||
|
|
||||||
|
Map<String, Object> firstSysParamJson = new HashMap<>();
|
||||||
|
firstSysParamJson.put("busiaction", "科目辅助余额表-查询");
|
||||||
|
firstSysParamJson.put("appcode", "20028003");
|
||||||
|
firstSysParamJson.put("tabid", "");
|
||||||
|
firstSysParamJson.put("ts", System.currentTimeMillis());
|
||||||
|
firstSysParamJson.put("from", "");
|
||||||
|
firstSysParamJson.put("pagecs", System.currentTimeMillis());
|
||||||
|
|
||||||
|
// 创建第二个 Map 对象
|
||||||
|
Map<String, Object> secondBusiParamJson = new HashMap<>();
|
||||||
|
secondBusiParamJson.put("pk_accountingbook", pkAccountingBook);
|
||||||
|
secondBusiParamJson.put("pk_unit", new ArrayList<String>(){});
|
||||||
|
secondBusiParamJson.put("multbusi", false);
|
||||||
|
secondBusiParamJson.put("usesubjversion", "N");
|
||||||
|
secondBusiParamJson.put("versiondate", null);
|
||||||
|
secondBusiParamJson.put("startlvl", "1");
|
||||||
|
secondBusiParamJson.put("endlvl", "1");
|
||||||
|
secondBusiParamJson.put("isleave", isleave);
|
||||||
|
secondBusiParamJson.put("isoutacc", "N");
|
||||||
|
secondBusiParamJson.put("startyear", startYear);
|
||||||
|
secondBusiParamJson.put("endyear", endYear);
|
||||||
|
secondBusiParamJson.put("startperiod", startPeriod);
|
||||||
|
secondBusiParamJson.put("endperiod", endPeriod);
|
||||||
|
secondBusiParamJson.put("startdate", startDate);
|
||||||
|
secondBusiParamJson.put("endtdate", endDate);
|
||||||
|
secondBusiParamJson.put("includeuntally", "N");
|
||||||
|
secondBusiParamJson.put("includeerror", "N");
|
||||||
|
secondBusiParamJson.put("includeplcf", "Y");
|
||||||
|
secondBusiParamJson.put("includerc", "N");
|
||||||
|
secondBusiParamJson.put("pk_currtype", "本币");
|
||||||
|
secondBusiParamJson.put("returncurr", "1");
|
||||||
|
secondBusiParamJson.put("mutibook", "N");
|
||||||
|
secondBusiParamJson.put("showzerooccur", "N");
|
||||||
|
secondBusiParamJson.put("showzerobalanceoccur", "Y");
|
||||||
|
secondBusiParamJson.put("currplusacc", "Y");
|
||||||
|
secondBusiParamJson.put("sumbysubjtype", "N");
|
||||||
|
secondBusiParamJson.put("balanceori", "-1");
|
||||||
|
secondBusiParamJson.put("twowaybalance", "N");
|
||||||
|
secondBusiParamJson.put("querybyperiod", true);
|
||||||
|
// secondBusiParamJson.put("pk_accasoa", new ArrayList<String>(){});
|
||||||
|
secondBusiParamJson.put("pk_accasoa", pkAccasoa);//1001A1100000000017SV
|
||||||
|
|
||||||
|
Map<String, Object> secondSysParamJson = new HashMap<>();
|
||||||
|
secondSysParamJson.put("busiaction", "科目余额表-查询");
|
||||||
|
secondSysParamJson.put("appcode", "20023005");
|
||||||
|
secondSysParamJson.put("tabid", "");
|
||||||
|
secondSysParamJson.put("ts", System.currentTimeMillis());
|
||||||
|
secondSysParamJson.put("from", "");
|
||||||
|
secondSysParamJson.put("pagecs", System.currentTimeMillis());
|
||||||
|
Map<String, Object> paraMap = new HashMap<>();
|
||||||
|
Map<String, Object> first = new HashMap<>();
|
||||||
|
first.put("busiParamJson", firstBusiParamJson);
|
||||||
|
first.put("sysParamJson", firstSysParamJson);
|
||||||
|
Map<String, Object> second = new HashMap<>();
|
||||||
|
second.put("busiParamJson2", secondBusiParamJson);
|
||||||
|
second.put("sysParamJson2", secondSysParamJson);
|
||||||
|
paraMap.put("first",firstBusiParamJson);
|
||||||
|
paraMap.put("second",secondBusiParamJson);
|
||||||
|
return paraMap;
|
||||||
|
}
|
||||||
|
private void setAppcode(Map<String, Object> paraMap) {
|
||||||
|
String appcode = SessionContext.getInstance().getAppcode();
|
||||||
|
if (appcode.startsWith("2002305010")) {
|
||||||
|
appcode = (String)paraMap.get("pk_multicol");
|
||||||
|
} else if (appcode.startsWith("2002308010")) {
|
||||||
|
appcode = (String)paraMap.get("pk_report");
|
||||||
|
}
|
||||||
|
|
||||||
|
paraMap.put("appcode", appcode);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,367 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<actions>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.accbalquery</name>
|
||||||
|
<label>科目余额表查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AccountBalanceQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.triaccquery</name>
|
||||||
|
<label>三栏式总账</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.TriAccbooksQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.detailbookquery</name>
|
||||||
|
<label>三栏式明细账</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DetailBookQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.subjassemblequery</name>
|
||||||
|
<label>科目汇总表</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SubjAssembleQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.summarylistquery</name>
|
||||||
|
<label>摘要汇总表</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SummaryListQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookformatquery</name>
|
||||||
|
<label>多栏账定义查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookFormatQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookformatcopy</name>
|
||||||
|
<label>多栏账定义复制</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookFormatCopyAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookformatsave</name>
|
||||||
|
<label>多栏账定义保存</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookFormatSaveAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookformatdelete</name>
|
||||||
|
<label>多栏账定义删除</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookFormatDeleteAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookformatpreview</name>
|
||||||
|
<label>多栏账表格预览</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookFormatPreviewAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookquery</name>
|
||||||
|
<label>多栏账查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookpage</name>
|
||||||
|
<label>多栏账分页信息</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookPageAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assanalysisreportquery</name>
|
||||||
|
<label>辅助分析设置查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssAnalysisReportQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assanalysisreportsave</name>
|
||||||
|
<label>辅助分析设置保存</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssAnalysisReportSaveAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assanalysisreportdelete</name>
|
||||||
|
<label>辅助分析设置删除</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssAnalysisReportDeleteAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assanalysisquery</name>
|
||||||
|
<label>辅助分析查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssAnalysisQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.diarybookspage</name>
|
||||||
|
<label>日记账分页信息</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DiaryBooksPageAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.diarybooksquery</name>
|
||||||
|
<label>日记账查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DiaryBooksQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.dailyreportquery</name>
|
||||||
|
<label>日报表查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DailyReportQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assattqueryobject</name>
|
||||||
|
<label>辅助属性查询对象</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssAttrQueryObjectAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assattquerybalance</name>
|
||||||
|
<label>辅助属性余额查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssAttBalanceQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multianalysisqueryobject</name>
|
||||||
|
<label>多维分析表查询对象</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiAnalysisQueryObjectAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multianalysisquerybook</name>
|
||||||
|
<label>多维分析表查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiAnalysisBookQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.subjassbalancebooksquery</name>
|
||||||
|
<label>科目辅助余额表</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SubjAssBalanceBooksQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assbalancequery</name>
|
||||||
|
<label>辅助余额表</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssBalanceQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.cashdiaryquery</name>
|
||||||
|
<label>现金日记账和银行日记账</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.CashDiaryQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.sequencebooksquery</name>
|
||||||
|
<label>序时账</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SequenceBooksQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.balancebookprint</name>
|
||||||
|
<label>科目余额表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.BalanceBookPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.balancebookoutput</name>
|
||||||
|
<label>科目余额表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.BalanceBookOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assbalanceprint</name>
|
||||||
|
<label>辅助余额表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssBalancePrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assbalanceoutput</name>
|
||||||
|
<label>辅助余额表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssBalanceOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assdetailprint</name>
|
||||||
|
<label>辅助明细账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssDetailPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assdetailoutput</name>
|
||||||
|
<label>辅助明细账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssDetailOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assdetailoutput</name>
|
||||||
|
<label>辅助明细账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssDetailOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.triaccbookprint</name>
|
||||||
|
<label>三栏式总账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.TriAccBookPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.triaccbookoutput</name>
|
||||||
|
<label>三栏式总账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.TriAccBookOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.triaccdetailprint</name>
|
||||||
|
<label>三栏式明细账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DetailBookPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.triaccdetailoutput</name>
|
||||||
|
<label>三栏式明细账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DetailBookOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.sequencebookprint</name>
|
||||||
|
<label>序时账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SequenceBookPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.sequencebookoutput</name>
|
||||||
|
<label>序时账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SequenceBookOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookprint</name>
|
||||||
|
<label>多栏账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.multibookoutput</name>
|
||||||
|
<label>多栏账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.MultiBookOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.subjassbalanceprint</name>
|
||||||
|
<label>科目辅助余额表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SubjAssBalanceBookPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.subjassbalanceoutput</name>
|
||||||
|
<label>科目辅助余额表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SubjAssBalanceBookOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.diarybooksprint</name>
|
||||||
|
<label>日记账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DiaryBooksPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.diarybooksoutput</name>
|
||||||
|
<label>日记账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DiaryBooksOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.cashdiaryprint</name>
|
||||||
|
<label>现金日记账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.BankDiaryPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.cashdiaryoutput</name>
|
||||||
|
<label>现金日记账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.BankDiaryOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.bankdiaryprint</name>
|
||||||
|
<label>银行日记账打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.BankDiaryPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.bankdiaryoutput</name>
|
||||||
|
<label>银行日记账输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.BankDiaryOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.subjassembleprint</name>
|
||||||
|
<label>科目汇总表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SubjAssemblePrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.subjassembleoutput</name>
|
||||||
|
<label>科目汇总表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SubjAssembleOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.summarylistprint</name>
|
||||||
|
<label>摘要汇总表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SummaryListPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.summarylistoutput</name>
|
||||||
|
<label>摘要汇总表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SummaryListOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.dailyreportprint</name>
|
||||||
|
<label>日报表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DailyReportPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.dailyreportoutput</name>
|
||||||
|
<label>日报表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DailyReportOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.capitalreportprint</name>
|
||||||
|
<label>资金日报表打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DailyReportPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.capitalreportoutput</name>
|
||||||
|
<label>资金日报表输出</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DailyReportOutputAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assbalancequeryobject</name>
|
||||||
|
<label>辅助余额查询对象</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssBalanceQueryObjectAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.assdetailquery</name>
|
||||||
|
<label>辅助明细账</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AssDetailQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.budgetlink</name>
|
||||||
|
<label>预算联查报表</label>
|
||||||
|
<clazz>nccloud.web.gl.accountreplink.action.BudgetLinkAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.voucherlinksequence</name>
|
||||||
|
<label>凭证联查序时账</label>
|
||||||
|
<clazz>nccloud.web.gl.accountreplink.action.VoucherLinkSequenceAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.directprint</name>
|
||||||
|
<label>直接打印</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.DirectPrintAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.queryaccount</name>
|
||||||
|
<label>查询科目</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AccountQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.queryassitembyaccountpk</name>
|
||||||
|
<label>查询科目及下级的辅助项(科目余额表联查辅助)</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.QueryAssItemByAccountPKAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.summarylistqueryassitem</name>
|
||||||
|
<label>查询科目及下级的辅助项(摘要汇总表)</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.SummaryListQueryAssItemAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.ufolink</name>
|
||||||
|
<label>企业报表联查</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.UFOLinkAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.expandfun</name>
|
||||||
|
<label>多主体公式展开</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.ExpendFunAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.checkparam</name>
|
||||||
|
<label>账表查询的参数校验</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.CheckParamAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.glproviderdesign</name>
|
||||||
|
<label>语义模型业务数据</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.GLProviderDesignAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>gl.accountrep.accountbalancetotal</name>
|
||||||
|
<label>账账相对查询</label>
|
||||||
|
<clazz>nccloud.web.gl.accountrep.action.AccountBalanceTotalQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
</actions>
|
|
@ -0,0 +1,149 @@
|
||||||
|
<authorizes>
|
||||||
|
<authorize>
|
||||||
|
<!--账表 -->
|
||||||
|
<appcode>20023005,20023010,20023030,20023020,20023025,20023040,2002305005,2002305010,20023055,20023060,2002308005,2002308010,20023015,20023035,20023083,20023081,20023082,20028001,20028002,20028003,20028005,20023085</appcode>
|
||||||
|
<actions>
|
||||||
|
<!-- 账表操作:查询,打印,模板输出,直接输出 -->
|
||||||
|
<!-- 科目余额表 -->
|
||||||
|
<action>gl.accountrep.accbalquery</action>
|
||||||
|
<!-- 三栏式总账 -->
|
||||||
|
<action>gl.accountrep.triaccquery</action>
|
||||||
|
<!-- 三栏式明细账 -->
|
||||||
|
<action>gl.accountrep.detailbookquery</action>
|
||||||
|
<!-- 科目汇总表 -->
|
||||||
|
<action>gl.accountrep.subjassemblequery</action>
|
||||||
|
<!-- 摘要汇总表 -->
|
||||||
|
<action>gl.accountrep.summarylistquery</action>
|
||||||
|
<!-- 多栏账定义查询 -->
|
||||||
|
<action>gl.accountrep.multibookformatquery</action>
|
||||||
|
<!-- 多栏账定义复制 -->
|
||||||
|
<action>gl.accountrep.multibookformatcopy</action>
|
||||||
|
<!-- 多栏账定义保存 -->
|
||||||
|
<action>gl.accountrep.multibookformatsave</action>
|
||||||
|
<!-- 多栏账定义删除 -->
|
||||||
|
<action>gl.accountrep.multibookformatdelete</action>
|
||||||
|
<!-- 多栏账表格预览 -->
|
||||||
|
<action>gl.accountrep.multibookformatpreview</action>
|
||||||
|
<!-- 多栏账查询 -->
|
||||||
|
<action>gl.accountrep.multibookquery</action>
|
||||||
|
<!-- 多栏账分页信息 -->
|
||||||
|
<action>gl.accountrep.multibookpage</action>
|
||||||
|
<!-- 辅助分析设置查询 -->
|
||||||
|
<action>gl.accountrep.assanalysisreportquery</action>
|
||||||
|
<!-- 辅助分析设置保存 -->
|
||||||
|
<action>gl.accountrep.assanalysisreportsave</action>
|
||||||
|
<!-- 辅助分析设置删除 -->
|
||||||
|
<action>gl.accountrep.assanalysisreportdelete</action>
|
||||||
|
<!-- 辅助分析查询 -->
|
||||||
|
<action>gl.accountrep.assanalysisquery</action>
|
||||||
|
<!-- 日记账分页信息 -->
|
||||||
|
<action>gl.accountrep.diarybookspage</action>
|
||||||
|
<!-- 日记账查询 -->
|
||||||
|
<action>gl.accountrep.diarybooksquery</action>
|
||||||
|
<!-- 日报表查询 -->
|
||||||
|
<action>gl.accountrep.dailyreportquery</action>
|
||||||
|
<!-- 辅助属性查询对象 -->
|
||||||
|
<action>gl.accountrep.assattqueryobject</action>
|
||||||
|
<!-- 辅助属性余额查询 -->
|
||||||
|
<action>gl.accountrep.assattquerybalance</action>
|
||||||
|
<!-- 多维分析表查询对象 -->
|
||||||
|
<action>gl.accountrep.multianalysisqueryobject</action>
|
||||||
|
<!-- 多维分析表查询 -->
|
||||||
|
<action>gl.accountrep.multianalysisquerybook</action>
|
||||||
|
<!-- 科目辅助余额表 -->
|
||||||
|
<action>gl.accountrep.subjassbalancebooksquery</action>
|
||||||
|
<!-- 辅助余额表 -->
|
||||||
|
<action>gl.accountrep.assbalancequery</action>
|
||||||
|
<!-- 现金日记账和银行日记账 -->
|
||||||
|
<action>gl.accountrep.cashdiaryquery</action>
|
||||||
|
<!-- 序时账 -->
|
||||||
|
<action>gl.accountrep.sequencebooksquery</action>
|
||||||
|
<!-- 科目余额表打印 -->
|
||||||
|
<action>gl.accountrep.balancebookprint</action>
|
||||||
|
<!-- 科目余额表输出 -->
|
||||||
|
<action>gl.accountrep.balancebookoutput</action>
|
||||||
|
<!-- 辅助余额表打印 -->
|
||||||
|
<action>gl.accountrep.assbalanceprint</action>
|
||||||
|
<!-- 辅助余额表输出 -->
|
||||||
|
<action>gl.accountrep.assbalanceoutput</action>
|
||||||
|
<!-- 辅助明细账打印 -->
|
||||||
|
<action>gl.accountrep.assdetailprint</action>
|
||||||
|
<!-- 辅助明细账打印 -->
|
||||||
|
<action>gl.accountrep.assdetailoutput</action>
|
||||||
|
<!-- 辅助明细账输出 -->
|
||||||
|
<action>gl.accountrep.assdetailoutput</action>
|
||||||
|
<!-- 三栏式总账打印 -->
|
||||||
|
<action>gl.accountrep.triaccbookprint</action>
|
||||||
|
<!-- 三栏式总账输出 -->
|
||||||
|
<action>gl.accountrep.triaccbookoutput</action>
|
||||||
|
<!-- 三栏式明细账打印 -->
|
||||||
|
<action>gl.accountrep.triaccdetailprint</action>
|
||||||
|
<!-- 三栏式明细账输出 -->
|
||||||
|
<action>gl.accountrep.triaccdetailoutput</action>
|
||||||
|
<!-- 序时账打印 -->
|
||||||
|
<action>gl.accountrep.sequencebookprint</action>
|
||||||
|
<!-- 序时账输出 -->
|
||||||
|
<action>gl.accountrep.sequencebookoutput</action>
|
||||||
|
<!-- 多栏账打印 -->
|
||||||
|
<action>gl.accountrep.multibookprint</action>
|
||||||
|
<!-- 多栏账输出 -->
|
||||||
|
<action>gl.accountrep.multibookoutput</action>
|
||||||
|
<!-- 科目辅助余额表打印 -->
|
||||||
|
<action>gl.accountrep.subjassbalanceprint</action>
|
||||||
|
<!-- 科目辅助余额表输出 -->
|
||||||
|
<action>gl.accountrep.subjassbalanceoutput</action>
|
||||||
|
<!-- 日记账打印 -->
|
||||||
|
<action>gl.accountrep.diarybooksprint</action>
|
||||||
|
<!-- 日记账输出 -->
|
||||||
|
<action>gl.accountrep.diarybooksoutput</action>
|
||||||
|
<!-- 现金日记账打印 -->
|
||||||
|
<action>gl.accountrep.cashdiaryprint</action>
|
||||||
|
<!-- 现金日记账输出 -->
|
||||||
|
<action>gl.accountrep.cashdiaryoutput</action>
|
||||||
|
<!-- 银行日记账打印 -->
|
||||||
|
<action>gl.accountrep.bankdiaryprint</action>
|
||||||
|
<!-- 银行日记账输出 -->
|
||||||
|
<action>gl.accountrep.bankdiaryoutput</action>
|
||||||
|
<!-- 科目汇总表打印 -->
|
||||||
|
<action>gl.accountrep.subjassembleprint</action>
|
||||||
|
<!-- 科目汇总表输出 -->
|
||||||
|
<action>gl.accountrep.subjassembleoutput</action>
|
||||||
|
<!-- 摘要汇总表打印 -->
|
||||||
|
<action>gl.accountrep.summarylistprint</action>
|
||||||
|
<!-- 摘要汇总表输出 -->
|
||||||
|
<action>gl.accountrep.summarylistoutput</action>
|
||||||
|
<!-- 日报表打印 -->
|
||||||
|
<action>gl.accountrep.dailyreportprint</action>
|
||||||
|
<!-- 日报表输出 -->
|
||||||
|
<action>gl.accountrep.dailyreportoutput</action>
|
||||||
|
<!-- 资金日报表打印 -->
|
||||||
|
<action>gl.accountrep.capitalreportprint</action>
|
||||||
|
<!-- 资金日报表输出 -->
|
||||||
|
<action>gl.accountrep.capitalreportoutput</action>
|
||||||
|
<!-- 辅助余额查询对象 -->
|
||||||
|
<action>gl.accountrep.assbalancequeryobject</action>
|
||||||
|
<!-- 辅助明细账 -->
|
||||||
|
<action>gl.accountrep.assdetailquery</action>
|
||||||
|
<!-- 预算联查报表 -->
|
||||||
|
<action>gl.accountrep.budgetlink</action>
|
||||||
|
<!-- 凭证联查序时账 -->
|
||||||
|
<action>gl.accountrep.voucherlinksequence</action>
|
||||||
|
<!-- 直接打印 -->
|
||||||
|
<action>gl.accountrep.directprint</action>
|
||||||
|
<!-- 查询科目 -->
|
||||||
|
<action>gl.accountrep.queryaccount</action>
|
||||||
|
<!-- 查询科目及下级的辅助项(科目余额表联查辅助) -->
|
||||||
|
<action>gl.accountrep.queryassitembyaccountpk</action>
|
||||||
|
<!-- 查询科目及下级的辅助项(摘要汇总表) -->
|
||||||
|
<action>gl.accountrep.summarylistqueryassitem</action>
|
||||||
|
<!-- 常用摘要参照 -->
|
||||||
|
<action>fipub.ref.SummaryRef</action>
|
||||||
|
<!-- 用户600026(辅助分析设置的使用人) -->
|
||||||
|
<action>riart.ref.userDefaultRefTreeAction</action>
|
||||||
|
<!-- 账表查询的参数校验 -->
|
||||||
|
<action>gl.accountrep.checkparam</action>
|
||||||
|
<action>gl.voucher.voucherRelatedApp</action>
|
||||||
|
<!-- <action>gl.accountrep.accountbalancetotal</action>-->
|
||||||
|
</actions>
|
||||||
|
</authorize>
|
||||||
|
</authorizes>
|
|
@ -0,0 +1,44 @@
|
||||||
|
<authorizes>
|
||||||
|
<authorize>
|
||||||
|
<!--期末处理关结账-->
|
||||||
|
<appcode>20020BATCL,20020RECON,20020RECOQ,20020TRYBL,2002BATCHRECON,2002CLACC,101006,101007</appcode>
|
||||||
|
<actions>
|
||||||
|
<!--结账刷新期间-->
|
||||||
|
<action>gl.reckoning.refreshperiod</action>
|
||||||
|
<!--结账报告-->
|
||||||
|
<action>gl.reckoning.reckoningreport</action>
|
||||||
|
<!--结账-->
|
||||||
|
<action>gl.reckoning.reckoning</action>
|
||||||
|
<!--反结账-->
|
||||||
|
<action>gl.reckoning.unreckoning</action>
|
||||||
|
<!--关账报告-->
|
||||||
|
<action>gl.reckoning.closereport</action>
|
||||||
|
<!--结账状态查询-->
|
||||||
|
<action>gl.reckoning.reckoningstatus</action>
|
||||||
|
<!--批量结账查询-->
|
||||||
|
<action>gl.reckoning.batchreckoningquery</action>
|
||||||
|
<!--批量结账-->
|
||||||
|
<action>gl.reckoning.batchreckoning</action>
|
||||||
|
<!--批量反结账-->
|
||||||
|
<action>gl.reckoning.batchunreckoning</action>
|
||||||
|
<!--关账报告打印-->
|
||||||
|
<action>gl.settled.closereportprint</action>
|
||||||
|
<!--关账报告输出-->
|
||||||
|
<action>gl.accountrep.closereportoutput</action>
|
||||||
|
<!--结账报告打印-->
|
||||||
|
<action>gl.accountrep.reckoningreportprint</action>
|
||||||
|
<!--结账报告输出-->
|
||||||
|
<action>gl.accountrep.reckoningreportoutput</action>
|
||||||
|
<!--试算-->
|
||||||
|
<action>gl.voucher.calculation</action>
|
||||||
|
<!--试算平衡打印-->
|
||||||
|
<action>gl.voucher.checkbalanceprint</action>
|
||||||
|
<!--税务云-上传-->
|
||||||
|
<action>gl.pfxx.taxcloudupload</action>
|
||||||
|
<!--税务云-请求配置-->
|
||||||
|
<action>gl.pfxx.taxcloudconfig</action>
|
||||||
|
|
||||||
|
<action>gl.accountrep.accountbalancetotal</action>
|
||||||
|
</actions>
|
||||||
|
</authorize>
|
||||||
|
</authorizes>
|
|
@ -74,9 +74,12 @@ public class N_4455_WRITE extends AbstractCompiler2 {
|
||||||
// 通过备料计划的表体主键查询已申请数量
|
// 通过备料计划的表体主键查询已申请数量
|
||||||
String getApplyNumSql = "SELECT NVL(SUM(nassistnum),0) nassistnum "
|
String getApplyNumSql = "SELECT NVL(SUM(nassistnum),0) nassistnum "
|
||||||
+ "FROM ic_sapply_b "
|
+ "FROM ic_sapply_b "
|
||||||
+ "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]' and cgeneralbid != '[bid]'";
|
+ "WHERE NVL(dr,0) = 0 AND csourcebillbid = '[csourcebillbid]'";
|
||||||
getApplyNumSql = getApplyNumSql.replace("[csourcebillbid]", csourcebillbid);
|
getApplyNumSql = getApplyNumSql.replace("[csourcebillbid]", csourcebillbid);
|
||||||
getApplyNumSql = getApplyNumSql.replace("[bid]", bodyVO.getPrimaryKey());
|
// 修改的时候加上子表主键
|
||||||
|
if (null != outVOs[0] && null != outVOs[0].getHead() && null != outVOs[0].getHead().getCgeneralhid()) {
|
||||||
|
getApplyNumSql += " AND cgeneralbid != '" + bodyVO.getPrimaryKey() + "'";
|
||||||
|
}
|
||||||
Object nassistnum = getBaseDAO().executeQuery(getApplyNumSql,
|
Object nassistnum = getBaseDAO().executeQuery(getApplyNumSql,
|
||||||
new ColumnProcessor("nassistnum"));
|
new ColumnProcessor("nassistnum"));
|
||||||
UFDouble applyNum = new UFDouble(String.valueOf(nassistnum));
|
UFDouble applyNum = new UFDouble(String.valueOf(nassistnum));
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
// (powered by FernFlower decompiler)
|
// (powered by FernFlower decompiler)
|
||||||
//
|
//
|
||||||
|
|
||||||
package nc.vo.mmpac.pickm.entity;
|
package nc.vo.pu.m422x.entity;
|
||||||
|
|
||||||
|
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
|
||||||
|
import nc.vo.mmpac.pickm.entity.PickmItemVO;
|
||||||
import nc.vo.pubapp.pattern.model.meta.entity.bill.AbstractBillMeta;
|
import nc.vo.pubapp.pattern.model.meta.entity.bill.AbstractBillMeta;
|
||||||
|
|
||||||
public class PickmAppVOMeta extends AbstractBillMeta {
|
public class PickmAppVOMeta extends AbstractBillMeta {
|
|
@ -8,7 +8,6 @@ package nc.vo.pu.m422x.entity;
|
||||||
import nc.vo.annotation.AggVoInfo;
|
import nc.vo.annotation.AggVoInfo;
|
||||||
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
|
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
|
||||||
import nc.vo.mmpac.pickm.entity.PickmItemVO;
|
import nc.vo.mmpac.pickm.entity.PickmItemVO;
|
||||||
import nc.vo.mmpac.pickm.entity.PickmAppVOMeta;
|
|
||||||
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
|
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
|
||||||
import nc.vo.pubapp.pattern.model.meta.entity.bill.BillMetaFactory;
|
import nc.vo.pubapp.pattern.model.meta.entity.bill.BillMetaFactory;
|
||||||
import nc.vo.pubapp.pattern.model.meta.entity.bill.IBillMeta;
|
import nc.vo.pubapp.pattern.model.meta.entity.bill.IBillMeta;
|
|
@ -0,0 +1,403 @@
|
||||||
|
package nccloud.api.impl.so.m30;
|
||||||
|
|
||||||
|
import nc.bd.itf.tools.BFPubTools;
|
||||||
|
import nc.bs.dao.BaseDAO;
|
||||||
|
import nc.bs.framework.common.NCLocator;
|
||||||
|
import nc.itf.fi.pub.Currency;
|
||||||
|
import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil;
|
||||||
|
import nc.itf.so.m30.self.ISaleOrderMaintain;
|
||||||
|
import nc.itf.so.m30.self.ISaleOrderScriptMaintain;
|
||||||
|
import nc.itf.uap.pf.IPFBusiAction;
|
||||||
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
|
import nc.pubitf.so.m30.api.ISaleOrderQueryAPI;
|
||||||
|
import nc.vo.ml.NCLangRes4VoTransl;
|
||||||
|
import nc.vo.pub.BusinessException;
|
||||||
|
import nc.vo.pub.VOStatus;
|
||||||
|
import nc.vo.pub.lang.UFBoolean;
|
||||||
|
import nc.vo.pub.lang.UFDate;
|
||||||
|
import nc.vo.pub.lang.UFDouble;
|
||||||
|
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
||||||
|
import nc.vo.pubapp.pflow.PfUserObject;
|
||||||
|
import nc.vo.scmpub.check.billvalidate.BillVOsCheckRule;
|
||||||
|
import nc.vo.scmpub.res.billtype.SOBillType;
|
||||||
|
import nc.vo.scmpub.util.StringUtil;
|
||||||
|
import nc.vo.so.m30.entity.SaleOrderBVO;
|
||||||
|
import nc.vo.so.m30.entity.SaleOrderHVO;
|
||||||
|
import nc.vo.so.m30.entity.SaleOrderVO;
|
||||||
|
import nc.vo.so.m30.revise.entity.SaleOrderHistoryBVO;
|
||||||
|
import nc.vo.so.m30.revise.entity.SaleOrderHistoryHVO;
|
||||||
|
import nc.vo.so.m30.revise.entity.SaleOrderHistoryVO;
|
||||||
|
import nc.vo.so.pub.SOConstant;
|
||||||
|
import nc.vo.so.pub.keyvalue.IKeyValue;
|
||||||
|
import nc.vo.so.pub.keyvalue.VOKeyValue;
|
||||||
|
import nc.vo.so.pub.util.AggVOUtil;
|
||||||
|
import nc.vo.so.pub.util.SOCurrencyUtil;
|
||||||
|
import nccloud.api.impl.so.m30.check.SaleOrderValidator;
|
||||||
|
import nccloud.api.impl.so.m30.fill.SaleOrderSaveFillValue;
|
||||||
|
import nccloud.api.impl.so.m30.fill.SetUpdateData;
|
||||||
|
import nccloud.api.so.m30.IAPISaleOrderMaitain;
|
||||||
|
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
||||||
|
import nccloud.dto.scmpub.pflow.SCMCloudPFlowContext;
|
||||||
|
import nccloud.pubitf.scmpub.commit.service.IBatchRunScriptService;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 销售订单维护实现类
|
||||||
|
* @author: yanghff
|
||||||
|
* @date: 2019-10-23 下午4:57:49
|
||||||
|
* @Copyright:
|
||||||
|
*/
|
||||||
|
public class APISaleOrderMaitainImpl2 implements IAPISaleOrderMaitain {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SaleOrderVO[] save(SaleOrderVO[] vos) throws BusinessException {
|
||||||
|
|
||||||
|
SaleOrderVO[] fillvos = vos;
|
||||||
|
// 检查非空项
|
||||||
|
for (SaleOrderVO vo : vos) {
|
||||||
|
SaleOrderHVO hvo = vo.getParentVO();
|
||||||
|
String corigcurrencyid = hvo.getCorigcurrencyid();
|
||||||
|
UFDate dbilldate = hvo.getDbilldate();
|
||||||
|
SaleOrderBVO[] bvos = vo.getChildrenVO();
|
||||||
|
String sql = " select bd_currtype.pk_currtype from bd_currtype where (code='" + hvo.getCorigcurrencyid() + "' or pk_currtype='" + hvo.getCorigcurrencyid() + "') and dr=0 ";
|
||||||
|
Object o = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
if (o != null) {
|
||||||
|
hvo.setCorigcurrencyid(BFPubTools.getString_TrimAsNull(o));
|
||||||
|
} else {
|
||||||
|
throw new BusinessException("表头币种不能为空或币种不存在");
|
||||||
|
}
|
||||||
|
sql = " select bd_currtype.pk_currtype from bd_currtype where (code='" + bvos[0].getCcurrencyid() + "' or pk_currtype='" + bvos[0].getCcurrencyid() + "') and dr=0 ";
|
||||||
|
Object o1 = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
if (o1 == null) {
|
||||||
|
throw new BusinessException("表体币种不能为空或币种不存在");
|
||||||
|
}
|
||||||
|
String csettleorgid = bvos[0].getCsettleorgid();
|
||||||
|
String ccurrencyorgid = o1.toString();
|
||||||
|
UFDouble exchangerate = SOCurrencyUtil.getInCurrencyRateByOrg(csettleorgid, BFPubTools.getString_TrimAsNull(o), ccurrencyorgid, dbilldate);
|
||||||
|
for (SaleOrderBVO bvo : bvos) {
|
||||||
|
bvo.setCcurrencyid(BFPubTools.getString_TrimAsNull(o1));
|
||||||
|
if (!BFPubTools.getString_TrimAsNull(o).equals(ccurrencyorgid)) {
|
||||||
|
bvo.setNexchangerate(exchangerate);
|
||||||
|
} else {
|
||||||
|
bvo.setNexchangerate(UFDouble.ONE_DBL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// bvo.setNexchangerate(rateReturnObject.getRate());
|
||||||
|
// bvo.setCratetype(rateReturnObject.getPk_ratetype());
|
||||||
|
// bvo.setFratecategory( rateReturnObject.getRate_category());
|
||||||
|
// bvo.setDratedate( rateReturnObject.getDate());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BillVOsCheckRule checker = new BillVOsCheckRule(new SaleOrderValidator());
|
||||||
|
checker.check(vos);
|
||||||
|
// 填充默认值
|
||||||
|
new SaleOrderSaveFillValue().setDefValue(vos);
|
||||||
|
// 有值不覆盖
|
||||||
|
for (SaleOrderVO ordervo : vos) {
|
||||||
|
calculatorPrice(ordervo);
|
||||||
|
}
|
||||||
|
|
||||||
|
SaleOrderVO[] combinBillVOs =
|
||||||
|
(SaleOrderVO[]) AggVOUtil.combinBillVO(fillvos, vos);
|
||||||
|
// 保存
|
||||||
|
SaleOrderVO[] retvos =
|
||||||
|
(SaleOrderVO[]) PfServiceScmUtil.processBatch(SOConstant.WRITE,
|
||||||
|
SOBillType.Order.getCode(), combinBillVOs, null, null);
|
||||||
|
|
||||||
|
SaleOrderVO[] billvos = ((ISaleOrderQueryAPI) NCLocator.getInstance().lookup(ISaleOrderQueryAPI.class)).queryVOByIDs(new String[]{retvos[0].getParentVO().getPrimaryKey()});
|
||||||
|
if (billvos != null) {
|
||||||
|
((IPFBusiAction) NCLocator.getInstance().lookup(IPFBusiAction.class)).processAction("APPROVE", billvos[0].getParentVO().getVtrantypecode(), null, billvos[0], null, null);
|
||||||
|
}
|
||||||
|
return retvos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void calculatorPrice(SaleOrderVO ordervo) throws BusinessException {
|
||||||
|
|
||||||
|
|
||||||
|
IKeyValue keyValue = new VOKeyValue<SaleOrderVO>(ordervo);
|
||||||
|
|
||||||
|
|
||||||
|
String ctrantypeid = keyValue.getHeadStringValue(SaleOrderHVO.CTRANTYPEID);
|
||||||
|
if (StringUtil.isEmptyTrimSpace(ctrantypeid)) {
|
||||||
|
ExceptionUtils.wrappBusinessException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4006013_0", "04006013-0024")/*@res "请先选择交易类型!"*/);
|
||||||
|
}
|
||||||
|
// 1.缓存交易类型VO
|
||||||
|
|
||||||
|
SaleOrderBVO[] vbos = ordervo.getChildrenVO();
|
||||||
|
UFDouble sumnum = UFDouble.ZERO_DBL;
|
||||||
|
UFDouble sumnny = UFDouble.ZERO_DBL;
|
||||||
|
String ybpk = ordervo.getParentVO().getCorigcurrencyid();
|
||||||
|
|
||||||
|
for (int i = 0; i < vbos.length; i++) {
|
||||||
|
SaleOrderBVO childrenVO = vbos[i];
|
||||||
|
String zbbz = childrenVO.getCcurrencyid();
|
||||||
|
|
||||||
|
childrenVO.setFtaxtypeflag(1);
|
||||||
|
//得到税率
|
||||||
|
UFDouble ntaxrate = BFPubTools.getUFDouble_NullAsZero(childrenVO.getNtaxrate());
|
||||||
|
|
||||||
|
// 折本汇率
|
||||||
|
UFDouble nexchangerate = childrenVO.getNexchangerate();
|
||||||
|
//含税单价
|
||||||
|
UFDouble nqtorigtaxprice = childrenVO.getNqtorigtaxprice();
|
||||||
|
//无税单价
|
||||||
|
UFDouble nqtorigprice = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100)));
|
||||||
|
// 价税合计
|
||||||
|
// UFDouble norigtaxmny=nqtorigtaxprice.multiply(childrenVO.getNqtunitnum());
|
||||||
|
UFDouble norigtaxmny = nqtorigtaxprice.multiply(childrenVO.getNqtunitnum()).setScale(2, 4);
|
||||||
|
childrenVO.setNorigtaxmny(norigtaxmny);
|
||||||
|
//无税金额
|
||||||
|
UFDouble norigmny = nqtorigprice.multiply(childrenVO.getNqtunitnum());
|
||||||
|
|
||||||
|
childrenVO.setNorigmny(Currency.getFormaUfValue(ybpk, norigmny));
|
||||||
|
//税额
|
||||||
|
childrenVO.setNqtorigprice(nqtorigprice.setScale(4, 4));
|
||||||
|
|
||||||
|
|
||||||
|
//无税本币金额单价
|
||||||
|
UFDouble taxspric = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100)));
|
||||||
|
|
||||||
|
|
||||||
|
sumnum = sumnum.add(childrenVO.getNastnum());
|
||||||
|
sumnny = sumnny.add(childrenVO.getNorigtaxmny());
|
||||||
|
|
||||||
|
|
||||||
|
nqtorigprice = nqtorigprice.setScale(4, 4);
|
||||||
|
//nqtorigtaxnetprc--含税净价
|
||||||
|
childrenVO.setNqtorigtaxnetprc(nqtorigtaxprice);
|
||||||
|
//,nqtorignetprice --无税净价
|
||||||
|
childrenVO.setNqtorignetprice(nqtorigprice);
|
||||||
|
String Vqtunitrate = childrenVO.getVqtunitrate();
|
||||||
|
UFDouble dVqtunitrate = UFDouble.ONE_DBL;
|
||||||
|
if (Vqtunitrate != null) {
|
||||||
|
dVqtunitrate = BFPubTools.getUFDouble_NullAsZero(Vqtunitrate.split("/")[0]);
|
||||||
|
}
|
||||||
|
//,norigtaxprice --主含税单价
|
||||||
|
|
||||||
|
UFDouble wsje = taxspric.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum());
|
||||||
|
if (ybpk.equals(zbbz) && BFPubTools.getString_TrimAsNull(childrenVO.getCqtunitid()).equals(BFPubTools.getString_TrimAsNull(childrenVO.getCastunitid()))) {
|
||||||
|
wsje = taxspric.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wsje = Currency.getFormaUfValue(zbbz, wsje);
|
||||||
|
//本币无税金额
|
||||||
|
childrenVO.setNorigtaxprice(nqtorigtaxprice.div(dVqtunitrate).setScale(4, 4));
|
||||||
|
//,norigprice --主无税单价
|
||||||
|
childrenVO.setNorigprice(nqtorigprice.div(dVqtunitrate).setScale(4, 4));
|
||||||
|
//,norigtaxnetprice --主含税净价
|
||||||
|
childrenVO.setNorigtaxnetprice(childrenVO.getNorigtaxprice());
|
||||||
|
//,norignetprice --主无税净价
|
||||||
|
childrenVO.setNorignetprice(childrenVO.getNorigprice());
|
||||||
|
// ncaltaxmny --计税金额
|
||||||
|
|
||||||
|
// ,nqttaxprice --本币含税单价
|
||||||
|
childrenVO.setNqttaxprice(nqtorigtaxprice.multiply(nexchangerate));
|
||||||
|
//,nqtprice --本币无税单价
|
||||||
|
UFDouble bbwsd = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).multiply(nexchangerate);
|
||||||
|
childrenVO.setNqtprice(bbwsd.setScale(4, 4));
|
||||||
|
//, nqttaxnetprice --本币含税净价
|
||||||
|
childrenVO.setNqttaxnetprice(nqtorigtaxprice.multiply(nexchangerate));
|
||||||
|
//,nqtnetprice --本币无税净价
|
||||||
|
UFDouble Nqtnetprice = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).multiply(nexchangerate);
|
||||||
|
childrenVO.setNqtnetprice(Nqtnetprice.setScale(4, 4));
|
||||||
|
//,ntaxprice --主本币含税单价 , nprice --主本币无税单价
|
||||||
|
childrenVO.setNtaxprice(nqtorigtaxprice.div(dVqtunitrate).multiply(nexchangerate).setScale(4, 4));
|
||||||
|
UFDouble Nprice = nqtorigtaxprice.div(dVqtunitrate).div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).multiply(nexchangerate);
|
||||||
|
childrenVO.setNprice(Nprice.setScale(4, 4));
|
||||||
|
//,ntaxnetprice --主本币含税净价
|
||||||
|
//,nnetprice --主本币无税净价
|
||||||
|
childrenVO.setNtaxnetprice(nqtorigtaxprice.div(dVqtunitrate).multiply(nexchangerate).setScale(4, 4));
|
||||||
|
UFDouble Nnetprice = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).div(dVqtunitrate);
|
||||||
|
childrenVO.setNnetprice(Nnetprice.multiply(nexchangerate).setScale(4, 4));
|
||||||
|
// ,nmny --本币无税金额
|
||||||
|
// ,ntaxmny --本币价税合计
|
||||||
|
childrenVO.setNmny(Currency.getFormaUfValue(zbbz, norigmny.multiply(nexchangerate)));
|
||||||
|
childrenVO.setNtaxmny(nqtorigtaxprice.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum()).setScale(2, 4));
|
||||||
|
// childrenVO.setNtaxmny(nqtorigtaxprice.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum()));
|
||||||
|
childrenVO.setNcaltaxmny(wsje);
|
||||||
|
UFDouble ntax = norigtaxmny.multiply(nexchangerate).sub(wsje);
|
||||||
|
childrenVO.setNtax(ntax.setScale(2, 4));
|
||||||
|
}
|
||||||
|
ordervo.getParentVO().setNtotalnum(sumnum);
|
||||||
|
// ordervo.getParentVO().setNtotalorigmny(sumnny);
|
||||||
|
ordervo.getParentVO().setNtotalorigmny(sumnny.setScale(2, 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SaleOrderVO[] update(SaleOrderVO[] vos) throws BusinessException {
|
||||||
|
|
||||||
|
// 获取参数vo的id
|
||||||
|
Map<String, Set<String>> ids = this.getIds(vos);
|
||||||
|
if (ids.keySet() == null || ids.values() == null
|
||||||
|
|| ids.values().size() == 0) {
|
||||||
|
ExceptionUtils.wrappBusinessException("请传入订单主键和订单行主键");
|
||||||
|
}
|
||||||
|
String[] hids = ids.keySet().toArray(new String[ids.keySet().size()]);
|
||||||
|
// 查询销售订单
|
||||||
|
ISaleOrderMaintain service =
|
||||||
|
NCLocator.getInstance().lookup(ISaleOrderMaintain.class);
|
||||||
|
SaleOrderVO[] originVos = service.querySaleorder(hids);
|
||||||
|
SetUpdateData setData = new SetUpdateData();
|
||||||
|
setData.setData(vos, originVos);
|
||||||
|
setOtherId(vos);
|
||||||
|
// 有值不覆盖
|
||||||
|
SaleOrderVO[] combinBillVOs =
|
||||||
|
(SaleOrderVO[]) AggVOUtil.combinBillVO(vos, originVos);
|
||||||
|
// 设置单据状态
|
||||||
|
for (SaleOrderVO vo : vos) {
|
||||||
|
vo.getParentVO().setStatus(VOStatus.UPDATED);
|
||||||
|
for (SaleOrderBVO bvo : vo.getChildrenVO()) {
|
||||||
|
bvo.setStatus(VOStatus.UPDATED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 保存
|
||||||
|
ISaleOrderScriptMaintain maintainsrv =
|
||||||
|
NCLocator.getInstance().lookup(ISaleOrderScriptMaintain.class);
|
||||||
|
SaleOrderVO[] retvos =
|
||||||
|
maintainsrv.saleOrderUpdate(combinBillVOs, null, originVos);
|
||||||
|
return retvos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 获取参数vo的id
|
||||||
|
* @date: 2019-11-1 上午10:31:42
|
||||||
|
* @version NCC1909
|
||||||
|
*/
|
||||||
|
private Map<String, Set<String>> getIds(SaleOrderVO[] vos) {
|
||||||
|
Map<String, Set<String>> ids = new HashMap<String, Set<String>>();
|
||||||
|
for (SaleOrderVO vo : vos) {
|
||||||
|
String hid = vo.getParentVO().getCsaleorderid();
|
||||||
|
Set<String> bids = new HashSet<String>();
|
||||||
|
for (SaleOrderBVO bvo : vo.getChildrenVO()) {
|
||||||
|
bids.add(bvo.getCsaleorderbid());
|
||||||
|
}
|
||||||
|
ids.put(hid, bids);
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setOtherId(SaleOrderVO[] vos) {
|
||||||
|
for (SaleOrderVO vo : vos) {
|
||||||
|
// 部门、业务员、开票客户编码转id
|
||||||
|
String cdeptvid = vo.getParentVO().getCdeptvid();
|
||||||
|
String cemployeeid = vo.getParentVO().getCdeptvid();
|
||||||
|
String cinvoicecustid = vo.getParentVO().getCdeptvid();
|
||||||
|
try {
|
||||||
|
String sql = "";
|
||||||
|
// 部门
|
||||||
|
if (cdeptvid != null && !cdeptvid.isEmpty()) {
|
||||||
|
sql = " select pk_dept from org_dept where code = '[code]' ";
|
||||||
|
sql = sql.replace("[code]", cdeptvid);
|
||||||
|
Object deptObj = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
NCCForUAPLogger.debug("APISaleOrderMaitainImpl-setOtherId-deptObj:" + deptObj);
|
||||||
|
if (deptObj != null) {
|
||||||
|
String id = BFPubTools.getString_TrimAsNull(deptObj);
|
||||||
|
if (!id.isEmpty()) {
|
||||||
|
vo.getParentVO().setCdeptvid(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 业务员
|
||||||
|
if (cemployeeid != null && !cemployeeid.isEmpty()) {
|
||||||
|
sql = " select pk_psndoc from bd_psndoc where code = '[code]' ";
|
||||||
|
sql = sql.replace("[code]", cemployeeid);
|
||||||
|
Object staffObj = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
NCCForUAPLogger.debug("APISaleOrderMaitainImpl-setOtherId-staffObj:" + staffObj);
|
||||||
|
if (staffObj != null) {
|
||||||
|
String id = BFPubTools.getString_TrimAsNull(staffObj);
|
||||||
|
if (!id.isEmpty()) {
|
||||||
|
vo.getParentVO().setCdeptvid(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 开票客户
|
||||||
|
if (cinvoicecustid != null && !cinvoicecustid.isEmpty()) {
|
||||||
|
sql = " select pk_customer from bd_customer where code = '[code]' ";
|
||||||
|
sql = sql.replace("[code]", cinvoicecustid);
|
||||||
|
Object invCustObj = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
NCCForUAPLogger.debug("APISaleOrderMaitainImpl-setOtherId-invCustObj:" + invCustObj);
|
||||||
|
if (invCustObj != null) {
|
||||||
|
String id = BFPubTools.getString_TrimAsNull(invCustObj);
|
||||||
|
if (!id.isEmpty()) {
|
||||||
|
vo.getParentVO().setCdeptvid(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
NCCForUAPLogger.debug("APISaleOrderMaitainImpl-setOtherId-exp:" + e.getMessage());
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SaleOrderVO[] modify(SaleOrderHistoryVO[] vos) throws BusinessException {
|
||||||
|
for (SaleOrderHistoryVO vo : vos) {
|
||||||
|
SaleOrderHistoryHVO hvo = vo.getParentVO();
|
||||||
|
UFDate dbilldate = hvo.getDbilldate();
|
||||||
|
SaleOrderHistoryBVO[] bvos = vo.getChildrenVO();
|
||||||
|
String sql = " select bd_currtype.pk_currtype from bd_currtype where (code='" + hvo.getCorigcurrencyid() + "' or pk_currtype='" + hvo.getCorigcurrencyid() + "') and dr=0 ";
|
||||||
|
Object o = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
if (o != null) {
|
||||||
|
hvo.setCorigcurrencyid(BFPubTools.getString_TrimAsNull(o));
|
||||||
|
} else {
|
||||||
|
throw new BusinessException("表头币种不能为空或币种不存在");
|
||||||
|
}
|
||||||
|
sql = " select bd_currtype.pk_currtype from bd_currtype where (code='" + bvos[0].getCcurrencyid() + "' or pk_currtype='" + bvos[0].getCcurrencyid() + "') and dr=0 ";
|
||||||
|
Object o1 = new BaseDAO().executeQuery(sql, new ColumnProcessor());
|
||||||
|
if (o1 == null) {
|
||||||
|
throw new BusinessException("表体币种不能为空或币种不存在");
|
||||||
|
}
|
||||||
|
String csettleorgid = bvos[0].getCsettleorgid();
|
||||||
|
String ccurrencyorgid = o1.toString();
|
||||||
|
UFDouble exchangerate = SOCurrencyUtil.getInCurrencyRateByOrg(csettleorgid, BFPubTools.getString_TrimAsNull(o), ccurrencyorgid, dbilldate);
|
||||||
|
for (SaleOrderHistoryBVO bvo : bvos) {
|
||||||
|
bvo.setCcurrencyid(BFPubTools.getString_TrimAsNull(o1));
|
||||||
|
if (!BFPubTools.getString_TrimAsNull(o).equals(ccurrencyorgid)) {
|
||||||
|
bvo.setNexchangerate(exchangerate);
|
||||||
|
} else {
|
||||||
|
bvo.setNexchangerate(UFDouble.ONE_DBL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (SaleOrderVO ordervo : vos) {
|
||||||
|
calculatorPrice(ordervo);
|
||||||
|
}
|
||||||
|
Map<Object, Object> eParam = new HashMap<Object, Object>();
|
||||||
|
eParam.put("nolockandconsist", UFBoolean.TRUE);
|
||||||
|
|
||||||
|
SCMCloudPFlowContext context = new SCMCloudPFlowContext();
|
||||||
|
context.setBillType(SOBillType.Order30R.getCode());
|
||||||
|
PfUserObject userObject = new PfUserObject();
|
||||||
|
userObject.setUserObject(null);
|
||||||
|
context.seteParam(eParam);
|
||||||
|
context.setUserObj(new PfUserObject[]{userObject});
|
||||||
|
context.setBillVos(vos);
|
||||||
|
context.setActionName("REVISEWRITE");
|
||||||
|
IBatchRunScriptService service2 = (IBatchRunScriptService) NCLocator.getInstance().lookup(IBatchRunScriptService.class);
|
||||||
|
SaleOrderHistoryVO[] objects = (SaleOrderHistoryVO[]) service2.run(context, SaleOrderHistoryVO.class);
|
||||||
|
|
||||||
|
|
||||||
|
return (SaleOrderVO[]) NCLocator.getInstance().lookup(IPFBusiAction.class).processAction("APPROVE", "30R", null, objects[0], null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cheageHVo(SaleOrderHistoryVO billvo, SaleOrderVO saleOrderVO) {
|
||||||
|
SaleOrderHistoryHVO hvo = billvo.getParentVO();
|
||||||
|
SaleOrderHVO oldvo = saleOrderVO.getParentVO();
|
||||||
|
hvo.setCinvoicecustid(oldvo.getCinvoicecustid());
|
||||||
|
hvo.setCemployeeid(oldvo.getCemployeeid());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue