Selaa lähdekoodia

胖子天骄业务调整

master
747575620@qq.com 6 kuukautta sitten
vanhempi
commit
48954e381a
5 muutettua tiedostoa jossa 48 lisäystä ja 12 poistoa
  1. +5
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  2. +4
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs
  3. +19
    -3
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs
  4. +2
    -2
      backend/BPA.MES.Base.Web.Entry/appsettings.json
  5. +18
    -7
      frontend/src/pages/workInfo/index.tsx

+ 5
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml Näytä tiedosto

@@ -7425,6 +7425,11 @@
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkBatchOutput.Count">
<summary>
个数
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoCraftstepRecordDto">
<summary>
名 称 :


+ 4
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs Näytä tiedosto

@@ -73,6 +73,10 @@
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 个数
/// </summary>
public int Count { get; set; }

}
}

+ 19
- 3
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs Näytä tiedosto

@@ -25,7 +25,19 @@

public async Task<bool> Del(WorkBatchDelInput input)
{
var res = await _dbContext.Deleteable<WorkBatchEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
var res = false;
try
{
_dbContext.Ado.BeginTran();
await _dbContext.Deleteable<WorkBatchEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
await _dbContext.Deleteable<Pztj_WorkInfoEntity>().Where(x => x.BatchId == input.Id).ExecuteCommandAsync();
_dbContext.Ado.CommitTran();
res = true;
}
catch (Exception)
{
_dbContext.Ado.RollbackTran();
}
return res;
}

@@ -40,13 +52,17 @@
{
var entity = await _dbContext.Queryable<WorkBatchEntity>()
.OrderByDescending(x => x.CreateTime)
.Select((x)=>new WorkBatchOutput
{
Id = x.Id.SelectAll(),
Count = SqlFunc.Subqueryable<Pztj_WorkInfoEntity>().Where(d=>d.BatchId==x.Id).Count()
})
.ToPagedListAsync(input.PageIndex, input.PageSize);
//foreach (var item in entity.Items)
//{
// item.Status = WorkOrderStatusEnum.Started
//}
SqlSugarPagedList<WorkBatchOutput> output = entity.Adapt<SqlSugarPagedList<WorkBatchOutput>>();
return output;
return entity;
}

public async Task<bool> Update(WorkBatchUpdateInput input)


+ 2
- 2
backend/BPA.MES.Base.Web.Entry/appsettings.json Näytä tiedosto

@@ -10,8 +10,8 @@
"AllowedHosts": "*",
"ConnectionConfigs": [
{
//"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=BapAdmin123456.;",
"ConnectionString": "server=192.168.1.231;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=pztj8127;",
"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=BapAdmin123456.;",
//"ConnectionString": "server=192.168.1.231;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=pztj8127;",
"DbType": "MySql",
"IsAutoCloseConnection": true
}


+ 18
- 7
frontend/src/pages/workInfo/index.tsx Näytä tiedosto

@@ -194,6 +194,7 @@ export default () => {
WorkInfoAPI.Del(EnablejsonData).then((r) => {
if (r.statusCode === 200) {
message.success(r.statusCode === 200 ? '删除成功' : r.message);
batchActionRef.current?.reload();
actionRef.current?.reload();
}
});
@@ -347,6 +348,14 @@ export default () => {
align: 'center',
width: 180
},
{
title: '工单个数',
dataIndex: 'count',
ellipsis: true,
hideInSearch: true,
align: 'center',
width: 80
},
{
title: '批次状态',
dataIndex: 'status',
@@ -416,7 +425,7 @@ export default () => {
>
新增工单
</Button>,
record.count>0?
<Popconfirm
key="workedit"
title="确定要下发全部工单吗?"
@@ -439,7 +448,7 @@ export default () => {
cancelText="关闭"
>
<Button type="primary" ghost>批次下发</Button>
</Popconfirm>
</Popconfirm>:""
,
<Popconfirm
key="workdel"
@@ -451,7 +460,7 @@ export default () => {
WorkInfoAPI.DelBatch(EnablejsonData).then((r) => {
if (r.statusCode === 200) {
message.success(r.statusCode === 200 ? '删除成功' : r.message);
actionRef.current?.reload();
batchActionRef.current?.reload();
}
});
}}
@@ -514,7 +523,7 @@ export default () => {
,
<Popconfirm
key="workdel"
title="确定要删除此工单吗?"
title="确定要删除此批次计划吗?"
onConfirm={() => {
const EnablejsonData: WorkInfoTypes.WorkInfoDelInput = {
id: record.id,
@@ -522,7 +531,7 @@ export default () => {
WorkInfoAPI.DelBatch(EnablejsonData).then((r) => {
if (r.statusCode === 200) {
message.success(r.statusCode === 200 ? '删除成功' : r.message);
actionRef.current?.reload();
batchActionRef.current?.reload();
}
});
}}
@@ -570,7 +579,7 @@ const OnBatchSubmit= async (values:any)=>{
const response = await WorkInfoAPI.UpdateBatch(values);
if (response.statusCode === 200) {
message.success('修改成功');
actionRef.current?.reload();
batchActionRef.current?.reload();
setIsBatchModalOpen(false);
} else {
message.error(JSON.stringify(response.errors) || '修改失败');
@@ -580,7 +589,7 @@ const OnBatchSubmit= async (values:any)=>{
console.log('response', response);
if (response.statusCode === 200) {
message.success('添加成功');
actionRef.current?.reload();
batchActionRef.current?.reload();
setIsBatchModalOpen(false);
} else {
message.error(JSON.stringify(response.errors) || '添加失败');
@@ -608,6 +617,7 @@ const OnBatchSubmit= async (values:any)=>{
console.log('response', response);
if (response.statusCode === 200) {
message.success('添加成功');
batchActionRef.current?.reload();
actionRef.current?.reload();
setIsModalOpen(false);
} else {
@@ -682,6 +692,7 @@ const OnBatchSubmit= async (values:any)=>{
console.log('record',record);
}}}
columns={batchColumns}
actionRef={batchActionRef}
cardBordered


Ladataan…
Peruuta
Tallenna