diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs index 8987b58f2..5f38f366c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs @@ -2448,11 +2448,16 @@ where bb.StuNo not in (select b.StuNo from StuInfoBasic b where b.StuNo=bb.StuNo List orderdetaillist = BaseRepository("CollegeMIS").FindList("select * from StuEnrollFeeOrderDetail where OrderId='" + newdetail.Id + "'").ToList(); for (int i = 0; i < orderdetaillist.Count; i++) { - string sqldetail = "insert into SCS_ORDEL(GSDM,KJND,OR_ID,XH,SFND,SFXMDM,SFXMMC,JE,SFQJNM) " + - "values('001','" + newdetail.YearNo + "','" + newdetail.orderid + "-" + newdetail.YearNo + "','" + (xhnew + i + 1) + "','" + newdetail.YearNo + "','" + orderdetaillist[i].ChargeItemID + "','" + orderdetaillist[i].ChargeItemName + "','" + orderdetaillist[i].SJAmount + "','" + newdetail.YearNo + "')"; - BaseRepository("YongyouDb").ExecuteBySql(sqldetail); - //更新主表 - BaseRepository("YongyouDb").ExecuteBySql("update SCS_ORDER set AMOUNT=AMOUNT+" + orderdetaillist[i].SJAmount + " where KJND='" + newdetail.YearNo + "' and OR_ID='" + newdetail.orderid + "-" + newdetail.YearNo + "' and OR_NO='" + newdetail.orderid + "'"); + if (BaseRepository("YongyouDb") + .FindTable("select * from SCS_ORDEL where OR_ID='" + newdetail.orderid + "-" + + newdetail.YearNo + "' and SFXMDM='" + orderdetaillist[i].ChargeItemID + "'").Rows.Count==0) + { + string sqldetail = "insert into SCS_ORDEL(GSDM,KJND,OR_ID,XH,SFND,SFXMDM,SFXMMC,JE,SFQJNM) " + + "values('001','" + newdetail.YearNo + "','" + newdetail.orderid + "-" + newdetail.YearNo + "','" + (xhnew + i + 1) + "','" + newdetail.YearNo + "','" + orderdetaillist[i].ChargeItemID + "','" + orderdetaillist[i].ChargeItemName + "','" + orderdetaillist[i].SJAmount + "','" + newdetail.YearNo + "')"; + BaseRepository("YongyouDb").ExecuteBySql(sqldetail); + //更新主表 + BaseRepository("YongyouDb").ExecuteBySql("update SCS_ORDER set AMOUNT=AMOUNT+" + orderdetaillist[i].SJAmount + " where KJND='" + newdetail.YearNo + "' and OR_ID='" + newdetail.orderid + "-" + newdetail.YearNo + "' and OR_NO='" + newdetail.orderid + "'"); + } } } }