|
@@ -58,34 +58,34 @@ namespace EInk.Controllers
|
|
|
content = Lot3Data,
|
|
|
create_time = DateTime.Now
|
|
|
};
|
|
|
- //校验是否有id重复的数据
|
|
|
+ //根据guid查看是否为重复插入
|
|
|
if (_db.Ado.GetInt(string.Format("select count(*) from lot2lot3_info where lot_id='{0}'", lot3Dto.id)) > 0)
|
|
|
{
|
|
|
lot3model.is_send = 3;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //校验是否有片号重复的数据
|
|
|
- List<Lot2Lot3Model> lot_list = _db.Queryable<Lot2Lot3Model>().Where(x => x.product_no == lot3Dto.slidesNumber).OrderByDescending(x => x.id).ToList();
|
|
|
- if (lot_list.Count > 0)
|
|
|
- {
|
|
|
- Lot2Lot3Dto lot3Dto_db = JsonConvert.DeserializeObject<Lot2Lot3Dto>(lot_list[0].content);
|
|
|
- if (Convert.ToDateTime(lot3Dto.createTime) > Convert.ToDateTime(lot3Dto_db.createTime))
|
|
|
- {
|
|
|
- if (lot3Dto_db.result == "NG") lot3Dto.result = "NG";
|
|
|
- foreach (var item in lot3Dto.itemCheckDatas)
|
|
|
- {
|
|
|
- lot3Dto_db.itemCheckDatas.Add(item);
|
|
|
- }
|
|
|
- lot3Dto.itemCheckDatas = lot3Dto_db.itemCheckDatas;
|
|
|
- lot3model.content = JsonConvert.SerializeObject(lot3Dto);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- lot3model.is_send = 3;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // //校验是否有片号重复的数据
|
|
|
+ // List<Lot2Lot3Model> lot_list = _db.Queryable<Lot2Lot3Model>().Where(x => x.product_no == lot3Dto.slidesNumber).OrderByDescending(x => x.id).ToList();
|
|
|
+ // if (lot_list.Count > 0)
|
|
|
+ // {
|
|
|
+ // Lot2Lot3Dto lot3Dto_db = JsonConvert.DeserializeObject<Lot2Lot3Dto>(lot_list[0].content);
|
|
|
+ // if (Convert.ToDateTime(lot3Dto.createTime) > Convert.ToDateTime(lot3Dto_db.createTime))
|
|
|
+ // {
|
|
|
+ // if (lot3Dto_db.result == "NG") lot3Dto.result = "NG";
|
|
|
+ // foreach (var item in lot3Dto.itemCheckDatas)
|
|
|
+ // {
|
|
|
+ // lot3Dto_db.itemCheckDatas.Add(item);
|
|
|
+ // }
|
|
|
+ // lot3Dto.itemCheckDatas = lot3Dto_db.itemCheckDatas;
|
|
|
+ // lot3model.content = JsonConvert.SerializeObject(lot3Dto);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // lot3model.is_send = 3;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
_db.Insertable(lot3model).ExecuteCommand();
|
|
|
return Ok(ResultDto.Success());
|
|
|
}
|
|
@@ -124,24 +124,30 @@ namespace EInk.Controllers
|
|
|
};
|
|
|
ColourCastModel colourcastmodel = new()
|
|
|
{
|
|
|
+ gid = colourcastDto.id,
|
|
|
slidesNumber = colourcastDto.slidesNumber,
|
|
|
is_send = 0,
|
|
|
content = ColourCastData,
|
|
|
create_time = DateTime.Now
|
|
|
};
|
|
|
- List<ColourCastModel> colourcast_list = _db.Queryable<ColourCastModel>().Where(x => x.slidesNumber == colourcastDto.slidesNumber).OrderByDescending(x => x.id).ToList();
|
|
|
- if (colourcast_list.Count > 0)
|
|
|
+ //根据guid查看是否为重复插入
|
|
|
+ if (_db.Ado.GetInt(string.Format("select count(*) from colourcast_info where gid='{0}'", colourcastDto.id)) > 0)
|
|
|
{
|
|
|
- ColourCastDto colourcastDto_db = JsonConvert.DeserializeObject<ColourCastDto>(colourcast_list[0].content);
|
|
|
- if (Convert.ToDateTime(colourcastDto.createTime) > Convert.ToDateTime(colourcastDto_db.createTime))
|
|
|
- {
|
|
|
- colourcastmodel.is_send = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- colourcastmodel.is_send = 3;
|
|
|
- }
|
|
|
+ colourcastmodel.is_send = 3;
|
|
|
}
|
|
|
+ //List<ColourCastModel> colourcast_list = _db.Queryable<ColourCastModel>().Where(x => x.slidesNumber == colourcastDto.slidesNumber).OrderByDescending(x => x.id).ToList();
|
|
|
+ //if (colourcast_list.Count > 0)
|
|
|
+ //{
|
|
|
+ // ColourCastDto colourcastDto_db = JsonConvert.DeserializeObject<ColourCastDto>(colourcast_list[0].content);
|
|
|
+ // if (Convert.ToDateTime(colourcastDto.createTime) > Convert.ToDateTime(colourcastDto_db.createTime))
|
|
|
+ // {
|
|
|
+ // colourcastmodel.is_send = 0;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // colourcastmodel.is_send = 3;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
_db.Insertable(colourcastmodel).ExecuteCommand();
|
|
|
return Ok(ResultDto.Success());
|
|
|
}
|