Commit 4a1b996b by 熊智

优化

parent 988faa21
...@@ -88,10 +88,12 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe ...@@ -88,10 +88,12 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
BigDecimal rate = bussPlan.getDflcpRate2(); BigDecimal rate = bussPlan.getDflcpRate2();
BigDecimal verifyAmt = entry.getThisVerifyAmt(); BigDecimal verifyAmt = entry.getThisVerifyAmt();
dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).multiply(new BigDecimal(diffDays)).setScale(2, RoundingMode.HALF_UP); 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) { 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 ...@@ -113,9 +115,11 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
BigDecimal verifyAmt = entry.getThisVerifyAmt(); BigDecimal verifyAmt = entry.getThisVerifyAmt();
BigDecimal dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP); BigDecimal dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP);
BigDecimal zdDlfAmt = bussPlan.getDflLowAmount2(); 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) { 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 ...@@ -153,16 +157,18 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
} }
if (rate.compareTo(BigDecimal.ZERO) != 0) { if (rate.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal verifyAmt = entry.getThisVerifyAmt(); BigDecimal verifyAmt = entry.getThisVerifyAmt();
String formula = verifyAmt + "*" + rate + "/100";
dlfAmt = verifyAmt.multiply(rate).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP); 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) { 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(); ScsfundPoolInfo fInfo = new ScsfundPoolInfo();
fInfo.setBizFlow(info.getBizFlow()); fInfo.setBizFlow(info.getBizFlow());
fInfo.setBizSubFlow(info.getBizSubFlow()); fInfo.setBizSubFlow(info.getBizSubFlow());
...@@ -190,7 +196,7 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe ...@@ -190,7 +196,7 @@ public class ArVerificationRecordControllerBean extends AbstractArVerificationRe
fInfo.setCompany(info.getCompany());// 公司 fInfo.setCompany(info.getCompany());// 公司
fInfo.setDealPerson(info.getDealPerson());// 处理人 fInfo.setDealPerson(info.getDealPerson());// 处理人
fInfo.setCreateTime(DCUtil.DateToTimestamp(srcInfo.getBizDate()));// 业务日期 fInfo.setCreateTime(DCUtil.DateToTimestamp(srcInfo.getBizDate()));// 业务日期
fInfo.setDescription(info.getDescription()); fInfo.setDescription(formula);
fInfo.setCU(info.getCU());// CU fInfo.setCU(info.getCU());// CU
ScsfundPoolFactory.getLocalInstance(ctx).save(fInfo); ScsfundPoolFactory.getLocalInstance(ctx).save(fInfo);
} }
......
...@@ -2,6 +2,7 @@ package com.kingdee.eas.hse.scm.salemanager.app; ...@@ -2,6 +2,7 @@ package com.kingdee.eas.hse.scm.salemanager.app;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.sql.Array;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -12,6 +13,7 @@ import java.util.concurrent.ExecutorService; ...@@ -12,6 +13,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import org.apache.log4j.Logger; 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.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -725,7 +727,7 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill ...@@ -725,7 +727,7 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill
} }
String scmWSDLUrl = DCUtil.getInitSysValueByParamNumber(ctx, "scmWSDLUrl"); String scmWSDLUrl = DCUtil.getInitSysValueByParamNumber(ctx, "scmWSDLUrl");
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("entrustNo", customerBillNo); json.put("entrustNos", customerBillNo);
HashMap<String, Object> params = XZUtil.APIWSCtx(scmWSDLUrl, "getGCDatas", json.toJSONString()); HashMap<String, Object> params = XZUtil.APIWSCtx(scmWSDLUrl, "getGCDatas", json.toJSONString());
String rs = XZAppUtil.callAPI(ctx, params); String rs = XZAppUtil.callAPI(ctx, params);
reloadInitData(ctx, postReqInfo, info, rs); reloadInitData(ctx, postReqInfo, info, rs);
...@@ -748,12 +750,17 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill ...@@ -748,12 +750,17 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill
*/ */
private void reloadInitData(Context ctx, PostRequistionBillInfo postReqInfo, EntrustBillInfo info, String rs) throws EASBizException, BOSException { private void reloadInitData(Context ctx, PostRequistionBillInfo postReqInfo, EntrustBillInfo info, String rs) throws EASBizException, BOSException {
if (!StringUtils.isEmpty(rs)) { 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); JSONArray jsons = JSONObject.parseArray(rs);
IScsfundPool iFactory = ScsfundPoolFactory.getLocalInstance(ctx); IScsfundPool iFactory = ScsfundPoolFactory.getLocalInstance(ctx);
for (int i = 0; i < jsons.size(); i++) { for (int i = 0; i < jsons.size(); i++) {
JSONObject json = jsons.getJSONObject(i); JSONObject json = jsons.getJSONObject(i);
String poolID = json.getString("poolID"); String poolID = json.getString("poolID");
String poolNo = json.getString("poolNo"); String poolNo = json.getString("poolNo");
String entrustNo = json.getString("entrustNo");
tempEntrustNos2.add(entrustNo);
String serveProject = json.getString("serveProject"); String serveProject = json.getString("serveProject");
BigDecimal amt = json.getBigDecimal("amt"); BigDecimal amt = json.getBigDecimal("amt");
String bizDate = json.getString("bizDate"); String bizDate = json.getString("bizDate");
...@@ -800,6 +807,14 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill ...@@ -800,6 +807,14 @@ public class PostRequistionBillControllerBean extends AbstractPostRequistionBill
iFactory.save(fInfo1); 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 { ...@@ -1852,10 +1852,8 @@ public class FundManager implements IServiceManager {
} }
} }
} }
} }
private void doDFHKRPWriteOffBill(ServiceController sc, Command cmd) throws EASBizException, BOSException { private void doDFHKRPWriteOffBill(ServiceController sc, Command cmd) throws EASBizException, BOSException {
RPWriteOffBillInfo model = (RPWriteOffBillInfo) cmd.getSCSBillBaseInfo(); RPWriteOffBillInfo model = (RPWriteOffBillInfo) cmd.getSCSBillBaseInfo();
model = RPWriteOffBillFactory.getLocalInstance(cmd.getContext()).getRPWriteOffBillInfo(new ObjectUuidPK(model.getId())); model = RPWriteOffBillFactory.getLocalInstance(cmd.getContext()).getRPWriteOffBillInfo(new ObjectUuidPK(model.getId()));
...@@ -1880,11 +1878,11 @@ public class FundManager implements IServiceManager { ...@@ -1880,11 +1878,11 @@ public class FundManager implements IServiceManager {
BigDecimal settleamt = DCUtil.emptyToValue(sfInfo.getInnerAmount(), BigDecimal.ZERO) BigDecimal settleamt = DCUtil.emptyToValue(sfInfo.getInnerAmount(), BigDecimal.ZERO)
.subtract(DCUtil.emptyToValue(einfo.getTWriteOffAmount(), BigDecimal.ZERO) .subtract(DCUtil.emptyToValue(einfo.getTWriteOffAmount(), BigDecimal.ZERO)
.add(DCUtil.emptyToValue(einfo.getTAdjustAmount(), 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()+"'"); ServeProjectInfo infoSp = ServeProjectFactory.getLocalInstance(cmd.getContext()).getServeProjectInfo(" where id = '"+sfInfo.getServerProject().getId().toString()+"'");
if(!"101020".equals(infoSp.getNumber())){ if(!"101020".equals(infoSp.getNumber())){
return; return;
} }
if(settleamt.compareTo(BigDecimal.ZERO)!=0){
fInfo.setSettlementType(sfInfo.getSettlementType()); fInfo.setSettlementType(sfInfo.getSettlementType());
fInfo.setLastZqDate(sfInfo.getLastZqDate()); fInfo.setLastZqDate(sfInfo.getLastZqDate());
fInfo.setBizFlow(sfInfo.getBizFlow()); fInfo.setBizFlow(sfInfo.getBizFlow());
......
...@@ -430,7 +430,7 @@ public class ArInterestsSettleEditUI extends AbstractArInterestsSettleEditUI { ...@@ -430,7 +430,7 @@ public class ArInterestsSettleEditUI extends AbstractArInterestsSettleEditUI {
isJSDzfwf = false; isJSDzfwf = false;
} else { } else {
overDay = DCUtil.daysBetween(d2, d1); overDay = DCUtil.daysBetween(d2, d1);
d1 = d2; // d1 = d2;
} }
} else if (d1.compareTo(d2) <= 0) { } else if (d1.compareTo(d2) <= 0) {
if (isOverDay) { 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