|
@@ -900,4 +900,162 @@ class Manufacture extends Api
|
|
|
$this->error('修改失败');
|
|
$this->error('修改失败');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 子订单领料派单
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\db\exception\BindParamException
|
|
|
|
|
+ * @throws \think\exception\PDOException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function processAdd()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (Request::instance()->post() === false){
|
|
|
|
|
+ $this->error('参数错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $param = Request::instance()->post();
|
|
|
|
|
+ if (empty($param)){
|
|
|
|
|
+ $this->error('参数错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $data['班组编号'] = $param['班组'];
|
|
|
|
|
+ $data['订单编号'] = $param['订单编号'];
|
|
|
|
|
+ $data['子订单编号'] = $param['子订单编号'];
|
|
|
|
|
+ $data['sys_id'] = $param['Sys_id'];
|
|
|
|
|
+ $data['sys_rq'] = date('Y-m-d H:i:s',time());
|
|
|
|
|
+ $sql = \db('工单_排程班次')->fetchSql(true)->insert($data);
|
|
|
|
|
+ $res = \db()->query($sql);
|
|
|
|
|
+ if ($res !== false){
|
|
|
|
|
+ $this->success('成功');
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->error('失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 车缝班组菜单显示
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ */
|
|
|
|
|
+ public function MachineList()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
|
|
+ $this->error('请求错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $list = \db('设备_基本资料')
|
|
|
|
|
+ ->where('生产工序','车缝')
|
|
|
|
|
+ ->column('设备编号');
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 班组生产数据
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
|
|
+ * @throws \think\exception\DbException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function MachineDetail()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
|
|
+ $this->error('请求错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $param = $this->request->param();
|
|
|
|
|
+ if (empty($param)){
|
|
|
|
|
+ $this->error('参数错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $list = \db('工单_排程班次')
|
|
|
|
|
+ ->alias('a')
|
|
|
|
|
+ ->join('工单_印件资料 b','b.订单编号 = a.订单编号 AND a.子订单编号 = a.子订单编号')
|
|
|
|
|
+ ->join('设备_产量计酬 c','a.订单编号 = c.订单编号 AND a.子订单编号 = c.子订单编号','LEFT')
|
|
|
|
|
+ ->field('a.订单编号,a.子订单编号,b.款号,b.颜色,b.船样,b.zdtotal as 制单数,SUM(c.数量) as 已完成')
|
|
|
|
|
+ ->where('a.班组编号',$param['machine'])
|
|
|
|
|
+ ->where('a.mod_rq',null)
|
|
|
|
|
+ ->select();
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 工单审核
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\Exception
|
|
|
|
|
+ * @throws \think\db\exception\BindParamException
|
|
|
|
|
+ * @throws \think\exception\PDOException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function Approval()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->request->isPost() === false){
|
|
|
|
|
+ $this->error('请求错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $param = Request::instance()->post();
|
|
|
|
|
+ if (empty($param)){
|
|
|
|
|
+ $this->error('参数错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $data['审核'] = $param['sys_id'];
|
|
|
|
|
+ $data['审核日期'] = date('Y-m-d H:i:s',time());
|
|
|
|
|
+ $sql = \db('工单_基本资料')
|
|
|
|
|
+ ->where('Uniqid',$param['Uniqid'])
|
|
|
|
|
+ ->fetchSql(true)
|
|
|
|
|
+ ->update($data);
|
|
|
|
|
+ $res = \db()->query($sql);
|
|
|
|
|
+ if ($res === false){
|
|
|
|
|
+ $this->error('审核失败');
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->success('审核成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 订单未审核列表
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
|
|
+ * @throws \think\exception\DbException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function UnapprovalList()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
|
|
+ $this->error('请求错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $param = $this->request->param();
|
|
|
|
|
+ if (isset($param)){
|
|
|
|
|
+ $where['订单编号'] = ['like','%'.$param['search'].'%'];
|
|
|
|
|
+ }
|
|
|
|
|
+ $where['审核'] = null;
|
|
|
|
|
+ $where['审核日期'] = null;
|
|
|
|
|
+ $where['Mod_rq'] = null;
|
|
|
|
|
+ $list = \db('工单_基本资料')
|
|
|
|
|
+ ->where($where)
|
|
|
|
|
+ ->select();
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 月度工序产量列表
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
|
|
+ * @throws \think\exception\DbException
|
|
|
|
|
+ */
|
|
|
|
|
+ public function OrderYieldList()
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->request->isGet() === false){
|
|
|
|
|
+ $this->error('请求错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $param = $this->request->param();
|
|
|
|
|
+ if(empty($param)){
|
|
|
|
|
+ $this->error('参数错误');
|
|
|
|
|
+ }
|
|
|
|
|
+ $time = date('Y-m',strtotime($param['mouth']));
|
|
|
|
|
+ $list = \db('工单_印件资料')
|
|
|
|
|
+ ->alias('a')
|
|
|
|
|
+ ->join('工单_基本资料 b','a.订单编号 = b.订单编号')
|
|
|
|
|
+ ->join('设备_产量计酬 c','a.订单编号 = c.订单编号 AND a.子订单编号 = c.子订单编号','left')
|
|
|
|
|
+ ->field('a.订单编号,a.子订单编号,a.款号,a.颜色,a.zdtotal as 制单总数,a.sctotal as 裁切总数,a.ck_rq as 出库日期,
|
|
|
|
|
+ SUM(c.数量) as 车缝产量,c.后道,c.大烫,c.总检,c.包装')
|
|
|
|
|
+ ->where('b.Sys_rq','like',$time.'%')
|
|
|
|
|
+ ->group('a.子订单编号')
|
|
|
|
|
+ ->order('a.Uniqid')
|
|
|
|
|
+ ->select();
|
|
|
|
|
+ $this->success('成功',$list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|