dev
dengyu 2 months ago
parent c5ae5e7bc6
commit c5324bdf51

@ -45,7 +45,7 @@ namespace DS.Module.ExcelModule
{
try
{
string[] PathNames = fullFielPath.Split(new string[] { @"/" }, StringSplitOptions.RemoveEmptyEntries);
string[] PathNames = fullFielPath.Split(new string[] { @"/",@"\\", @"\" }, StringSplitOptions.RemoveEmptyEntries);
var ExcelFileName = PathNames[PathNames.Length - 1];
if (ExcelFileName.EndsWith(".xls"))
@ -53,7 +53,9 @@ namespace DS.Module.ExcelModule
var newExcelFileName = PathNames[PathNames.Length - 1].Replace(".xls", ".xlsx");
var _newFileFullname = Path.GetDirectoryName(fullFielPath) + "/" + newExcelFileName;
var pathhead = Path.GetDirectoryName(fullFielPath);
var _newFileFullname = pathhead + "/" + newExcelFileName;
Workbook book = new Workbook();
book.LoadFromFile(fullFielPath);

@ -883,7 +883,8 @@ public class CM_RentOutService : CMServiceBase, ICM_RentOutService
newrec.Pid = id;
newrec.RentDirectId = CMRentDirectEnum.;
newrec.DropoffDate = head.Bsdate;
newrec.RentDetailId = addrec.Id;//
//newrec.RentDetailId = addrec.Id;//
newrec.RentDetailId = 0;
newrec.RentCustomerId = head.RentCustomerId;
newrec.RentCustomerName = head.RentCustomerName;
newrec.RentTypeId = head.RentTypeId;
@ -982,6 +983,8 @@ public class CM_RentOutService : CMServiceBase, ICM_RentOutService
{
var addList = req.BodyList.Adapt<List<CM_RentOut_Detail>>();
await TenantDb.Insertable(addList).ExecuteCommandAsync();
var _body = await TenantDb.Queryable<CM_RentOut_Detail>().Where(a => a.Pid == id).ToListAsync();
var ch = new CtnTotalHelper2<List<CM_RentOut_Detail>>(_body);

@ -314,7 +314,7 @@ public class CM_State_ChangeService : CMServiceBase, ICM_State_ChangeService
newBaseinfo.ProductionDate = change.ProductionDate;
newBaseinfo.CtnWeight = change.CtnWeight == null ? 0 : change.CtnValue_Base;
newBaseinfo.CtnWeight = change.CtnWeight == null ? 0 : change.CtnWeight;
newBaseinfo.CtnValue_Base = change.CtnValue_Base == null ? 0 : change.CtnValue_Base;
newBaseinfo.CtnValue_BuyingPrice = change.CtnValue_BuyingPrice == null ? 0 : change.CtnValue_BuyingPrice;

@ -576,11 +576,31 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
{
var reqtype = new CM_BuyCtn_DetailReq();
var detail = new CM_BuyCtn_Detail();
_r = await (reqtype, detail, req);
//_r = await 通过模板导入子表明细(reqtype, detail, req);
var _head = tenantDb.Queryable<CM_BuyCtn>().Where(x => x.Id == req.Id).First();
var head = _head.Adapt<CM_BuyCtnReq>();
_r = await (reqtype, req);
if (!_r.Succeeded)
{
return _r;
}
if (_r.Data != null)
{
head.BodyList = _r.Data as List<CM_BuyCtn_DetailReq>;
_CM_BuyCtn.EditCM_BuyCtn(head);
}
return _r;
}
//卖箱 处理
if (req.FormName == "CM_SellCtn")
{
@ -709,11 +729,32 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
{
var reqtype = new CM_RentOneWay_DetailReq();
var detail = new CM_RentOneWay_Detail();
_r = await (reqtype, detail, req);
//_r = await 通过模板导入子表明细(reqtype, detail, req);
var _head = tenantDb.Queryable<CM_RentOneWay_In>().Where(x => x.Id == req.Id).First();
var head = _head.Adapt<CM_RentOneWay_InReq>();
_r = await (reqtype, req);
if (!_r.Succeeded)
{
return _r;
}
if (_r.Data != null)
{
head.BodyList = _r.Data as List<CM_RentOneWay_DetailReq>;
_CM_RentOneWay_In.EditCM_RentOneWay_In(head);
}
return _r;
//return _r;
}
//报废处理
if (req.FormName == "CM_CtnScrap")
{
@ -793,10 +834,15 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
var head = await db.Queryable<SysDictType>().FirstAsync(x => x.Code == "CM_StateChange_Field");
var = await db.Queryable<SysDictData>().Where(x => x.TypeId == head.Id).ToListAsync();
//1834834297505320960
var excelinfo = tenantDb.Queryable<OpFile>().FirstAsync(x => x.Id == req.FileId).Result;
//var filePath = Path.Combine(_environment.WebRootPath, excel文件info.FilePath);
//正式地址
//var pathhead = _environment.WebRootPath.Replace("containermanagement-api", "main-api") + "\\LinkAttach";
//var filePath = Path.Combine(pathhead, excel文件info.FilePath);
//调试地址
//var filePath = Path.Combine("D:\\ds8-solution-pro\\ds-wms-service\\DS.WMS.MainApi\\wwwroot\\LinkAttach", excel文件info.FilePath);
var pathhead = "D:\\ds8-solution-pro\\ds-wms-service\\DS.WMS.MainApi\\wwwroot";
@ -804,11 +850,28 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
{
pathhead = _environment.WebRootPath.Replace("containermanagement-api", "main-api");
}
catch (Exception e) {
catch (Exception e)
{
}
var filePath = Path.Combine(pathhead + "\\LinkAttach", excelinfo.FilePath);
////////////////
////var filePath = Path.Combine(_environment.WebRootPath, excel文件info.FilePath);
//var pathhead = "D:\\ds8-solution-pro\\ds-wms-service\\DS.WMS.MainApi\\wwwroot";
//try
//{
// pathhead = _environment.WebRootPath.Replace("containermanagement-api", "main-api");
//}
//catch (Exception e) {
//}
//var filePath = Path.Combine(pathhead + "\\LinkAttach", excel文件info.FilePath);
//var filePath = Path.Combine("D:\\ds8-solution-pro\\ds-wms-service\\DS.WMS.MainApi\\wwwroot\\LinkAttach", excel文件info.FilePath);
//var basePath = AppSetting.app(new string[] { "FileSettings", "BasePath" });
@ -1074,12 +1137,26 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha
//var filePath = Path.Combine(dirAbs, excel文件info.FilePath);
//正式地址
var pathhead = _environment.WebRootPath.Replace("containermanagement-api", "main-api") + "\\LinkAttach";
var filePath = Path.Combine(pathhead, excelinfo.FilePath);
//var pathhead = _environment.WebRootPath.Replace("containermanagement-api", "main-api") + "\\LinkAttach";
//var filePath = Path.Combine(pathhead, excel文件info.FilePath);
//调试地址
//var filePath = Path.Combine("D:\\ds8-solution-pro\\ds-wms-service\\DS.WMS.MainApi\\wwwroot\\LinkAttach", excel文件info.FilePath);
var pathhead = "D:\\ds8-solution-pro\\ds-wms-service\\DS.WMS.MainApi\\wwwroot";
try
{
pathhead = _environment.WebRootPath.Replace("containermanagement-api", "main-api");
}
catch (Exception e)
{
}
var filePath = Path.Combine(pathhead + "\\LinkAttach", excelinfo.FilePath);
if (!File.Exists(filePath))
{
var _r0 = DataResult.Successed("添加失败", filePath, MultiLanguageConst.CM_Templat_);

Loading…
Cancel
Save