|
|
|
@ -44,7 +44,13 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
|
|
|
|
|
var admin = cdc.VW_user.First(x => x.CODENAME == "admin");
|
|
|
|
|
|
|
|
|
|
var OpapplyHead = getHeadInfo(head, "add", admin);
|
|
|
|
|
var _r2 = getHeadInfo(head, "add", admin);
|
|
|
|
|
if (!_r2.Success) {
|
|
|
|
|
result = new JsonResponse { Success = _r2.Success, Message = _r2.Message, Data = _r2.Data };
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
var OpapplyHead = (MsOpApply)_r2.Data;
|
|
|
|
|
|
|
|
|
|
var OpapplyGoodsDetailList = new List<MsOpApplyDetail>();
|
|
|
|
|
|
|
|
|
@ -65,7 +71,16 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
|
|
|
|
|
if (_count == 0)
|
|
|
|
|
{
|
|
|
|
|
OpapplyHead = getHeadInfo(head,"add",admin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _r3 = getHeadInfo(head, "add", admin);
|
|
|
|
|
if (!_r3.Success)
|
|
|
|
|
{
|
|
|
|
|
result = new JsonResponse { Success = _r3.Success, Message = _r3.Message, Data = _r3.Data };
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
OpapplyHead = (MsOpApply)_r3.Data;
|
|
|
|
|
|
|
|
|
|
OpapplyHead.DbOperationType = DbOperationType.DbotIns;
|
|
|
|
|
|
|
|
|
@ -101,7 +116,16 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
OpapplyHead = getHeadInfo(head, "update");
|
|
|
|
|
//OpapplyHead = getHeadInfo(head, "update");
|
|
|
|
|
|
|
|
|
|
var _r4 = getHeadInfo(head, "update");
|
|
|
|
|
if (!_r4.Success)
|
|
|
|
|
{
|
|
|
|
|
result = new JsonResponse { Success = _r4.Success, Message = _r4.Message, Data = _r4.Data };
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
OpapplyHead = (MsOpApply)_r4.Data;
|
|
|
|
|
|
|
|
|
|
OpapplyHead.DbOperationType = DbOperationType.DbotUpd;
|
|
|
|
|
|
|
|
|
@ -327,10 +351,12 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static MsOpApply getHeadInfo(GuanMaoYun_Head headinfo,string opstatus,VW_user_md userinfo=null)
|
|
|
|
|
public static DBResult getHeadInfo(GuanMaoYun_Head headinfo,string opstatus,VW_user_md userinfo=null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var result = new MsOpApply();
|
|
|
|
|
var result = new MsOpApply();
|
|
|
|
|
|
|
|
|
|
var returnresult = new DBResult();
|
|
|
|
|
|
|
|
|
|
if (opstatus == "add")
|
|
|
|
|
{
|
|
|
|
@ -347,7 +373,26 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
result.MASTERNO = headinfo.BUSINESS_ORDER_INFO.WORK_NO;
|
|
|
|
|
result.CUSCIQNO = head.EPROT_NO;
|
|
|
|
|
|
|
|
|
|
result.CUSTOMERNAME = headinfo.BUSINESS_ORDER_INFO.EXPORT_NAME;
|
|
|
|
|
var cdc = new CommonDataContext();
|
|
|
|
|
|
|
|
|
|
//委托单位使用BUSINESS_ORDER_INFO.EXPORT_CODE和code_cust_edi中ediname=关贸云的数据相关联 如无则返回错误
|
|
|
|
|
var 委托单位关贸云code = headinfo.BUSINESS_ORDER_INFO.EXPORT_CODE;
|
|
|
|
|
|
|
|
|
|
var customernameList = cdc.code_cust_edi.Where(x => x.EDINAME == "关贸云" && 委托单位关贸云code==x.EDICODE).ToList();
|
|
|
|
|
|
|
|
|
|
var CUSTOMER = new info_client_md();
|
|
|
|
|
|
|
|
|
|
if (customernameList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
result.CUSTOMERNAME = customernameList[0].CUST;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
returnresult.SetErrorInfo($"[{委托单位关贸云code}]没有做代码对应(ediname=关贸云,edicode=关贸云的用户id)");
|
|
|
|
|
return returnresult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//result.CUSTOMERNAME = headinfo.BUSINESS_ORDER_INFO.EXPORT_NAME;
|
|
|
|
|
|
|
|
|
|
//E出口 I进口
|
|
|
|
|
if (head.IE_TYPE == "E") result.BSTYPE = "2";
|
|
|
|
@ -395,6 +440,8 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
result.ENTERP = head.EXPORT_NAME; //经营单位名称
|
|
|
|
|
result.ENTERPID = head.EXPORT_CODE; //经营单位代码
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.BOOKNO = head.HAND_BOOK_NO;//手册备案号
|
|
|
|
|
|
|
|
|
|
result.CONTRACTNO = head.CONTR_NO;//合同号
|
|
|
|
@ -420,7 +467,11 @@ namespace DSWeb.Areas.CommMng.DAL
|
|
|
|
|
|
|
|
|
|
result.CUSTOMSNUM = headinfo.GOODS_LIST.Count();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
result.OP = headinfo.BUSINESS_ORDER_INFO.PROJECT_NO;//操作 2023-1-13
|
|
|
|
|
|
|
|
|
|
returnresult.OK("", result);
|
|
|
|
|
|
|
|
|
|
return returnresult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|