|
|
@@ -215,7 +215,7 @@ class PackagingCountDocument extends Api
|
|
|
rtrim(sczl_desc) as sczl_desc')
|
|
|
->where('UniqId',$UniqId)
|
|
|
->find();
|
|
|
- $rs = db()->table('人事_基本资料')->where('员工编号',$rows['sczl_bh'])->find();
|
|
|
+ $rs = db()->table('人事_基本资料')->field('员工姓名')->where('员工编号',$rows['sczl_bh'])->find();
|
|
|
$rows['name'] = $rs ? trim($rs['员工姓名']) : '';
|
|
|
for ($i=1;$i<=6;$i++){
|
|
|
$rows['Gd_cpmc'.$i] = array_key_exists($rows['sczl_gdbh'.$i], $gd) ? trim($gd[$rows['sczl_gdbh'.$i]]) : '';
|
|
|
@@ -261,36 +261,69 @@ class PackagingCountDocument extends Api
|
|
|
$this->success('成功',$rows);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询员工名称
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $sczl_bh 员工编号
|
|
|
+ */
|
|
|
+ public function getYg()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+ if (isset($req['sczl_bh']) && !empty($req['sczl_bh'])){
|
|
|
+ $sczl_bh = $req['sczl_bh'];
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $rs = db()->table('人事_基本资料')->field('rtrim(员工姓名) as ygxm')->where('员工编号',$sczl_bh)->find();
|
|
|
+ if(!$rs){
|
|
|
+ $this->error('失败');
|
|
|
+ }
|
|
|
+ $this->success('成功',$rs);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 新增
|
|
|
* @ApiMethod (POST)
|
|
|
- * @param string 'sys_id','sczl_rq',
|
|
|
+ * @param string 'sys_id','sczl_rq', 'sczl_bh', 'sczl_jsss', 'sczl_冲定额', 'sczl_bzdh',
|
|
|
'sczl_gdbh1', 'sczl_gdbh2', 'sczl_gdbh3', 'sczl_gdbh4', 'sczl_gdbh5', 'sczl_gdbh6',
|
|
|
'sczl_yjGx1', 'sczl_yjGx2', 'sczl_yjGx3', 'sczl_yjGx4', 'sczl_yjGx5', 'sczl_yjGx6',
|
|
|
'sczl_gxmc1', 'sczl_gxmc2', 'sczl_gxmc3', 'sczl_gxmc4', 'sczl_gxmc5', 'sczl_gxmc6',
|
|
|
'sczl_cl1', 'sczl_cl2', 'sczl_cl3', 'sczl_cl4', 'sczl_cl5', 'sczl_cl6',
|
|
|
'sczl_PgCl1', 'sczl_PgCl2', 'sczl_PgCl3', 'sczl_PgCl4', 'sczl_PgCl5', 'sczl_PgCl6',
|
|
|
- 'sczl_clAdd1', 'sczl_clAdd2', 'sczl_clAdd3', 'sczl_clAdd4', 'sczl_clAdd5', 'sczl_clAdd6'
|
|
|
+ 'sczl_返工产量1', 'sczl_返工产量2', 'sczl_返工产量3', 'sczl_返工产量4', 'sczl_返工产量5', 'sczl_返工产量6',
|
|
|
+ 'sczl_计产系数1', 'sczl_计产系数2', 'sczl_计产系数3', 'sczl_计产系数4', 'sczl_计产系数5', 'sczl_计产系数6',
|
|
|
+ 'sczl_Jtbh1','sczl_Jtbh2', 'sczl_Jtbh3', 'sczl_Jtbh4', 'sczl_Jtbh5', 'sczl_Jtbh6',
|
|
|
+ 'sczl_dedh1', 'sczl_dedh2', 'sczl_dedh3', 'sczl_dedh4', 'sczl_dedh5', 'sczl_dedh6',
|
|
|
+ 'sczl_desc'
|
|
|
*/
|
|
|
public function add()
|
|
|
{
|
|
|
- //get请求
|
|
|
if(!$this->request->isPost()){
|
|
|
$this->error('请求方式错误');
|
|
|
}
|
|
|
$req = $this->request->param();
|
|
|
$arr = [
|
|
|
- 'sys_id','sczl_rq',
|
|
|
+ 'sys_id','sczl_rq', 'sczl_bh', 'sczl_jsss', 'sczl_冲定额', 'sczl_bzdh',
|
|
|
'sczl_gdbh1', 'sczl_gdbh2', 'sczl_gdbh3', 'sczl_gdbh4', 'sczl_gdbh5', 'sczl_gdbh6',
|
|
|
'sczl_yjGx1', 'sczl_yjGx2', 'sczl_yjGx3', 'sczl_yjGx4', 'sczl_yjGx5', 'sczl_yjGx6',
|
|
|
'sczl_gxmc1', 'sczl_gxmc2', 'sczl_gxmc3', 'sczl_gxmc4', 'sczl_gxmc5', 'sczl_gxmc6',
|
|
|
'sczl_cl1', 'sczl_cl2', 'sczl_cl3', 'sczl_cl4', 'sczl_cl5', 'sczl_cl6',
|
|
|
'sczl_PgCl1', 'sczl_PgCl2', 'sczl_PgCl3', 'sczl_PgCl4', 'sczl_PgCl5', 'sczl_PgCl6',
|
|
|
- 'sczl_clAdd1', 'sczl_clAdd2', 'sczl_clAdd3', 'sczl_clAdd4', 'sczl_clAdd5', 'sczl_clAdd6'
|
|
|
+ 'sczl_返工产量1', 'sczl_返工产量2', 'sczl_返工产量3', 'sczl_返工产量4', 'sczl_返工产量5', 'sczl_返工产量6',
|
|
|
+ 'sczl_计产系数1', 'sczl_计产系数2', 'sczl_计产系数3', 'sczl_计产系数4', 'sczl_计产系数5', 'sczl_计产系数6',
|
|
|
+ 'sczl_Jtbh1','sczl_Jtbh2', 'sczl_Jtbh3', 'sczl_Jtbh4', 'sczl_Jtbh5', 'sczl_Jtbh6',
|
|
|
+ 'sczl_dedh1', 'sczl_dedh2', 'sczl_dedh3', 'sczl_dedh4', 'sczl_dedh5', 'sczl_dedh6',
|
|
|
+ 'sczl_desc'
|
|
|
];
|
|
|
$data = [];
|
|
|
foreach ($arr as $key => $value){
|
|
|
- if (!(isset($req[$value]) && trim($req[$value])!='')){
|
|
|
+ if (!isset($req[$value])){
|
|
|
$this->error('参数错误',$value,$key+1);
|
|
|
}
|
|
|
$data[$value] = $req[$value];
|
|
|
@@ -329,23 +362,28 @@ class PackagingCountDocument extends Api
|
|
|
*/
|
|
|
public function edit()
|
|
|
{
|
|
|
- //get请求
|
|
|
if(!$this->request->isPost()){
|
|
|
$this->error('请求方式错误');
|
|
|
}
|
|
|
+ $bool = db()->table('db_包装计件')->where('UniqId',0)->update(['sczl_冲定额'=>1]);
|
|
|
+ halt($bool);
|
|
|
$req = $this->request->param();
|
|
|
$arr = [
|
|
|
- 'sczl_rq',
|
|
|
+ 'sys_id','sczl_rq', 'sczl_bh', 'sczl_jsss', 'sczl_冲定额', 'sczl_bzdh',
|
|
|
'sczl_gdbh1', 'sczl_gdbh2', 'sczl_gdbh3', 'sczl_gdbh4', 'sczl_gdbh5', 'sczl_gdbh6',
|
|
|
'sczl_yjGx1', 'sczl_yjGx2', 'sczl_yjGx3', 'sczl_yjGx4', 'sczl_yjGx5', 'sczl_yjGx6',
|
|
|
'sczl_gxmc1', 'sczl_gxmc2', 'sczl_gxmc3', 'sczl_gxmc4', 'sczl_gxmc5', 'sczl_gxmc6',
|
|
|
'sczl_cl1', 'sczl_cl2', 'sczl_cl3', 'sczl_cl4', 'sczl_cl5', 'sczl_cl6',
|
|
|
'sczl_PgCl1', 'sczl_PgCl2', 'sczl_PgCl3', 'sczl_PgCl4', 'sczl_PgCl5', 'sczl_PgCl6',
|
|
|
- 'sczl_clAdd1', 'sczl_clAdd2', 'sczl_clAdd3', 'sczl_clAdd4', 'sczl_clAdd5', 'sczl_clAdd6'
|
|
|
+ 'sczl_返工产量1', 'sczl_返工产量2', 'sczl_返工产量3', 'sczl_返工产量4', 'sczl_返工产量5', 'sczl_返工产量6',
|
|
|
+ 'sczl_计产系数1', 'sczl_计产系数2', 'sczl_计产系数3', 'sczl_计产系数4', 'sczl_计产系数5', 'sczl_计产系数6',
|
|
|
+ 'sczl_Jtbh1','sczl_Jtbh2', 'sczl_Jtbh3', 'sczl_Jtbh4', 'sczl_Jtbh5', 'sczl_Jtbh6',
|
|
|
+ 'sczl_dedh1', 'sczl_dedh2', 'sczl_dedh3', 'sczl_dedh4', 'sczl_dedh5', 'sczl_dedh6',
|
|
|
+ 'sczl_desc'
|
|
|
];
|
|
|
$data = [];
|
|
|
foreach ($arr as $key => $value){
|
|
|
- if (!(isset($req[$value]) && trim($req[$value])!='')){
|
|
|
+ if (!isset($req[$value])){
|
|
|
$this->error('参数错误',$value,$key+1);
|
|
|
}
|
|
|
$data[$value] = $req[$value];
|