varobj=_connection.QueryFirstOrDefault<Models.dc_auto_uprush_config>("select * from dc_auto_uprush_config where id="+m.id);
varobj=_connection.QueryFirstOrDefault<Models.dc_auto_uprush_config>("select * from dc_auto_uprush_config where id="+m.id);
if(obj==null)
if(obj==null)
{
{
...
@@ -1380,16 +1384,30 @@ and start_date<=@end_date and end_date>=@start_date
...
@@ -1380,16 +1384,30 @@ and start_date<=@end_date and end_date>=@start_date
obj.id=m.id;
obj.id=m.id;
obj.warehouse_code=m.warehouse_code;
obj.warehouse_code=m.warehouse_code;
obj.percentage=m.percentage;
obj.percentage=m.percentage;
obj.hq_type=m.hq_type;
// 检查该数据是否有存在
if(!string.IsNullOrWhiteSpace(m.warehouse_code))
{
varoldData=_connection.QueryFirstOrDefault(" select * from dc_auto_uprush_config where warehouse_code=@warehouse_code and id!=@id ",new{m.warehouse_code,m.id});
if(oldData!=null)
{
return$" 仓库:【{m.warehouse_code}】已经配置过了 ";
}
}
// 检查该数据是否有存在
// 检查该数据是否有存在
varoldData=_connection.QueryFirstOrDefault(" select * from dc_auto_uprush_config where warehouse_code=@warehouse_code and id!=@id ",new{m.warehouse_code,m.id});
if(!string.IsNullOrWhiteSpace(m.hq_type))
if(oldData!=null)
{
{
return$" 仓库:【{m.warehouse_code}】已经配置过了 ";
varoldData=_connection.QueryFirstOrDefault(" select * from dc_auto_uprush_config where hq_type=@hq_type and id!=@id ",new{m.hq_type,m.id});