|
|
@@ -26,7 +26,7 @@ class ProductionLot extends Api
|
|
|
public function GetOrderList()
|
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
$param = $this->request->param();
|
|
|
// $where = [
|
|
|
@@ -61,11 +61,11 @@ class ProductionLot extends Api
|
|
|
public function GetList()
|
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
|
- $this->error('参数错误');
|
|
|
+ $this->success('参数错误');
|
|
|
}
|
|
|
$param = $this->request->param();
|
|
|
if (empty($param) || isset($param['gdbh']) === false || isset($param['yjno']) === false){
|
|
|
- $this->error('参数错误');
|
|
|
+ $this->success('参数错误');
|
|
|
}
|
|
|
$list = db('设备_产量计酬')
|
|
|
->field('DISTINCT(sczl_num) as num')
|
|
|
@@ -79,11 +79,6 @@ class ProductionLot extends Api
|
|
|
foreach ($list as $key => $value){
|
|
|
$list[$key]['流程单'] = '第'.$value['num'].'个流程单';
|
|
|
}
|
|
|
-// $cpmc = db('工单_基本资料')
|
|
|
-// ->where('Gd_gdbh',$param['gdbh'])
|
|
|
-// ->where('行号',$param['yjno'])
|
|
|
-// ->column('Gd_cpmc')[0];
|
|
|
-// $data[$param['gdbh'].'-'.$cpmc]['印件'.$param['yjno']] = $list;
|
|
|
$this->success('成功',$list);
|
|
|
}
|
|
|
|
|
|
@@ -97,11 +92,11 @@ class ProductionLot extends Api
|
|
|
public function GetOrderDetail()
|
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
$param = $this->request->param();
|
|
|
if (empty($param) || isset($param['gdbh']) === false || isset($param['yjno']) === false){
|
|
|
- $this->error('参数错误');
|
|
|
+ $this->success('参数错误');
|
|
|
}
|
|
|
$list = db('工单_基本资料')
|
|
|
->field('Gd_gdbh,Gd_cpdh,Gd_cpmc,订单数量,实际投料,计量单位,投料率')
|
|
|
@@ -125,11 +120,11 @@ class ProductionLot extends Api
|
|
|
public function ProcessList()
|
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
$param = $this->request->param();
|
|
|
if (!isset($param['gdbh']) || !isset($param['yjno']) || !isset($param['num'])){
|
|
|
- $this->error('参数错误');
|
|
|
+ $this->success('参数错误');
|
|
|
}
|
|
|
$query= db('设备_产量计酬')
|
|
|
->alias('a')
|
|
|
@@ -170,11 +165,11 @@ class ProductionLot extends Api
|
|
|
public function ProcessInspection()
|
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
$param = $this->request->param();
|
|
|
if (!isset($param['gdbh']) || !isset($param['yjno'])|| !isset($param['num'])){
|
|
|
- $this->error('参数错误');
|
|
|
+ $this->success('参数错误');
|
|
|
}
|
|
|
$list = db('制程检验_记录')
|
|
|
->field('工单编号,流程单号,工序名称,班组编号,类别,检验项目,检验结果,检验备注 as 项目备注,相关标准 as 修改标准')
|
|
|
@@ -190,7 +185,7 @@ class ProductionLot extends Api
|
|
|
'total' => $total
|
|
|
];
|
|
|
if (empty($list)){
|
|
|
- $this->error('未找到制程检验记录');
|
|
|
+ $this->success('未找到制程检验记录');
|
|
|
}
|
|
|
$this->success('成功',$data);
|
|
|
|
|
|
@@ -206,11 +201,11 @@ class ProductionLot extends Api
|
|
|
public function ProcessAnomaly()
|
|
|
{
|
|
|
if ($this->request->isGet() === false){
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
$param = $this->request->param();
|
|
|
if (!isset($param['gdbh']) || !isset($param['yjno'])|| !isset($param['num'])){
|
|
|
- $this->error('参数错误');
|
|
|
+ $this->success('参数错误');
|
|
|
}
|
|
|
$list = db('制程检验_记录附加')
|
|
|
->field('流程单号,缺陷备注')
|
|
|
@@ -220,7 +215,7 @@ class ProductionLot extends Api
|
|
|
->order('流程单号')
|
|
|
->select();
|
|
|
if (empty($list)){
|
|
|
- $this->error('未找到制程异常记录');
|
|
|
+ $this->success('未找到制程异常记录');
|
|
|
}
|
|
|
foreach ($list as $key => $value){
|
|
|
$list[$key]['数量'] = '';
|
|
|
@@ -246,7 +241,7 @@ class ProductionLot extends Api
|
|
|
{
|
|
|
// 1. 简化请求方法验证
|
|
|
if (!$this->request->isGet()) {
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
|
|
|
// 2. 集中参数验证
|
|
|
@@ -261,7 +256,7 @@ class ProductionLot extends Api
|
|
|
}
|
|
|
|
|
|
if (!empty($missingParams)) {
|
|
|
- $this->error('参数错误,缺少:' . implode(', ', $missingParams));
|
|
|
+ $this->success('参数错误,缺少:' . implode(', ', $missingParams));
|
|
|
}
|
|
|
|
|
|
// 3. 使用常量或配置定义静态数据
|
|
|
@@ -297,10 +292,10 @@ class ProductionLot extends Api
|
|
|
->select();
|
|
|
|
|
|
if (empty($list)) {
|
|
|
- $this->error('未找到物料资料');
|
|
|
+ $this->success('未找到物料资料');
|
|
|
}
|
|
|
|
|
|
- // 5. 提前查询工序数据,避免在循环中重复处理
|
|
|
+ // 5. 提前查询工序数据
|
|
|
$process = db('设备_产量计酬')
|
|
|
->alias('a')
|
|
|
->join('工单_工艺资料 b', 'a.sczl_gdbh = b.Gy0_gdbh AND a.sczl_yjno = b.Gy0_yjno AND a.sczl_gxh = b.Gy0_gxh')
|
|
|
@@ -373,7 +368,7 @@ class ProductionLot extends Api
|
|
|
{
|
|
|
// 1. 请求方法验证
|
|
|
if (!$this->request->isGet()) {
|
|
|
- $this->error('请求错误');
|
|
|
+ $this->success('请求错误');
|
|
|
}
|
|
|
|
|
|
// 2. 参数验证与提取
|
|
|
@@ -382,7 +377,7 @@ class ProductionLot extends Api
|
|
|
|
|
|
foreach ($requiredParams as $requiredParam) {
|
|
|
if (empty($param[$requiredParam])) {
|
|
|
- $this->error("参数错误,缺少:{$requiredParam}");
|
|
|
+ $this->success("参数错误,缺少:{$requiredParam}");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -410,7 +405,7 @@ class ProductionLot extends Api
|
|
|
->select();
|
|
|
|
|
|
if (empty($list)) {
|
|
|
- $this->error('未找到印版数据');
|
|
|
+ $this->success('未找到印版数据');
|
|
|
}
|
|
|
|
|
|
// 4. 收集所有机台号,准备批量查询
|