Commit 5c9dc64a by zxw

1222 部署

parent 8278dcff
......@@ -135,6 +135,12 @@ namespace JmpModel.Model
public string BagInventoryId { get; set; }
[Column("is_need_push_update")]
public bool? IsNeedPushUpdate { get; set; }
/// <summary>
/// 是否继续使用
/// </summary>
[Required]
[Column("is_continue_use")]
public bool? IsContinueUse { get; set; }
[ForeignKey(nameof(BagInventoryId))]
[InverseProperty(nameof(CommonJpBagInventory.CommonJpEquipmentInventories))]
......
......@@ -392,6 +392,7 @@ namespace JmpModel.Model.DataContext
entity.HasOne(d => d.Apply)
.WithMany(p => p.CommonJpBorrowReturns)
.HasForeignKey(d => d.ApplyId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("common_jp_borrow_return_ibfk_6");
entity.HasOne(d => d.Org)
......@@ -449,6 +450,7 @@ namespace JmpModel.Model.DataContext
entity.HasOne(d => d.Estimate)
.WithMany(p => p.CommonJpBorrowReturnDetailEstimates)
.HasForeignKey(d => d.EstimateId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("common_jp_borrow_return_detail_estimate_ibfk_5");
entity.HasOne(d => d.Size)
......@@ -478,6 +480,7 @@ namespace JmpModel.Model.DataContext
entity.HasOne(d => d.Estimate)
.WithMany(p => p.CommonJpBorrowReturnDetailRealities)
.HasForeignKey(d => d.EstimateId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("common_jp_borrow_return_detail_reality_ibfk_7");
entity.HasOne(d => d.Reality)
......@@ -609,6 +612,10 @@ namespace JmpModel.Model.DataContext
entity.Property(e => e.IsBorrowed).HasDefaultValueSql("b'0'");
entity.Property(e => e.IsContinueUse)
.HasDefaultValueSql("b'0'")
.HasComment("是否继续使用");
entity.Property(e => e.IsInBox).HasDefaultValueSql("b'0'");
entity.Property(e => e.IsNeedPushUpdate).HasDefaultValueSql("b'0'");
......@@ -1416,6 +1423,10 @@ namespace JmpModel.Model.DataContext
{
entity.ToView("v_scrap_view");
entity.Property(e => e.IsContinueUse)
.HasDefaultValueSql("b'0'")
.HasComment("是否继续使用");
entity.Property(e => e.IsScrap)
.UseCollation("utf8mb4_general_ci")
.HasCharSet("utf8mb4");
......@@ -1472,6 +1483,10 @@ namespace JmpModel.Model.DataContext
entity.Property(e => e.InventoryState).HasDefaultValueSql("'normal'");
entity.Property(e => e.IsContinueUse)
.HasDefaultValueSql("b'0'")
.HasComment("是否继续使用");
entity.Property(e => e.IsMap).HasDefaultValueSql("'0'");
entity.Property(e => e.Price).HasPrecision(12, 2);
......
......@@ -15,6 +15,12 @@ namespace JmpModel.Model
[Column("id")]
[StringLength(36)]
public string Id { get; set; }
/// <summary>
/// 是否继续使用
/// </summary>
[Required]
[Column("isContinueUse")]
public bool? IsContinueUse { get; set; }
[Column("epc")]
[StringLength(128)]
public string Epc { get; set; }
......
......@@ -78,5 +78,10 @@ namespace JmpModel.Model
public int? SafeLevel { get; set; }
[Column("is_map", TypeName = "smallint(6)")]
public short? IsMap { get; set; }
/// <summary>
/// 是否继续使用
/// </summary>
[Column("is_continue_use")]
public bool? IsContinueUse { get; set; }
}
}
\ No newline at end of file
......@@ -114,6 +114,7 @@ namespace JunmpPoliceStation.Controllers
c.UpdateTime,
c.UpdateUser,
c.UnitType,
c.AliasName,
supplierList = c.BaseJpSupplierEquipments.Select(t => new { t.SupplierCode })
}
).ToList();
......@@ -207,6 +208,7 @@ namespace JunmpPoliceStation.Controllers
c.Id,
c.Sort,
c.Name,
c.AliasName,
c.EquipmentId,
EquipmentName = c.Equipment?.Name,
c.Unit,
......@@ -323,6 +325,7 @@ namespace JunmpPoliceStation.Controllers
c.Id,
c.Sort,
c.Name,
c.AliasName,
c.EquipmentId,
c.Code,
EquipmentName = c.Equipment?.Name,
......@@ -437,6 +440,7 @@ namespace JunmpPoliceStation.Controllers
c.Id,
c.Sort,
c.Name,
c.AliasName,
c.EquipmentId,
EquipmentName = c.Equipment?.Name,
c.Unit,
......@@ -522,7 +526,14 @@ namespace JunmpPoliceStation.Controllers
if (updateObject != null)
{
updateObject.AliasName = entity.aliasName;
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
if (_unitOfWork.EquipmentDetailRepository.Update(updateObject))
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
}
else
{
......
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
......@@ -207,6 +208,7 @@ namespace JunmpPoliceStation.Controllers
/// "days":7,
/// "scrap":true,
/// "position":"全部 仓库 库外 单警柜",
/// "isContinueUse":"是否继续使用 true",
/// }
/// </remarks>
[HttpPost("GetTreeScrapMsg")]
......@@ -227,6 +229,7 @@ namespace JunmpPoliceStation.Controllers
DateTime startTime = default;
DateTime endTime = default;
bool.TryParse(entity?.scrap ?? "false", out bool scrap);
bool.TryParse(entity?.isContinueUse ?? "false", out bool isContinueUse);
if (string.IsNullOrEmpty(orgId))
{
return JsonManager.SimpleCustResponse("orgId is require");
......@@ -283,6 +286,9 @@ namespace JunmpPoliceStation.Controllers
}
}
//继续使用
expression = expression.AndAlso(x => x.IsContinueUse == isContinueUse);
var scrapList = _unitOfWork.ScrapViewRepository.GetPage(expression, "WarrantyTime", 0, 999999);
var data = scrapList.content
.GroupBy(x => new { x.WarehouseName, x.WarehouseId, x.EquName, x.SizeName })
......@@ -296,6 +302,7 @@ namespace JunmpPoliceStation.Controllers
children = s.Select(y => new
{
id = y.Id,
equId = y.EquId,
epc = y.Epc,
sizeId = y.SizeId,
sizeName = y.SizeName,
......@@ -335,6 +342,74 @@ namespace JunmpPoliceStation.Controllers
}
/// <summary>
/// 更新是否继续使用状态
/// </summary>
/// <param name="jdata"></param>
/// <returns></returns>
/// <remarks>
///
/// ## 例子
/// {
/// "isContinueUse":"是否继续使用 true",
/// "detailList":[
/// {
/// "id":"装备id"
/// }]
/// }
///
/// </remarks>
[HttpPost("UpdateEquIsContinueUse")]
public async Task<HttpResponseMessage> UpdateEquIsContinueUse([FromBody] JObject jdata)
{
return await Task.Run(() =>
{
try
{
if (jdata != null)
{
var entity = JsonManager.GetJsonEntity(jdata);
var idList = new List<string>();
if (entity.detailList is IEnumerable)
{
foreach (var obj in entity.detailList)
{
idList.Add(obj.id);
}
}
if (!bool.TryParse(entity?.isContinueUse, out bool isContinueUse))
{
return JsonManager.SimpleCustResponse("isContinueUse is require");
}
var invList = _unitOfWork.EquipmentInventoryRepository.GetList(x => idList.Contains(x.Id)).ToList();
foreach (var inv in invList)
{
inv.IsContinueUse = isContinueUse;
}
if (_unitOfWork.EquipmentInventoryRepository.Update(invList))
{
return JsonManager.ReturnSuccessResponse(ResultCode.OPERATE_SUCCESS);
}
else
{
return JsonManager.ReturnSuccessResponse(ResultCode.OPERATE_FAILED);
}
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception ex)
{
return JsonManager.SimpleCustResponse(ex.ToString());
}
});
}
/// <summary>
/// 获取借用超期明细
/// </summary>
/// <param name="jdata"></param>
......
......@@ -223,7 +223,7 @@ namespace JunmpPoliceStation.Controllers
//即将报废
jjbfCount = ViewEquipmentList.Where(c => c.ParentName.Equals(parentName) && c.SafeLevel.Equals(1) && !c.CurrentState.Equals(6)).Count();
//已超期未报废
ycqCount = ViewEquipmentList.Where(c => c.ParentName.Equals(parentName) && c.SafeLevel.Equals(2) && !c.CurrentState.Equals(6)).Count();
ycqCount = ViewEquipmentList.Where(c => c.ParentName.Equals(parentName) && c.SafeLevel.Equals(2) && !c.CurrentState.Equals(6) && c.IsContinueUse != true).Count();
//超期未还
cqwhCount = Convert.ToInt32(_unitOfWork.BorrowViewRepository.Count(x =>
......@@ -244,7 +244,7 @@ namespace JunmpPoliceStation.Controllers
//即将报废
jjbfCount = ViewEquipmentList.Where(c => c.SafeLevel.Equals(1) && !c.CurrentState.Equals(6)).Count();
//已超期未报废
ycqCount = ViewEquipmentList.Where(c => c.SafeLevel.Equals(2) && !c.CurrentState.Equals(6)).Count();
ycqCount = ViewEquipmentList.Where(c => c.SafeLevel.Equals(2) && !c.CurrentState.Equals(6) && c.IsContinueUse != true).Count();
//超期未还
cqwhCount = Convert.ToInt32(_unitOfWork.BorrowViewRepository.Count(x =>
......@@ -1329,7 +1329,7 @@ namespace JunmpPoliceStation.Controllers
}).ToList();
var data = groupData.GroupBy(t => new { t.id, t.PoliceCode, t.Name }).Where(c=>!string.IsNullOrEmpty(c.Key.id)).Select(c => new
var data = groupData.GroupBy(t => new { t.id, t.PoliceCode, t.Name }).Where(c => !string.IsNullOrEmpty(c.Key.id)).Select(c => new
{
c.Key.id,
c.Key.PoliceCode,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论