@@ -2295,7 +2295,7 @@ where bb.StuNo not in (select b.StuNo from StuInfoBasic b where b.StuNo=bb.StuNo
}
//数据筛查完毕,执行导入
//order主表记录查询
var orderlist = BaseRepository("CollegeMIS").FindList<StuEnrollFeeOrderEntity>("select * from StuEnrollFeeOrder where YearNo='" +(templateId=="1"? "20"+stufreshlist.FirstOrDefault(m=>m.StuNo== dr[1].ToString()).Grade: dr[0].ToString()) + "' and StuNo='" + dr[1].ToString() + "' and Status=999");
var orderlist = BaseRepository("CollegeMIS").FindList<StuEnrollFeeOrderEntity>("select * from StuEnrollFeeOrder where YearNo='" +(templateId=="1"? "20"+stufreshlist.FirstOrDefault(m=>m.StuNo== dr[1].ToString()).Grade: dr[0].ToString()) + "' and StuNo='" + dr[1].ToString() + "' and Status=999");
//查无订单新建
if (orderlist.Count() == 0)
{
@@ -2303,7 +2303,7 @@ where bb.StuNo not in (select b.StuNo from StuInfoBasic b where b.StuNo=bb.StuNo
db.BeginTrans();
StuEnrollFeeOrderEntity orderEntity = new StuEnrollFeeOrderEntity();
BaseRepository().ExecuteBySql("insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),122,'yongyou','用友回写SCS_ORDER完成',getdate())");
//用友明细
List<StuEnrollFeeOrderDetailEntity> orderdetaillist = BaseRepository("CollegeMIS").FindList<StuEnrollFeeOrderDetailEntity>("select * from StuEnrollFeeOrderDetail where OrderId='" + newdetail.Id + "'").ToList();
for (int i = 0; i < orderdetaillist.Count; i++)
//判断用友订单是否存在记录
DataTable scs_orderlist = BaseRepository("YongyouDb").FindTable("select * from SCS_ORDER where KJND='" + newdetail.YearNo + "' and OR_ID='" + newdetail.orderid + "-" + newdetail.YearNo + "' and OR_NO='" + newdetail.orderid + "'");
if (scs_orderlist.Rows.Count == 0)
{
string sqldetail = "insert into SCS_ORDEL(GSDM,KJND,OR_ID,XH,SFND,SFXMDM,SFXMMC,JE,SFQJNM) " +
BaseRepository().ExecuteBySql("insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),122,'yongyou','用友回写SCS_ORDER完成',getdate())");
//用友明细
List<StuEnrollFeeOrderDetailEntity> orderdetaillist = BaseRepository("CollegeMIS").FindList<StuEnrollFeeOrderDetailEntity>("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) " +