任务表新增字段 IsEnbaled  是否有效
提交审核、审核新增房屋流转日志步骤
选房逻辑调整
This commit is contained in:
2021-07-07 17:30:25 +08:00
parent 5ac860c119
commit 59fb976434
11 changed files with 140 additions and 60 deletions

View File

@@ -257,5 +257,10 @@ namespace Ewide.Application
[Comment("最后提交时间")] [Comment("最后提交时间")]
public DateTime? LastSubmitTime { get; set; } public DateTime? LastSubmitTime { get; set; }
/// <summary>
/// 是否有效
/// </summary>
[Comment("是否有效")]
public bool IsEnabled { get; set; }
} }
} }

View File

@@ -18,11 +18,15 @@ namespace Ewide.Application
[Description("房屋建档")] [Description("房屋建档")]
CreateInfo = 3, CreateInfo = 3,
[Description("审核")]
Check = 4,
[Description("审核通过")] [Description("审核通过")]
Agree = 4, Agree = 5,
[Description("审核退回")] [Description("审核退回")]
Disagree = 5 Disagree = 6
} }
public enum HouseLogStatus public enum HouseLogStatus

View File

@@ -616,6 +616,11 @@
住宅查询 住宅查询
</summary> </summary>
</member> </member>
<member name="T:Ewide.Application.Service.HouseLogService">
<summary>
房屋流转日志
</summary>
</member>
<member name="M:Ewide.Application.Service.HouseMemberService.QueryMemberPageList(Ewide.Core.Service.UserInput)"> <member name="M:Ewide.Application.Service.HouseMemberService.QueryMemberPageList(Ewide.Core.Service.UserInput)">
<summary> <summary>
分页查询用户 分页查询用户

View File

@@ -19,7 +19,7 @@ namespace Ewide.Application
public string CommName { get; set; } public string CommName { get; set; }
public string ZoneName { get; set; } public string ZoneName { get; set; }
public string ProjectNote { get; set; } public string ProjectNote { get; set; }
public string ProjectFullName { get; set; } public string FullProjName { get; set; }
public string HouseCode { get; set; } public string HouseCode { get; set; }
public int No { get; set; } public int No { get; set; }
public string Lng { get; set; } public string Lng { get; set; }

View File

@@ -50,11 +50,7 @@ namespace Ewide.Application.Service.HouseSafety.HouseInfo
[AllowAnonymous] [AllowAnonymous]
public async Task Save([FromBody] HouseInfoInputSave input) public async Task Save([FromBody] HouseInfoInputSave input)
{ {
//根据任务审核记录判断是否是审核操作,从而确定 DataStatus await InputDataProcess(input, DataStatus.Saved);
//审核操作,则为 input.TaskCheckRecord.PassOrBackDataStatus
//非审核操作,则为 DataStatus.Saved
var isCheckAction = input.TaskCheckRecord != null;
await InputDataProcess(input, isCheckAction ? input.TaskCheckRecord.PassOrBackDataStatus : DataStatus.Saved);
} }
[HttpPost("/houseInfo/submitToCheck")] [HttpPost("/houseInfo/submitToCheck")]
@@ -65,6 +61,13 @@ namespace Ewide.Application.Service.HouseSafety.HouseInfo
await InputDataProcess(input,DataStatus.Submited); 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")] [HttpGet("/houseInfo/getByTaskId")]
[UnitOfWork] [UnitOfWork]
public async Task<HouseInfoOutputForDetailPage> GetByTaskId([Required] string taskId) 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); 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) if (dataStatus == DataStatus.Back || dataStatus == DataStatus.Passed)
{ {
var checkRecord = input.TaskCheckRecord.Adapt<BsHouseTaskCheckRecord>(); var checkRecord = input.TaskCheckRecord.Adapt<BsHouseTaskCheckRecord>();
await checkRecord.InsertAsync(); await checkRecord.InsertAsync();
await _houseLogService.AddThenDone(input.houseCode.Id, _userManager.User, dataStatus == DataStatus.Passed ? HouseLogType.Agree : HouseLogType.Disagree);
} }
} }
} }

View File

@@ -14,7 +14,10 @@ using System.Threading.Tasks;
namespace Ewide.Application.Service namespace Ewide.Application.Service
{ {
[ApiDescriptionSettings(Name = "HouseLog", Order = 180)] /// <summary>
/// 房屋流转日志
/// </summary>
[ApiDescriptionSettings(Name = "HouseLog", Order = 210)]
public class HouseLogService : IHouseLogService, IDynamicApiController, ITransient public class HouseLogService : IHouseLogService, IDynamicApiController, ITransient
{ {
private readonly IDapperRepository _dapperRep; private readonly IDapperRepository _dapperRep;
@@ -27,12 +30,14 @@ namespace Ewide.Application.Service
_bsHouseLogRep = bsHouseLogRep; _bsHouseLogRep = bsHouseLogRep;
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task Add(string houseCodeId, SysUser targetUser, HouseLogType type) public async Task Add(string houseCodeId, SysUser targetUser, HouseLogType type)
{ {
await Add(houseCodeId, new List<SysUser> { targetUser }, type); await Add(houseCodeId, new List<SysUser> { targetUser }, type);
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type) public async Task Add(string houseCodeId, List<SysUser> targetUsers, HouseLogType type)
{ {
@@ -46,6 +51,7 @@ namespace Ewide.Application.Service
}.InsertAsync(); }.InsertAsync();
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task Read(string houseCodeId) public async Task Read(string houseCodeId)
{ {
@@ -60,6 +66,7 @@ namespace Ewide.Application.Service
} }
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task Done(string houseCodeId) public async Task Done(string houseCodeId)
{ {
@@ -74,12 +81,14 @@ namespace Ewide.Application.Service
} }
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type) public async Task AddThenRead(string houseCodeId, SysUser targetUser, HouseLogType type)
{ {
await AddThenRead(houseCodeId, new List<SysUser> { targetUser }, type); await AddThenRead(houseCodeId, new List<SysUser> { targetUser }, type);
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type) public async Task AddThenRead(string houseCodeId, List<SysUser> targetUsers, HouseLogType type)
{ {
@@ -93,12 +102,14 @@ namespace Ewide.Application.Service
}.InsertAsync(); }.InsertAsync();
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type) public async Task AddThenDone(string houseCodeId, SysUser targetUser, HouseLogType type)
{ {
await AddThenDone(houseCodeId, new List<SysUser> { targetUser }, type); await AddThenDone(houseCodeId, new List<SysUser> { targetUser }, type);
} }
[NonAction]
[UnitOfWork] [UnitOfWork]
public async Task AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type) public async Task AddThenDone(string houseCodeId, List<SysUser> targetUsers, HouseLogType type)
{ {

View File

@@ -6,6 +6,7 @@ using Furion.DatabaseAccessor.Extensions;
using Furion.DependencyInjection; using Furion.DependencyInjection;
using Furion.DynamicApiController; using Furion.DynamicApiController;
using Furion.FriendlyException; using Furion.FriendlyException;
using Mapster;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic; using System.Collections.Generic;
@@ -154,14 +155,8 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
// 选定房屋 // 选定房屋
house.ForEach(async p => house.ForEach(async p =>
{ {
new BsHouseMemberRelation var originalTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t =>t.HouseCodeId == p && t.TaskType == 0);
{ if (originalTask == null)
SysUserId = selectedUser.Id,
HouseCodeId = p
}.Insert();
var initTask = _bsHouseTaskRep.DetachedEntities.FirstOrDefault(t =>t.HouseCodeId == p && t.TaskType == 0);
if (initTask == null)
{ {
new BsHouseTask new BsHouseTask
{ {
@@ -174,16 +169,36 @@ INNER JOIN (SELECT * FROM bs_house_member_relation WHERE SysUserId = @UserId) HM
}.Insert(); }.Insert();
await _houseLogService.Done(p); await _houseLogService.Done(p);
await _houseLogService.Add(p, selectedUser, HouseLogType.CreateInfo);
} }
else else
{ {
initTask.UserID = input.UserId;
initTask.Update();
await _houseLogService.AddThenDone(p, _userManager.User, HouseLogType.SelectMember); 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();
}); });
} }

View File

@@ -154,5 +154,20 @@ namespace Ewide.Application
public string ReportRemark { get; set; } public string ReportRemark { get; set; }
public int Status { 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; }
} }
} }

View File

@@ -1,6 +1,7 @@
const urls = { const urls = {
houseInfoGetByTaskId: ['/houseInfo/getByTaskId', 'get'], houseInfoGetByTaskId: ['/houseInfo/getByTaskId', 'get'],
houseInfoSave: ['houseInfo/save', 'post'], houseInfoSave: ['houseInfo/save', 'post'],
houseInfoCheck: ['houseInfo/check', 'post'],
houseInfoSubmitToCheck: ['/houseInfo/submitToCheck', 'post'] houseInfoSubmitToCheck: ['/houseInfo/submitToCheck', 'post']
} }

View File

@@ -1,7 +1,7 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd' import { Form, Button, Input, Descriptions, message as Message, Modal, Spin, Tabs } from 'antd'
import { merge, isEqual, pickBy } from 'lodash' import { merge, isEqual, pickBy } from 'lodash'
import { AntIcon, ComponentDynamic, Container } from 'components' import { AntIcon, ComponentDynamic, Container, Auth } from 'components'
import { api } from 'common/api' import { api } from 'common/api'
const tabs = [ const tabs = [
@@ -58,7 +58,7 @@ const actions = {
after: 'close', after: 'close',
}, },
check: { check: {
action: 'houseInfoSave', action: 'houseInfoCheck',
remark: '审核', remark: '审核',
after: 'close', after: 'close',
}, },
@@ -222,41 +222,43 @@ export default class index extends Component {
<Container mode="fluid"> <Container mode="fluid">
<div className="yo-form-page--bar-inner"> <div className="yo-form-page--bar-inner">
<span> <span>
{this.state.taskStatus == 3 && ( <Auth auth={{ houseInfo: 'check' }}>
<Form ref={this.checkForm} layout="inline"> {this.state.taskStatus == 3 && (
<Form.Item <Form ref={this.checkForm} layout="inline">
label="审核意见" <Form.Item
name={['taskCheckRecord', 'content']} label="审核意见"
rules={[ name={['taskCheckRecord', 'content']}
{ rules={[
required: true, {
message: '请输入审核意见', required: true,
}, message: '请输入审核意见',
]} },
> ]}
<Input.TextArea
autoSize
autoComplete="off"
placeholder="请输入审核意见"
className="w-500"
/>
</Form.Item>
<Form.Item>
<Button
type="primary"
onClick={() => this.onCheck(6)}
> >
通过 <Input.TextArea
</Button> autoSize
<Button autoComplete="off"
type="primary" placeholder="请输入审核意见"
onClick={() => this.onCheck(-1)} className="w-500"
> />
退回 </Form.Item>
</Button> <Form.Item>
</Form.Item> <Button
</Form> type="primary"
)} onClick={() => this.onCheck(6)}
>
通过
</Button>
<Button
type="primary"
onClick={() => this.onCheck(-1)}
>
退回
</Button>
</Form.Item>
</Form>
)}
</Auth>
</span> </span>
<span> <span>
{this.state.taskStatus >= -1 && 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.areaName}-${
record.houseCode.roadName record.houseCode.roadName
}-${record.houseCode.commName}-${ }-${record.houseCode.commName}-${
record.houseCode.projectFullName record.houseCode.fullProjName
}-${record.houseCode.no.toString().padStart(3, '0')}`} }-${record.houseCode.no.toString().padStart(3, '0')}`}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item span="2" label="编码"> <Descriptions.Item span="2" label="编码">

View File

@@ -56,7 +56,7 @@ export default class index extends Component {
render: (text, record) => ( render: (text, record) => (
<> <>
{`${record.areaName}-${record.roadName}-${record.commName}-${ {`${record.areaName}-${record.roadName}-${record.commName}-${
record.note record.fullProjName
}-${record.no.toString().padStart(3, '0')}`} }-${record.no.toString().padStart(3, '0')}`}
<br /> <br />
<Tag color="purple">{text}</Tag> <Tag color="purple">{text}</Tag>