update
任务表新增字段 IsEnbaled 是否有效 提交审核、审核新增房屋流转日志步骤 选房逻辑调整
This commit is contained in:
@@ -257,5 +257,10 @@ namespace Ewide.Application
|
||||
[Comment("最后提交时间")]
|
||||
public DateTime? LastSubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
[Comment("是否有效")]
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,15 @@ namespace Ewide.Application
|
||||
[Description("房屋建档")]
|
||||
CreateInfo = 3,
|
||||
|
||||
[Description("审核")]
|
||||
Check = 4,
|
||||
|
||||
[Description("审核通过")]
|
||||
Agree = 4,
|
||||
Agree = 5,
|
||||
|
||||
[Description("审核退回")]
|
||||
Disagree = 5
|
||||
Disagree = 6
|
||||
|
||||
}
|
||||
|
||||
public enum HouseLogStatus
|
||||
|
||||
@@ -616,6 +616,11 @@
|
||||
住宅查询
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Ewide.Application.Service.HouseLogService">
|
||||
<summary>
|
||||
房屋流转日志
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Ewide.Application.Service.HouseMemberService.QueryMemberPageList(Ewide.Core.Service.UserInput)">
|
||||
<summary>
|
||||
分页查询用户
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -50,11 +50,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")]
|
||||
@@ -65,6 +61,13 @@ 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")]
|
||||
[UnitOfWork]
|
||||
public async Task<HouseInfoOutputForDetailPage> GetByTaskId([Required] string taskId)
|
||||
@@ -158,12 +161,31 @@ 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 _sysUserRep = Db.GetRepository<SysUser>();
|
||||
var _sysEmpRep = Db.GetRepository<SysEmp>();
|
||||
var _sysUserRoleRep = Db.GetRepository<SysUserRole>();
|
||||
var _sysRoleRep = Db.GetRepository<SysRole>();
|
||||
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.AddThenDone(input.houseCode.Id, zoneManagerList, HouseLogType.Check);
|
||||
}
|
||||
//审核操作则新增一条审核记录
|
||||
if (dataStatus == DataStatus.Back || dataStatus == DataStatus.Passed)
|
||||
{
|
||||
var checkRecord = input.TaskCheckRecord.Adapt<BsHouseTaskCheckRecord>();
|
||||
await checkRecord.InsertAsync();
|
||||
await _houseLogService.AddThenDone(input.houseCode.Id, _userManager.User, dataStatus == DataStatus.Passed ? HouseLogType.Agree : HouseLogType.Disagree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Application.Service
|
||||
{
|
||||
[ApiDescriptionSettings(Name = "HouseLog", Order = 180)]
|
||||
/// <summary>
|
||||
/// 房屋流转日志
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "HouseLog", Order = 210)]
|
||||
public class HouseLogService : IHouseLogService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IDapperRepository _dapperRep;
|
||||
@@ -27,12 +30,14 @@ namespace Ewide.Application.Service
|
||||
_bsHouseLogRep = bsHouseLogRep;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task Add(string houseCodeId, SysUser targetUser, HouseLogType type)
|
||||
{
|
||||
await Add(houseCodeId, new List<SysUser> { targetUser }, type);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type)
|
||||
{
|
||||
@@ -46,6 +51,7 @@ namespace Ewide.Application.Service
|
||||
}.InsertAsync();
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task Read(string houseCodeId)
|
||||
{
|
||||
@@ -60,6 +66,7 @@ namespace Ewide.Application.Service
|
||||
}
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task Done(string houseCodeId)
|
||||
{
|
||||
@@ -74,12 +81,14 @@ namespace Ewide.Application.Service
|
||||
}
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type)
|
||||
{
|
||||
await AddThenRead(houseCodeId, new List<SysUser> { targetUser }, type);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type)
|
||||
{
|
||||
@@ -93,12 +102,14 @@ namespace Ewide.Application.Service
|
||||
}.InsertAsync();
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type)
|
||||
{
|
||||
await AddThenDone(houseCodeId, new List<SysUser> { targetUser }, type);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[UnitOfWork]
|
||||
public async Task AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ 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;
|
||||
@@ -154,14 +155,8 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
|
||||
// 选定房屋
|
||||
house.ForEach(async p =>
|
||||
{
|
||||
new BsHouseMemberRelation
|
||||
{
|
||||
SysUserId = selectedUser.Id,
|
||||
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
|
||||
{
|
||||
@@ -174,16 +169,36 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
|
||||
}.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<BsHouseTask>();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo);
|
||||
new BsHouseMemberRelation
|
||||
{
|
||||
SysUserId = selectedUser.Id,
|
||||
HouseCodeId = p
|
||||
}.Insert();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -154,5 +154,20 @@ namespace Ewide.Application
|
||||
public string ReportRemark { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交时间
|
||||
/// </summary>
|
||||
public DateTime? SubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后提交时间
|
||||
/// </summary>
|
||||
public DateTime? LastSubmitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const urls = {
|
||||
houseInfoGetByTaskId: ['/houseInfo/getByTaskId', 'get'],
|
||||
houseInfoSave: ['houseInfo/save', 'post'],
|
||||
houseInfoCheck: ['houseInfo/check', 'post'],
|
||||
houseInfoSubmitToCheck: ['/houseInfo/submitToCheck', 'post']
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
<Container mode="fluid">
|
||||
<div className="yo-form-page--bar-inner">
|
||||
<span>
|
||||
{this.state.taskStatus == 3 && (
|
||||
<Form ref={this.checkForm} layout="inline">
|
||||
<Form.Item
|
||||
label="审核意见"
|
||||
name={['taskCheckRecord', 'content']}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入审核意见',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.TextArea
|
||||
autoSize
|
||||
autoComplete="off"
|
||||
placeholder="请输入审核意见"
|
||||
className="w-500"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.onCheck(6)}
|
||||
<Auth auth={{ houseInfo: 'check' }}>
|
||||
{this.state.taskStatus == 3 && (
|
||||
<Form ref={this.checkForm} layout="inline">
|
||||
<Form.Item
|
||||
label="审核意见"
|
||||
name={['taskCheckRecord', 'content']}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入审核意见',
|
||||
},
|
||||
]}
|
||||
>
|
||||
通过
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.onCheck(-1)}
|
||||
>
|
||||
退回
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
)}
|
||||
<Input.TextArea
|
||||
autoSize
|
||||
autoComplete="off"
|
||||
placeholder="请输入审核意见"
|
||||
className="w-500"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.onCheck(6)}
|
||||
>
|
||||
通过
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.onCheck(-1)}
|
||||
>
|
||||
退回
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
)}
|
||||
</Auth>
|
||||
</span>
|
||||
<span>
|
||||
{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')}`}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item span="2" label="编码">
|
||||
|
||||
@@ -56,7 +56,7 @@ export default class index extends Component {
|
||||
render: (text, record) => (
|
||||
<>
|
||||
{`${record.areaName}-${record.roadName}-${record.commName}-${
|
||||
record.note
|
||||
record.fullProjName
|
||||
}-${record.no.toString().padStart(3, '0')}`}
|
||||
<br />
|
||||
<Tag color="purple">{text}</Tag>
|
||||
|
||||
Reference in New Issue
Block a user