Commit 902a33d7 authored by hujun's avatar hujun

收款

parent 53ad14b7
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
namespace app\index\controller; namespace app\index\controller;
use app\api_broker\service\OfficeOrderLogService;
use app\api_broker\service\OfficePayLogService; use app\api_broker\service\OfficePayLogService;
use app\api_broker\service\RedisCacheService; use app\api_broker\service\RedisCacheService;
use app\index\extend\Basic; use app\index\extend\Basic;
...@@ -2307,4 +2308,99 @@ class OfficePayLog extends Basic ...@@ -2307,4 +2308,99 @@ class OfficePayLog extends Basic
return $this->response($code, $msg, []); return $this->response($code, $msg, []);
} }
/**
* 收款
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function collectingBill() {
$params = $this->params;
if (empty($params["agent_id"]) || empty($params["report_id"]) ||
empty($params["order_id"]) || empty($params["order_no"]) | empty($params["collecting_bill"]) ||
!isset($params["house_number"]) || !isset($params["industry_type"]) || !isset($params['bargain_id'])) {
return $this->response("101", "请求参数错误");
}
/* $params = array(
"agent_id" => 1,//收款经纪人id
"agent_name" => 1,//收款经纪人id
"report_id" => 111,//报备id
"order_id" => 2, //关联order表id
"order_no" => "123123123", //订单no
// `type` '付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他',
//`pay_type` '支付方式 10支付宝 20 微信 30pos机器 40转账 50现金',
// `money` '入账金额',
"collecting_bill" => [ { "type" : 10, "pay_type" : 10, "money" : 1100 }, { "type" :10, "pay_type" : 10, "money": 1200 } ],
"house_number" => "3301号",
"industry_type" => "asdasdasd",
"remark" => "没什么备注",
"transfer_img" => "12312312312",
"is_dividend" => 1, //是否分红 1否 0是
"last_transfer_time" => "2018-10-18", //最后转定时间
"pay_id" => 1,
);*/
if (empty($params['agent_name'])) {
$params['agent_name'] = $this->userName;
}
$params["collecting_bill"] = json_decode($params["collecting_bill"], true);
$remark = isset($params["remark"]) ? $params["remark"] : "";
$transfer_img = isset($params["transfer_img"]) ? json_decode($params["transfer_img"], true): "";
$income_time = isset($params["income_time"]) ? strtotime($params["income_time"]) : "";
$last_transfer_time = isset($params["last_transfer_time"]) ? strtotime($params["last_transfer_time"]) : "";
$pay_id = isset($params["pay_id"]) ? $params["pay_id"] : 0;
$source = $params["source"] ? $params["source"] : 0;
$receipt_number = isset($params["receipt_number"]) ? $params["receipt_number"] : "";
$transfer_name = isset($params["transfer_name"]) ? $params["transfer_name"] : "";
$received_money = isset($params["received_money"]) ? $params["received_money"] : 0;
$type_ext = isset($params["type_ext"]) ? $params["type_ext"] : 0;
$is_open = isset($params['is_open']) ? $params['is_open'] : -1;
if($pay_id > 0){
$source = 2;
}
$service_ = new OfficeOrderLogService();
$is_ok = $service_->addCollectingBill($params["agent_id"], $params["agent_name"], $params["report_id"],
$params["order_id"], $params["order_no"], $params["collecting_bill"], $params["house_number"], $params["industry_type"],
$remark, $transfer_img, $source,$income_time,$params["is_dividend"],$last_transfer_time,$pay_id, $receipt_number,$transfer_name, $received_money, $type_ext, $params['bargain_id'], $is_open);
if ($is_ok > 0) {
return $this->response("200", "request success", [ "bill_id" => $is_ok ]);
} elseif ($is_ok == -1){
return $this->response("101", "付款类型或支付方式错误");
} elseif ($is_ok == -2) {
return $this->response("101", "调整金额不能多于可被调整的金额");
}
return $this->response("101", "request faild");
}
/**
* 获取上次提交收款的门牌号等
* @return \think\Response
*/
public function getBeForNum()
{
$params = $this->params;
/* $params = array(
"order_id" => 15523, //关联order表id
);*/
if (!isset($params["order_id"])) {
return $this->response("101", "订单编号不能为空");
}
$service_ = new OfficePayLogService();
$billInfo = $service_->getBeForNum($params["order_id"]);
if (count($billInfo) > 0) {
return $this->response("200", "request success", $billInfo[0]);
} else {
return $this->response("200", "request null");
}
}
} }
\ No newline at end of file
...@@ -284,7 +284,7 @@ Route::group('index', [ ...@@ -284,7 +284,7 @@ Route::group('index', [
'getCollectionDetail' => ['index/Finance/getCollectionDetail', ['method' => 'post|get']],//收款详情 'getCollectionDetail' => ['index/Finance/getCollectionDetail', ['method' => 'post|get']],//收款详情
'getCollectionEdit' => ['index/Finance/getCollectionEdit', ['method' => 'post']],//收款修改保存 'getCollectionEdit' => ['index/Finance/getCollectionEdit', ['method' => 'post']],//收款修改保存
'collectingBill' => ['index/Finance/collectingBill', ['method' => 'post']],//收款 'collectingBill' => ['index/Finance/collectingBill', ['method' => 'post']],//收款
'getBeForNum' => ['index/Finance/getBeForNum', ['method' => 'get']],//getBeForNum 'getBeForNum' => ['index/Finance/getBeForNum', ['method' => 'get']],//获取上次提交收款的门牌号等
'getAdjustment' => ['index/Finance/getAdjustment', ['method' => 'get']],//剩余可以调整或退款的钱 'getAdjustment' => ['index/Finance/getAdjustment', ['method' => 'get']],//剩余可以调整或退款的钱
'delAdjustment' => ['index/Finance/delAdjustment', ['method' => 'post']],//撤销调整 'delAdjustment' => ['index/Finance/delAdjustment', ['method' => 'post']],//撤销调整
'getAdjustmentDetail' => ['index/Finance/getAdjustmentDetail', ['method' => 'get']],//调整详情 'getAdjustmentDetail' => ['index/Finance/getAdjustmentDetail', ['method' => 'get']],//调整详情
...@@ -1071,6 +1071,9 @@ Route::group('office_index', [ ...@@ -1071,6 +1071,9 @@ Route::group('office_index', [
'checkBackOutOne/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核撤销成交报告-第一级审核 'checkBackOutOne/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核撤销成交报告-第一级审核
'checkBackOutTwo/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核撤销成交报告-第二级审核 'checkBackOutTwo/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核撤销成交报告-第二级审核
'checkBackOutThree/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核撤销成交报告-第三级审核 'checkBackOutThree/:check_status' => ['index/officePayLog/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核撤销成交报告-第三级审核
'collectingBill' => ['index/officePayLog/collectingBill', ['method' => 'get|post']], //收款
'getBeForNum' => ['index/officePayLog/getBeForNum', ['method' => 'get']],//获取上次提交收款的门牌号等
'inspectionRecordOur/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 0]], //我的约带看 'inspectionRecordOur/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 0]], //我的约带看
'inspectionRecordStore/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 1]], //门店约带看 'inspectionRecordStore/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 1]], //门店约带看
'inspectionRecordDistrict/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 2]], //部门约带看 'inspectionRecordDistrict/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 2]], //部门约带看
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment