This commit is contained in:
余宇波 2025-04-28 15:44:41 +08:00
parent 9b50bb7a59
commit b64bbdc582
3 changed files with 22 additions and 5 deletions

View File

@ -229,9 +229,21 @@ namespace MyCode.Project.OutSideService.Implementation
public string AddTiaoMa(string json) public string AddTiaoMa(string json)
{ {
List<AddTiaoMa> list = JsonHelper.ToObject<List<AddTiaoMa>>(json); List<AddTiaoMa> list = JsonHelper.ToObject<List<AddTiaoMa>>(json);
List<string> barcodeList = new List<string>();
List<AddTiaoMa> senList = new List<AddTiaoMa>();
list.ForEach(t =>
{
if (!barcodeList.Contains(t.FBarCode))
{
t.FBarCodeRule = "01";
senList.Add(t);
barcodeList.Add(t.FBarCode);
}
});
AddTiaoMaConfig addconfig = new AddTiaoMaConfig(); AddTiaoMaConfig addconfig = new AddTiaoMaConfig();
addconfig.Key = "qwe123!@#"; addconfig.Key = "qwe123!@#";
addconfig.Items = list; addconfig.Items = senList;
WebUtils webUtils = new WebUtils(); WebUtils webUtils = new WebUtils();
string json2 = JsonHelper.ToJson(addconfig); string json2 = JsonHelper.ToJson(addconfig);
string ServerUrl = ConfigurationManager.AppSettings.Get("TiaoMaUrl"); string ServerUrl = ConfigurationManager.AppSettings.Get("TiaoMaUrl");

View File

@ -4,7 +4,7 @@
<job name="EveryOtherJob" desc="每60秒执行调度" enabled="true" type="MyCode.Project.ScheduleTask.Jobs.EveryOtherJob,MyCode.Project.ScheduleTask" CronExpression="0 */1 * * * ?" /> <job name="EveryOtherJob" desc="每60秒执行调度" enabled="true" type="MyCode.Project.ScheduleTask.Jobs.EveryOtherJob,MyCode.Project.ScheduleTask" CronExpression="0 */1 * * * ?" />
<job name="EveryFiveMinuteJob" desc="10分钟抓取一次金蝶的采购订单" enabled="true" type="MyCode.Project.ScheduleTask.Jobs.EveryFiveMinuteJob,MyCode.Project.ScheduleTask" CronExpression="*/5 */1 * * * ?" /> <job name="EveryFiveMinuteJob" desc="30分钟抓取一次金蝶的采购订单" enabled="true" type="MyCode.Project.ScheduleTask.Jobs.EveryFiveMinuteJob,MyCode.Project.ScheduleTask" CronExpression="0 */30 * * * ?" />
</Jobs> </Jobs>

View File

@ -274,7 +274,8 @@ namespace MyCode.Project.Services.Implementation
} }
if(addList.Count==0) var allBarcodeList = _tiaoMaRepository.Queryable().Where(t => t.FBillNo == order.FBillNo).Select(t => t.FBarCode).ToList().Distinct().ToList();
if (addList.Count==0)
{ {
_tiaoMaRepository.Delete(t=>t.InvoceOrderItemId== orderItem.Id); _tiaoMaRepository.Delete(t=>t.InvoceOrderItemId== orderItem.Id);
orderItem.CuseQty = act.CuseQty; orderItem.CuseQty = act.CuseQty;
@ -325,10 +326,12 @@ namespace MyCode.Project.Services.Implementation
} }
List<AddTiaoMa> addTiaoMas = new List<AddTiaoMa>(); List<AddTiaoMa> addTiaoMas = new List<AddTiaoMa>();
addTiaoMas = addList.Select(t => new AddTiaoMa var addList2 = addList.Where(t => !allBarcodeList.Contains(t.FBarCode)).ToList();
addTiaoMas = addList2.Select(t => new AddTiaoMa
{ {
FBarCode = t.FBarCode, FBarCode = t.FBarCode,
FBarCodeRule = "03", FBarCodeRule = "01",
FBillCode = t.FBillNo, FBillCode = t.FBillNo,
FSupplierLot = t.FSupplierLot == null ? "" : t.FSupplierLot, FSupplierLot = t.FSupplierLot == null ? "" : t.FSupplierLot,
FMaterialId = t.MaterialCode, FMaterialId = t.MaterialCode,
@ -337,6 +340,8 @@ namespace MyCode.Project.Services.Implementation
}).ToList(); }).ToList();
_workProcessService.Add<IKingDeeService>(this.MerchantId, "AddTiaoMa", "生成条码档案", JsonHelper.ToJson(addTiaoMas), 5); _workProcessService.Add<IKingDeeService>(this.MerchantId, "AddTiaoMa", "生成条码档案", JsonHelper.ToJson(addTiaoMas), 5);
} }
TiaoMaResp result = new TiaoMaResp(); TiaoMaResp result = new TiaoMaResp();
result.Id = orderItem.Id; result.Id = orderItem.Id;
result.BarCodeList = addList; result.BarCodeList = addList;