|
@@ -233,6 +233,50 @@ class FinancialManager extends Base{
|
|
|
}
|
|
|
return success('操作成功');
|
|
|
}
|
|
|
+ //待确认数据 c端订单确认处理
|
|
|
+ public function CheckSureByOther(){
|
|
|
+ $params = $this->request->param(['manager_id'=>[],'relaArr'=>[],"fz_date"=>""],'post','trim');
|
|
|
+ $valid = $this->validate($params,[
|
|
|
+ 'manager_id|出库明细ID'=>'require|array',
|
|
|
+ 'relaArr|关联数据'=>'require|array',
|
|
|
+ 'fz_date|封账月份'=>'max:255',
|
|
|
+ ]);
|
|
|
+ if($valid!==true) return error($valid);
|
|
|
+ $manager = $this->model->whereIn('id',$params['manager_id'])->select();
|
|
|
+ if($manager->isEmpty()) return error('待确认数据不存在');
|
|
|
+ $goodNos = array_unique(array_column($manager->toArray(),'goodNo'));
|
|
|
+ if(count($goodNos)!=1) return error('待确认数据商品编码不一致');
|
|
|
+ $this->model->startTrans();
|
|
|
+ try{
|
|
|
+ foreach ($manager as $item){
|
|
|
+ $item->relaArr=$params['relaArr'];
|
|
|
+ $item->fz_date=$params['fz_date']??"";
|
|
|
+ $check = $this->model->inProduct($item);
|
|
|
+ if(empty($check)) return error('待确认数据处理失败');
|
|
|
+ if($item->balance_num!=0) return error('待确认数据数量未处理完不可提交');
|
|
|
+ ManagerProduct::AddProduct($item->id,$check);
|
|
|
+ $item->status=2;
|
|
|
+ $item->error_remark='';
|
|
|
+ $item->save();
|
|
|
+ }
|
|
|
+ $this->model->commit();
|
|
|
+ }catch (\Exception $e){
|
|
|
+ $this->model->rollback();
|
|
|
+ return error($e->getMessage());
|
|
|
+ }
|
|
|
+ return success('操作成功');
|
|
|
+ }
|
|
|
+ // 删除待确认数据
|
|
|
+ public function delete(){
|
|
|
+ $id = $this->request->param('id','0','intval');
|
|
|
+ $info=$this->model->findOrEmpty($id);
|
|
|
+ if($info->isEmpty()) return error("数据不存在");
|
|
|
+ if($info->status!=1) return error("当前数据状态不允许删除");
|
|
|
+ if($info->manager_status!=3) return error("当前数据不是待确认数据");
|
|
|
+ if($info->balance_num!=$info->total_num) return error("数据数量已处理过不可删除");
|
|
|
+ $info->delete();
|
|
|
+ return success("删除成功");
|
|
|
+ }
|
|
|
public function CheckList(){
|
|
|
$params = $this->request->param(["page"=>1,"size"=>20,"goodType"=>'',"goodNo"=>'',"company_code"=>'',"start_time"=>"","end_time"=>"","keywords"=>""],"post","trim");
|
|
|
$where=[];
|