功能调整
This commit is contained in:
		
							parent
							
								
									44a1ed41f7
								
							
						
					
					
						commit
						e0732a29e5
					
				|  | @ -5,6 +5,22 @@ | |||
| 
 | ||||
| package nc.bs.arap.actions; | ||||
| 
 | ||||
| import nc.bs.arap.bill.ArapBillPubUtil; | ||||
| import nc.bs.arap.util.ArapBillVOUtils; | ||||
| import nc.bs.arap.util.ArapVOUtils; | ||||
| import nc.bs.arap.util.BillAccountCalendarUtils; | ||||
| import nc.bs.arap.validator.CrossRuleCheckValidator; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.arap.basebill.BaseBillVO; | ||||
| import nc.vo.arap.utils.StringUtil; | ||||
| import nc.vo.pub.AggregatedValueObject; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.CircularlyAccessibleValueObject; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction { | ||||
|     public GatheringbillEditSaveBatchBSAction() { | ||||
|         this.validatorCode.add(5); | ||||
|  | @ -12,6 +28,79 @@ public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction | |||
|         this.validatorCode.add(57); | ||||
|         this.validatorCode.add(59); | ||||
|         this.validatorCode.add(62); | ||||
|         this.validatorCode.remove(44); | ||||
|     } | ||||
| 
 | ||||
|     protected void doBeforeUpdate(AggregatedValueObject[] bills, AggregatedValueObject[] orginBills) throws BusinessException { | ||||
|         ArapBillPubUtil.fillTradeTypeInfo(bills); | ||||
| 
 | ||||
|         for(AggregatedValueObject bill : bills) { | ||||
|             ArapBillPubUtil.processMoneyOnlySum(bill); | ||||
|         } | ||||
| 
 | ||||
|         /** | ||||
|          * 收款单保存校验关联的销售订单实际收款金额是否超过价税合计 | ||||
|          */ | ||||
|         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(); //修改前的金额 | ||||
|             String pk_tradetype = billVO.getPk_tradetype(); | ||||
|             if(!"F2-Cxx-02".equals(pk_tradetype)){ | ||||
|                 continue; | ||||
|             } | ||||
|             String def3 = billVO.getDef3(); //收款单对应的销售订单id | ||||
|             if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){ | ||||
|                 //无绑定的销售订单则下一次循环 | ||||
|                 continue; | ||||
|             } | ||||
|             //计算收款单金额差值 | ||||
|             UFDouble changeMoney = money.sub(oriMoney); | ||||
|             //根据销售订单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()); | ||||
|                 ntotalorigmny = new UFDouble(saleMap.get("ntotalorigmny") == null ? "0" : saleMap.get("ntotalorigmny").toString()); | ||||
|             } | ||||
|             UFDouble moreMoney = nreceivedmny.add(changeMoney).sub(ntotalorigmny); | ||||
|             if(nreceivedmny.add(changeMoney).compareTo(ntotalorigmny) > 0){ | ||||
|                 throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】"); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         ArapBillVOUtils.prepareDefaultInfo(bills, true); | ||||
|         int updateType = this.getUpdateType(bills, orginBills); | ||||
| 
 | ||||
|         for(AggregatedValueObject bill : bills) { | ||||
|             bill.getParentVO().setStatus(1); | ||||
|         } | ||||
| 
 | ||||
|         if (updateType == TEMP_2_SAVE || updateType == SAVE_2_SAVE) { | ||||
|             for(AggregatedValueObject bill : bills) { | ||||
|                 for(CircularlyAccessibleValueObject item : bill.getChildrenVO()) { | ||||
|                     if (item.getStatus() != 2 && item.getStatus() != 3) { | ||||
|                         item.setStatus(1); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (updateType == TEMP_2_SAVE || updateType == SAVE_2_SAVE) { | ||||
|             BillAccountCalendarUtils.setAccperiodYearMonth(bills); | ||||
|         } | ||||
| 
 | ||||
|         this.checkIsCorrdBillMoneyControl(bills, orginBills); | ||||
|         this.checkOtherSystemBill(bills, orginBills); | ||||
|         (new CrossRuleCheckValidator()).validate(bills); | ||||
|         ArapVOUtils.resetMoneyBal(bills, orginBills); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -5,6 +5,19 @@ | |||
| 
 | ||||
| package nc.bs.arap.actions; | ||||
| 
 | ||||
| import nc.bs.arap.bill.ArapBillPubUtil; | ||||
| import nc.bs.arap.util.*; | ||||
| import nc.bs.arap.validator.CrossRuleCheckValidator; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.arap.basebill.BaseBillVO; | ||||
| import nc.vo.arap.utils.StringUtil; | ||||
| import nc.vo.pub.AggregatedValueObject; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { | ||||
|     public GatheringbillSaveBatchBSAction() { | ||||
|         this.validatorCode.add(5); | ||||
|  | @ -26,4 +39,52 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { | |||
|         this.validatorCode.add(62); | ||||
|         this.validatorCode.add(76); | ||||
|     } | ||||
| 
 | ||||
|     protected void doBeforeInsert(AggregatedValueObject[] bills) throws BusinessException { | ||||
|         ArapBillPubUtil.fillTradeTypeInfo(bills); | ||||
|         BillBankUtils.fillSettleBankrelated_code(bills); | ||||
|         BillDateUtils.setBillDateByNow(bills); | ||||
|         ArapBillPubUtil.resetBasedocVid(bills); | ||||
|         BillAccountCalendarUtils.setAccperiodYearMonth(bills); | ||||
|         ArapBillVOUtils.prepareDefaultInfo(bills); | ||||
|         BillMoneyVUtils.sumAllVoBodyToHead(bills); | ||||
|         (new CrossRuleCheckValidator()).validate(bills); | ||||
|         ArapBillPubUtil.resetDestVODoc(bills); | ||||
|         ArapBillVOUtils.setMaterialInfo(bills); | ||||
|         ArapBillVOUtils.setDefaultSagaFrozen(bills); | ||||
| 
 | ||||
|         /** | ||||
|          * 收款单保存校验关联的销售订单实际收款金额是否超过价税合计 | ||||
|          */ | ||||
| 
 | ||||
|         for(AggregatedValueObject bill : bills) { | ||||
|             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 | ||||
|             if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){ | ||||
|                 //无绑定的销售订单则下一次循环 | ||||
|                 continue; | ||||
|             } | ||||
|             //根据销售订单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()); | ||||
|                 ntotalorigmny = new UFDouble(saleMap.get("ntotalorigmny") == null ? "0" : saleMap.get("ntotalorigmny").toString()); | ||||
|             } | ||||
|             UFDouble moreMoney = nreceivedmny.add(money).sub(ntotalorigmny); | ||||
|             if(nreceivedmny.add(money).compareTo(ntotalorigmny) > 0){ | ||||
|                 throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】"); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -1,31 +1,10 @@ | |||
| package nc.bs.arap.busireg; | ||||
| 
 | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import com.google.gson.Gson; | ||||
| import com.yonyou.cloud.utils.StringUtils; | ||||
| import nc.bs.businessevent.BdUpdateEvent; | ||||
| import nc.bs.businessevent.BusinessEvent; | ||||
| import nc.bs.businessevent.IBusinessEvent; | ||||
| import nc.bs.businessevent.IBusinessListener; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.trade.business.HYSuperDMO; | ||||
| import nc.bs.uapbd.util.IgnoreSslUtil; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.arap.basebill.BaseAggVO; | ||||
| import nc.vo.arap.utils.ArrayUtil; | ||||
| import nc.vo.pub.AggregatedValueObject; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.CircularlyAccessibleValueObject; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| import nc.vo.so.m30.entity.SaleOrderHVO; | ||||
| import nccloud.bs.arap.sagas.util.SagasUtils; | ||||
| import nccloud.commons.lang.ArrayUtils; | ||||
| 
 | ||||
| import javax.crypto.Mac; | ||||
| import javax.crypto.spec.SecretKeySpec; | ||||
| import javax.net.ssl.HttpsURLConnection; | ||||
| import java.io.*; | ||||
| import java.io.BufferedReader; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | ||||
| import java.io.OutputStream; | ||||
| import java.net.URL; | ||||
| import java.net.URLEncoder; | ||||
| import java.nio.charset.StandardCharsets; | ||||
|  | @ -34,6 +13,35 @@ import java.util.HashMap; | |||
| import java.util.Map; | ||||
| import java.util.TreeMap; | ||||
| 
 | ||||
| import javax.crypto.Mac; | ||||
| import javax.crypto.spec.SecretKeySpec; | ||||
| import javax.net.ssl.HttpsURLConnection; | ||||
| 
 | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import com.google.gson.Gson; | ||||
| import com.yonyou.cloud.utils.StringUtils; | ||||
| 
 | ||||
| import nc.bs.businessevent.BdUpdateEvent; | ||||
| import nc.bs.businessevent.BusinessEvent; | ||||
| import nc.bs.businessevent.IBusinessEvent; | ||||
| import nc.bs.businessevent.IBusinessListener; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.trade.business.HYPubBO; | ||||
| import nc.bs.trade.business.HYSuperDMO; | ||||
| import nc.bs.uapbd.util.IgnoreSslUtil; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.arap.basebill.BaseAggVO; | ||||
| import nc.vo.arap.utils.ArrayUtil; | ||||
| import nc.vo.cmp.settlement.SettlementAggVO; | ||||
| import nc.vo.pub.AggregatedValueObject; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.CircularlyAccessibleValueObject; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| import nc.vo.so.m30.entity.SaleOrderHVO; | ||||
| import nccloud.bs.arap.sagas.util.SagasUtils; | ||||
| import nccloud.commons.lang.ArrayUtils; | ||||
| 
 | ||||
| public class BusiregForSyncSaleorderAndToBIP implements IBusinessListener{ | ||||
| 
 | ||||
|     @Override | ||||
|  | @ -43,18 +51,18 @@ public class BusiregForSyncSaleorderAndToBIP implements IBusinessListener{ | |||
|         if (ArrayUtils.isEmpty(bills) || SagasUtils.isCompensateStage()) { | ||||
|             return; | ||||
|         } | ||||
| 		// 更新 销售订单 | ||||
|         // 更新 销售订单 | ||||
|         try { | ||||
|             BaseDAO dao = new BaseDAO(); | ||||
|             for(BaseAggVO aggvo : bills) { | ||||
|                 CircularlyAccessibleValueObject headvo = aggvo.getParentVO(); | ||||
| 				// 本次收款金额 | ||||
|                 // 本次收款金额 | ||||
|                 Object money = headvo.getAttributeValue("money"); | ||||
| 				// 收款单主键 | ||||
|                 // 收款单主键 | ||||
|                 Object pk_busibill = headvo.getAttributeValue("pk_gatherbill"); | ||||
| 				// 销售订单主键 | ||||
|                 // 销售订单主键 | ||||
|                 Object csaleorderid = headvo.getAttributeValue("def3"); | ||||
| 				// 根据销售订单主键,查询比较字段 | ||||
|                 // 根据销售订单主键,查询比较字段 | ||||
|                 String sql = "select vdef17, vdef15, vdef14, vdef11, vdef9 from so_saleorder where csaleorderid = '" + csaleorderid + "' and dr = 0 "; | ||||
|                 HashMap hm = (HashMap)dao.executeQuery(sql, new MapProcessor()); | ||||
|                 Object vdef17 = hm.get("vdef17"); | ||||
|  | @ -62,31 +70,31 @@ public class BusiregForSyncSaleorderAndToBIP implements IBusinessListener{ | |||
|                 Object vdef14 = hm.get("vdef14"); | ||||
|                 Object vdef11 = hm.get("vdef11"); | ||||
|                 Object  vdef9 = hm.get("vdef9"); | ||||
| 				// 合同号 | ||||
|                 // 合同号 | ||||
|                 Object ctpk = aggvo.getChildrenVO()[0].getAttributeValue("def6"); | ||||
| 				// 查询合同号下 | ||||
|                 // 查询合同号下 | ||||
|                 String sql1 = " select sum(ar_gatheritem.money_cr) sk_effect_money " + | ||||
|                         " from ar_gatheritem " + | ||||
|                         " left join ar_gatherbill on ar_gatherbill.pk_gatherbill = ar_gatheritem.pk_gatherbill " + | ||||
|                         " where ar_gatherbill.dr = 0 and ar_gatheritem.dr = 0 and ar_gatherbill.EFFECTSTATUS = 10 " + | ||||
|                         " and ar_gatheritem.def6 = '" + ctpk + "'"; | ||||
|                 Object obj = dao.executeQuery(sql1, new ColumnProcessor()); | ||||
| 				// 收款单累计金额 | ||||
|                 // 收款单累计金额 | ||||
|                 UFDouble sk_effect_money = UFDouble.ZERO_DBL; | ||||
|                 if(obj != null) { | ||||
|                     sk_effect_money = new UFDouble(obj.toString()); | ||||
|                 } | ||||
| 				// 表头合同金额 | ||||
|                 // 表头合同金额 | ||||
|                 UFDouble ctmoney = UFDouble.ZERO_DBL; | ||||
|                 if(vdef17 != null) { | ||||
|                     ctmoney = new UFDouble(vdef17.toString()); | ||||
|                 } | ||||
| 				// 预收比例 | ||||
|                 // 预收比例 | ||||
|                 UFDouble preratio = UFDouble.ZERO_DBL; | ||||
|                 if(vdef15 != null) { | ||||
|                     preratio = new UFDouble(vdef15.toString()); | ||||
|                 } | ||||
| 				// 收款大于预收 | ||||
|                 // 收款大于预收 | ||||
|                 if (sk_effect_money.compareTo(UFDouble.ZERO_DBL) > 0 && sk_effect_money.sub(ctmoney.multiply(preratio)).compareTo(UFDouble.ZERO_DBL) >= 0) { | ||||
|                     String updateSQL = "update so_saleorder set vdef11 = (select pk_defdoc from bd_defdoc where code = 'fhk01') where csaleorderid = '" + csaleorderid + "'"; | ||||
|                     dao.executeUpdate(updateSQL); | ||||
|  | @ -100,32 +108,32 @@ public class BusiregForSyncSaleorderAndToBIP implements IBusinessListener{ | |||
|                 SaleOrderHVO[] hvo = (SaleOrderHVO[])dmo.queryByWhereClause(SaleOrderHVO.class, "csaleorderid='"+csaleorderid+"'"); | ||||
| 
 | ||||
| 
 | ||||
| 				// 实际预收款 npreceivemny | ||||
|                 // 实际收款金额 npreceivemny | ||||
|                 UFDouble npreceivemny = hvo[0].getNpreceivemny(); | ||||
|                 JSONObject p = new JSONObject(); | ||||
| 				HTXSDD.put("actPreRecvAmt", npreceivemny.getDouble()); | ||||
| 				// 实际收款金额 nreceivedmny | ||||
|                 HTXSDD.put("actRecvAmt", npreceivemny.getDouble()); | ||||
|                 // 实际预收款 nreceivedmny | ||||
|                 UFDouble nreceivedmny = hvo[0].getNreceivedmny(); | ||||
| 				HTXSDD.put("actRecvAmt", nreceivedmny.getDouble()); | ||||
| 				// 是否收到预收款 | ||||
|                 HTXSDD.put("actPreRecvAmt", nreceivedmny.getDouble()); | ||||
|                 // 是否收到预收款 | ||||
|                 Object vdef14Code = dao.executeQuery("select code from bd_defdoc where pk_defdoc = '" + vdef14 + "'", new ColumnProcessor()); | ||||
|                 HTXSDD.put("isPreRecv", vdef14Code); | ||||
| 				// 是否收到发货款 | ||||
|                 // 是否收到发货款 | ||||
|                 Object vdef11Code = dao.executeQuery("select code from bd_defdoc where pk_defdoc = '" + vdef11 + "'", new ColumnProcessor()); | ||||
|                 HTXSDD.put("isShipRecdAmt", vdef11Code); | ||||
|                 p.put("HTXSDD", HTXSDD); | ||||
|                 System.out.println(p.toJSONString()); | ||||
| 				// 获取旗舰版的token | ||||
|                 // 获取旗舰版的token | ||||
|                 Map<String, String> params = new HashMap<>(); | ||||
|                 String appKey = "a3c57e0d871240e9b9bf56b35001a324"; | ||||
|                 String appSecret = "a959f7786db8dbb9a2c0493b5855a46bea68ad75"; | ||||
|                 String tokenUrl="https://www.tkkfbip.com/iuap-api-auth/open-auth/selfAppAuth/getAccessToken"; | ||||
|                 String toBipUrl="https://www.tkkfbip.com/iuap-api-gateway/oxp4h3x6/current_yonbip_default_sys/KKAPI/contractSaleOrder/update?access_token="; | ||||
| 	 			// 除签名外的其他参数 | ||||
|                 // 除签名外的其他参数 | ||||
|                 params.put("appKey", appKey); | ||||
|                 String timestamp = String.valueOf(System.currentTimeMillis()); | ||||
|                 params.put("timestamp", timestamp); | ||||
| 				// 计算签名 | ||||
|                 // 计算签名 | ||||
|                 Map<String, String> treeMap; | ||||
|                 if (params instanceof TreeMap) { | ||||
|                     treeMap = params; | ||||
|  | @ -176,7 +184,7 @@ public class BusiregForSyncSaleorderAndToBIP implements IBusinessListener{ | |||
|         return bills; | ||||
|     } | ||||
| 
 | ||||
| private String doGet(String requestUrl, Map<String, String> paramMap) throws IOException { | ||||
|     private String doGet(String requestUrl, Map<String, String> paramMap) throws IOException { | ||||
| 
 | ||||
|         StringBuilder param = new StringBuilder("?"); | ||||
|         if (paramMap != null) { | ||||
|  | @ -191,7 +199,7 @@ private String doGet(String requestUrl, Map<String, String> paramMap) throws IOE | |||
|         String url = requestUrl + param; | ||||
|         URL u = new URL(url); | ||||
|         try { | ||||
| 				if("https".equalsIgnoreCase(u.getProtocol())){//判定网址是否信任,不信任则调用忽略信任工具类SslUtil | ||||
|             if("https".equalsIgnoreCase(u.getProtocol())){//判定网址是否信任,不信任则调用忽略信任工具类SslUtil | ||||
|                 IgnoreSslUtil.ignoreSsl(); | ||||
|             } | ||||
|             HttpsURLConnection connection = (HttpsURLConnection)u.openConnection(); | ||||
|  | @ -225,31 +233,31 @@ private String doGet(String requestUrl, Map<String, String> paramMap) throws IOE | |||
|     private String doPost(String requestUrl, JSONObject json) throws IOException { | ||||
|         URL u = new URL(requestUrl); | ||||
|         try { | ||||
| 			if("https".equalsIgnoreCase(u.getProtocol())){//判定网址是否信任,不信任则调用忽略信任工具类SslUtil | ||||
|             if("https".equalsIgnoreCase(u.getProtocol())){//判定网址是否信任,不信任则调用忽略信任工具类SslUtil | ||||
|                 IgnoreSslUtil.ignoreSsl(); | ||||
|             } | ||||
|             HttpsURLConnection connection = (HttpsURLConnection)u.openConnection(); | ||||
| 			// 设置请求方法 | ||||
|             // 设置请求方法 | ||||
|             connection.setRequestMethod("POST"); | ||||
| 	         // 设置请求属性 | ||||
|             // 设置请求属性 | ||||
|             connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); | ||||
| 	         // 发送POST请求必须设置如下两行 | ||||
|             // 发送POST请求必须设置如下两行 | ||||
|             connection.setDoOutput(true); | ||||
|             connection.setDoInput(true); | ||||
|             byte[] outputInBytes = json.toJSONString().getBytes(StandardCharsets.UTF_8); | ||||
| 	        // 写入数据到请求体 | ||||
|             // 写入数据到请求体 | ||||
|             OutputStream os = connection.getOutputStream(); | ||||
|             os.write(outputInBytes); | ||||
| 	        // 获取响应码 | ||||
|             // 获取响应码 | ||||
|             int responseCode = connection.getResponseCode(); | ||||
|             System.out.println("Response Code: " + responseCode); | ||||
| 	        // 读取响应 | ||||
|             // 读取响应 | ||||
|             String response = ""; | ||||
|             try(BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { | ||||
|                 br.readLine(); | ||||
|                 System.out.println("Response: " + response); | ||||
|             } | ||||
| 	        // 关闭连接 | ||||
|             // 关闭连接 | ||||
|             connection.disconnect(); | ||||
|             return response; | ||||
|         } catch(Exception e) { | ||||
|  |  | |||
|  | @ -10,6 +10,7 @@ import nc.impl.pubapp.pattern.rule.IRule; | |||
| import nc.md.persist.framework.IMDPersistenceQueryService; | ||||
| 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.pmo.pac0002.entity.PMOAggVO; | ||||
| import nc.vo.mmpac.pmo.pac0002.entity.PMOItemVO; | ||||
| import nc.vo.mmpac.pmo.pac0002.enumeration.PMOFBillstatusEnum; | ||||
|  | @ -55,13 +56,22 @@ public void process(PMOAggVO[] vos) { | |||
| 				} | ||||
| 				//Êý×éת»» | ||||
| 				AggPickmVO[] aggVOsArr = new AggPickmVO[aggVOs.size()]; | ||||
| 				boolean flag = false; | ||||
| 				for(int z=0; z<aggVOs.size(); z++) { | ||||
| 					AggPickmVO aggPickmVO = aggVOs.get(z); | ||||
| 					PickmHeadVO pickmHeadVO = aggPickmVO.getParentVO(); | ||||
| 					Integer fbillstatus = pickmHeadVO.getFbillstatus(); | ||||
| 					//已经位完工态的备料计划不修改 | ||||
| 					if(fbillstatus != 2){ | ||||
| 						aggVOsArr[z] =aggVOs.get(z); | ||||
| 						flag = true; | ||||
| 					} | ||||
| 				 | ||||
| 				} | ||||
| 				if(flag) { | ||||
| 					//±¸Áϼƻ®Í깤 | ||||
| 					PickmMaintainServiceImpl ipickmMaintainService = new PickmMaintainServiceImpl(); | ||||
| 					ipickmMaintainService.finishPickm(aggVOsArr); | ||||
| 				} | ||||
| 			}catch(BusinessException e) { | ||||
| 				// TODO Auto-generated catch block | ||||
| 				e.printStackTrace(); | ||||
|  |  | |||
|  | @ -242,8 +242,21 @@ public class IVApplicationServiceImpl implements IVApplicationService { | |||
|             //如果来源单据为销售发票,根据来源单据编号src_billno和来源单据类型(billtype = 32)查询销售发票价税合计(ntotalorigmny)与开票申请中价税合计(jshj)比较,须满足 jshj<ntotalorigmny | ||||
|             String src_billtype = ivApplicationVO.getParentVO().getSrc_billtype(); //来源单据类型 | ||||
|             String src_billno = ivApplicationVO.getParentVO().getSrc_billno(); //来源单据号 | ||||
|             if("32".equals(src_billtype) && !StringUtil.isNullStringOrNull(src_billno)){ | ||||
|             String def23 = ivApplicationVO.getParentVO().getDef23(); //bip开票类型 (3:出口发票) | ||||
|             //根据开票申请自定义项23查询自定义档案编码 | ||||
|             BaseDAO dao = new BaseDAO(); | ||||
|             String sqlDefdoc = "select code from bd_defdoc where dr = 0 and pk_defdoc = '" +def23+"'"; | ||||
|             Object objDefdoc = dao.executeQuery(sqlDefdoc, new ColumnProcessor()); | ||||
|             String def23Code = ""; | ||||
|             if(objDefdoc != null) { | ||||
|                 def23Code = objDefdoc.toString(); | ||||
|             } | ||||
|             /** | ||||
|              * 2025-03-12新增: | ||||
|              *  开票申请自定义项 23(bip开票类型) 不等于 3,def23Code != 3 | ||||
|              *  再做金额校验 | ||||
|              */ | ||||
|             if("32".equals(src_billtype) && !StringUtil.isNullStringOrNull(src_billno) && !"3".equals(def23Code)){ | ||||
|                 String sql = "select ntotalorigmny from so_saleinvoice where dr = 0 and vbillcode = '" +src_billno+"'"; | ||||
|                 Object obj = dao.executeQuery(sql, new ColumnProcessor()); | ||||
|                 //销售发票价税合计 | ||||
|  |  | |||
|  | @ -1,8 +1,11 @@ | |||
| package nccloud.web.ssctp.sscbd.ssctask.action; | ||||
| 
 | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| import antlr.collections.List; | ||||
| import itf.approvecenter.util.DataExchangeBean; | ||||
| import java.lang.reflect.InvocationTargetException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Map; | ||||
| import nc.bs.framework.common.InvocationInfoProxy; | ||||
| import nc.bs.logging.Logger; | ||||
|  | @ -26,7 +29,13 @@ implements ICommonAction | |||
| public Object doAction(IRequest request) { | ||||
|   IJson json = JsonFactory.create(); | ||||
|   String read = request.read(); | ||||
|   Map<String, Object> map = (Map)json.fromJson(read, Map.class); | ||||
|   Map<String, Object> requestMap = (Map)json.fromJson(read, Map.class); | ||||
|   //????????????????? | ||||
|   ArrayList<Map<String, Object>> dataList = (ArrayList)requestMap.get("batchDataList"); | ||||
|   ArrayList<JSONObject> resultList = new ArrayList<>(); | ||||
|   JSONObject jo = new JSONObject(); | ||||
|   //????????? | ||||
|   for(Map<String, Object> map: dataList) { | ||||
| 	  String billType = (String)map.get("billtype"); | ||||
| 	  String billno = (String)map.get("billno"); | ||||
| 	  String pk_group = (String)map.get("pk_group"); | ||||
|  | @ -36,7 +45,6 @@ public Object doAction(IRequest request) { | |||
| 	  String mod = (String)map.get("mod"); | ||||
| 	   | ||||
| 	  AggregatedValueObject billvo = null; | ||||
|   JSONObject jo = new JSONObject(); | ||||
| 	   | ||||
| 	  try { | ||||
| 	    checkSagaStatus(pk_currenttask, SSCCurrentTaskVO.getDefaultTableName(), "pk_currenttask"); | ||||
|  | @ -45,6 +53,7 @@ public Object doAction(IRequest request) { | |||
| 	     | ||||
| 	    String ts = TaskQryUtil.getLatestTs(pk_task, mod); | ||||
| 	    jo.put("ts", (ts == null) ? (String)map.get("ts") : ts); | ||||
| 	    resultList.add(jo); | ||||
| 	  } catch (Exception e) { | ||||
| 	    Throwable ex = ExceptionUtils.unmarsh(e); | ||||
| 	    if (e.getCause() instanceof InvocationTargetException) | ||||
|  | @ -54,7 +63,7 @@ public Object doAction(IRequest request) { | |||
| 	 | ||||
| 	       | ||||
| 	      if ((ex.getCause() != null && isInterface(ex.getCause().getClass(), "nc.itf.pubapp.pub.exception.IResumeException")) || (ex.getCause() == null && isInterface(ex.getClass(), "nc.itf.pubapp.pub.exception.IResumeException"))) { | ||||
|         JSONObject retJson = new JSONObject(); | ||||
| //	        JSONObject retJson = new JSONObject(); | ||||
| 	        String skipcodes = ""; | ||||
| 	 | ||||
| 	         | ||||
|  | @ -79,9 +88,9 @@ public Object doAction(IRequest request) { | |||
| 	        if (lastcodes != null && !"".equals(lastcodes)) { | ||||
| 	          skipcodes = skipcodes + "," + lastcodes; | ||||
| 	        } | ||||
|         retJson.put("skipcodes", skipcodes); | ||||
|         retJson.put("bugetAlarm", ((InvocationTargetException)e.getCause()).getTargetException().getMessage()); | ||||
|         return retJson; | ||||
| 	        jo.put("skipcodes", skipcodes); | ||||
| 	        jo.put("bugetAlarm", ((InvocationTargetException)e.getCause()).getTargetException().getMessage()); | ||||
| 	        resultList.add(jo); | ||||
| 	      }  | ||||
| 	    } | ||||
| 	   | ||||
|  | @ -92,7 +101,9 @@ public Object doAction(IRequest request) { | |||
| 	    Logger.error(e.getMessage(), e); | ||||
| 	    ExceptionUtils.wrapException(e); | ||||
| 	  }  | ||||
|   return jo; | ||||
|   } | ||||
|    | ||||
|   return resultList.toString(); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -100,12 +100,16 @@ public class InvoiceTaskPlugin implements IBackgroundWorkPlugin{ | |||
|                      */ | ||||
|                     //手动开启事务 | ||||
|                     TransactionFactory.getTMProxy().begin(3,0); | ||||
|                     //修改发票信息单据号 | ||||
|                     String sscivmSql = "UPDATE sscivm_invoice set billno = '" + fphm +"' where pk_invoice = '"+ pk_invoice +"'"; | ||||
|                     dao.executeUpdate(sscivmSql); | ||||
|                     Logger.error("---sscivmSqlExecute------"+sscivmSql); | ||||
|                     //修改发票关联关系单据编码 | ||||
|                     String sirSql = "UPDATE sscivm_invoice_relation set billno = '" + billno +"' where pk_invoice = '"+ pk_invoice +"' and billid = '"+ csaleinvoiceid +"'"; | ||||
|                     String sirSql = "UPDATE sscivm_invoice_relation set billno = '" + fphm +"' where pk_invoice = '"+ pk_invoice +"' and billid = '"+ csaleinvoiceid +"'"; | ||||
|                     dao.executeUpdate(sirSql); | ||||
|                     Logger.error("---sirSqlExecute------"+sirSql); | ||||
|                     //ERP销售发票回传,根据销售发票id,回写发票号和单据编号 | ||||
|                     String sSaleSql = "UPDATE so_saleinvoice set vdef20 = 'Y' , vdef13 = '" + fphm + "', vbillcode = '" + billno +"'  where csaleinvoiceid = '" + csaleinvoiceid + "'"; | ||||
|                     String sSaleSql = "UPDATE so_saleinvoice set vdef20 = 'Y' , vdef13 = '" + fphm + "', vbillcode = '" + fphm +"'  where csaleinvoiceid = '" + csaleinvoiceid + "'"; | ||||
|                     dao.executeUpdate(sSaleSql); | ||||
|                     Logger.error("---sSaleSqlExecute------"+sSaleSql); | ||||
|                     //根据销售发票id 回写下游应收单表头发票号 | ||||
|  | @ -125,7 +129,7 @@ public class InvoiceTaskPlugin implements IBackgroundWorkPlugin{ | |||
|                     Logger.error("---recItemSqlExecute------"+recItemSql); | ||||
|                     //查询销售发票下游单据,如果有将下游单据表体字段【来源单据号】更新成新的发票号 | ||||
|                     String saleOutSql = "UPDATE ic_saleout_b \n" + | ||||
|                             "SET vsourcebillcode = '"+ billno +"' \n" + | ||||
|                             "SET vsourcebillcode = '"+ fphm +"' \n" + | ||||
|                             "WHERE\n" + | ||||
|                             "csourcetype = '32' \n" + | ||||
|                             "AND csourcebillhid = '" + csaleinvoiceid +"'"; | ||||
|  |  | |||
|  | @ -92,7 +92,7 @@ public class MaterialDefaultRefModel extends AbstractRefGridTreeBigDataModel imp | |||
|         this.setClassDataPower(true); | ||||
|         this.setClassWherePart("1 = 1"); | ||||
|         this.setFieldCode(new String[]{"pk_org", "code", "name", "materialspec", "materialtype", "materialshortname", | ||||
|                 "materialmnecode", "graphid", "pk_measdoc", "memo"}); | ||||
|                 "materialmnecode", "memo", "graphid", "pk_measdoc"}); | ||||
|         String[] fieldNames = new String[]{NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "2UC000-000360"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "UC000-0002911"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "UC000-0002908"), | ||||
|  | @ -100,14 +100,14 @@ public class MaterialDefaultRefModel extends AbstractRefGridTreeBigDataModel imp | |||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "UC000-0001240"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("10140mag", "2materia-000017"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "UC000-0000703"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "2UC000-000258"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "UC000-0001223"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "2UC000-000031"), | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "2UC000-000258")}; | ||||
|                 NCLangRes4VoTransl.getNCLangRes().getStrByID("common", "2UC000-000031")}; | ||||
|         this.setFieldName(fieldNames); | ||||
|         String orgFomula = "getMLCValue(\"" + OrgVO.getDefaultTableName() + "\",\"" + "name" + "\",\"" + "pk_org" + "\"," + "pk_org" + ")"; | ||||
|         String mesFomula = "getMLCValue(\"" + MeasdocVO.getDefaultTableName() + "\",\"" + "name" + "\",\"" + "pk_measdoc" + "\"," + "pk_measdoc" + ")"; | ||||
|         this.setFormulas(new String[][]{{"pk_org", orgFomula}, {"pk_measdoc", mesFomula}}); | ||||
|         this.setDefaultFieldCount(7); | ||||
|         this.setDefaultFieldCount(8); | ||||
|         this.setHiddenFieldCode(new String[]{"pk_material", "pk_source", "pk_marbasclass"}); | ||||
|         this.setTableName(MaterialVersionVO.getDefaultTableName()); | ||||
|         this.setPkFieldCode("pk_source"); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue