Commit 4a1b996b by 熊智

优化

parent 988faa21
......@@ -88,10 +88,12 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
BigDecimal rate = bussPlan.getDflcpRate2();
BigDecimal verifyAmt = entry.getThisVerifyAmt();
dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).multiply(new BigDecimal(diffDays)).setScale(2, RoundingMode.HALF_UP);
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectdlfGoodAmount, dlfAmt);
String formula = verifyAmt + "*" + rate + "/100*" + diffDays;
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectdlfGoodAmount, dlfAmt, formula);
}
if (zdDlfAmt.compareTo(dlfAmt) > 0) {
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectLowdlfGoodAmount, zdDlfAmt.subtract(dlfAmt));
String formula = zdDlfAmt + "-" + dlfAmt;
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectLowdlfGoodAmount, zdDlfAmt.subtract(dlfAmt), formula);
}
}
......@@ -113,9 +115,11 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
BigDecimal verifyAmt = entry.getThisVerifyAmt();
BigDecimal dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP);
BigDecimal zdDlfAmt = bussPlan.getDflLowAmount2();
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectdlfGoodAmount, dlfAmt);
String formula = verifyAmt + "*" + rate + "/100";
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectdlfGoodAmount, dlfAmt, formula);
if (zdDlfAmt.compareTo(dlfAmt) > 0) {
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectLowdlfGoodAmount, zdDlfAmt.subtract(dlfAmt));
formula = zdDlfAmt + "-" + dlfAmt;
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectLowdlfGoodAmount, zdDlfAmt.subtract(dlfAmt), formula);
}
}
......@@ -153,16 +157,18 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
}
if (rate.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal verifyAmt = entry.getThisVerifyAmt();
String formula = verifyAmt + "*" + rate + "/100";
dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP);
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectdlfGoodAmount, dlfAmt);
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectdlfGoodAmount, dlfAmt, formula);
}
}
if (zdDlfAmt.compareTo(dlfAmt) > 0) {
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectLowdlfGoodAmount, zdDlfAmt.subtract(dlfAmt));
String formula = zdDlfAmt + "-" + dlfAmt;
createDLfFundPool(ctx, info, billInfo, DCConstant.serviceProjectLowdlfGoodAmount, zdDlfAmt.subtract(dlfAmt), formula);
}
}
private void createDLfFundPool(Context ctx, ArVerificationRecordInfo srcInfo, EntrustBillInfo info, String dlfNumber, BigDecimal amt) throws EASBizException, BOSException {
private void createDLfFundPool(Context ctx, ArVerificationRecordInfo srcInfo, EntrustBillInfo info, String dlfNumber, BigDecimal amt, String formula) throws EASBizException, BOSException {
ScsfundPoolInfo fInfo = new ScsfundPoolInfo();
fInfo.setBizFlow(info.getBizFlow());
fInfo.setBizSubFlow(info.getBizSubFlow());
......@@ -190,7 +196,7 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
fInfo.setCompany(info.getCompany());// 公司
fInfo.setDealPerson(info.getDealPerson());// 处理人
fInfo.setCreateTime(DCUtil.DateToTimestamp(srcInfo.getBizDate()));// 业务日期
fInfo.setDescription(info.getDescription());
fInfo.setDescription(formula);
fInfo.setCU(info.getCU());// CU
ScsfundPoolFactory.getLocalInstance(ctx).save(fInfo);
}
......
......@@ -2,6 +2,7 @@ package com.kingdee.eas.hse.scm.salemanager.app;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Array;
import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
......@@ -12,6 +13,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.log4j.Logger;
import org.mozilla.javascript.edu.emory.mathcs.backport.java.util.Arrays;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -725,7 +727,7 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill
}
String scmWSDLUrl = DCUtil.getInitSysValueByParamNumber(ctx, "scmWSDLUrl");
JSONObject json = new JSONObject();
json.put("entrustNo", customerBillNo);
json.put("entrustNos", customerBillNo);
HashMap<String, Object> params = XZUtil.APIWSCtx(scmWSDLUrl, "getGCDatas", json.toJSONString());
String rs = XZAppUtil.callAPI(ctx, params);
reloadInitData(ctx, postReqInfo, info, rs);
......@@ -748,12 +750,17 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill
*/
private void reloadInitData(Context ctx, PostRequistionBillInfo postReqInfo, EntrustBillInfo info, String rs) throws EASBizException, BOSException {
if (!StringUtils.isEmpty(rs)) {
String entrustNos = info.getCustomerBillNumber();
HashSet<String> tempEntrustNos = new HashSet<String>(Arrays.asList(entrustNos.split(";")));
HashSet<String> tempEntrustNos2 = new HashSet<String>();
JSONArray jsons = JSONObject.parseArray(rs);
IScsfundPool iFactory = ScsfundPoolFactory.getLocalInstance(ctx);
for (int i = 0; i < jsons.size(); i++) {
JSONObject json = jsons.getJSONObject(i);
String poolID = json.getString("poolID");
String poolNo = json.getString("poolNo");
String entrustNo = json.getString("entrustNo");
tempEntrustNos2.add(entrustNo);
String serveProject = json.getString("serveProject");
BigDecimal amt = json.getBigDecimal("amt");
String bizDate = json.getString("bizDate");
......@@ -800,6 +807,14 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill
iFactory.save(fInfo1);
}
}
if (tempEntrustNos.size() != tempEntrustNos2.size()) {
for (String entrustNo : tempEntrustNos) {
if (!tempEntrustNos2.contains(entrustNo)) {
throw XZAppUtil.diyEASBizException("没有取到报关系统" + entrustNo + "的增值税关税数据,请确认!!!");
}
}
}
}
}
......
......@@ -1852,10 +1852,8 @@ public class FundManager implements IServiceManager {
}
}
}
}
private void doDFHKRPWriteOffBill(ServiceController sc, Command cmd) throws EASBizException, BOSException {
RPWriteOffBillInfo model = (RPWriteOffBillInfo) cmd.getSCSBillBaseInfo();
model = RPWriteOffBillFactory.getLocalInstance(cmd.getContext()).getRPWriteOffBillInfo(new ObjectUuidPK(model.getId()));
......@@ -1880,11 +1878,11 @@ public class FundManager implements IServiceManager {
BigDecimal settleamt = DCUtil.emptyToValue(sfInfo.getInnerAmount(), BigDecimal.ZERO)
.subtract(DCUtil.emptyToValue(einfo.getTWriteOffAmount(), BigDecimal.ZERO)
.add(DCUtil.emptyToValue(einfo.getTAdjustAmount(), BigDecimal.ZERO)));
if(settleamt.compareTo(BigDecimal.ZERO)!=0){
ServeProjectInfo infoSp = ServeProjectFactory.getLocalInstance(cmd.getContext()).getServeProjectInfo(" where id = '"+sfInfo.getServerProject().getId().toString()+"'");
if(!"101020".equals(infoSp.getNumber())){
return;
}
if(settleamt.compareTo(BigDecimal.ZERO)!=0){
fInfo.setSettlementType(sfInfo.getSettlementType());
fInfo.setLastZqDate(sfInfo.getLastZqDate());
fInfo.setBizFlow(sfInfo.getBizFlow());
......
......@@ -430,7 +430,7 @@ public class ArInterestsSettleEditUI extends AbstractArInterestsSettleEditUI {
isJSDzfwf = false;
} else {
overDay = DCUtil.daysBetween(d2, d1);
d1 = d2;
// d1 = d2;
}
} else if (d1.compareTo(d2) <= 0) {
if (isOverDay) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment