/// <summary>
        /// 提交
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <MessageModel <AgitationSubmitParam> > Submit(AgitationSubmitParam model)
        {
            MessageModel <AgitationSubmitParam> message = new MessageModel <AgitationSubmitParam>();

            try
            {
                model.stir_sum = Math.Round(Convert.ToDouble(model.stir_sum), 1).ToString();
                await _dal.InsertSubmit(model);

                await _dal.wip_QTY(model);

                await _dal.InserGroup(model);

                await _dal.UpdatePackageState(model);

                message.success  = true;
                message.msg      = "添加成功";
                message.response = model;
            }
            catch (Exception ex)
            {
                message.success = false;
                message.msg     = "添加失败-" + ex;
            }
            return(message);
        }
Beispiel #2
0
        /// <summary>
        /// 更新t_CO_package状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <bool> UpdatePackageState(AgitationSubmitParam model)
        {
            string strAdd = string.Format(@" update t_co_package m
set    m.stutas = '10', m.shift_anode = nvl(m.shift_anode, 0) + 1
where  m.package_id = '{0}'
and    (m.stutas < 12 or m.stutas = '10')
", model.packagenumber);

            return(await base.ExecuteCommand(strAdd, new { }) > 0);
        }
Beispiel #3
0
        /// <summary>
        /// 记录组别
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <bool> InserGroup(AgitationSubmitParam model)
        {
            string strAdd = string.Format(@" insert into t_mes_groupname_info
   (group_name_id, group_name, barcode, mo, processes,create_user)
 values
   (SEQ_GROUPNAME_ID.nextval, '{0}', '{1}', '{2}', '{3}', '{4}')
", model.groupName, model.shipment_no, model.moNumber, model.productType, model.USER_NAME);

            return(await base.ExecuteCommand(strAdd, new { }) > 0);
        }
Beispiel #4
0
        public async Task <bool> wip_QTY(AgitationSubmitParam model)
        {
            //添加
            string strAddUpdate = "";

            strAddUpdate = string.Format(@"insert into T_MES_WIP_QTY
  (STATION_NAME, MO_NUMBER, SHIPT_NO,QTY_INPUT, START_DATE)
values
  ('{0}', '{1}', '{2}', '{3}',sysdate) ", model.device_sn, model.moNumber, model.shipment_no, model.input_sum);

            return(await base.ExecuteCommand(strAddUpdate, new { }) > 0);
        }
Beispiel #5
0
        /// <summary>
        /// 搅拌提交信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <bool> InsertSubmit(AgitationSubmitParam model)
        {
            string strAdd = string.Format(@"insert into T_MES_MACHINE_USEINFO
  (technology,
   group_name,
   shipment_no,
   formula_no,
   requirement,
   input_sum,
   stir_sum,
   device_no,
   add_date,
TYPE_NAME,
USER_NAME,
Engineer,current_steps,package_id)
values
  ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}',sysdate,'{8}','{9}','{10}','{11}','{12}')", model.moNumber, model.groupName, model.shipment_no, model.Formula, model.requirement, model.input_sum, model.stir_sum, model.device_sn, model.A_Type, model.USER_NAME, model.engineer, model.productType, model.packagenumber);

            return(await base.ExecuteCommand(strAdd, new { }) > 0);
        }
 public async Task <MessageModel <AgitationSubmitParam> > Submit(AgitationSubmitParam jsondata)
 {
     return(await _agitationServices.Submit(jsondata));
 }