|
@@ -17,14 +17,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
|
|
|
|
|
|
- public class EnterExitCostRepository:BaseRepository<Grp_EnterExitCost, EnterExitCostView>
|
|
|
+ public class EnterExitCostRepository : BaseRepository<Grp_EnterExitCost, EnterExitCostView>
|
|
|
{
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly SetDataRepository _setDataRep;
|
|
|
|
|
|
|
|
|
public EnterExitCostRepository(SqlSugarClient sqlSugar, IMapper mapper, SetDataRepository setDataRep)
|
|
|
- :base(sqlSugar)
|
|
|
+ : base(sqlSugar)
|
|
|
{
|
|
|
_setDataRep = setDataRep;
|
|
|
_mapper = mapper;
|
|
@@ -42,7 +42,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
foreach (var item in enterExitList)
|
|
|
{
|
|
|
- string rateStr = string.Format(@"美元(USD):{0}|日元(JPY):{1}|欧元(EUR):{2}|英镑(GBP):{3}|港币(HKD):{4}", item.RateUSD,item.RateJPY,item.RateEUR,item.RateGBP,item.RateHKD);
|
|
|
+ string rateStr = string.Format(@"美元(USD):{0}|日元(JPY):{1}|欧元(EUR):{2}|英镑(GBP):{3}|港币(HKD):{4}", item.RateUSD, item.RateJPY, item.RateEUR, item.RateGBP, item.RateHKD);
|
|
|
item.CurrencyRemark = rateStr;
|
|
|
}
|
|
|
|
|
@@ -51,7 +51,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
.UpdateColumns(it => new { it.CurrencyRemark })
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
- if (res > 0)
|
|
|
+ if (res > 0)
|
|
|
{
|
|
|
result.Code = 0;
|
|
|
result.Msg = res.ToString();
|
|
@@ -61,7 +61,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -101,22 +101,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
result.Msg = "未查询出数据!!!";
|
|
|
}
|
|
|
|
|
@@ -124,7 +124,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
else result.Msg = ErrorMsg.Error_Port_Msg;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -135,8 +135,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
|
|
|
public async Task<Result> PostEnterExitCostOperate(EnterExitCostOperateDto dto)
|
|
|
- {
|
|
|
- Result result = new Result() { Code =-1,Msg="操作失败!" };
|
|
|
+ {
|
|
|
+ Result result = new Result() { Code = -1, Msg = "操作失败!" };
|
|
|
|
|
|
#region MyRegion
|
|
|
|
|
@@ -198,6 +198,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ if (dto.SumJJC == 0) {
|
|
|
+ dto.OutsideJJPay = 0;
|
|
|
+ }
|
|
|
+ if (dto.SumGWC == 0) {
|
|
|
+ dto.OutsaideGWPay = 0;
|
|
|
+ }
|
|
|
+
|
|
|
var enterExitCost = _mapper.Map<Grp_EnterExitCost>(dto);
|
|
|
|
|
|
|
|
@@ -231,6 +238,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
try
|
|
|
{
|
|
|
int enterExitId = 0;
|
|
|
+
|
|
|
if (enterExitCost.Id > 0)
|
|
|
{
|
|
|
var updateId = _sqlSugar.Updateable<Grp_EnterExitCost>(enterExitCost)
|
|
@@ -260,31 +268,46 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
if (enterExitId > 0)
|
|
|
{
|
|
|
+
|
|
|
+ string sqlDelete = string.Format(@" Delete From Grp_DayAndCost Where Diid = {0} ", dto.DiId);
|
|
|
+ await ExecuteCommandAsync(sqlDelete);
|
|
|
+
|
|
|
foreach (var item in subData)
|
|
|
{
|
|
|
- if (item.Id > 0)
|
|
|
+ var updateId = _sqlSugar.Insertable<Grp_DayAndCost>(item).ExecuteCommand();
|
|
|
+ if (updateId < 1)
|
|
|
{
|
|
|
- var updateId = _sqlSugar.Updateable<Grp_DayAndCost>(item)
|
|
|
- .IgnoreColumns(it => new { it.DiId, it.Type, it.CreateUserId, it.CreateTime, it.IsDel })
|
|
|
- .ExecuteCommand();
|
|
|
- if (updateId < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- result.Msg = "修改操作失败!";
|
|
|
- return result;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var updateId = _sqlSugar.Insertable<Grp_DayAndCost>(item).ExecuteCommand();
|
|
|
- if (updateId < 1)
|
|
|
- {
|
|
|
- _sqlSugar.RollbackTran();
|
|
|
- result.Msg = "添加操作失败!";
|
|
|
- return result;
|
|
|
- }
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
+ result.Msg = "添加操作失败!";
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
_sqlSugar.CommitTran();
|
|
@@ -321,7 +344,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")
|
|
|
};
|
|
|
|
|
|
- var del = _sqlSugar.Updateable(data).UpdateColumns(it => new { it.IsDel, it.DeleteUserId,it.DeleteTime }).ExecuteCommand();
|
|
|
+ var del = _sqlSugar.Updateable(data).UpdateColumns(it => new { it.IsDel, it.DeleteUserId, it.DeleteTime }).ExecuteCommand();
|
|
|
|
|
|
if (del > 0) result.Code = 0;
|
|
|
else result.Msg = string.Format("删除失败!");
|