|
|
@ -422,7 +422,7 @@ func (impl *SerialOrderServiceImplement) ReplaceData(serialOrder *model.SerialOr |
|
|
|
serialOrderOp.CharPara9 = strings.Replace(serialOrderOp.CharPara9, "$serialNumber$", serialNumber, 1) |
|
|
|
serialOrderOp.CharPara10 = strings.Replace(serialOrderOp.CharPara10, "$serialNumber$", serialNumber, 1) |
|
|
|
if isPre { |
|
|
|
serialOrderOp.CharPara1 = strings.Replace(serialOrderOp.CharPara1, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara1 = strings.Replace(serialOrderOp.CharPara1, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara2 = strings.Replace(serialOrderOp.CharPara2, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara3 = strings.Replace(serialOrderOp.CharPara3, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara4 = strings.Replace(serialOrderOp.CharPara4, "$date$", day, 1) |
|
|
@ -430,8 +430,8 @@ func (impl *SerialOrderServiceImplement) ReplaceData(serialOrder *model.SerialOr |
|
|
|
serialOrderOp.CharPara6 = strings.Replace(serialOrderOp.CharPara6, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara7 = strings.Replace(serialOrderOp.CharPara7, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara8 = strings.Replace(serialOrderOp.CharPara8, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara9 = strings.Replace(serialOrderOp.CharPara9, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara10 = strings.Replace(serialOrderOp.CharPara10, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara9 = strings.Replace(serialOrderOp.CharPara9, "$date$", day, 1) |
|
|
|
serialOrderOp.CharPara10 = strings.Replace(serialOrderOp.CharPara10, "$date$", day, 1) |
|
|
|
} |
|
|
|
serialOrder.SerialOrderOPDetailLi[index] = serialOrderOp |
|
|
|
} |
|
|
@ -457,3 +457,58 @@ func (impl *SerialOrderServiceImplement) ReplaceData(serialOrder *model.SerialOr |
|
|
|
serialOrder.LabelDetailLi[index] = labelDetail |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//func (impl *Serial OrderServiceImplement) ExecuteCrossPlantTask(session *xorm.Session, task baseModel.CrossPlanTask, artId string) error {
|
|
|
|
// user := &global.User{
|
|
|
|
// PlantNr: task.ToPlantNr,
|
|
|
|
// UserId: "MultiPlantTask",
|
|
|
|
// }
|
|
|
|
// writeSerialOrderLi := make([]model.SerialOrder, 0)
|
|
|
|
// workLinePoDao := baseDal.NewWorkLineProcessLstDAO(session, user.PlantNr, user.UserId)
|
|
|
|
// productDao := meDal.NewProductDAO(session, user.PlantNr, user.UserId)
|
|
|
|
// workLineLi, err := workLinePoDao.Select([]grmi.Predicate{
|
|
|
|
// baseMeta.WorkLineProcessLst_PO.NewPredicate(grmi.Equal, task.LastPo),
|
|
|
|
// }, nil)
|
|
|
|
// if err != nil {
|
|
|
|
// return grmi.NewBusinessError("查询工序关联产线失败, 错误:" + err.Error())
|
|
|
|
// }
|
|
|
|
// if len(workLineLi) == 0 {
|
|
|
|
// return grmi.NewBusinessError("拆分工单指定末道序未关联产线, 末道序:" + task.LastPo)
|
|
|
|
// }
|
|
|
|
// if len(workLineLi) != 1 {
|
|
|
|
// return grmi.NewBusinessError("拆分工单指定末道序关联多条产线, 末道序:" + task.LastPo)
|
|
|
|
// }
|
|
|
|
// workLineId := workLineLi[0].WorkLineId
|
|
|
|
// product, err := productDao.SelectOne(artId, task.ProjectId)
|
|
|
|
// if err != nil {
|
|
|
|
// return grmi.NewBusinessError("查询总成失败, 错误:" + err.Error())
|
|
|
|
// }
|
|
|
|
// if product == nil {
|
|
|
|
// return grmi.NewBusinessError("总成不存在, 总成ID:" + artId)
|
|
|
|
// }
|
|
|
|
// serialOrderId := strings.Replace(artId, "-", "", -1) + "$date$" + "$serialNumber$"
|
|
|
|
// insertOrder := model.SerialOrder{
|
|
|
|
// SerialOrderId: serialOrderId,
|
|
|
|
// ArtId: artId,
|
|
|
|
// ProjectId: task.ProjectId,
|
|
|
|
// Descr: product.Descr,
|
|
|
|
// PreSchedKey: 0,
|
|
|
|
// SchedKey: 0,
|
|
|
|
// Priority: 0,
|
|
|
|
// OrderType: baseModel.ORDER_TYPE_PRE,
|
|
|
|
// PlanResourceId: workLineId,
|
|
|
|
// UsedResourceId: workLineId,
|
|
|
|
// PlanQty: 1,
|
|
|
|
// PickingFlag: product.PickingFlag,
|
|
|
|
// }
|
|
|
|
// insertOrder.SerialOrderStatus = model.SerialOrderStatus{
|
|
|
|
// SerialOrderId: serialOrderId,
|
|
|
|
// Status: baseModel.WO_STATUS_RELEASED,
|
|
|
|
// }
|
|
|
|
// writeSerialOrderLi = append(writeSerialOrderLi, insertOrder)
|
|
|
|
// err = impl.GenerateProductCraft(user, session, &insertOrder)
|
|
|
|
// if err != nil {
|
|
|
|
// return grmi.NewBusinessError("生成工单工艺数据失败, 错误:" + err.Error())
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//}
|