add 任务管理
This commit is contained in:
@@ -23,18 +23,21 @@ namespace Ewide.Application.Service
|
||||
|
||||
private readonly IRepository<BsHouseMemberRelation> _bsHouseMemberRelationRep;
|
||||
private readonly IRepository<BsHouseCode> _bsHouseCodeRep;
|
||||
private readonly IRepository<BsHouseTask> _bsHouseTaskRep;
|
||||
private readonly IHouseZoneService _houseZoneService;
|
||||
|
||||
public HouseSelectorService(
|
||||
IDapperRepository dapperRep,
|
||||
IRepository<BsHouseMemberRelation> bsHouseMemberRelationRep,
|
||||
IRepository<BsHouseCode> bsHouseCodeRep,
|
||||
IRepository<BsHouseTask> bsHouseTaskRep,
|
||||
IHouseZoneService houseZoneService
|
||||
)
|
||||
{
|
||||
_dapperRep = dapperRep;
|
||||
_bsHouseMemberRelationRep = bsHouseMemberRelationRep;
|
||||
_bsHouseCodeRep = bsHouseCodeRep;
|
||||
_bsHouseTaskRep = bsHouseTaskRep;
|
||||
_houseZoneService = houseZoneService;
|
||||
}
|
||||
|
||||
@@ -145,6 +148,25 @@ WHERE 1=1
|
||||
SysUserId = input.UserId,
|
||||
HouseCodeId = p
|
||||
}.Insert();
|
||||
|
||||
var initTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t => t.TaskType == 0);
|
||||
if (initTask == null)
|
||||
{
|
||||
new BsHouseTask
|
||||
{
|
||||
Id = System.Guid.NewGuid().ToString(),
|
||||
HouseCodeId = p,
|
||||
UserID = input.UserId,
|
||||
EndTime = System.DateTime.Now.AddMonths(1),
|
||||
Status = 0,
|
||||
TaskType = 0
|
||||
}.Insert();
|
||||
}
|
||||
else
|
||||
{
|
||||
initTask.UserID = input.UserId;
|
||||
initTask.Update();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user