diff --git a/Api/Ewide.Application/Entity/BsHouseLog.cs b/Api/Ewide.Application/Entity/BsHouseLog.cs
new file mode 100644
index 0000000..594af95
--- /dev/null
+++ b/Api/Ewide.Application/Entity/BsHouseLog.cs
@@ -0,0 +1,29 @@
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Ewide.Application
+{
+ [Table("bs_house_log")]
+ [Comment("房屋流转日志")]
+ public class BsHouseLog : Core.DEntityBase
+ {
+ [Comment("房屋编码Id")]
+ [MaxLength(36)]
+ public string HouseCodeId { get; set; }
+
+ [Comment("目标处理人Id,可多个")]
+ public string TargetUserIds { get; set; }
+
+ [Comment("步骤类型")]
+ public HouseLogType Type { get; set; }
+
+ [Comment("状态")]
+ public HouseLogStatus Status { get; set; }
+ }
+}
diff --git a/Api/Ewide.Application/Entity/BsHouseTask.cs b/Api/Ewide.Application/Entity/BsHouseTask.cs
index ba20803..e0ecb1e 100644
--- a/Api/Ewide.Application/Entity/BsHouseTask.cs
+++ b/Api/Ewide.Application/Entity/BsHouseTask.cs
@@ -257,5 +257,10 @@ namespace Ewide.Application
[Comment("最后提交时间")]
public DateTime? LastSubmitTime { get; set; }
+ ///
+ /// 是否有效
+ ///
+ [Comment("是否有效")]
+ public bool IsEnabled { get; set; }
}
}
diff --git a/Api/Ewide.Application/Enum/HouseLog.cs b/Api/Ewide.Application/Enum/HouseLog.cs
new file mode 100644
index 0000000..29d707f
--- /dev/null
+++ b/Api/Ewide.Application/Enum/HouseLog.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Ewide.Application
+{
+ public enum HouseLogType
+ {
+ [Description("创建房屋编码")]
+ CreateCode = 1,
+
+ [Description("人员选房")]
+ SelectMember = 2,
+
+ [Description("房屋建档")]
+ CreateInfo = 3,
+
+ [Description("审核")]
+ Check = 4,
+
+ [Description("审核通过")]
+ Agree = 5,
+
+ [Description("审核退回")]
+ Disagree = 6
+
+ }
+
+ public enum HouseLogStatus
+ {
+ [Description("待处理")]
+ Handle = 0,
+
+ [Description("正在处理")]
+ Handling = 1,
+
+ [Description("已处理")]
+ Handled = 2,
+ }
+}
diff --git a/Api/Ewide.Application/Ewide.Application.xml b/Api/Ewide.Application/Ewide.Application.xml
index 1faa368..53d4ca2 100644
--- a/Api/Ewide.Application/Ewide.Application.xml
+++ b/Api/Ewide.Application/Ewide.Application.xml
@@ -489,6 +489,11 @@
最后提交时间
+
+
+ 是否有效
+
+
任务Id
@@ -616,6 +621,11 @@
住宅查询
+
+
+ 房屋流转日志
+
+
分页查询用户
@@ -726,11 +736,11 @@
-
+
通过ID获取项目
-
+
@@ -1446,6 +1456,21 @@
上报备注
+
+
+ 提交时间
+
+
+
+
+ 最后提交时间
+
+
+
+
+ 是否有效
+
+
所属街道
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs b/Api/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs
index de2cda4..bb691f8 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseCode/Dto/HouseCodeOutput.cs
@@ -19,7 +19,7 @@ namespace Ewide.Application
public string CommName { get; set; }
public string ZoneName { get; set; }
public string ProjectNote { get; set; }
- public string ProjectFullName { get; set; }
+ public string FullProjName { get; set; }
public string HouseCode { get; set; }
public int No { get; set; }
public string Lng { get; set; }
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs
index ff662e9..fa32082 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseCode/HouseCodeService.cs
@@ -13,6 +13,7 @@ using Dapper;
using Ewide.Core.Extension;
using System.ComponentModel.DataAnnotations;
using System.Linq;
+using System.Collections.Generic;
namespace Ewide.Application.Service.HouseCode
{
@@ -25,13 +26,20 @@ namespace Ewide.Application.Service.HouseCode
private readonly IRepository _houseCodeRep;
private readonly IDapperRepository _dapperRepository;
- public HouseCodeService(IRepository HouseCodeRep, IDapperRepository dapperRepository)
+ private readonly IUserManager _userManager;
+ private readonly IHouseLogService _houseLogService;
+
+ public HouseCodeService(IRepository HouseCodeRep, IDapperRepository dapperRepository, IUserManager userManager, IHouseLogService houseLogService)
{
_houseCodeRep = HouseCodeRep;
_dapperRepository = dapperRepository;
+
+ _userManager = userManager;
+ _houseLogService = houseLogService;
}
[HttpPost("/houseCode/add")]
+ [UnitOfWork]
public async Task AddHouseCode(AddHouseCodeInput input)
{
var houseProjectInfoRep = Db.GetRepository();
@@ -42,10 +50,16 @@ namespace Ewide.Application.Service.HouseCode
var areaCode = await areaCodeRep.DetachedEntities.FirstOrDefaultAsync(a => a.Code == input.AreaCode && a.LevelType == 4);
if(areaCode == null) throw Oops.Oh("区域编码有误,添加失败");
input.HouseCode = areaCode.AdCode + houseProject.Sort.ToString().PadLeft(3, '0') + input.No.ToString().PadLeft(3, '0');
+ var id = System.Guid.NewGuid().ToString().ToLower();
var houseCode = input.Adapt();
+ houseCode.Id = id;
var isExist = await _houseCodeRep.AnyAsync(p => p.HouseCode == houseCode.HouseCode);
if (isExist) throw Oops.Oh("房屋编码已存在,不可重复添加");
- await _houseCodeRep.InsertAsync(houseCode);
+ await houseCode.InsertAsync();
+
+ // 添加到流转日志
+ await _houseLogService.AddThenDone(id, _userManager.User, HouseLogType.CreateCode);
+ await _houseLogService.Add(id, _userManager.User, HouseLogType.SelectMember);
}
[HttpPost("/houseCode/edit")]
@@ -65,7 +79,9 @@ namespace Ewide.Application.Service.HouseCode
[HttpPost("/houseCode/page")]
public async Task QueryPage([FromBody] QueryHouseCodeInput input)
{
- var sql = @"SELECT HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.Name,'(',Proj.Note,')') FullProjName FROM bs_house_code HC
+ var sql = @"SELECT
+HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName
+FROM bs_house_code HC
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs
index a162309..ee92918 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseInfo/HouseInfoService.cs
@@ -28,17 +28,28 @@ namespace Ewide.Application.Service.HouseSafety.HouseInfo
private readonly IRepository _houseCodeRep;
private readonly IRepository _houseInfoRep;
private readonly IRepository _houseTaskRep;
+ private readonly IRepository _sysUserRep;
private readonly IUserManager _userManager;
private readonly IDapperRepository _dapperRepository;
+ private readonly IHouseLogService _houseLogService;
- public HouseInfoService(IRepository HouseCodeRep,IRepository HouseInfoRep, IRepository HouseTaskRep, IUserManager userManager, IDapperRepository dapperRepository)
+
+ public HouseInfoService(
+ IRepository HouseCodeRep,
+ IRepository HouseInfoRep,
+ IRepository HouseTaskRep,
+ IRepository sysUserRep,
+ IUserManager userManager, IDapperRepository dapperRepository, IHouseLogService houseLogService)
{
_houseCodeRep = HouseCodeRep;
_houseInfoRep = HouseInfoRep;
_houseTaskRep = HouseTaskRep;
+ _sysUserRep = sysUserRep;
_userManager = userManager;
_dapperRepository = dapperRepository;
+
+ _houseLogService = houseLogService;
}
[HttpPost("/houseInfo/save")]
@@ -46,11 +57,7 @@ namespace Ewide.Application.Service.HouseSafety.HouseInfo
[AllowAnonymous]
public async Task Save([FromBody] HouseInfoInputSave input)
{
- //根据任务审核记录判断是否是审核操作,从而确定 DataStatus
- //审核操作,则为 input.TaskCheckRecord.PassOrBackDataStatus
- //非审核操作,则为 DataStatus.Saved
- var isCheckAction = input.TaskCheckRecord != null;
- await InputDataProcess(input, isCheckAction ? input.TaskCheckRecord.PassOrBackDataStatus : DataStatus.Saved);
+ await InputDataProcess(input, DataStatus.Saved);
}
[HttpPost("/houseInfo/submitToCheck")]
@@ -61,8 +68,15 @@ namespace Ewide.Application.Service.HouseSafety.HouseInfo
await InputDataProcess(input,DataStatus.Submited);
}
+ [HttpPost("/houseInfo/check")]
+ [UnitOfWork]
+ public async Task Check([FromBody] HouseInfoInputSave input)
+ {
+ await InputDataProcess(input, input.TaskCheckRecord.PassOrBackDataStatus );
+ }
+
[HttpGet("/houseInfo/getByTaskId")]
- [AllowAnonymous]
+ [UnitOfWork]
public async Task GetByTaskId([Required] string taskId)
{
//获取任务实体
@@ -71,7 +85,9 @@ namespace Ewide.Application.Service.HouseSafety.HouseInfo
//获取房屋编码信息
var houseCodeOutputAsync = await _dapperRepository.QueryAsync(
- @"SELECT HC.Id,HC.Address,HC.ProjectId,HC.ZoneId,HC.Type,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,O.Name ZoneName,Proj.Note ProjectNote,CONCAT(Proj.Name,'(',Proj.Note,')') ProjectFullName,HC.HouseCode,HC.Lng,HC.Lat,HC.No FROM bs_house_code HC
+ @"SELECT
+HC.Id,HC.Address,HC.ProjectId,HC.ZoneId,HC.Type,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,O.Name ZoneName,Proj.Note ProjectNote,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName,HC.HouseCode,HC.Lng,HC.Lat,HC.No
+FROM bs_house_code HC
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_org O ON HC.ZoneId = O.Id
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
@@ -97,6 +113,12 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
taskOutput.PatrolUser = String.IsNullOrEmpty(houseTask.PatrolUser) ? currentUser.Name : houseTask.PatrolUser;
houseInfoOutputForDetailPage.PatrolInfo = taskOutput;
+ if (houseInfo == null || houseInfo.State <= (int)DataStatus.Submited)
+ {
+ // 未建档或者当前数据未提交时打开,标记为已读
+ await _houseLogService.Read(houseCodeOutput.Id);
+ }
+
if (houseInfo == null)
{
houseInfoOutputForDetailPage.HouseInfo = new HouseInfoOutput();
@@ -120,9 +142,9 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
var houseEntity = await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(h => h.HouseCodeId == input.houseCode.Id);
//建档审核通过的房屋数据修改时,对应的建档任务Task不处理
+ var houseTask = input.PatrolInfo.Adapt();
if (houseEntity == null || houseEntity.State != 6)
{
- var houseTask = input.PatrolInfo.Adapt();
houseTask.HouseCodeId = input.houseCode.Id;
//任务没有暂存状态,其他状态与HouseInfo的State一致
houseTask.Status = dataStatus == DataStatus.TempSaved ? (int)DataStatus.Saved : (int)dataStatus;
@@ -146,12 +168,36 @@ WHERE HC.Id=@HouseCodeId", new { houseTask.HouseCodeId }
await houseInfo.UpdateExcludeAsync(new[] { nameof(BsHouseInfo.HouseGrade) }, true);
}
-
+ if(dataStatus == DataStatus.Submited)
+ {
+ await _houseLogService.Done(input.houseCode.Id);
+
+ var org = await _userManager.GetUserOrgInfo();
+
+ var _sysEmpRep = Db.GetRepository();
+ var _sysUserRoleRep = Db.GetRepository();
+ var _sysRoleRep = Db.GetRepository();
+ var zoneManagerList = await (from u in _sysUserRep.DetachedEntities
+ join e in _sysEmpRep.DetachedEntities on u.Id equals e.Id
+ join ur in _sysUserRoleRep.DetachedEntities on u.Id equals ur.SysUserId
+ join r in _sysRoleRep.DetachedEntities on ur.SysRoleId equals r.Id
+ where e.OrgId == org.Id && r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()
+ select u).ToListAsync();
+
+ await _houseLogService.Add(input.houseCode.Id, zoneManagerList, HouseLogType.Check);
+ }
//审核操作则新增一条审核记录
if (dataStatus == DataStatus.Back || dataStatus == DataStatus.Passed)
{
var checkRecord = input.TaskCheckRecord.Adapt();
await checkRecord.InsertAsync();
+ await _houseLogService.Done(input.houseCode.Id);
+ await _houseLogService.AddThenDone(input.houseCode.Id, _userManager.User, dataStatus == DataStatus.Passed ? HouseLogType.Agree : HouseLogType.Disagree);
+ if (dataStatus == DataStatus.Back)
+ {
+ var user = await _sysUserRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(houseTask.UserID));
+ await _houseLogService.Add(input.houseCode.Id, user, HouseLogType.CreateInfo);
+ }
}
}
}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs b/Api/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs
new file mode 100644
index 0000000..356d221
--- /dev/null
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogInput.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Ewide.Application
+{
+ public class HouseLogInput
+ {
+ [Required(ErrorMessage = "Id不能为空")]
+ public string Id { get; set; }
+ }
+}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs b/Api/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs
new file mode 100644
index 0000000..f5aab48
--- /dev/null
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseLog/Dto/HouseLogOutput.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Ewide.Application
+{
+ public class HouseLogOutput
+ {
+ public string TargetUserNames { get; set; }
+ public int Type { get; set; }
+ public int Status { get; set; }
+ public DateTime CreatedTime { get; set; }
+ public DateTime? UpdatedTimeg { get; set; }
+ public string CreatedUserName { get; set; }
+ public string UpdatedUserName { get; set; }
+ }
+}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs
new file mode 100644
index 0000000..a64796e
--- /dev/null
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseLog/HouseLogService.cs
@@ -0,0 +1,165 @@
+using Dapper;
+using Ewide.Core;
+using Furion.DatabaseAccessor;
+using Furion.DatabaseAccessor.Extensions;
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Ewide.Application.Service
+{
+ ///
+ /// 房屋流转日志
+ ///
+ [ApiDescriptionSettings(Name = "HouseLog", Order = 210)]
+ public class HouseLogService : IHouseLogService, IDynamicApiController, ITransient
+ {
+ private readonly IDapperRepository _dapperRep;
+
+ private readonly IRepository _bsHouseLogRep;
+
+ public HouseLogService(IDapperRepository dapperRep, IRepository bsHouseLogRep)
+ {
+ _dapperRep = dapperRep;
+ _bsHouseLogRep = bsHouseLogRep;
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task Add(string houseCodeId, SysUser targetUser, HouseLogType type)
+ {
+ await Add(houseCodeId, new List { targetUser }, type);
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task Add(string houseCodeId, List targetUsers, HouseLogType type)
+ {
+ await new BsHouseLog
+ {
+ Id = Guid.NewGuid().ToString(),
+ HouseCodeId = houseCodeId,
+ TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)),
+ Type = type,
+ Status = HouseLogStatus.Handle
+ }.InsertAsync();
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task Read(string houseCodeId)
+ {
+ var log = await _bsHouseLogRep
+ .Where(p => p.HouseCodeId.Equals(houseCodeId) && p.Status.Equals(HouseLogStatus.Handle))
+ .OrderByDescending(p => p.CreatedTime)
+ .FirstOrDefaultAsync();
+ if (log != null)
+ {
+ log.Status = HouseLogStatus.Handling;
+ await log.UpdateAsync();
+ }
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task Done(string houseCodeId)
+ {
+ var log = await _bsHouseLogRep
+ .Where(p => p.HouseCodeId.Equals(houseCodeId) && !p.Status.Equals(HouseLogStatus.Handled))
+ .OrderByDescending(p => p.CreatedTime)
+ .FirstOrDefaultAsync();
+ if (log != null)
+ {
+ log.Status = HouseLogStatus.Handled;
+ await log.UpdateAsync();
+ }
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type)
+ {
+ await AddThenRead(houseCodeId, new List { targetUser }, type);
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task AddThenRead(string houseCodeId, List targetUsers, HouseLogType type)
+ {
+ await new BsHouseLog
+ {
+ Id = Guid.NewGuid().ToString(),
+ HouseCodeId = houseCodeId,
+ TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)),
+ Type = type,
+ Status = HouseLogStatus.Handling
+ }.InsertAsync();
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type)
+ {
+ await AddThenDone(houseCodeId, new List { targetUser }, type);
+ }
+
+ [NonAction]
+ [UnitOfWork]
+ public async Task AddThenDone(string houseCodeId, List targetUsers, HouseLogType type)
+ {
+ await new BsHouseLog
+ {
+ Id = Guid.NewGuid().ToString(),
+ HouseCodeId = houseCodeId,
+ TargetUserIds = String.Join(",", targetUsers.Select(p => p.Id)),
+ Type = type,
+ Status = HouseLogStatus.Handled
+ }.InsertAsync();
+ }
+
+ [HttpGet("/houseLog/list")]
+ public async Task List([FromQuery] HouseLogInput input)
+ {
+ var sql = @"SELECT *,
+(SELECT GROUP_CONCAT(`Name`) FROM sys_user
+ WHERE Id IN (
+ SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(_HL.TargetUserIds,',',HT.help_topic_id + 1),',',-1)
+ FROM bs_house_log _HL
+ JOIN mysql.help_topic HT ON HT.help_topic_id < (LENGTH(_HL.TargetUserIds) - LENGTH(REPLACE(_HL.TargetUserIds,',','')) + 1)
+ WHERE _HL.Id = HL.Id
+ )
+) TargetUserNames
+FROM bs_house_log HL
+WHERE HouseCodeId = @HouseCodeId
+ORDER BY HL.CreatedTime DESC, Type DESC";
+
+ return await _dapperRep.QueryAsync(sql, new { houseCodeId = input.Id });
+ }
+
+ [HttpGet("/houseLog/listByInfoId")]
+ public async Task ListByInfoId([FromQuery] HouseLogInput input)
+ {
+ var info = await Db.GetRepository().DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.Id));
+ return await List(new HouseLogInput
+ {
+ Id = info.HouseCodeId
+ });
+ }
+
+ [HttpGet("/houseLog/listByTaskId")]
+ public async Task ListByTaskId([FromQuery] HouseLogInput input)
+ {
+ var task = await Db.GetRepository().DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.Id));
+ return await List(new HouseLogInput
+ {
+ Id = task.HouseCodeId
+ });
+ }
+ }
+}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs
new file mode 100644
index 0000000..f85e66f
--- /dev/null
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseLog/IHouseLogService.cs
@@ -0,0 +1,24 @@
+using Ewide.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Ewide.Application.Service
+{
+ public interface IHouseLogService
+ {
+ Task Add(string houseCodeId, SysUser targetUser, HouseLogType type);
+ Task Add(string houseCodeId, List targetUsers, HouseLogType type);
+ Task Read(string houseCodeId);
+ Task Done(string houseCodeId);
+ Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type);
+ Task AddThenRead(string houseCodeId, List targetUsers, HouseLogType type);
+ Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type);
+ Task AddThenDone(string houseCodeId, List targetUsers, HouseLogType type);
+ Task List(HouseLogInput input);
+ Task ListByInfoId(HouseLogInput input);
+ Task ListByTaskId(HouseLogInput input);
+ }
+}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs
index 5f68f22..a77a0b5 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseMember/HouseMemberService.cs
@@ -322,14 +322,5 @@ WHERE SU.Id=@Id";
return roles;
}
-
- [HttpGet("/houseMember/test")]
- [Microsoft.AspNetCore.Authorization.AllowAnonymous]
- public async Task Test([FromQuery] string str)
- {
- var result1 = str.ToCamelCase();
- var result2 = str.ToUnderScoreCase();
- return result1 + "," + result2;
- }
}
}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs
index 60048d3..d0f8112 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/HouseProjectInfoService.cs
@@ -69,12 +69,12 @@ namespace Ewide.Application.Service.HouseProjectInfo
///
/// 通过ID获取项目
///
- ///
+ ///
///
- [HttpGet("/houseProjectInfo/detailById")]
- public async Task GetProjectById([Required] string id)
+ [HttpGet("/houseProjectInfo/getById")]
+ public async Task GetById([Required] string projectId)
{
- return await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == id);
+ return await _houseProjectInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == projectId);
}
///
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs
index 2d6824d..e8b05c6 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseProjectInfo/IHouseProjectInfoService.cs
@@ -14,7 +14,7 @@ namespace Ewide.Application.Service.HouseProjectInfo
Task AddProject(AddProjectInput input);
Task DeleteProject(DeleteProjectInput input);
Task UpdateProject(UpdateProjectInput input);
- Task GetProjectById([FromRoute] string id);
+ Task GetById([FromRoute] string projectId);
Task GetProject([FromQuery] QueryProjectInput input);
Task QueryProjectPageList([FromQuery] PageProjectInput input);
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs
index 46d1295..1da270b 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseSelector/HouseSelectorService.cs
@@ -1,10 +1,12 @@
using Dapper;
+using Ewide.Core;
using Ewide.Core.Extension;
using Furion.DatabaseAccessor;
using Furion.DatabaseAccessor.Extensions;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Furion.FriendlyException;
+using Mapster;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
@@ -19,26 +21,38 @@ namespace Ewide.Application.Service
[ApiDescriptionSettings(Name = "HouseSelector", Order = 180)]
public class HouseSelectorService : IHouseSelectorService, IDynamicApiController, ITransient
{
+ private readonly IUserManager _userManager;
private readonly IDapperRepository _dapperRep;
private readonly IRepository _bsHouseMemberRelationRep;
private readonly IRepository _bsHouseCodeRep;
private readonly IRepository _bsHouseTaskRep;
+ private readonly IRepository _sysUserRep;
private readonly IHouseZoneService _houseZoneService;
+ private readonly IHouseLogService _houseLogService;
+
public HouseSelectorService(
+ IUserManager userManager,
IDapperRepository dapperRep,
IRepository bsHouseMemberRelationRep,
IRepository bsHouseCodeRep,
IRepository bsHouseTaskRep,
- IHouseZoneService houseZoneService
+ IRepository sysUserRep,
+ IHouseZoneService houseZoneService,
+ IHouseLogService houseLogService
)
{
+ _userManager = userManager;
+
_dapperRep = dapperRep;
_bsHouseMemberRelationRep = bsHouseMemberRelationRep;
_bsHouseCodeRep = bsHouseCodeRep;
_bsHouseTaskRep = bsHouseTaskRep;
+ _sysUserRep = sysUserRep;
_houseZoneService = houseZoneService;
+
+ _houseLogService = houseLogService;
}
///
@@ -50,7 +64,7 @@ namespace Ewide.Application.Service
public async Task HouseSelectorList([FromBody] QueryHouseSelectorInput input)
{
var sql = @"SELECT
- HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`,'(',Proj.Note,')') FullProjName
+ HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName
FROM bs_house_code HC
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
@@ -77,7 +91,7 @@ WHERE HM.Id IS NULL";
public async Task HouseSelectedList([FromBody] QueryHouseSelectorInput input)
{
var sql = @"SELECT
- HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`,'(',Proj.Note,')') FullProjName
+ HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName
FROM bs_house_code HC
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
@@ -128,8 +142,10 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
if (ids.Count == 0) throw Oops.Oh("当前房屋在此之前已经全部被选中,请确认");
+ var selectedUser = await _sysUserRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id.Equals(input.UserId));
+
// 从用户所在片区中过滤房屋
- var zoneId = await _houseZoneService.GetZoneByUser(input.UserId);
+ var zoneId = await _houseZoneService.GetZoneByUser(selectedUser.Id);
var house = await _bsHouseCodeRep.DetachedEntities.Where(p => ids.Contains(p.Id) && p.ZoneId == zoneId).Select(p => p.Id).ToListAsync();
if (house.Count == 0) throw Oops.Oh("选中的房屋错误");
@@ -137,32 +153,52 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
#endregion
// 选定房屋
- house.ForEach(p =>
+ house.ForEach(async p =>
{
- new BsHouseMemberRelation
- {
- SysUserId = input.UserId,
- HouseCodeId = p
- }.Insert();
-
- var initTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t =>t.HouseCodeId == p && t.TaskType == 0);
- if (initTask == null)
+ var originalTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t =>t.HouseCodeId == p && t.TaskType == 0);
+ if (originalTask == null)
{
new BsHouseTask
{
Id = System.Guid.NewGuid().ToString(),
HouseCodeId = p,
- UserID = input.UserId,
+ UserID = selectedUser.Id,
EndTime = System.DateTime.Now.AddMonths(1),
Status = 0,
TaskType = 0
}.Insert();
+
+ await _houseLogService.Done(p);
+ await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo);
}
else
{
- initTask.UserID = input.UserId;
- initTask.Update();
+ await _houseLogService.AddThenDone(p, _userManager.User, HouseLogType.SelectMember);
+ if (originalTask.Status != 6)//建档未完成,生成新建档任务分配给新的人员;原建档任务数据保留,有效性设置为false,取消巡查关系
+ {
+ var newTask = originalTask.Adapt();
+ newTask.Id = System.Guid.NewGuid().ToString();
+ newTask.UserID = input.UserId;
+ newTask.EndTime = System.DateTime.Now.AddMonths(1);
+ newTask.Insert();
+
+ originalTask.IsEnabled = false;
+ originalTask.Update();
+
+ await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo);
+ }//已建档完成,不再分配建档任务,仅更换巡查关系
+ else
+ {
+ var originalRelation = _bsHouseMemberRelationRep.DetachedEntities.FirstOrDefault(r => r.HouseCodeId == p && r.SysUserId == originalTask.UserID);
+ originalRelation.Delete();
+ }
}
+
+ new BsHouseMemberRelation
+ {
+ SysUserId = selectedUser.Id,
+ HouseCodeId = p
+ }.Insert();
});
}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs b/Api/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs
index d824a23..b5f1df0 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseTask/Dto/HouseTaskOutput.cs
@@ -154,5 +154,20 @@ namespace Ewide.Application
public string ReportRemark { get; set; }
public int Status { get; set; }
+
+ ///
+ /// 提交时间
+ ///
+ public DateTime? SubmitTime { get; set; }
+
+ ///
+ /// 最后提交时间
+ ///
+ public DateTime? LastSubmitTime { get; set; }
+
+ ///
+ /// 是否有效
+ ///
+ public bool IsEnabled { get; set; }
}
}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs
index a99b541..6337437 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseTask/HouseTaskService.cs
@@ -29,40 +29,44 @@ namespace Ewide.Application.Service
private readonly IDapperRepository _dapperRepository;
private readonly IUserManager _userManager;
- public HouseTaskService(IRepository HouseTaskRep, IRepository HouseInfoRep, IDapperRepository dapperRepository, IUserManager userManager)
+ private readonly IHouseLogService _houseLogService;
+
+ public HouseTaskService(IRepository HouseTaskRep, IRepository HouseInfoRep, IDapperRepository dapperRepository, IUserManager userManager, IHouseLogService houseLogService)
{
_houseTaskRep = HouseTaskRep;
_houseInfoRep = HouseInfoRep;
_dapperRepository = dapperRepository;
_userManager = userManager;
+
+ _houseLogService = houseLogService;
}
[HttpPost("/houseTask/page")]
public async Task QueryPage([FromBody] QueryHouseTaskInput input)
{
- var sql = @"SELECT T.Id,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,Proj.Name,CONCAT(Proj.Name,'(',Proj.Note,')') FullProjName,HC.HouseCode,HC.Address,T.EndTime,HC.Type,HC.Industry,HC.No,T.Status,IFNULL(HI.State,0) State FROM `bs_house_task` T
+ var sql = @"SELECT T.Id,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,Proj.Name,CONCAT(Proj.`Name`, IFNULL(CONCAT('(',Proj.Note,')'), '')) FullProjName,HC.HouseCode,HC.Address,T.EndTime,HC.Type,HC.Industry,HC.No,T.Status,IFNULL(HI.State,0) State FROM `bs_house_task` T
LEFT JOIN bs_house_code HC ON T.HouseCodeId = HC.Id
LEFT JOIN bs_house_info HI ON HI.HouseCodeId = T.HouseCodeId
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6)
-WHERE {0}";
+WHERE T.IsEnabled = 1 {0}";
var user = await _userManager.CheckUserAsync();
if (user == null) throw Oops.Oh("登录信息丢失");
var userRoles = await _userManager.GetUserRoleList();
var userOrg = await _userManager.GetUserOrgInfo();
var param = new DynamicParameters();
- if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Count() > 0)
+ if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.HouseSecurityManager).ToUnderScoreCase()).Any())
{
- sql = String.Format(sql, " T.UserID=@UserID ");
+ sql = String.Format(sql, " AND T.UserID=@UserID ");
param.Add("UserID", user.Id);
}
- if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()).Count() > 0)
+ if (userRoles.Where(r => r.Code == Enum.GetName(HouseManagerRole.ZoneManager).ToUnderScoreCase()).Any())
{
- sql = String.Format(sql, " (T.Status=3 OR T.Status=6) AND HC.ZoneId = @ZoneId ");
+ sql = String.Format(sql, " AND (T.Status=3 OR T.Status=6) AND HC.ZoneId = @ZoneId ");
param.Add("ZoneId", userOrg.Id);
}
@@ -90,6 +94,9 @@ WHERE {0}";
houseInfo.State = 5;
await houseInfo.UpdateExcludeAsync(new[] { nameof(BsHouseInfo.HouseGrade) }, true);
}
+
+ // 提交时流转日志
+ await _houseLogService.Done(houseTask.HouseCodeId);
}
}
}
diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs
index e5aac58..791374b 100644
--- a/Api/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs
+++ b/Api/Ewide.Application/Service/HouseSafety/HouseZone/HouseZoneService.cs
@@ -64,6 +64,12 @@ namespace Ewide.Application.Service
.ToListAsync();
}
+ [HttpGet("/houseZone/getById")]
+ public async Task GetById([Required] string zoneId)
+ {
+ return await _sysOrgRep.DetachedEntities.FirstOrDefaultAsync(p => p.Id == zoneId);
+ }
+
///
/// 分页查询片区
///
diff --git a/Api/Ewide.Core/Extension/DataFilter/Entity/FilterInfo.cs b/Api/Ewide.Core/Extension/DataFilter/Entity/FilterInfo.cs
index a7087be..42b1d2d 100644
--- a/Api/Ewide.Core/Extension/DataFilter/Entity/FilterInfo.cs
+++ b/Api/Ewide.Core/Extension/DataFilter/Entity/FilterInfo.cs
@@ -34,6 +34,7 @@ namespace Ewide.Core.Extension.DataFilter.Entity
///
public void SetSearchInfo(SearchInfo[] searchInfo, IEnumerable filterFields)
{
+ if (searchInfo == null) return;
try
{
foreach (var elem in searchInfo)
diff --git a/Api/Ewide.Core/Service/Notice/SysNoticeService.cs b/Api/Ewide.Core/Service/Notice/SysNoticeService.cs
index dba5165..b182d18 100644
--- a/Api/Ewide.Core/Service/Notice/SysNoticeService.cs
+++ b/Api/Ewide.Core/Service/Notice/SysNoticeService.cs
@@ -232,7 +232,7 @@ WHERE SNU.UserId = @UserId AND SN.Status = @Status";
},
new[]
{
- "Type","Title"
+ "Type","Title","ReadStatus"
}
);
@@ -254,8 +254,10 @@ WHERE SNU.UserId = @UserId AND SN.Status = @Status";
[HttpGet("/sysNotice/unread")]
public async Task GetUnreadCount()
{
- var noticeList = await _sysNoticeRep.Where(u => u.Status != (int)NoticeStatus.DELETED).Select(s => s.Id).ToListAsync();
- return await _sysNoticeUserRep.Where(u => u.UserId == _userManager.UserId && noticeList.Contains(u.NoticeId) && u.ReadStatus == (int)NoticeUserStatus.UNREAD).CountAsync();
+ //删除 或者 草稿都不让显示
+ var noticeList = await _sysNoticeRep.Where(u => u.Status != (int)NoticeStatus.DELETED&& u.Status != (int)NoticeStatus.DRAFT).Select(s => s.Id).ToListAsync();
+ var noticeUserList = await _sysNoticeUserRep.Where(u => u.UserId == _userManager.UserId && noticeList.Contains(u.NoticeId) && u.ReadStatus == (int)NoticeUserStatus.UNREAD).ToListAsync();
+ return noticeUserList.Count();
}
///
diff --git a/web-react/src/assets/style/dark/main.less b/web-react/src/assets/style/dark/main.less
index d264d6b..6e9fb0b 100644
--- a/web-react/src/assets/style/dark/main.less
+++ b/web-react/src/assets/style/dark/main.less
@@ -547,10 +547,13 @@
line-height: @layout-header-height - 16px;
height: @layout-header-height - 20px;
+
+ color: fade(@black, 35%);
.anticon {
color: fade(@black, 35%);
}
&:hover {
+ color: @icon-color-hover;
background-color: fade(@black, 5%);
.anticon {
color: @icon-color-hover;
@@ -596,10 +599,12 @@
}
.header-actions {
.header-action {
+ color: fade(@white, 60%);
.anticon {
color: fade(@white, 60%);
}
&:hover {
+ color: @white;
background-color: fade(@white, 20%);
.anticon {
color: @white;
diff --git a/web-react/src/assets/style/default/main.less b/web-react/src/assets/style/default/main.less
index 112f21b..f4b6848 100644
--- a/web-react/src/assets/style/default/main.less
+++ b/web-react/src/assets/style/default/main.less
@@ -541,10 +541,13 @@
line-height: @layout-header-height - 16px;
height: @layout-header-height - 20px;
+
+ color: fade(@black, 35%);
.anticon {
color: fade(@black, 35%);
}
&:hover {
+ color: @icon-color-hover;
background-color: fade(@black, 5%);
.anticon {
color: @icon-color-hover;
@@ -590,10 +593,12 @@
}
.header-actions {
.header-action {
+ color: fade(@white, 60%);
.anticon {
color: fade(@white, 60%);
}
&:hover {
+ color: @white;
background-color: fade(@white, 20%);
.anticon {
color: @white;
diff --git a/web-react/src/common/api/requests/business/houseSafety/houseInfo.js b/web-react/src/common/api/requests/business/houseSafety/houseInfo.js
index 0177ae8..8e51acd 100644
--- a/web-react/src/common/api/requests/business/houseSafety/houseInfo.js
+++ b/web-react/src/common/api/requests/business/houseSafety/houseInfo.js
@@ -1,6 +1,7 @@
const urls = {
houseInfoGetByTaskId: ['/houseInfo/getByTaskId', 'get'],
houseInfoSave: ['houseInfo/save', 'post'],
+ houseInfoCheck: ['houseInfo/check', 'post'],
houseInfoSubmitToCheck: ['/houseInfo/submitToCheck', 'post']
}
diff --git a/web-react/src/common/api/requests/business/houseSafety/houseProjectInfo.js b/web-react/src/common/api/requests/business/houseSafety/houseProjectInfo.js
index 6b3175f..2ab0b53 100644
--- a/web-react/src/common/api/requests/business/houseSafety/houseProjectInfo.js
+++ b/web-react/src/common/api/requests/business/houseSafety/houseProjectInfo.js
@@ -5,7 +5,8 @@ const urls = {
houseProejctDelete: ['/houseProjectInfo/delete', 'post'],
houseProejctDetail: ['/houseProjectInfo/detail', 'get'],
houseProjectNextSort: ['/houseProjectInfo/nextSort', 'get'],
- houseProjectList: ['houseProjectInfo/list', 'get']
+ houseProjectList: ['houseProjectInfo/list', 'get'],
+ houseProjectGetById: ['houseProjectInfo/getById', 'get']
}
export default urls
\ No newline at end of file
diff --git a/web-react/src/common/api/requests/business/houseSafety/houseZone.js b/web-react/src/common/api/requests/business/houseSafety/houseZone.js
index d042f01..29f4a98 100644
--- a/web-react/src/common/api/requests/business/houseSafety/houseZone.js
+++ b/web-react/src/common/api/requests/business/houseSafety/houseZone.js
@@ -8,7 +8,8 @@ const urls = {
houseZoneList: '/houseZone/list',
houseZoneAutoIncrement: '/houseZone/autoIncrement',
houseZoneAdd: ['/houseZone/add', 'post'],
- houseZoneEdit: ['/houseZone/edit', 'post']
+ houseZoneEdit: ['/houseZone/edit', 'post'],
+ houseZoneGetById: ['/houseZone/getById', 'get']
}
export default urls
\ No newline at end of file
diff --git a/web-react/src/components/business/house-log.jsx b/web-react/src/components/business/house-log.jsx
new file mode 100644
index 0000000..2ccf2c9
--- /dev/null
+++ b/web-react/src/components/business/house-log.jsx
@@ -0,0 +1,72 @@
+import React, { Component } from 'react'
+import { Spin, Steps, Timeline } from 'antd'
+import { AntIcon } from 'components'
+import { api } from 'common/api'
+import getDictData from 'util/dic'
+import { toCamelCase } from 'util/format'
+
+export default class houseLog extends Component {
+ state = {
+ loading: true,
+ codes: {
+ houseLogType: [],
+ },
+ data: [],
+ }
+
+ async componentDidMount() {
+ const { id, infoId, taskId } = this.props
+ const state = { loading: false }
+
+ state.codes = await getDictData('house_log_type')
+
+ if (id) {
+ } else if (infoId) {
+ } else if (taskId) {
+ const { data } = await api.houseLogListByTaskId({ id: taskId })
+ state.data = data
+ }
+ this.setState(state)
+ }
+
+ bindCodeValue(code, name) {
+ name = toCamelCase(name)
+ const codes = this.state.codes[name]
+ if (codes) {
+ const c = codes.find(p => p.code == code)
+ if (c) {
+ return c.value
+ }
+ }
+ return null
+ }
+
+ render() {
+ const { loading, codes, data } = this.state
+
+ return (
+ }>
+
+ {data.map((item, i) => (
+ ,
+ ,
+ ][item.status]
+ }
+ >
+
+ {this.bindCodeValue(item.type, 'house_log_type')}
+
+ {item.updatedTime}
+ {item.targetUserNames}
+
+ ))}
+
+
+ )
+ }
+}
diff --git a/web-react/src/components/index.js b/web-react/src/components/index.js
index a729563..43eca8f 100644
--- a/web-react/src/components/index.js
+++ b/web-react/src/components/index.js
@@ -14,3 +14,5 @@ export { default as QueryList } from './query-list'
export { default as QueryTable } from './query-table'
export { default as QueryTableActions } from './query-table-actions'
export { default as QueryTreeLayout } from './query-tree-layout'
+
+export { default as HouseLog } from './business/house-log'
\ No newline at end of file
diff --git a/web-react/src/components/query-table-actions/index.jsx b/web-react/src/components/query-table-actions/index.jsx
index d509d3f..0b59588 100644
--- a/web-react/src/components/query-table-actions/index.jsx
+++ b/web-react/src/components/query-table-actions/index.jsx
@@ -26,7 +26,7 @@ export default class QueryTableActions extends Component {
(series && node.className == className) ||
(!node.nextElementSibling && node.className == className)
) {
- node.remove()
+ node.style.display = 'none'
series = false
} else if (node.className == className) {
series = true
diff --git a/web-react/src/pages/business/house/code/index.jsx b/web-react/src/pages/business/house/code/index.jsx
index 175d5f1..35a069b 100644
--- a/web-react/src/pages/business/house/code/index.jsx
+++ b/web-react/src/pages/business/house/code/index.jsx
@@ -50,11 +50,11 @@ export default class index extends Component {
title: '房屋编码',
dataIndex: 'houseCode',
sorter: true,
- width: 300,
+ width: 400,
render: (text, record) => (
<>
{`${record.areaName}-${record.roadName}-${record.commName}-${
- record.note
+ record.fullProjName
}-${record.no.toString().padStart(3, '0')}`}
{text}
@@ -77,9 +77,9 @@ export default class index extends Component {
},
{
title: '登记时间',
+ width: 180,
dataIndex: 'createdTime',
sorter: true,
- width: 150,
},
]
diff --git a/web-react/src/pages/business/house/info/form/index.jsx b/web-react/src/pages/business/house/info/form/index.jsx
index bfae1a8..5670d97 100644
--- a/web-react/src/pages/business/house/info/form/index.jsx
+++ b/web-react/src/pages/business/house/info/form/index.jsx
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd'
import { merge, isEqual, pickBy } from 'lodash'
-import { AntIcon, ComponentDynamic, Container } from 'components'
+import { AntIcon, ComponentDynamic, Container, Auth } from 'components'
import { api } from 'common/api'
const tabs = [
@@ -58,7 +58,7 @@ const actions = {
after: 'close',
},
check: {
- action: 'houseInfoSave',
+ action: 'houseInfoCheck',
remark: '审核',
after: 'close',
},
@@ -222,41 +222,43 @@ export default class index extends Component {
- {this.state.taskStatus == 3 && (
-
-
-
-
-
-
-
-
- )}
+
+
+
+
+
+
+
+ )}
+
{this.state.taskStatus >= -1 && this.state.taskStatus < 3 && (
@@ -302,7 +304,7 @@ export default class index extends Component {
`${record.houseCode.areaName}-${
record.houseCode.roadName
}-${record.houseCode.commName}-${
- record.houseCode.projectFullName
+ record.houseCode.fullProjName
}-${record.houseCode.no.toString().padStart(3, '0')}`}
diff --git a/web-react/src/pages/business/house/member/selector/selected-list.jsx b/web-react/src/pages/business/house/member/selector/selected-list.jsx
index 038e8da..8c36e4c 100644
--- a/web-react/src/pages/business/house/member/selector/selected-list.jsx
+++ b/web-react/src/pages/business/house/member/selector/selected-list.jsx
@@ -48,9 +48,9 @@ export default class index extends Component {
sorter: true,
width: 300,
render: (text, record) =>
- `${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${record.no
- .toString()
- .padStart(3, '0')}`,
+ `${record.areaName}-${record.roadName}-${record.commName}-${
+ record.fullProjName
+ }-${record.no.toString().padStart(3, '0')}`,
},
{
title: '房屋性质及行业',
diff --git a/web-react/src/pages/business/house/member/selector/selector-list.jsx b/web-react/src/pages/business/house/member/selector/selector-list.jsx
index e4f7bbf..3a9e355 100644
--- a/web-react/src/pages/business/house/member/selector/selector-list.jsx
+++ b/web-react/src/pages/business/house/member/selector/selector-list.jsx
@@ -48,9 +48,9 @@ export default class index extends Component {
sorter: true,
width: 300,
render: (text, record) =>
- `${record.areaName}-${record.roadName}-${record.commName}-${record.note}-${record.no
- .toString()
- .padStart(3, '0')}`,
+ `${record.areaName}-${record.roadName}-${record.commName}-${
+ record.fullProjName
+ }-${record.no.toString().padStart(3, '0')}`,
},
{
title: '房屋性质及行业',
diff --git a/web-react/src/pages/business/house/project/form.jsx b/web-react/src/pages/business/house/project/form.jsx
index 31a7ea1..cee85f4 100644
--- a/web-react/src/pages/business/house/project/form.jsx
+++ b/web-react/src/pages/business/house/project/form.jsx
@@ -41,19 +41,29 @@ export default class form extends Component {
* @param {*} params
*/
async fillData(params) {
- const areaCodeDefault = params.record
- ? params.record.areaCode
- : params.pid
- ? params.pid
- : ''
+ let areaCodeDefault = params.pid ? params.pid : ''
this.houseType = params.record ? params.record.type : 1
- this.record = cloneDeep(params.record)
+ if (params.id) {
+ this.setState({
+ loading: true,
+ })
+
+ api.houseProjectGetById({ projectId: params.id }).then(({ data }) => {
+ areaCodeDefault = data.areaCode
+ this.record = data
+
+ this.setState({
+ loading: false,
+ })
+ })
+ }
+ // this.record = cloneDeep(params.record)
this.initRecord = cloneDeep(params.record)
//#region 从后端转换成前段所需格式
const areaData = await this.loadAreaData()
this.setState({
- exist: !!params.record,
+ exist: !!params.id,
options: { areaData },
})
@@ -81,7 +91,9 @@ export default class form extends Component {
if (areaCodeDefault) {
findCode(areaData)
this.areaCode = areaCodeDefault
- this.nextSort(this.areaCode, this.houseType)
+ if (!this.state.exist) {
+ this.nextSort(this.areaCode, this.houseType)
+ }
}
this.record = {
diff --git a/web-react/src/pages/business/house/project/index.jsx b/web-react/src/pages/business/house/project/index.jsx
index 68ec611..1f6d8f7 100644
--- a/web-react/src/pages/business/house/project/index.jsx
+++ b/web-react/src/pages/business/house/project/index.jsx
@@ -88,7 +88,7 @@ export default class index extends Component {
render: (text, record) => (
- this.onOpen(this.editForm, record)}>编辑
+ this.onOpen(this.editForm, record.id)}>编辑
(
<>
{`${record.areaName}-${record.roadName}-${record.commName}-${
- record.note
+ record.fullProjName
}-${record.no.toString().padStart(3, '0')}`}
{text}
diff --git a/web-react/src/pages/business/house/task/index.jsx b/web-react/src/pages/business/house/task/index.jsx
index ff9fcb6..ed5dea0 100644
--- a/web-react/src/pages/business/house/task/index.jsx
+++ b/web-react/src/pages/business/house/task/index.jsx
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
-import { Card, Form, Input, message as Message, Radio, Select, Tag } from 'antd'
+import { Card, Checkbox, Form, Input, message as Message, Radio, Select, Tag } from 'antd'
import { Auth, Container, QueryTable, QueryTableActions } from 'components'
import { api } from 'common/api'
import auth from 'components/authorized/handler'
@@ -7,6 +7,7 @@ import { isEqual } from 'lodash'
import getDictData from 'util/dic'
import { toCamelCase } from 'util/format'
import { getSearchInfo } from 'util/query'
+import { checkboxCheckedNone } from 'util/tool'
/**
* 注释段[\/**\/]为必须要改
@@ -49,11 +50,11 @@ export default class index extends Component {
title: '房屋编码',
dataIndex: 'houseCode',
sorter: true,
- width: 300,
+ width: 400,
render: (text, record) => (
<>
{`${record.areaName}-${record.roadName}-${record.commName}-${
- record.note
+ record.fullProjName
}-${record.no.toString().padStart(3, '0')}`}
{text}
@@ -245,12 +246,22 @@ export default class index extends Component {
columns={this.columns}
queryInitialValues={{
type: '',
- state: 0,
+ state: [-1, 0, 1, 2],
}}
onQueryChange={values => {
if (values.hasOwnProperty('type')) {
this.setState({ type: values.type })
}
+ if (values.hasOwnProperty('state')) {
+ const value = checkboxCheckedNone({
+ value: values.state,
+ length: codes.houseStatus.length,
+ required: true,
+ })
+ return {
+ state: value,
+ }
+ }
}}
query={
@@ -286,14 +297,14 @@ export default class index extends Component {
-
+
}
diff --git a/web-react/src/pages/business/house/zone/form.jsx b/web-react/src/pages/business/house/zone/form.jsx
index c93e21c..b97e82a 100644
--- a/web-react/src/pages/business/house/zone/form.jsx
+++ b/web-react/src/pages/business/house/zone/form.jsx
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import { Form, Input, InputNumber, Spin, TreeSelect } from 'antd'
import { AntIcon } from 'components'
-import { cloneDeep } from 'lodash'
+import { cloneDeep, pickBy } from 'lodash'
import { api } from 'common/api'
import { numberToChinese } from 'util/format'
import store from 'store'
@@ -54,12 +54,25 @@ export default class form extends Component {
*/
async fillData(params) {
const { user } = this.state
- this.record = cloneDeep(params.record)
+ if (params.id) {
+ this.setState({
+ loading: true,
+ })
+
+ api.houseZoneGetById({ zoneId: params.id }).then(({ data }) => {
+ this.record = data
+
+ this.setState({
+ loading: false,
+ })
+ })
+ }
+ // this.record = cloneDeep(params.record)
//#region 从后端转换成前段所需格式
const orgData = await this.loadOrgData()
this.setState({
- exist: !!params.record,
+ exist: !!params.id,
options: { orgData },
})
@@ -78,7 +91,7 @@ export default class form extends Component {
}
//#endregion
- if (!params.record && !!params.orgId) {
+ if (!params.id && !!params.orgId) {
this.onOrgIdChanged(params.orgId)
}
this.form.current.setFieldsValue(this.record)
diff --git a/web-react/src/pages/business/house/zone/index.jsx b/web-react/src/pages/business/house/zone/index.jsx
index fb8857f..bf84083 100644
--- a/web-react/src/pages/business/house/zone/index.jsx
+++ b/web-react/src/pages/business/house/zone/index.jsx
@@ -80,7 +80,7 @@ export default class index extends Component {
render: (text, record) => (
- this.onOpen(this.editForm, record)}>编辑
+ this.onOpen(this.editForm, record.id)}>编辑
this.bindCodeValue(text, 'notice_type'),
},
{
title: '状态',
dataIndex: 'status',
+ width: 120,
render: text => this.bindCodeValue(text, 'notice_status'),
},
]
@@ -94,7 +104,7 @@ export default class index extends Component {
if (flag) {
this.columns.push({
title: '操作',
- width: 150,
+ width: 200,
dataIndex: 'actions',
render: (text, record) => (
@@ -178,6 +188,7 @@ export default class index extends Component {
})
})
}
+
subUniqueKey(text, index) {
return text.substr(index, 5)
}
@@ -252,26 +263,23 @@ export default class index extends Component {
* @param {*} id
*/
onDelete(id) {
- this.onAction(apiAction.Status({ id, Status: 3 }), '删除成功')
+ this.onAction(apiAction.Status({ id, status: 3 }), '删除成功')
}
/**
* 发布
* @param {*} id
*/
onPublish(id) {
- this.onAction(apiAction.Status({ id, Status: 1 }), '发布成功')
+ this.onAction(apiAction.Status({ id, status: 1 }), '发布成功')
}
/**
* 撤回
* @param {*} id
*/
onGoBack(id) {
- this.onAction(apiAction.Status({ id, Status: 2 }), '撤回成功')
+ this.onAction(apiAction.Status({ id, status: 2 }), '撤回成功')
} //
- //#region 自定义方法
- //#endregion
-
render() {
const { codes } = this.state
return (
@@ -280,7 +288,6 @@ export default class index extends Component {
record.id}
autoLoad={false}
loadData={this.loadData}
columns={this.columns}
diff --git a/web-react/src/pages/system/noticeReceived/form.jsx b/web-react/src/pages/system/noticeReceived/form.jsx
index e4d73c9..44465b1 100644
--- a/web-react/src/pages/system/noticeReceived/form.jsx
+++ b/web-react/src/pages/system/noticeReceived/form.jsx
@@ -1,15 +1,18 @@
import React, { Component } from 'react'
-import { Spin, Divider, Modal, Row } from 'antd'
+import { Spin, Divider, Modal, Row, Form, Upload } from 'antd'
import { api } from 'common/api'
import { AntIcon } from 'components'
+import { BlobToBase64, GetFileName, PreviewFile } from 'util/file'
export default class form extends Component {
state = {
detailVisible: false,
detailLoading: false,
detailData: {},
+ fileValue: false,
}
+ filedu = React.createRef()
/**
* mount后回调
*/
@@ -20,12 +23,57 @@ export default class form extends Component {
async onOpenDetail(id) {
this.setState({ detailLoading: true, detailVisible: true })
const { data } = await api.sysNoticeDetail({ id })
+
this.setState({
detailLoading: false,
detailData: data,
+ fileValue: false,
})
+
+ if (data) {
+ const { attachments } = data
+ if (attachments) {
+ const fileValue = []
+ const fileList = attachments.split(',')
+ for (const fileId of fileList) {
+ try {
+ const file = await PreviewFile(fileId)
+ const base64 = await BlobToBase64(file)
+ fileValue.push({
+ uid: fileId,
+ response: fileId,
+ name: file.name,
+ url: base64,
+ status: 'done',
+ })
+ } catch {
+ const { data: file } = await api.sysFileInfoDetail({ id: fileId })
+ fileValue.push({
+ uid: fileId,
+ response: '文件已丢失',
+ name: file.fileOriginName,
+ status: 'error',
+ })
+ }
+ }
+ this.setState({
+ fileValue,
+ })
+ }
+ }
}
+ async onFileDownload(file) {
+ const { data, headers } = await api.sysFileInfoDownload({ id: file.response })
+ const url = window.URL.createObjectURL(data)
+ const fileName = GetFileName(headers['content-disposition'])
+ const a = document.createElement('a')
+ a.href = url
+ a.download = fileName
+ a.click()
+ window.URL.revokeObjectURL(url)
+ a.remove()
+ }
render() {
const { detailLoading, detailVisible, detailData } = this.state
return (
@@ -43,6 +91,21 @@ export default class form extends Component {
dangerouslySetInnerHTML={{ __html: detailData.content }}
>
+ {this.state.fileValue && (
+
+
+ 查看附件
+ this.onFileDownload(file)}
+ >
+
+
+ )}
+
发布人:{detailData.publicUserName}
发布时间:{detailData.publicTime}
diff --git a/web-react/src/pages/system/noticeReceived/index.jsx b/web-react/src/pages/system/noticeReceived/index.jsx
index 3c5452f..d4b580f 100644
--- a/web-react/src/pages/system/noticeReceived/index.jsx
+++ b/web-react/src/pages/system/noticeReceived/index.jsx
@@ -20,6 +20,7 @@ export default class index extends Component {
codes: {
noticeStatus: [],
noticeType: [],
+ readStatus: [],
},
}
@@ -33,25 +34,39 @@ export default class index extends Component {
{
title: '标题',
dataIndex: 'title',
+ width: 300,
+ sorter: true,
},
{
title: '发布人',
dataIndex: 'publicUserName',
+ width: 150,
+ sorter: true,
},
{
title: '发布时间',
dataIndex: 'createdTime',
+ width: 200,
+ sorter: true,
},
{
title: '发布单位',
dataIndex: 'publicOrgName',
width: 200,
+ sorter: true,
},
{
title: '类型',
dataIndex: 'type',
+ width: 120,
render: text => this.bindCodeValue(text, 'notice_type'),
},
+ {
+ title: '已读未读',
+ dataIndex: 'readStatus',
+ width: 120,
+ render: text => this.bindCodeValue(text, 'read_status'),
+ },
]
/**
@@ -94,33 +109,13 @@ export default class index extends Component {
componentDidMount() {
const { onLoading, onLoadData } = this.table.current
onLoading()
- getDictData('notice_status', 'notice_type').then(codes => {
+ getDictData('notice_status', 'notice_type', 'read_status').then(codes => {
this.setState({ codes }, () => {
onLoadData()
})
})
}
- /**
- * 对表格上的操作进行统一处理
- * [异步]
- * @param {*} action
- * @param {*} successMessage
- */
- async onAction(action, successMessage) {
- const { onLoading, onLoaded, onReloadData } = this.table.current
- onLoading()
- try {
- if (action) {
- await action
- }
- if (successMessage) {
- Message.success(successMessage)
- }
- onReloadData()
- } catch {
- onLoaded()
- }
- }
+
/**
* 调用加载数据接口,可在调用前对query进行处理
* [异步,必要]
@@ -134,6 +129,7 @@ export default class index extends Component {
queryType: {
type: QueryType.Equal,
title: QueryType.Like,
+ readStatus: QueryType.Equal,
},
})
@@ -200,6 +196,19 @@ export default class index extends Component {
))}
+
+
+
}
/>
diff --git a/web-react/src/util/global/index.js b/web-react/src/util/global/index.js
index 374ca42..2584c5e 100644
--- a/web-react/src/util/global/index.js
+++ b/web-react/src/util/global/index.js
@@ -38,6 +38,11 @@ export const RSA_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQU
*/
export const CITY = '黄石市'
+/**
+ *
+ */
+export const AMAP_WEBAPI_KEY = 'ca01719fe09757131a1249c273619a17'
+
/**
* 响应式响应宽度
*/
diff --git a/web-react/src/util/tool/index.js b/web-react/src/util/tool/index.js
new file mode 100644
index 0000000..239faaf
--- /dev/null
+++ b/web-react/src/util/tool/index.js
@@ -0,0 +1,23 @@
+import { first, last } from "lodash"
+
+export const checkboxCheckedNone = (arg) => {
+ let { value, length, noneValue, required } = arg
+ if (length === undefined) length = 2
+ if (noneValue === undefined) noneValue = ''
+ if (required === undefined) required = false
+
+ if (first(value) === noneValue && value.length > 1) {
+ // 在'无'之后选中其他值
+ value.shift()
+ } else if (
+ value.length >= length
+ ||
+ (last(value) === noneValue && value.length > 1)
+ ||
+ (!value.length && required)
+ ) {
+ // 在其他值之后选中'无'
+ value = [noneValue]
+ }
+ return value
+}
\ No newline at end of file
diff --git a/web-react/src/views/main/_layout/header/index.jsx b/web-react/src/views/main/_layout/header/index.jsx
index 0cdf6c8..b3f6dea 100644
--- a/web-react/src/views/main/_layout/header/index.jsx
+++ b/web-react/src/views/main/_layout/header/index.jsx
@@ -6,6 +6,7 @@ import { api } from 'common/api'
import Logo from '../logo'
import Search from './search'
+import Weather from './weather'
import Notice from './notice'
import User from './user'
@@ -53,6 +54,7 @@ export default class index extends Component {
+
>
}
+ description={
+ item.readStatus == 0 ? (
+ 未读
+ ) : (
+ 已读
+ )
+ }
/>
{item.content}
@@ -140,6 +192,21 @@ export default class notice extends Component {
dangerouslySetInnerHTML={{ __html: detailData.content }}
>
+ {this.state.fileValue && (
+
+
+ 查看附件
+ this.onFileDownload(file)}
+ >
+
+
+ )}
+
发布人:{detailData.publicUserName}
发布时间:{detailData.publicTime}
diff --git a/web-react/src/views/main/_layout/header/weather.jsx b/web-react/src/views/main/_layout/header/weather.jsx
new file mode 100644
index 0000000..7718c2b
--- /dev/null
+++ b/web-react/src/views/main/_layout/header/weather.jsx
@@ -0,0 +1,51 @@
+import React, { Component } from 'react'
+import { Space } from 'antd'
+import AntIcon from 'components/ant-icon'
+import { axios } from 'common/api'
+import { AMAP_WEBAPI_KEY } from 'util/global'
+
+export default class weather extends Component {
+ state = {
+ weather: '',
+ temperature: 0,
+ }
+
+ async componentDidMount() {
+ const {
+ data: { adcode },
+ } = await axios.get('https://restapi.amap.com/v3/ip', {
+ params: {
+ key: AMAP_WEBAPI_KEY,
+ },
+ })
+ const {
+ data: { lives },
+ } = await axios.get('http://restapi.amap.com/v3/weather/weatherInfo', {
+ params: {
+ key: AMAP_WEBAPI_KEY,
+ city: adcode,
+ },
+ })
+ if (Array.isArray(lives)) {
+ const { weather, temperature } = lives.shift()
+ this.setState({
+ weather,
+ temperature,
+ })
+ }
+ }
+
+ render() {
+ const { weather, temperature } = this.state
+
+ return (
+
+
+
+ {temperature}℃
+ {weather}
+
+
+ )
+ }
+}