|
|
@@ -221,6 +221,12 @@ class Facility extends Api
|
|
|
$machine = $params['machine'];
|
|
|
$machineCode = \db('dic_lzde')->where('适用机型',$machine)->value('sys_bh');
|
|
|
$data = \db('设备_产量采集')->where('设备编号',$machine)->order('UniqId desc')->find();
|
|
|
+ if (empty($data)){
|
|
|
+ $this->success('未找到生产订单');
|
|
|
+ }
|
|
|
+ if (rtrim($data['工单编号']) === '' || rtrim($data['工单编号']) === null ){
|
|
|
+ $this->success('未找到生产订单');
|
|
|
+ }
|
|
|
$endTime = \db('工单_工艺资料')
|
|
|
->where('Gy0_gdbh',$data['工单编号'])
|
|
|
->where('Gy0_gxh',$data['工序号'])
|
|
|
@@ -316,15 +322,13 @@ class Facility extends Api
|
|
|
rtrim(b.Gy0_最早开工时间) AS 最早开工时间
|
|
|
FROM
|
|
|
`工单_基本资料` AS a
|
|
|
- JOIN `工单_工艺资料` AS b ON a.Gd_gdbh = b.Gy0_gdbh
|
|
|
- JOIN `产品_基本资料` AS c ON a.`成品代号` = c.`产品编号`
|
|
|
+ JOIN `工单_工艺资料` AS b ON a.Gd_gdbh = b.Gy0_gdbh
|
|
|
JOIN `工单_印件资料` AS d ON a.Gd_gdbh = d.Yj_Gdbh
|
|
|
LEFT JOIN `设备_产量计酬` AS e ON e.sczl_gdbh = a.Gd_gdbh AND e.sczl_jtbh = b.Gy0_sbbh
|
|
|
WHERE
|
|
|
a.gd_statu = '2-生产中'
|
|
|
AND a.`行号` = '1'
|
|
|
AND b.Gy0_sbbh = '{$machine}'
|
|
|
- AND c.`状态` = ''
|
|
|
AND b.PD_WG = '1900-01-01 00:00:00'
|
|
|
AND b.Gy0_sj1 <> '1900-01-01 00:00:00'
|
|
|
GROUP BY a.Gd_gdbh
|
|
|
@@ -474,7 +478,7 @@ class Facility extends Api
|
|
|
$where = [
|
|
|
'sczl_gdbh' => $workOrder,
|
|
|
'sczl_jtbh' => $machine,
|
|
|
- 'sczl_cl' => ['<>',0.0],
|
|
|
+// 'sczl_cl' => ['<>',0.0],
|
|
|
'sczl_bzdh' => $team,
|
|
|
];
|
|
|
$field = 'rtrim(sczl_gdbh) as 工单编号,rtrim(sczl_yjno) as yjno,rtrim(sczl_gxmc) as gxmc,rtrim(sczl_num) as 标牌号,rtrim(sczl_cl) as 产量,
|
|
|
@@ -1110,7 +1114,9 @@ class Facility extends Api
|
|
|
WHERE
|
|
|
a.`使用部门` = '{$workshop}'
|
|
|
GROUP BY
|
|
|
- a.`设备编号`";
|
|
|
+ a.`设备编号`
|
|
|
+ ORDER BY
|
|
|
+ a.UniqId";
|
|
|
$list = \db()->query($sql);
|
|
|
foreach ($list as $key=>$value){
|
|
|
if ($value['状态'] == ''){
|
|
|
@@ -1504,9 +1510,12 @@ class Facility extends Api
|
|
|
$this->error('非法请求');
|
|
|
}
|
|
|
$params = Request::instance()->post();
|
|
|
- if (!isset($params['machine']) || empty($params['machine'])) {
|
|
|
+ if (!isset($params['machine']) || empty($params['machine'] )) {
|
|
|
$this->error('参数不能为空');
|
|
|
}
|
|
|
+ if (empty($params['team_id']) || empty($params['sczl_bzdh'])){
|
|
|
+ $this->error('请先选择班组成员');
|
|
|
+ }
|
|
|
$machine = $params['machine'] . '#';
|
|
|
$data = [];
|
|
|
$lastData = \db('设备_产量采集')
|