sunhao 6 months ago
parent 4fc445812e
commit 340d629fe0

@ -22,8 +22,6 @@ namespace ibk.IPD.Service.IPD_PS
#region 获取存储数据
/// <summary>
/// 获取所有未确认数据
/// </summary>

@ -309,79 +309,7 @@ const Main = () => {
{ title: '钢板利用率', dataIndex: 'SUB_RATE', key: 'SUB_RATE', width: 100, ellipsis: true },
{ title: '替代时间', dataIndex: 'DATA_TIME', key: 'DATA_TIME', width: 102, ellipsis: true },
{ title: '替代类型', dataIndex: 'IS_FULL', key: 'IS_FULL', width: 83, ellipsis: true },
{
title: '替代前物料信息',
ellipsis: true,
className: 'replaceColor',
children: [
{
title: '标准号',
dataIndex: 'GP_APLY_STDSPEC',
key: 'GP_APLY_STDSPEC',
width: 160,
ellipsis: true,
className: 'replaceColor',
},
{
title: '厚度',
dataIndex: 'GP_THK',
key: 'GP_THK',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '宽度',
dataIndex: 'GP_WID',
key: 'GP_WID',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '长度',
dataIndex: 'GP_LEN',
key: 'GP_LEN',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '重量',
dataIndex: 'GP_WGT',
key: 'GP_WGT',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '状态',
dataIndex: 'PROC_STATE',
key: 'PROC_STATE',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '替代时仓库',
dataIndex: 'GP_CUR_INV',
key: 'GP_CUR_INV',
width: 100,
ellipsis: true,
className: 'replaceColor',
},
{
title: '货位',
dataIndex: 'LOC',
key: 'LOC',
width: 100,
ellipsis: true,
className: 'replaceColor',
},
],
},
{
{
title: '替代后订单',
ellipsis: true,
className: 'endColor',
@ -402,14 +330,14 @@ const Main = () => {
ellipsis: true,
className: 'endColor',
},
{
title: '订单交货期',
dataIndex: 'BOI_DEL_TO_DATE',
key: 'BOI_DEL_TO_DATE',
width: 100,
ellipsis: true,
className: 'endColor',
},
// {
// title: '订单交货期',
// dataIndex: 'BOI_DEL_TO_DATE',
// key: 'BOI_DEL_TO_DATE',
// width: 100,
// ellipsis: true,
// className: 'endColor',
// },
{
title: '标准',
dataIndex: 'BOI_STDSPEC',
@ -500,11 +428,84 @@ const Main = () => {
className: 'endColor',
},
],
},
{
title: '替代前物料信息',
ellipsis: true,
className: 'replaceColor',
children: [
{
title: '标准号',
dataIndex: 'GP_APLY_STDSPEC',
key: 'GP_APLY_STDSPEC',
width: 160,
ellipsis: true,
className: 'replaceColor',
},
{
title: '厚度',
dataIndex: 'GP_THK',
key: 'GP_THK',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '宽度',
dataIndex: 'GP_WID',
key: 'GP_WID',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '长度',
dataIndex: 'GP_LEN',
key: 'GP_LEN',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '重量',
dataIndex: 'GP_WGT',
key: 'GP_WGT',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '状态',
dataIndex: 'PROC_STATE',
key: 'PROC_STATE',
width: 60,
ellipsis: true,
className: 'replaceColor',
},
{
title: '替代时仓库',
dataIndex: 'GP_CUR_INV',
key: 'GP_CUR_INV',
width: 100,
ellipsis: true,
className: 'replaceColor',
},
{
title: '货位',
dataIndex: 'LOC',
key: 'LOC',
width: 100,
ellipsis: true,
className: 'replaceColor',
},
],
},
{
title: '用户交货期',
dataIndex: 'BOI_DEL_TO_DATE',
key: 'BOI_DEL_TO_DATE',
dataIndex: 'BOI_DEL_FR_DATE',
key: 'BOI_DEL_FR_DATE',
width: 100,
ellipsis: true,
},
@ -885,32 +886,7 @@ const Main = () => {
/>
</Item>
</Col>
<Col span={3} style={{ marginLeft: '-100px' }}>
<Item label="状态" name="PROC_CD" style={{ width: 211 }}>
<Select
mode="multiple"
showArrow={true}
placeholder="请选择"
value={selectedItems}
allowClear
onChange={setSelectedItems}
style={{ width: '100%' }}
>
{filteredOptions.map((item) => (
<Select.Option key={item} value={item}>
{item}
</Select.Option>
))}
</Select>
{/* <Dictionary
placeholder="请选择"
dict="TDZT"
form={form}
valueName="PROC_CD"
labelName="PROC_CD"
/> */}
</Item>
</Col>
</Row>
<Row gutter={[16, 8]} style={{ marginBottom: '-25px' }}>
{/* <Col span={4}>
@ -960,6 +936,43 @@ const Main = () => {
/> */}
</Item>
</Col>
<Col span={4} style={{ marginLeft: '-40px' }}>
<Item label="工厂" style={{ width: 170 }}>
<Dictionary
placeholder="请选择"
dict="B0033"
form={form}
valueName="PLT"
labelName="PLT"
/>
</Item>
</Col>
<Col span={3} style={{ marginLeft: '-40px' }}>
<Item label="状态" name="PROC_CD" style={{ width: 211 }}>
<Select
mode="multiple"
showArrow={true}
placeholder="请选择"
value={selectedItems}
allowClear
onChange={setSelectedItems}
style={{ width: '100%' }}
>
{filteredOptions.map((item) => (
<Select.Option key={item} value={item}>
{item}
</Select.Option>
))}
</Select>
{/* <Dictionary
placeholder="请选择"
dict="TDZT"
form={form}
valueName="PROC_CD"
labelName="PROC_CD"
/> */}
</Item>
</Col>
<Space style={{ position: 'absolute', right: 25 }} size={8}>
<Item style={{ textAlign: 'center' }}>

@ -703,7 +703,8 @@ const Main = () => {
labelName="PLT"
/>
</Item>
<Item label={`结果`} name="HAN_RSL" style={{ width: 225, marginLeft: -60 }}>
{/* , marginLeft: -60 */}
<Item label={`结果`} name="HAN_RSL" style={{ width: 225}}>
<Dictionary
style={{ width: 100 }}
placeholder="请选择"

@ -20,6 +20,7 @@ using Newtonsoft.Json;
using Google.Protobuf.WellKnownTypes;
using ibk.IPD.Entity.IPD_PS.QueryArgs;
using RestSharp;
using SOA.Objects;
namespace ibk.IPD
{
@ -314,12 +315,12 @@ namespace ibk.IPD
DataTable gQP_TEST_HEAD_SMP1 = new DataTable();
gQP_TEST_HEAD_SMP = surMatSubService.getQP_TEST_HEAD();//SOA获取
//gQP_TEST_HEAD_SMP1 = Dal.GetInstance().getQP_TEST_HEAD();
//gQP_TEST_HEAD_SMP1 = Dal.GetInstance().getQP_TEST_HEAD();
// if (gQP_TEST_HEAD_SMP1.Rows.Count > 0)
// {
// gQP_TEST_HEAD_SMP = ModelConvertHelper1<QP_TEST_HEAD>.ConvertToModel(gQP_TEST_HEAD_SMP1);
// }
// if (gQP_TEST_HEAD_SMP1.Rows.Count > 0)
// {
// gQP_TEST_HEAD_SMP = ModelConvertHelper1<QP_TEST_HEAD>.ConvertToModel(gQP_TEST_HEAD_SMP1);
// }
logger.Info("【2_00试样号】" + gQP_TEST_HEAD_SMP.Count);
});
@ -580,12 +581,43 @@ namespace ibk.IPD
logger.Info("【多线程获取数据结束】");
#region 更新价格
//pdismp = surMatSubService.GetPDI_SMP();
//logger.Info("【2_02并样履历】" + pdismp.Count);
//测试test改SQL数据源不需要修改这里
//gP_PLATEs= gP_PLATEs.Where(p => p.PLATE_NO == "23110460540301").ToList();
//gQP_TEST_HEAD_SMP = gQP_TEST_HEAD_SMP.Where(p => p.SMP_NO == "23111671310301").ToList();
//pdismp = pdismp.Where(p => p.SMP_NO == "24102618020121").ToList();
//using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
//{
// try
// {
// //因为是同时操作两个表, 所以开启事务
// db.BeginTransaction();
// //更新历史履历价格
// foreach (var PSN_Price in pdismp)
// {
// //getExperPriceStr
// double price = getExperPriceStr(PSN_Price.SMP_NO);
// StringBuilder strUpd = new StringBuilder();
// strUpd.AppendFormat(" UPDATE PDI_SMP_NO SET COSTS='{0}' WHERE SMP_NO='{1}' ", price, PSN_Price.SMP_NO);
// db.Execute(strUpd.ToString());//更新数据
// }
// db.Commit();
// }
// catch (Exception)
// {
// db.Rollback();
// }
//}
#endregion
foreach (GP_PLATE plate in gP_PLATEs)
{
@ -3638,6 +3670,42 @@ namespace ibk.IPD
return Math.Round(g_price + p_price, 2);
}
/// <summary>
/// 获取检验费
/// </summary>
/// <param name="plate"></param>
/// <param name="ORD_save"></param>
/// <returns></returns>
private static double getExperPriceStr(string strSMPNo)
{
double g_price = 0;//默认78元检验费部分取样没有检验费用
double p_price = 0;
//取样价格
if (!string.IsNullOrEmpty(strSMPNo))
{
List<data> data = doHttpPost(strSMPNo);
////接口数据
//logger.InfoFormat("式样号:{0};订单号:{1}-{2}") ;
if (data.Count > 0)
{
foreach (var ds in data)
{
p_price += Convert.ToDouble(ds.test_charge);
}
}
}
if (p_price == 0)
{
g_price = 78;
logger.InfoFormat("接口缺少价格=>式样号{0}", strSMPNo);
}
//最终价格
return Math.Round(g_price + p_price, 2);
}
/// <summary>
/// 获取检验费
/// </summary>
@ -3646,13 +3714,17 @@ namespace ibk.IPD
/// <returns></returns>
private static double getExperPrice(GP_PLATE plate, BP_ORDER_ITEM ORD_save)
{
double g_price = 78;//默认78元检验费部分取样没有检验费用
double g_price = 0;//默认78元检验费部分取样没有检验费用
double p_price = 0;
//取样价格
if (!string.IsNullOrEmpty(plate.SMP_NO))
{
List<data> data = doHttpPost(plate.SMP_NO);
////接口数据
//logger.InfoFormat("式样号:{0};订单号:{1}-{2}") ;
if (data.Count > 0)
{
foreach (var ds in data)
@ -3661,7 +3733,11 @@ namespace ibk.IPD
}
}
}
if (p_price == 0)
{
g_price = 78;
logger.InfoFormat("接口缺少价格=>式样号{0}", plate.SMP_NO);
}
//最终价格
return Math.Round(g_price + p_price, 2);
}

@ -24,6 +24,8 @@ using QP_STD_HEAD = ibk.IPD.Entity.IPD_PS.QP_STD_HEAD;
using System.Diagnostics;
using ibk.IPD.Service.IPD_SS;
using Confluent.Kafka;
using NPOI.SS.Formula.Functions;
using static NPOI.HSSF.Util.HSSFColor;
namespace ibk.IPD.Controller.IPD_PS
{
@ -421,6 +423,14 @@ namespace ibk.IPD.Controller.IPD_PS
if (queryArgs != null)
{
//生产厂
if (!string.IsNullOrWhiteSpace(queryArgs.PLT))
{
strSql.AppendLine(" AND sur.GP_PLT = '" + queryArgs.PLT + "'");
}
//不能有完全替代的钢板,余材替代应该全部替代
strSql.AppendLine(" AND sur.SUB_FULL = '" + "P" + "'");
if (!string.IsNullOrWhiteSpace(queryArgs.IS_FULL))
{
@ -491,6 +501,65 @@ namespace ibk.IPD.Controller.IPD_PS
dtCheck = db.Query(strSql.ToString());
//result.data = db.Query(strSql.ToString());
result.data = dtCheck;
StringBuilder strPlateNo = new StringBuilder();
for (int i = 0; i <= dtCheck.Rows.Count - 1; i++)
{
if (i==0)
{
strPlateNo.AppendLine("'" + dtCheck.Rows[i]["PLATE_NO"] + "'");
}
else
{
strPlateNo.AppendLine(",'" + dtCheck.Rows[i]["PLATE_NO"] + "'");
}
}
//剔除掉非余材的信息
if (strPlateNo.ToString().Length!=0)
{
StringBuilder strPlate = new StringBuilder();
strPlate.AppendLine(" SELECT* FROM NISCO.GP_PLATE gp WHERE 1=1");
strPlate.AppendLine("AND gp.ORD_FL = '1'");
strPlate.AppendLine(" AND gp.PLATE_NO IN( ");
strPlate.AppendLine(strPlateNo.ToString());
strPlate.AppendLine(") ");
using (IDbContext db_sur = ObjectContainer.GetObject<IDbContext>("db_sur"))
{
var dtPlate = db_sur.Query(strPlate.ToString());
foreach (DataRow row in dtCheck.Rows)
{
//24304312010201
if (row["PLATE_NO"].ToString() == "24303644030324")
{
}
var filteredRows = dtPlate.AsEnumerable().Where(p => p.Field<string>("PLATE_NO") == row["PLATE_NO"].ToString());
//var query = from DataRow row2 in dtPlate.Rows
// where row2["PLATE_NO"] == row["PLATE_NO"].ToString()
// select row2;
//if (query.Count()>0)
//{
// row.Delete();
//}
if (filteredRows.Count()>0)
{
row.Delete();
}
}
}
}
dtCheck.AcceptChanges();
if (dtCheck.Rows.Count > 0)
{
result.msg = "操作成功!";

@ -55,5 +55,8 @@ namespace ibk.IPD.Entity.IPD_PS.QueryArgs
//板坯号
public string SLAB_NO { get; set; }
//轧制工厂
public string PLT { get; set; }
}
}

Loading…
Cancel
Save