|
@@ -36,14 +36,15 @@ class Manufacture extends Api
|
|
|
rtrim(Gd_客户代号) as 客户编号,rtrim(Gd_desc) as 备注,rtrim(客户料号) as 客户料号,rtrim(Sys_id) as 创建用户,rtrim(Sys_rq) as 创建时间,
|
|
rtrim(Gd_客户代号) as 客户编号,rtrim(Gd_desc) as 备注,rtrim(客户料号) as 客户料号,rtrim(Sys_id) as 创建用户,rtrim(Sys_rq) as 创建时间,
|
|
|
rtrim(Mod_rq) as 修改时间,rtrim(Uniqid) as UNIQID,rtrim(投料率) as 投料率,rtrim(销售订单号) as 销售订单号';
|
|
rtrim(Mod_rq) as 修改时间,rtrim(Uniqid) as UNIQID,rtrim(投料率) as 投料率,rtrim(销售订单号) as 销售订单号';
|
|
|
$list = Db::table('工单_基本资料')->where($where)->field($field)->select();
|
|
$list = Db::table('工单_基本资料')->where($where)->field($field)->select();
|
|
|
- if ($list){
|
|
|
|
|
- foreach ($list as $key=>$value){
|
|
|
|
|
|
|
+ if (empty($list)){
|
|
|
|
|
+ $this->error('失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ foreach ($list as $key=>$value){
|
|
|
// $cateGory = Db::table('产品_基本资料')->where('产品编号',$value['产品代号'])->find();
|
|
// $cateGory = Db::table('产品_基本资料')->where('产品编号',$value['产品代号'])->find();
|
|
|
// $list[$key]['产品类别'] = $cateGory['产品类别'];
|
|
// $list[$key]['产品类别'] = $cateGory['产品类别'];
|
|
|
- $list[$key]['订单数量'] = rtrim((float)$value['订单数量']);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $list[$key]['订单数量'] = rtrim((float)$value['订单数量']);
|
|
|
}
|
|
}
|
|
|
- return json(['code'=>1,'msg'=>'成功','total'=>count($list),'data'=>$list]);
|
|
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -71,23 +72,24 @@ class Manufacture extends Api
|
|
|
rtrim(Gy0_sbbh) as 机组,rtrim(Gy0_小时产能) as 小时产能,rtrim(Gy0_生产工时) as 生产工时,rtrim(Gy0_辅助工时) as 辅助工时,
|
|
rtrim(Gy0_sbbh) as 机组,rtrim(Gy0_小时产能) as 小时产能,rtrim(Gy0_生产工时) as 生产工时,rtrim(Gy0_辅助工时) as 辅助工时,
|
|
|
rtrim(印刷方式) as 印刷方式,rtrim(版距) as 版距,rtrim(Sys_id) as 创建用户,rtrim(Sys_rq) as 创建时间,rtrim(Mod_rq) as 修改时间,rtrim(UniqId) as UNIQID';
|
|
rtrim(印刷方式) as 印刷方式,rtrim(版距) as 版距,rtrim(Sys_id) as 创建用户,rtrim(Sys_rq) as 创建时间,rtrim(Mod_rq) as 修改时间,rtrim(UniqId) as UNIQID';
|
|
|
$list = Db::table('工单_工艺资料')->where($where)->field($filed)->select();
|
|
$list = Db::table('工单_工艺资料')->where($where)->field($filed)->select();
|
|
|
- if ($list){
|
|
|
|
|
- foreach ($list as $key=>$value){
|
|
|
|
|
- if ((int)$value['Gy0_yjno'] <10){
|
|
|
|
|
- $value['Gy0_yjno'] = '0'.rtrim($value['Gy0_yjno']);
|
|
|
|
|
- }
|
|
|
|
|
- if ((int)$value['Gy0_gxh'] <10){
|
|
|
|
|
- $value['Gy0_gxh'] = '0'.rtrim($value['Gy0_gxh']);
|
|
|
|
|
- }
|
|
|
|
|
- if (rtrim($value['Add_gxmc']) == ''){
|
|
|
|
|
- $list[$key]['印件工序及名称'] = $value['Gy0_yjno'].'-'.$value['Gy0_gxh'].'-->'.rtrim($value['Gy0_gxmc']);
|
|
|
|
|
- }else{
|
|
|
|
|
- $list[$key]['印件工序及名称'] = $value['Gy0_yjno'].'-'.$value['Gy0_gxh'].'-->'.rtrim($value['Gy0_gxmc']).'【'.rtrim($value['Add_gxmc']).'】';
|
|
|
|
|
- }
|
|
|
|
|
- unset($list[$key]['Gy0_yjno'],$list[$key]['Gy0_gxh'],$list[$key]['Gy0_gxmc'],$list[$key]['Add_gxmc']);
|
|
|
|
|
|
|
+ if (empty($list)){
|
|
|
|
|
+ $this->error('失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ foreach ($list as $key=>$value){
|
|
|
|
|
+ if ((int)$value['Gy0_yjno'] <10){
|
|
|
|
|
+ $value['Gy0_yjno'] = '0'.rtrim($value['Gy0_yjno']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ((int)$value['Gy0_gxh'] <10){
|
|
|
|
|
+ $value['Gy0_gxh'] = '0'.rtrim($value['Gy0_gxh']);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (rtrim($value['Add_gxmc']) == ''){
|
|
|
|
|
+ $list[$key]['印件工序及名称'] = $value['Gy0_yjno'].'-'.$value['Gy0_gxh'].'-->'.rtrim($value['Gy0_gxmc']);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $list[$key]['印件工序及名称'] = $value['Gy0_yjno'].'-'.$value['Gy0_gxh'].'-->'.rtrim($value['Gy0_gxmc']).'【'.rtrim($value['Add_gxmc']).'】';
|
|
|
|
|
+ }
|
|
|
|
|
+ unset($list[$key]['Gy0_yjno'],$list[$key]['Gy0_gxh'],$list[$key]['Gy0_gxmc'],$list[$key]['Add_gxmc']);
|
|
|
}
|
|
}
|
|
|
- return json(['code'=>1,'msg'=>'成功','total'=>count($list),'data'=>$list]);
|
|
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -118,12 +120,13 @@ class Manufacture extends Api
|
|
|
rtrim(Sys_rq) as 创建时间,rtrim(Mod_rq) as 修改时间,rtrim(Uniqid) as UNIQID';
|
|
rtrim(Sys_rq) as 创建时间,rtrim(Mod_rq) as 修改时间,rtrim(Uniqid) as UNIQID';
|
|
|
$list = Db::table('工单_印件资料')->where($where)->field($field)->select();
|
|
$list = Db::table('工单_印件资料')->where($where)->field($field)->select();
|
|
|
if ($list){
|
|
if ($list){
|
|
|
- foreach ($list as $key=>$value){
|
|
|
|
|
- $list[$key]['成品数量'] = rtrim((float)$value['成品数量']);
|
|
|
|
|
- $list[$key]['实际投料'] = rtrim((float)$value['实际投料']);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $this->error('失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ foreach ($list as $key=>$value){
|
|
|
|
|
+ $list[$key]['成品数量'] = rtrim((float)$value['成品数量']);
|
|
|
|
|
+ $list[$key]['实际投料'] = rtrim((float)$value['实际投料']);
|
|
|
}
|
|
}
|
|
|
- return json(['code'=>1,'msg'=>'成功','total'=>count($list),'data'=>$list]);
|
|
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -141,12 +144,19 @@ class Manufacture extends Api
|
|
|
rtrim(交货日期) as 交货日期,rtrim(订单数量) as 订单数量,rtrim(计量单位) as 计量单位,rtrim(销售订单号) as 销售订单号,rtrim(Gd_客户代号) as 客户编号,
|
|
rtrim(交货日期) as 交货日期,rtrim(订单数量) as 订单数量,rtrim(计量单位) as 计量单位,rtrim(销售订单号) as 销售订单号,rtrim(Gd_客户代号) as 客户编号,
|
|
|
rtrim(Gd_客户名称) as 客户名称,rtrim(客户料号) as 客户料号,rtrim(Uniqid) as GDUID';
|
|
rtrim(Gd_客户名称) as 客户名称,rtrim(客户料号) as 客户料号,rtrim(Uniqid) as GDUID';
|
|
|
$list = Db::table('工单_基本资料')->where($where)->field($field)->select();
|
|
$list = Db::table('工单_基本资料')->where($where)->field($field)->select();
|
|
|
- return json(['code'=>1,'msg'=>'成功','data'=>$list]);
|
|
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 排程中/制程中工单->工序列表
|
|
* 排程中/制程中工单->工序列表
|
|
|
|
|
+ * @ApiMethod (GET)
|
|
|
|
|
+ * @param string $Gd_gdbh 工单编号
|
|
|
|
|
+ * @return \think\response\Json
|
|
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
|
|
+ * @throws \think\exception\DbException
|
|
|
*/
|
|
*/
|
|
|
|
|
+
|
|
|
public function ScheduleProcess()
|
|
public function ScheduleProcess()
|
|
|
{
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
if ($this->request->isGet() === false){
|
|
@@ -158,6 +168,7 @@ class Manufacture extends Api
|
|
|
}
|
|
}
|
|
|
$where = [
|
|
$where = [
|
|
|
'Gy0_gdbh' => $Gd_gdbh,
|
|
'Gy0_gdbh' => $Gd_gdbh,
|
|
|
|
|
+ 'Gy0_sbbh' =>['neq',''],
|
|
|
];
|
|
];
|
|
|
$field = 'rtrim(Gy0_gdbh) as 工单编号,Gy0_yjno,Gy0_gxh,Gy0_gxmc,Add_gxmc,rtrim(Gy0_sbbh) as 设备编号,rtrim(Gy0_小时产能) as 小时产能,
|
|
$field = 'rtrim(Gy0_gdbh) as 工单编号,Gy0_yjno,Gy0_gxh,Gy0_gxmc,Add_gxmc,rtrim(Gy0_sbbh) as 设备编号,rtrim(Gy0_小时产能) as 小时产能,
|
|
|
rtrim(工价系数) as 产能系数,rtrim(Gy0_生产工时) as 生产工时,rtrim(Gy0_辅助工时) as 辅助工时,rtrim(Gy0_最早开工时间) as 最早开工时间,
|
|
rtrim(工价系数) as 产能系数,rtrim(Gy0_生产工时) as 生产工时,rtrim(Gy0_辅助工时) as 辅助工时,rtrim(Gy0_最早开工时间) as 最早开工时间,
|
|
@@ -181,13 +192,14 @@ class Manufacture extends Api
|
|
|
}
|
|
}
|
|
|
unset($list[$key]['Gy0_yjno'],$list[$key]['Gy0_gxh'],$list[$key]['Gy0_gxmc'],$list[$key]['Add_gxmc']);
|
|
unset($list[$key]['Gy0_yjno'],$list[$key]['Gy0_gxh'],$list[$key]['Gy0_gxmc'],$list[$key]['Add_gxmc']);
|
|
|
$list[$key]['机组'] = $value['设备编号'];
|
|
$list[$key]['机组'] = $value['设备编号'];
|
|
|
- $list[$key]['工序产量'] = Db::table('工单_基本资料')->where('Gd_gdbh',$list[$key]['工单编号'])->field('rtrim(计划投料) as 计划投料')->find();
|
|
|
|
|
-// $end = Db::table('设备_产量计酬')->where('sczl_gdbh',$value['工单编号'])->where('sczl_jtbh',$value['设备编号'])
|
|
|
|
|
-// ->field('SUM(sczl_cl)')->select();
|
|
|
|
|
-// $list[$key]['已完成产量'] = $end;
|
|
|
|
|
-// $list[$key]['剩余产量'] = (int)$list[$key]['工序产量']-(int)$list[$key]['已完成产量'];
|
|
|
|
|
|
|
+ $orderDetail = Db::table('工单_基本资料')->where('Gd_gdbh',$list[$key]['工单编号'])->field('rtrim(计划投料) as 计划投料')->find();
|
|
|
|
|
+ $list[$key]['工序产量'] = $orderDetail['计划投料'];
|
|
|
|
|
+ $end = Db::table('设备_产量计酬')->where('sczl_gdbh',$value['工单编号'])->where('sczl_jtbh',$value['设备编号'])
|
|
|
|
|
+ ->field('SUM(sczl_cl) as 已完成产量')->select();
|
|
|
|
|
+ $list[$key]['已完成产量'] = (int)$end[0]['已完成产量'];
|
|
|
|
|
+ $list[$key]['剩余产量'] = (int)$list[$key]['工序产量']-(int)$list[$key]['已完成产量'];
|
|
|
}
|
|
}
|
|
|
- return json(['data'=>$list]);
|
|
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
|
* 排单页面左侧车间和机台菜单
|
|
* 排单页面左侧车间和机台菜单
|
|
@@ -204,21 +216,22 @@ class Manufacture extends Api
|
|
|
}
|
|
}
|
|
|
$data = [];
|
|
$data = [];
|
|
|
$department = Db::table('设备_基本资料')->distinct(true)->column('使用部门');
|
|
$department = Db::table('设备_基本资料')->distinct(true)->column('使用部门');
|
|
|
- if ($department){
|
|
|
|
|
- foreach ($department as $value){
|
|
|
|
|
- if (rtrim($value) !== '研发中心'){
|
|
|
|
|
- $benchClass = Db::table('设备_基本资料')->where('使用部门',$value)->distinct(true)->column('设备编组');
|
|
|
|
|
- foreach ($benchClass as $v){
|
|
|
|
|
- if (rtrim($v) !== ''){
|
|
|
|
|
- $machine = Db::table('设备_基本资料')->where('使用部门',$value)->where('设备编组',$v)->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
|
|
|
|
|
- foreach ($machine as $kk=>$vv){
|
|
|
|
|
- $data[rtrim($value)][rtrim($v)][$kk] = $vv['设备编号'].'-->'.$vv['设备名称'];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (empty($department)){
|
|
|
|
|
+ $this->error('为获取到机台数据');
|
|
|
|
|
+ }
|
|
|
|
|
+ foreach ($department as $value){
|
|
|
|
|
+ if (rtrim($value) !== '研发中心'){
|
|
|
|
|
+ $benchClass = Db::table('设备_基本资料')->where('使用部门',$value)->distinct(true)->column('设备编组');
|
|
|
|
|
+ foreach ($benchClass as $v){
|
|
|
|
|
+ if (rtrim($v) !== ''){
|
|
|
|
|
+ $machine = Db::table('设备_基本资料')->where('使用部门',$value)->where('设备编组',$v)->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
|
|
|
|
|
+ foreach ($machine as $kk=>$vv){
|
|
|
|
|
+ $data[rtrim($value)][rtrim($v)][$kk] = $vv['设备编号'].'-->'.$vv['设备名称'];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return json(['code'=>1,'msg'=>'成功','data'=>$data]);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ $this->success('成功',$data);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|