Merge remote-tracking branch 'origin/main'

This commit is contained in:
mzr 2025-04-09 14:06:55 +08:00
commit 9975914490
9 changed files with 1464 additions and 22 deletions

View File

@ -31,6 +31,7 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction
this.validatorCode.add(93);
this.validatorCode.add(94);
this.validatorCode.add(100);
this.validatorCode.remove(44);
}
protected void doBeforeUpdate(AggregatedValueObject[] bills, AggregatedValueObject[] orginBills) throws BusinessException {
@ -41,34 +42,34 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction
}
/**
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
*/
int i = 0;
for(AggregatedValueObject bill : bills) {
AggregatedValueObject oriBill = orginBills[i++];
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
BaseBillVO billOriVO = (BaseBillVO) oriBill.getParentVO(); //之前的收款单
UFDouble money = billVO.getMoney(); //修改后的金额
UFDouble oriMoney = billOriVO.getMoney(); //修改前的金额
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
BaseBillVO billOriVO = (BaseBillVO) oriBill.getParentVO(); //之前的收款单
UFDouble money = billVO.getMoney(); //修改后的金额
UFDouble oriMoney = billOriVO.getMoney(); //修改前的金额
String pk_tradetype = billVO.getPk_tradetype();
if(!"F2-Cxx-02".equals(pk_tradetype)){
continue;
}
String def3 = billVO.getDef3(); //收款单对应的销售订单id
String def3 = billVO.getDef3(); //收款单对应的销售订单id
if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){
//无绑定的销售订单则下一次循环
//无绑定的销售订单则下一次循环
continue;
}
//计算收款单金额差值
//计算收款单金额差值
UFDouble changeMoney = money.sub(oriMoney);
//根据销售订单id去查询销售订单
//根据销售订单id去查询销售订单
BaseDAO dao = new BaseDAO();
String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'";
Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor());
//销售订单价税合计
//销售订单价税合计
UFDouble ntotalorigmny = UFDouble.ZERO_DBL;
//销售订单实际收款金额
//销售订单实际收款金额
UFDouble nreceivedmny = UFDouble.ZERO_DBL;
if(saleMap != null) {
nreceivedmny = new UFDouble(saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString());
@ -76,7 +77,7 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction
}
UFDouble moreMoney = nreceivedmny.add(changeMoney).sub(ntotalorigmny);
if(nreceivedmny.add(changeMoney).compareTo(ntotalorigmny) > 0){
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
}
}

View File

@ -30,7 +30,7 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction {
this.validatorCode.add(8);
this.validatorCode.add(24);
this.validatorCode.add(28);
this.validatorCode.add(44);
// this.validatorCode.add(44);
this.validatorCode.add(46);
this.validatorCode.add(31);
this.validatorCode.add(36);
@ -59,29 +59,29 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction {
ArapBillVOUtils.setDefaultSettleFlag(bills);
/**
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
* 收款单保存校验关联的销售订单实际收款金额是否超过价税合计
*/
for(AggregatedValueObject bill : bills) {
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
UFDouble money = billVO.getMoney(); //金额
BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单
UFDouble money = billVO.getMoney(); //金额
String pk_tradetype = billVO.getPk_tradetype();
if(!"F2-Cxx-02".equals(pk_tradetype)){
continue;
}
String def3 = billVO.getDef3(); //收款单对应的销售订单id
String def3 = billVO.getDef3(); //收款单对应的销售订单id
if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){
//无绑定的销售订单则下一次循环
//无绑定的销售订单则下一次循环
continue;
}
//根据销售订单id去查询销售订单
//根据销售订单id去查询销售订单
BaseDAO dao = new BaseDAO();
String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'";
Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor());
//销售订单价税合计
//销售订单价税合计
UFDouble ntotalorigmny = UFDouble.ZERO_DBL;
//销售订单实际收款金额
//销售订单实际收款金额
UFDouble nreceivedmny = UFDouble.ZERO_DBL;
if(saleMap != null) {
nreceivedmny = new UFDouble(saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString());
@ -89,7 +89,7 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction {
}
UFDouble moreMoney = nreceivedmny.add(money).sub(ntotalorigmny);
if(nreceivedmny.add(money).compareTo(ntotalorigmny) > 0){
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】");
}
}
}

View File

@ -0,0 +1,306 @@
package nccloud.web.gl.accountrep.action;
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;
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;
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);
if(pkAccasoa.isEmpty() || pkAccasoa.get(0).equals("")){
firstBusiParamJson.put("isleave", "N");
firstBusiParamJson.put("pk_accasoa", new ArrayList<String>(){});
}else{
firstBusiParamJson.put("isleave", null);
}
// 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("enddate", 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", pkAccasoa);//1001A1100000000017SV
if(pkAccasoa.isEmpty() || pkAccasoa.get(0).equals("")){
secondBusiParamJson.put("isleave", "N");
secondBusiParamJson.put("pk_accasoa", new ArrayList<String>(){});
}else{
secondBusiParamJson.put("isleave", null);
}
secondBusiParamJson.put("appcode", "20023005");
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);
}
}

View File

@ -0,0 +1,404 @@
<?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>
<btncode>add,edit,alter</btncode>
</action>
<action>
<name>gl.accountrep.assanalysisreportdelete</name>
<label>辅助分析设置删除</label>
<clazz>nccloud.web.gl.accountrep.action.AssAnalysisReportDeleteAction</clazz>
<btncode>delete</btncode>
</action>
<action>
<name>gl.accountrep.assanalysisquery</name>
<label>辅助分析查询</label>
<clazz>nccloud.web.gl.accountrep.action.AssAnalysisQueryAction</clazz>
<btncode>directprint</btncode>
</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>
<btncode>directprint</btncode>
</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>
<btncode>directprint</btncode>
</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>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.balancebookoutput</name>
<label>科目余额表输出</label>
<clazz>nccloud.web.gl.accountrep.action.BalanceBookOutputAction</clazz>
<btncode>directprint</btncode>
</action>
<action>
<name>gl.accountrep.assbalanceprint</name>
<label>辅助余额表打印</label>
<clazz>nccloud.web.gl.accountrep.action.AssBalancePrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.assbalanceoutput</name>
<label>辅助余额表输出</label>
<clazz>nccloud.web.gl.accountrep.action.AssBalanceOutputAction</clazz>
<btncode>directprint,templateOutput</btncode>
</action>
<action>
<name>gl.accountrep.assdetailprint</name>
<label>辅助明细账打印</label>
<clazz>nccloud.web.gl.accountrep.action.AssDetailPrintAction</clazz>
<btncode>print</btncode>
</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>
<btncode>directprint,templateOutput</btncode>
</action>
<action>
<name>gl.accountrep.triaccbookprint</name>
<label>三栏式总账打印</label>
<clazz>nccloud.web.gl.accountrep.action.TriAccBookPrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.triaccbookoutput</name>
<label>三栏式总账输出</label>
<clazz>nccloud.web.gl.accountrep.action.TriAccBookOutputAction</clazz>
<btncode>directprint,templateOutput</btncode>
</action>
<action>
<name>gl.accountrep.triaccdetailprint</name>
<label>三栏式明细账打印</label>
<clazz>nccloud.web.gl.accountrep.action.DetailBookPrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.triaccdetailoutput</name>
<label>三栏式明细账输出</label>
<clazz>nccloud.web.gl.accountrep.action.DetailBookOutputAction</clazz>
<btncode>directprint,templateOutput</btncode>
</action>
<action>
<name>gl.accountrep.sequencebookprint</name>
<label>序时账打印</label>
<clazz>nccloud.web.gl.accountrep.action.SequenceBookPrintAction</clazz>
<btncode>print</btncode>
</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>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.multibookoutput</name>
<label>多栏账输出</label>
<clazz>nccloud.web.gl.accountrep.action.MultiBookOutputAction</clazz>
<btncode>directprint,templateOutput</btncode>
</action>
<action>
<name>gl.accountrep.subjassbalanceprint</name>
<label>科目辅助余额表打印</label>
<clazz>nccloud.web.gl.accountrep.action.SubjAssBalanceBookPrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.subjassbalanceoutput</name>
<label>科目辅助余额表输出</label>
<clazz>nccloud.web.gl.accountrep.action.SubjAssBalanceBookOutputAction</clazz>
<btncode>directprint</btncode>
</action>
<action>
<name>gl.accountrep.diarybooksprint</name>
<label>日记账打印</label>
<clazz>nccloud.web.gl.accountrep.action.DiaryBooksPrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.diarybooksoutput</name>
<label>日记账输出</label>
<clazz>nccloud.web.gl.accountrep.action.DiaryBooksOutputAction</clazz>
<btncode>printexcel,printoutput</btncode>
</action>
<action>
<name>gl.accountrep.cashdiaryprint</name>
<label>现金日记账打印</label>
<clazz>nccloud.web.gl.accountrep.action.BankDiaryPrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.cashdiaryoutput</name>
<label>现金日记账输出</label>
<clazz>nccloud.web.gl.accountrep.action.BankDiaryOutputAction</clazz>
<btncode>directprint,templateOutput</btncode>
</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>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.subjassembleoutput</name>
<label>科目汇总表输出</label>
<clazz>nccloud.web.gl.accountrep.action.SubjAssembleOutputAction</clazz>
<btncode>directprint</btncode>
</action>
<action>
<name>gl.accountrep.summarylistprint</name>
<label>摘要汇总表打印</label>
<clazz>nccloud.web.gl.accountrep.action.SummaryListPrintAction</clazz>
<btncode>print</btncode>
</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>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.dailyreportoutput</name>
<label>日报表输出</label>
<clazz>nccloud.web.gl.accountrep.action.DailyReportOutputAction</clazz>
<btncode>directprint,templateOutput</btncode>
</action>
<action>
<name>gl.accountrep.capitalreportprint</name>
<label>资金日报表打印</label>
<clazz>nccloud.web.gl.accountrep.action.DailyReportPrintAction</clazz>
<btncode>print</btncode>
</action>
<action>
<name>gl.accountrep.capitalreportoutput</name>
<label>资金日报表输出</label>
<clazz>nccloud.web.gl.accountrep.action.DailyReportOutputAction</clazz>
<btncode>directprint</btncode>
</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>
<btncode>directprint,print</btncode>
</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.AdaptAccountRepLinkParam</name>
<label>联查报表获取参数值</label>
<clazz>nccloud.web.gl.accountreplink.action.AdaptAccountRepLinkParamAction</clazz>
</action>
<action>
<name>gl.accountrep.accountbalancetotal</name>
<label>账账相对查询</label>
<clazz>nccloud.web.gl.accountrep.action.AccountBalanceTotalQueryAction</clazz>
</action>
</actions>

View File

@ -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>

View File

@ -0,0 +1,176 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package nc.bs.mmpac.pickm.bp;
import nc.bs.mmpac.pickm.plugin.PickmPluginPoint;
import nc.bs.mmpac.pickm.rule.*;
import nc.bs.mmpac.pickm.rule.ic.PickmATPCheckRule;
import nc.bs.mmpac.pickm.rule.ic.PickmAutoReserveRule;
import nc.bs.mmpac.pickm.rule.sc.PickmSetDeftValueForScRule;
import nc.bs.mmpac.pickm.rule.sc.PickmSetItemDeftValueForScRule;
import nc.bs.mmpub.rule.MMAutoMaterialAssignRule;
import nc.bs.pubapp.pub.rule.FieldLengthCheckRule;
import nc.bs.pubapp.pub.rule.OrgDisabledCheckRule;
import nc.bsutil.mmpac.pickm.PickmSagasUtil;
import nc.impl.pubapp.bd.userdef.UserDefSaveRule;
import nc.impl.pubapp.pattern.data.bill.template.BillInsertOperator;
import nc.impl.pubapp.pattern.data.bill.template.InsertBPTemplate;
import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool;
import nc.impl.pubapp.pattern.rule.IRule;
import nc.impl.pubapp.pattern.rule.processer.AroundProcesser;
import nc.impl.pubapp.pattern.rule.template.IOperator;
import nc.util.mmf.busi.rule.MMBillCodeCheckAndTrantypeRule;
import nc.util.mmf.busi.rule.MMCreateBillcodeAndTrantypecodeRule;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.mmpac.pickm.entity.AggPickmVO;
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
import nc.vo.mmpac.pickm.entity.PickmItemVO;
import nc.vo.mmpac.pickm.enumeration.FsourcetypeEnum;
import java.util.ArrayList;
import java.util.List;
public class PickmInsertForScBP {
public PickmInsertForScBP() {
}
public void savePickmForSc(PickmHeadVO[] headVOs) {
if (!MMValueCheck.isEmpty(headVOs)) {
List<AggPickmVO> aggPickmVOList = new ArrayList();
AggPickmVO aggPickmVO = null;
for(PickmHeadVO headVO : headVOs) {
headVO.setFsourcetype(FsourcetypeEnum.WWBILL_STATE.toInteger());
aggPickmVO = new AggPickmVO();
aggPickmVO.setParent(headVO);
aggPickmVOList.add(aggPickmVO);
}
AggPickmVO[] retVOs = this.savePickmForSc((AggPickmVO[])aggPickmVOList.toArray(new AggPickmVO[0]));
IRule<AggPickmVO> pickmAutoApproveRule = new PickmAutoApproveAfterSaveRule();
pickmAutoApproveRule.process(retVOs);
}
}
public void savePickmForSc2(AggPickmVO[] vos) {
if (!MMValueCheck.isEmpty(vos)) {
AggPickmVO[] retVOs = this.savePickmForSc(vos);
IRule<AggPickmVO> pickmAutoApproveRule = new PickmAutoApproveAfterSaveRule();
pickmAutoApproveRule.process(retVOs);
}
}
private void addAfterRule(AroundProcesser<AggPickmVO> processor) {
IRule<AggPickmVO> billCodeCheckRule = new MMBillCodeCheckAndTrantypeRule("55A3", "vbillcode", "pk_group", "pk_org", "vbusitype");
processor.addAfterRule(billCodeCheckRule);
IRule<AggPickmVO> atpCheckRule = new PickmATPCheckRule(false, (AggPickmVO[])null);
processor.addAfterRule(atpCheckRule);
IRule<AggPickmVO> autoReserveRule = new PickmAutoReserveRule();
processor.addAfterRule(autoReserveRule);
}
private void addBeforeRule(AroundProcesser<AggPickmVO> processor) {
IRule<AggPickmVO> orgRule = new OrgDisabledCheckRule("pk_org", "FACTORYTYPE000000000");
processor.addBeforeRule(orgRule);
IRule<AggPickmVO> getMakeDateRule = new PickmMakeDateRule();
processor.addBeforeRule(getMakeDateRule);
IRule<AggPickmVO> setForScRule = new PickmSetDeftValueForScRule();
processor.addBeforeRule(setForScRule);
IRule<AggPickmVO> billcodeRule = new MMCreateBillcodeAndTrantypecodeRule("55A3", "vbillcode", "pk_group", "pk_org", "vbusitype");
processor.addBeforeRule(billcodeRule);
IRule<AggPickmVO> createSubItemRule = new PickmCreateSubItemRule(false);
processor.addBeforeRule(createSubItemRule);
IRule<AggPickmVO> setItemForScRule = new PickmSetItemDeftValueForScRule();
processor.addBeforeRule(setItemForScRule);
IRule<AggPickmVO> sameRule = new PickmCheckSameStockRule();
processor.addBeforeRule(sameRule);
IRule<AggPickmVO> checkSameRow = new PickmRowNoRule();
processor.addBeforeRule(checkSameRow);
IRule<AggPickmVO> lengthCheckRule = new FieldLengthCheckRule();
processor.addBeforeRule(lengthCheckRule);
IRule<AggPickmVO> autoHMaterialAssignRule = new MMAutoMaterialAssignRule("cmaterialvid", (String)null, new String[]{"pk_org"}, (String[])null);
processor.addBeforeFinalRule(autoHMaterialAssignRule);
IRule<AggPickmVO> autobMaterialAssignRule = new MMAutoMaterialAssignRule((String)null, "cbmaterialvid", new String[]{"pk_org"}, new String[]{"cdeliverorgid", "csupplyorgid"});
processor.addBeforeFinalRule(autobMaterialAssignRule);
IRule<AggPickmVO> marperRule = new PickmCheckMaterialPermissionRule();
processor.addBeforeRule(marperRule);
IRule<AggPickmVO> bmarperRule = new PickmCheckItemMaterialPermissionRule();
processor.addBeforeRule(bmarperRule);
IRule<AggPickmVO> pickmSaveRule = new PickmSaveRule();
processor.addBeforeRule(pickmSaveRule);
IRule<AggPickmVO> atpCheckRule = new PickmATPCheckRule(true, (AggPickmVO[])null);
processor.addBeforeRule(atpCheckRule);
IRule<AggPickmVO> userDefSaveRule = new UserDefSaveRule(new String[]{"vdef", "vbdef"}, new Class[]{PickmHeadVO.class, PickmItemVO.class});
processor.addBeforeRule(userDefSaveRule);
}
private AggPickmVO[] savePickmForSc(AggPickmVO[] vos) {
if (MMValueCheck.isEmpty(vos)) {
return null;
} else {
new BillTransferTool(vos);
InsertBPTemplate<AggPickmVO> bp = new InsertBPTemplate(PickmPluginPoint.INSERTFORSC);
this.addBeforeRule(bp.getAroundProcesser());
this.addAfterRule(bp.getAroundProcesser());
bp.getAroundProcesser().before(vos);
IOperator<AggPickmVO> operator = new BillInsertOperator();
AggPickmVO[] aggvos = (AggPickmVO[])operator.operate(vos);
PickmSagasUtil.addSagaAndCompensate4Insert(aggvos);
bp.getAroundProcesser().after(aggvos);
return aggvos;
}
}
public void savePickmForScSagasCheck(PickmHeadVO[] headVOs) {
if (!MMValueCheck.isEmpty(headVOs)) {
List<AggPickmVO> aggPickmVOList = new ArrayList();
AggPickmVO aggPickmVO = null;
for(PickmHeadVO headVO : headVOs) {
headVO.setFsourcetype(FsourcetypeEnum.WWBILL_STATE.toInteger());
aggPickmVO = new AggPickmVO();
aggPickmVO.setParent(headVO);
aggPickmVOList.add(aggPickmVO);
}
new BillTransferTool((AggPickmVO[])aggPickmVOList.toArray(new AggPickmVO[0]));
InsertBPTemplate<AggPickmVO> bp = new InsertBPTemplate(PickmPluginPoint.INSERTFORSC);
this.addBeforeRuleSagasCheck(bp.getAroundProcesser());
bp.getAroundProcesser().before((AggPickmVO[])aggPickmVOList.toArray(new AggPickmVO[0]));
}
}
private void addBeforeRuleSagasCheck(AroundProcesser<AggPickmVO> processor) {
IRule<AggPickmVO> orgRule = new OrgDisabledCheckRule("pk_org", "FACTORYTYPE000000000");
processor.addBeforeRule(orgRule);
IRule<AggPickmVO> getMakeDateRule = new PickmMakeDateRule();
processor.addBeforeRule(getMakeDateRule);
IRule<AggPickmVO> setForScRule = new PickmSetDeftValueForScRule();
processor.addBeforeRule(setForScRule);
IRule<AggPickmVO> createSubItemRule = new PickmCreateSubItemRule(false);
processor.addBeforeRule(createSubItemRule);
IRule<AggPickmVO> setItemForScRule = new PickmSetItemDeftValueForScRule();
processor.addBeforeRule(setItemForScRule);
IRule<AggPickmVO> sameRule = new PickmCheckSameStockRule();
processor.addBeforeRule(sameRule);
IRule<AggPickmVO> checkSameRow = new PickmRowNoRule();
processor.addBeforeRule(checkSameRow);
IRule<AggPickmVO> lengthCheckRule = new FieldLengthCheckRule();
processor.addBeforeRule(lengthCheckRule);
IRule<AggPickmVO> marperRule = new PickmCheckMaterialPermissionRule();
processor.addBeforeRule(marperRule);
IRule<AggPickmVO> bmarperRule = new PickmCheckItemMaterialPermissionRule();
processor.addBeforeRule(bmarperRule);
IRule<AggPickmVO> pickmSaveRule = new PickmSaveRule();
processor.addBeforeRule(pickmSaveRule);
IRule<AggPickmVO> atpCheckRule = new PickmATPCheckRule(true, (AggPickmVO[])null);
processor.addBeforeRule(atpCheckRule);
IRule<AggPickmVO> userDefSaveRule = new UserDefSaveRule(new String[]{"vdef", "vbdef"}, new Class[]{PickmHeadVO.class, PickmItemVO.class});
processor.addBeforeRule(userDefSaveRule);
}
}

View File

@ -0,0 +1,110 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package nc.impl.sc.m61.action.maintain.rule;
import nc.bs.framework.common.NCLocator;
import nc.impl.pubapp.pattern.rule.IRule;
import nc.itf.mmpac.pickm.IPickmMaintainService;
import nc.itf.sc.m61.compenstate.IScOrderSagasCompensate;
import nc.itf.sc.reference.mm.PubMMPACService;
import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil;
import nc.vo.mmpac.pickm.entity.AggPickmVO;
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nc.vo.sc.m61.entity.SCOrderItemVO;
import nc.vo.sc.m61.entity.SCOrderVO;
import nc.vo.scmpub.res.billtype.MMBillType;
import nc.vo.scmpub.res.billtype.SCBillType;
import nc.vo.scmpub.util.ArrayUtil;
import nccloud.commons.lang.ArrayUtils;
import nccloud.pubitf.sc.pub.util.ScSagasUtil;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SCOrderPushMoRule implements IRule<SCOrderVO> {
public SCOrderPushMoRule() {
}
public void process(SCOrderVO[] vos) {
if (!ArrayUtils.isEmpty(vos)) {
try {
// 分组处理逻辑
List<SCOrderVO> specialList = new ArrayList<>();
List<SCOrderVO> normalList = new ArrayList<>();
for (SCOrderVO vo : vos) {
// 假设通过 getBilltype() 获取单据类型请根据实际字段调整
if ("61-Cxx-01".equals(vo.getParentVO().getVtrantypecode()) ){
specialList.add(vo);
} else {
normalList.add(vo);
}
}
List<PickmHeadVO> headList = new ArrayList<>();
// 特殊类型处理
if (!specialList.isEmpty()) {
AggPickmVO[] specialPickVos = (AggPickmVO[]) PfServiceScmUtil.exeVOChangeByBillItfDef(
"61-Cxx-01", // 特殊类型编码
MMBillType.PickMo.getCode(),
vos);
IPickmMaintainService ipickmMaintainService = NCLocator.getInstance().lookup(IPickmMaintainService.class);
ipickmMaintainService.insert(specialPickVos);
}
// 常规处理
if (!normalList.isEmpty()) {
AggPickmVO[] normalPickVos = (AggPickmVO[]) PfServiceScmUtil.exeVOChangeByBillItfDef(
SCBillType.Order.getCode(),
MMBillType.PickMo.getCode(),
normalList.toArray(new SCOrderVO[0]));
for(AggPickmVO vo : normalPickVos) {
PickmHeadVO head = (PickmHeadVO)vo.getParent();
headList.add(head);
}
}
if (headList.size() > 0) {
this.addSagaAndCompensate(vos);
PubMMPACService.pushMMPac((PickmHeadVO[])headList.toArray(new PickmHeadVO[headList.size()]));
}
} catch (BusinessException e) {
ExceptionUtils.wrappException(e);
}
}
}
private void addSagaAndCompensate(SCOrderVO[] vos) {
ScSagasUtil.frozenAndAddSaga(vos, "pickMo", SCBillType.Order.getCode());
if (!ArrayUtil.isEmpty(vos)) {
Map<String, Serializable> map = new HashMap();
map.put("opertaion", "pickMo");
List<String> bids = new ArrayList();
for(SCOrderVO scOrderVO : vos) {
SCOrderItemVO[] itemVOs = scOrderVO.getChildrenVO();
for(SCOrderItemVO bvo : itemVOs) {
bids.add(bvo.getPk_order_b());
}
}
map.put("pk_order_b", bids.toArray(new String[0]));
try {
ScSagasUtil.compensate(IScOrderSagasCompensate.class, map);
} catch (BusinessException e) {
ExceptionUtils.wrappException(e);
}
}
}
}

View File

@ -0,0 +1,253 @@
package nccloud.web.sscivm.ivsale.sale.action;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.net.URLEncoder;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;
import com.yonyou.cloud.utils.StringUtils;
import nc.bs.trade.business.HYSuperDMO;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nc.vo.sscivm.invoice.IVMInvoiceHeadVO;
import nc.vo.sscivm.ivsale.IVApplicationHeadVO;
import nc.vo.sscivm.ivsale.IVApplogVO;
import nccloud.framework.core.io.WebFile;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;
import nccloud.itf.sscivm.ivsale.service.IVSaleQueryService;
import nccloud.pubitf.platform.attachment.IAttachmentService;
public class InvoiceDownloadAction implements ICommonAction {
IAttachmentService ncservice = ServiceLocator.find(IAttachmentService.class);
@Override
public Object doAction(IRequest request) {
Map<String, String[]> params_1 = request.readParameters();
String[] pk = params_1.get("pk");
String[] invoiceTypes = params_1.get("invoiceType");
String isdoc = "z";
WebFile file = null;
try {
List<IVMInvoiceHeadVO> headVOList =ServiceLocator.find(IVSaleQueryService.class).queryIVMInvoiceHeadVOsByPks(new String[] {pk[0]});
IVMInvoiceHeadVO headVO = headVOList.get(0);
String invoiceType = invoiceTypes[0];
// 获取旗舰版的token
String appKey = "8c9eb1ea1ba54b3f9683a8b355f8e615";
String appSecret = "999e15c2a13ee4eab480534be4bf52fdf9032a6d";
String tokenUrl="https://c2.yonyoucloud.com/iuap-api-auth/open-auth/selfAppAuth/getAccessToken";
String getbsfileUrl="https://c2.yonyoucloud.com/iuap-api-gateway/yonbip/tax/output-tax/api/einvoice/getbsfile?access_token=";
Map<String, String> params = new HashMap<>();
// 除签名外的其他参数
params.put("appKey", appKey);
String timestamp = String.valueOf(System.currentTimeMillis());
params.put("timestamp", timestamp);
// 计算签名
Map<String, String> treeMap;
if (params instanceof TreeMap) {
treeMap = params;
} else {
treeMap = new TreeMap<>(params);
}
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry<String, String> entry : treeMap.entrySet()) {
stringBuilder.append(entry.getKey()).append(entry.getValue());
}
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(appSecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] signData = mac.doFinal(stringBuilder.toString().getBytes(StandardCharsets.UTF_8));
String base64String = Base64.getEncoder().encodeToString(signData);
String signature = URLEncoder.encode(base64String, "UTF-8");
params.put("signature", signature);
// String responseString = doGet(
// "https://c1.yonyoucloud.com/iuap-api-auth/open-auth/selfAppAuth/getAccessToken", params);
String responseString = doGet(tokenUrl, params);
Gson gson = new Gson();
Map result = gson.fromJson(responseString, Map.class);
if (StringUtils.equals("00000", result.get("code").toString())) {
Map<String, Object> tokenInfo = (Map<String, Object>) result.get("data");
String access_token = (String) tokenInfo.get("access_token");
// 税务服务-调用销项发票管理-已开票-版式文件查询接口
Map<String, Object> map = new HashMap<>();
// 发票类型 1增值税电子普通发票 2增值税电子专用发票 3增值税普通发票 4增值税专用发票 增值税专用发票(机动车) 5机动车销售统一发票 8增值税电子普通发票成品油 10成品油普通发票 11成品油专用发票 15二手车销售统一发票 31数电专用发票 32数电普通发票 33数电纸质发票(增值税专用发票) 34数电纸质发票(普通发票)
map.put("fplx", headVO.getInvoice_type());
// 数电发票号码
map.put("slfphm", headVO.getFphm());
// 用友自画pdf
map.put("yypdf", "0");
// 税局pdf
map.put("taxpdf", "1".equals(invoiceType) ? "1" : "0");
// 税局xml
map.put("taxxml", "2".equals(invoiceType) ? "1" : "0");
// 税局ofd
map.put("taxofd", "3".equals(invoiceType) ? "1" : "0");
// String resString = doPost(
// "https://c1.yonyoucloud.com/iuap-api-gateway/yonbip/tax/output-tax/api/einvoice/getbsfile?access_token=" + access_token,
// map);
String resString = doPost(getbsfileUrl + access_token,map);
gson = new Gson();
Map resultMap = gson.fromJson(resString, Map.class);
if (StringUtils.equals("200", resultMap.get("code").toString())) {
Map<String, Object> infoMap = (Map<String, Object>) resultMap.get("data");
String tax = "1".equals(invoiceType) ? (String) infoMap.get("taxpdf") : "2".equals(invoiceType) ? (String) infoMap.get("taxxml") : "3".equals(invoiceType) ? (String) infoMap.get("taxofd") : "";
if (MMValueCheck.isEmpty(tax)) {
throw new Exception("未查询到发票信息");
}
byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(tax);
InputStream ins = new ByteArrayInputStream(imageBytes);
String Fphm = headVO.getFphm();
//发票号码+单位名称+合同号开票申请字段+金额发票上的价税合计
String filename = "1".equals(invoiceType) ? ".pdf" : "2".equals(invoiceType) ? ".xml" : "3".equals(invoiceType) ? ".ofd" : "";
String ctcode="";
HYSuperDMO dmo = new HYSuperDMO();
IVApplogVO[] ivApplogVO=(IVApplogVO[]) dmo.queryByWhereClause(IVApplogVO.class, "fphm='"+Fphm+"' and dr=0 ");
if(ivApplogVO!=null&&ivApplogVO.length>0) {
ivApplogVO[0].getLyid();//开票申请单主键
IVApplicationHeadVO ivApplicationHeadVO =(IVApplicationHeadVO) dmo.queryByPrimaryKey(IVApplicationHeadVO.class, ivApplogVO[0].getLyid());
ctcode=ivApplicationHeadVO.getDef2();//合同号
}
//发票号码+单位名称+合同号开票申请字段+金额发票上的价税合计 合同号_单位名称_发票号码_金额
// 合同号_单位名称_发票号码_金额
String name = ctcode+"_"+headVO.getGmfmc()+"_"+Fphm+"_"+String.valueOf(headVO.getJshj().toDouble()) + filename;
// String name = Fphm+"_"+headVO.getGmfmc()+"_"+ctcode+"_"+String.valueOf(headVO.getJshj().toDouble()) + filename;
file = new WebFile(name, ins);
} else {
throw new Exception("获取发票信息失败");
}
}else {
throw new Exception("获取access_token失败");
}
// String url = "";
// IVMInvoiceHeadVO headVO = headVOList.get(0);
//
// if (headVOList != null && headVOList.size() > 0) {
// url = headVO.getViewurl();
// }
// InputStream ins = this.ncservice.download(isdoc, url, "sscivm");
// String Fpdm = headVO.getFpdm();
// String Fphm = headVO.getFphm();
// String name = headVO.getFilename();
// String filename = ".pdf";
// if(name!=null && name.endsWith(".ofd")){
// filename = ".ofd";
// }
// file = new WebFile(Fpdm + "_" + Fphm + filename, ins);
} catch (BusinessException e) {
ExceptionUtils.wrappException(e);
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvalidKeyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return file;
}
private String doPost(String requestUrl, Map<String, Object> param) throws IOException {
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setMaxTotal(500);
cm.setDefaultMaxPerRoute(50);
RequestConfig globalConfig = RequestConfig.custom().setConnectionRequestTimeout(5000) // 连接池获取连接超时
.setConnectTimeout(5000) // 连接建立超时
.setSocketTimeout(20000) // 等待响应超时
.setCookieSpec(CookieSpecs.IGNORE_COOKIES).build();
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm)
.setDefaultRequestConfig(globalConfig).build();
HttpPost post = new HttpPost(requestUrl);
post.setHeader("Content-Type", "application/json;charset=UTF-8");
post.setEntity(new StringEntity(JSONObject.toJSONString(param), "utf-8"));
String responseString = httpClient.execute(post, response -> EntityUtils.toString(response.getEntity()));
return responseString;
}
private String doGet(String requestUrl, Map<String, String> paramMap) throws IOException {
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
cm.setMaxTotal(500);
cm.setDefaultMaxPerRoute(50);
RequestConfig globalConfig = RequestConfig.custom().setConnectionRequestTimeout(5000) // 连接池获取连接超时
.setConnectTimeout(5000) // 连接建立超时
.setSocketTimeout(20000) // 等待响应超时
.setCookieSpec(CookieSpecs.IGNORE_COOKIES).build();
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm)
.setDefaultRequestConfig(globalConfig).build();
StringBuilder param = new StringBuilder("?");
if (paramMap != null) {
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
param.append(entry.getKey());
param.append("=");
param.append(entry.getValue());
param.append("&");
}
param.deleteCharAt(param.length() - 1);
}
String url = requestUrl + param;
HttpGet get = new HttpGet(url);
String responseString = httpClient.execute(get, response -> EntityUtils.toString(response.getEntity()));
get.releaseConnection();
return responseString;
}
}

View File

@ -0,0 +1,148 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package nc.bs.ssctp.sscbd.tasktype.query.convertor;
import nc.bs.ssctp.sscbd.tasktype.config.TaskTypeConfigFactory;
import nc.bs.ssctp.sscbd.tasktype.query.SSCTaskQueryCondition;
import java.util.ArrayList;
import java.util.List;
public class BlurConvertor implements ITaskQueryConditionConvertor {
public BlurConvertor() {
}
public String getWherePart(SSCTaskQueryCondition condition) {
StringBuilder whereSql = new StringBuilder();
whereSql.append(" ");
if (TaskTypeConfigFactory.QUERYCONDITION_BLUR.equals(condition.getQueryField())) {
String blur = condition.getQueryFieldValue();
if (blur == null || "".equals(blur)) {
return "";
}
String[] blurs = blur.split(",");
List<String> vas = new ArrayList();
for(String str : blurs) {
vas.add(str);
}
if (vas != null && vas.size() > 0) {
for(String s : vas) {
whereSql.append(" and ( NODETASKS.busiid in ( ");
if (s.contains("=")) {
String[] strs = s.split("=");
whereSql.append(" SELECT a.busiid FROM sscrp_bill a,sscrp_detail b WHERE a.pk_bill = b.pk_bill AND CODE = '" + strs[0] + "' AND VALUE like '%" + strs[1].replaceAll("'", "") + "%' ");
whereSql.append(" UNION ALL ");
whereSql.append(" SELECT a.busiid FROM sscrp_bill_done a,sscrp_detail_done b WHERE a.pk_bill = b.pk_bill AND CODE = '" + strs[0] + "' AND VALUE like '%" + strs[1].replaceAll("'", "") + "%' ");
} else {
whereSql.append(" SELECT a.busiid FROM sscrp_bill a,sscrp_detail b WHERE a.pk_bill = b.pk_bill AND VALUE like '%" + s.replaceAll("'", "") + "%' ");
whereSql.append(" UNION ALL ");
whereSql.append(" SELECT a.busiid FROM sscrp_bill_done a,sscrp_detail_done b WHERE a.pk_bill = b.pk_bill AND VALUE like '%" + s.replaceAll("'", "") + "%' ");
}
whereSql.append(" ) ");
// 新增四个EXISTS条件 //联查 付款单收款单主报销单主借款单 四张单子
whereSql.append(" OR EXISTS (SELECT 1 FROM AR_GATHERITEM bill JOIN BD_BALATYPE bala ON bala.pk_balatype = bill.pk_balatype WHERE NODETASKS.busiid = bill.pk_gatherbill AND bala.name LIKE '%" + s.replaceAll("'", "") + "%')");
whereSql.append(" OR EXISTS (SELECT 1 FROM ap_paybill bill JOIN AP_PAYITEM item ON item.pk_paybill = bill.pk_paybill JOIN BD_BALATYPE bala ON bala.pk_balatype = item.pk_balatype WHERE NODETASKS.busiid = bill.pk_paybill AND bala.name LIKE '%" + s.replaceAll("'", "") + "%')");
whereSql.append(" OR EXISTS (SELECT 1 FROM er_bxzb bill JOIN BD_BALATYPE bala ON bala.pk_balatype = bill.jsfs WHERE NODETASKS.busiid = bill.pk_jkbx AND bala.name LIKE '%" + s.replaceAll("'", "") + "%')");
whereSql.append(" OR EXISTS (SELECT 1 FROM er_jkzb bill JOIN BD_BALATYPE bala ON bala.pk_balatype = bill.jsfs WHERE NODETASKS.busiid = bill.pk_jkbx AND bala.name LIKE '%" + s.replaceAll("'", "") + "%')");
whereSql.append(" ) ");
}
}
}
return whereSql.toString();
}
public String getWhere(String condition, Object blur) {
StringBuilder whereSql = new StringBuilder();
whereSql.append(condition);
List<String> vas = new ArrayList();
if (blur != null && !blur.toString().equals("")) {
for(Object c : (List)blur) {
vas.add((String)c);
}
}
for(String str : vas) {
vas.add(str);
}
if (vas != null && vas.size() > 0) {
StringBuilder sql = new StringBuilder();
sql.append(" SELECT TASK.busiid ");
sql.append(" FROM SSCTP_TASK TASK ");
sql.append(" LEFT JOIN SSCTP_CURRENTTASK CURTASK ");
sql.append(" ON CURTASK.PK_CURRENTTASK = TASK.PK_CURRENTTASK ");
sql.append(" LEFT JOIN SSCTP_TASKEXTENDINFO EXTENDINFO ");
sql.append(" ON EXTENDINFO.PK_CURRENTTASK = TASK.PK_CURRENTTASK ");
sql.append(" WHERE " + condition + " and TASK.dr=0 and (CURTASK.saga_frozen is null or CURTASK.saga_frozen <> 1) ");
for(String s : vas) {
whereSql.append(" and nodetasks.busiid in ( ");
if (s.contains("=")) {
String[] strs = s.split("=");
whereSql.append(" SELECT a.busiid FROM sscrp_bill a,sscrp_detail b WHERE a.pk_bill = b.pk_bill AND CODE = '" + strs[0] + "' AND VALUE like '%" + strs[1].replaceAll("'", "") + "%' AND a.busiid IN (" + sql.toString() + ") ");
whereSql.append(" UNION ALL ");
whereSql.append(" SELECT a.busiid FROM sscrp_bill_done a,sscrp_detail_done b WHERE a.pk_bill = b.pk_bill AND CODE = '" + strs[0] + "' AND VALUE like '%" + strs[1].replaceAll("'", "") + "%' AND a.busiid IN (" + sql.toString() + ") ");
} else {
String var10001 = s.replaceAll("'", "");
whereSql.append(" SELECT a.busiid FROM sscrp_bill a,sscrp_detail b WHERE a.pk_bill = b.pk_bill AND VALUE like '%" + var10001 + "%' AND a.busiid IN (" + sql.toString() + ") ");
whereSql.append(" UNION ALL ");
var10001 = s.replaceAll("'", "");
whereSql.append(" SELECT a.busiid FROM sscrp_bill_done a,sscrp_detail_done b WHERE a.pk_bill = b.pk_bill AND VALUE like '%" + var10001 + "%' AND a.busiid IN (" + sql.toString() + ") ");
}
whereSql.append(" ) ");
}
}
return whereSql.toString();
}
public String getWhere4QM(String condition, Object blur) {
StringBuilder whereSql = new StringBuilder();
whereSql.append(condition);
List<String> vas = new ArrayList();
if (blur != null && !blur.toString().equals("")) {
for(Object c : (List)blur) {
vas.add((String)c);
}
}
for(String str : vas) {
vas.add(str);
}
if (vas != null && vas.size() > 0) {
StringBuilder sql = new StringBuilder();
sql.append(" SELECT TASK.busiid ");
sql.append(" FROM SSCTP_TASK TASK ");
sql.append(" LEFT JOIN SSCTP_CURRENTTASK CURTASK ");
sql.append(" ON CURTASK.PK_CURRENTTASK = TASK.PK_CURRENTTASK ");
sql.append(" LEFT JOIN SSCTP_TASKEXTENDINFO EXTENDINFO ");
sql.append(" ON EXTENDINFO.PK_CURRENTTASK = TASK.PK_CURRENTTASK ");
sql.append(" WHERE " + condition + " and TASK.dr=0 and (CURTASK.saga_frozen is null or CURTASK.saga_frozen <> 1) ");
for(String s : vas) {
whereSql.append(" and nodetasks.busiid in ( ");
whereSql.append(" select id from sscqm_check_bill where pk_bill in ( ");
String var10001 = s.replaceAll("'", "");
whereSql.append(" SELECT a.busiid FROM sscrp_bill a,sscrp_detail b WHERE a.pk_bill = b.pk_bill AND VALUE like '%" + var10001 + "%' AND a.busiid IN (" + sql.toString() + ") ");
whereSql.append(" UNION ALL ");
var10001 = s.replaceAll("'", "");
whereSql.append(" SELECT a.busiid FROM sscrp_bill_done a,sscrp_detail_done b WHERE a.pk_bill = b.pk_bill AND VALUE like '%" + var10001 + "%' AND a.busiid IN (" + sql.toString() + ") ");
whereSql.append(" ) )");
}
}
return whereSql.toString();
}
}