Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zptz-sass-kelaidian
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李大见
zptz-sass-kelaidian
Commits
ce3cf3e9
提交
ce3cf3e9
authored
9月 12, 2024
作者:
窦斌
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edit
上级
b3e035f3
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
142 行增加
和
101 行删除
+142
-101
OrderListController.php
app/Http/Controllers/Api/MobileWeb/OrderListController.php
+11
-0
OrderListValidator.php
.../Requests/Validators/Api/MobileWeb/OrderListValidator.php
+27
-8
OrderListService.php
app/Services/Api/MobileWeb/OrderListService.php
+94
-85
DealPicService.php
app/Services/DealPicService.php
+8
-8
api.php
routes/api.php
+2
-0
没有找到文件。
app/Http/Controllers/Api/MobileWeb/OrderListController.php
浏览文件 @
ce3cf3e9
...
@@ -143,6 +143,17 @@ class OrderListController extends Controller
...
@@ -143,6 +143,17 @@ class OrderListController extends Controller
return
response
()
->
json
(
$return_data
);
return
response
()
->
json
(
$return_data
);
}
}
//上传图片
public
function
addPic
(
Request
$request
){
// 验证数据
$error_message
=
$this
->
dataValidator
->
addPicValidator
(
$request
->
all
());
if
(
$error_message
)
{
return
response
()
->
json
([
'ErrorCode'
=>
ErrorInc
::
INVALID_PARAM
,
'ErrorMessage'
=>
$error_message
->
first
(),
'Data'
=>
[
$error_message
]]);
}
$return_data
=
OrderListService
::
info
(
$request
->
all
());
return
response
()
->
json
(
$return_data
);
}
// 检验
// 检验
public
function
inspect
(
Request
$request
)
public
function
inspect
(
Request
$request
)
{
{
...
...
app/Http/Requests/Validators/Api/MobileWeb/OrderListValidator.php
浏览文件 @
ce3cf3e9
...
@@ -226,15 +226,39 @@ class OrderListValidator extends FormRequest
...
@@ -226,15 +226,39 @@ class OrderListValidator extends FormRequest
}
}
}
}
// 添加图片验证器
public
function
addPicValidator
(
$data
)
{
// 自定义错误消息
$messages
=
[
'id.required'
=>
'请输入订单id'
,
'id.integer'
=>
'参数错误'
,
'type.required'
=>
'请输入图片类型'
,
'type.in'
=>
'参数错误'
,
'file'
=>
'请上传图片'
,
];
// 数据验证
$validator
=
Validator
::
make
(
$data
,
[
'id'
=>
'required|integer|min:1'
,
'file'
=>
'required|string'
,
'type'
=>
[
//1获取技师2改派
'required'
,
Rule
::
in
([
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
]),
]
],
$messages
);
// 判断数据验证是否成功
if
(
$validator
->
fails
())
{
return
$validator
->
errors
();
}
}
// 安装反馈验证器
// 安装反馈验证器
public
function
installFeedbackValidator
(
$data
)
public
function
installFeedbackValidator
(
$data
)
{
{
// 自定义错误消息
// 自定义错误消息
$messages
=
[
$messages
=
[
'install_id.required'
=>
'参数错误'
,
'admin_id.required'
=>
'参数错误'
,
'id.required'
=>
'请输入服务工单id'
,
'id.required'
=>
'请输入服务工单id'
,
'type.required'
=>
'请选择完成类型'
,
// 'template_data.required' => '请输入图片相关数据',
// 'template_data.required' => '请输入图片相关数据',
// 'license_plate.required' => '请输入车牌号',
// 'license_plate.required' => '请输入车牌号',
// 'license_plate.max' => '长度超出限制',
// 'license_plate.max' => '长度超出限制',
...
@@ -242,12 +266,7 @@ class OrderListValidator extends FormRequest
...
@@ -242,12 +266,7 @@ class OrderListValidator extends FormRequest
// 数据验证
// 数据验证
$validator
=
Validator
::
make
(
$data
,
[
$validator
=
Validator
::
make
(
$data
,
[
'install_id'
=>
'required|integer|min:1'
,
'admin_id'
=>
'required|integer|min:1'
,
'id'
=>
'required|integer|min:1'
,
'id'
=>
'required|integer|min:1'
,
'type'
=>
'required|integer|min:1'
,
// 'template_data' => 'required',
// 'license_plate' => 'required|string|max:20',
],
$messages
);
],
$messages
);
// 判断数据验证是否成功
// 判断数据验证是否成功
...
...
app/Services/Api/MobileWeb/OrderListService.php
浏览文件 @
ce3cf3e9
...
@@ -929,13 +929,13 @@ class OrderListService extends Model
...
@@ -929,13 +929,13 @@ class OrderListService extends Model
unset
(
$arr5
);
unset
(
$arr5
);
unset
(
$arr6
);
unset
(
$arr6
);
//图片1
//图片1
$arr
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
1
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
[
'type'
]
=
1
;
//'1';
$arr
1
[
'type'
]
=
1
;
//'1';
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
1
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
1
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
1
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
1
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$arr
1
[
'feedback_status'
]
=
'2'
;
if
(
$_POST
[
'file1'
]){
if
(
$_POST
[
'file1'
]){
$streamFilename
=
self
::
creact_url
();
$streamFilename
=
self
::
creact_url
();
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file1'
]))){
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file1'
]))){
...
@@ -953,24 +953,22 @@ class OrderListService extends Model
...
@@ -953,24 +953,22 @@ class OrderListService extends Model
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
}
}
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
1
[
'feedback_pic'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
}
}
}
}
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr1
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr1
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'is_type'
]
=
1
;
$arr1
[
'is_type'
]
=
1
;
$arr
[
'type_name'
]
=
self
::
getPicName
(
1
);
//'1';
$arr1
[
'type_name'
]
=
self
::
getPicName
(
1
);
//'1';
Feedback
::
insert
(
$arr
);
unset
(
$arr
);
//图片2
//图片2
$arr
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
2
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
[
'type'
]
=
2
;
//'1';
$arr
2
[
'type'
]
=
2
;
//'1';
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
2
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
2
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
2
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
2
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$arr
2
[
'feedback_status'
]
=
'2'
;
if
(
$_POST
[
'file2'
]){
if
(
$_POST
[
'file2'
]){
$streamFilename
=
self
::
creact_url
();
$streamFilename
=
self
::
creact_url
();
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file2'
]))){
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file2'
]))){
...
@@ -988,24 +986,22 @@ class OrderListService extends Model
...
@@ -988,24 +986,22 @@ class OrderListService extends Model
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
}
}
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
2
[
'feedback_pic'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
}
}
}
}
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr2
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr2
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'is_type'
]
=
1
;
$arr2
[
'is_type'
]
=
1
;
$arr
[
'type_name'
]
=
self
::
getPicName
(
2
);
//'1';
$arr2
[
'type_name'
]
=
self
::
getPicName
(
2
);
//'1';
Feedback
::
insert
(
$arr
);
unset
(
$arr
);
//图片3
//图片3
$arr
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
3
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
[
'type'
]
=
3
;
//'1';
$arr
3
[
'type'
]
=
3
;
//'1';
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
3
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
3
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
3
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
3
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$arr
3
[
'feedback_status'
]
=
'2'
;
if
(
$_POST
[
'file3'
]){
if
(
$_POST
[
'file3'
]){
$streamFilename
=
self
::
creact_url
();
$streamFilename
=
self
::
creact_url
();
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file3'
]))){
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file3'
]))){
...
@@ -1023,24 +1019,22 @@ class OrderListService extends Model
...
@@ -1023,24 +1019,22 @@ class OrderListService extends Model
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
}
}
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
3
[
'feedback_pic'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
}
}
}
}
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr3
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr3
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'is_type'
]
=
1
;
$arr3
[
'is_type'
]
=
1
;
$arr
[
'type_name'
]
=
self
::
getPicName
(
3
);
//'1';
$arr3
[
'type_name'
]
=
self
::
getPicName
(
3
);
//'1';
Feedback
::
insert
(
$arr
);
unset
(
$arr
);
//图片4
//图片4
$arr
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
4
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
[
'type'
]
=
4
;
//'1';
$arr
4
[
'type'
]
=
4
;
//'1';
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
4
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
4
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
4
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
4
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$arr
4
[
'feedback_status'
]
=
'2'
;
if
(
$_POST
[
'file4'
]){
if
(
$_POST
[
'file4'
]){
$streamFilename
=
self
::
creact_url
();
$streamFilename
=
self
::
creact_url
();
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file4'
]))){
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file4'
]))){
...
@@ -1058,24 +1052,22 @@ class OrderListService extends Model
...
@@ -1058,24 +1052,22 @@ class OrderListService extends Model
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
}
}
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
4
[
'feedback_pic'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
}
}
}
}
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr4
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr4
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'is_type'
]
=
1
;
$arr4
[
'is_type'
]
=
1
;
$arr
[
'type_name'
]
=
self
::
getPicName
(
4
);
//'1';
$arr4
[
'type_name'
]
=
self
::
getPicName
(
4
);
//'1';
Feedback
::
insert
(
$arr
);
unset
(
$arr
);
//图片5
//图片5
$arr
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
5
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
[
'type'
]
=
5
;
//'1';
$arr
5
[
'type'
]
=
5
;
//'1';
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
5
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
5
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
5
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
5
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$arr
5
[
'feedback_status'
]
=
'2'
;
if
(
$_POST
[
'file5'
]){
if
(
$_POST
[
'file5'
]){
$streamFilename
=
self
::
creact_url
();
$streamFilename
=
self
::
creact_url
();
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file5'
]))){
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file5'
]))){
...
@@ -1093,24 +1085,22 @@ class OrderListService extends Model
...
@@ -1093,24 +1085,22 @@ class OrderListService extends Model
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
}
}
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
5
[
'feedback_pic'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
}
}
}
}
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr5
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr5
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'is_type'
]
=
1
;
$arr5
[
'is_type'
]
=
1
;
$arr
[
'type_name'
]
=
self
::
getPicName
(
5
);
//'1';
$arr5
[
'type_name'
]
=
self
::
getPicName
(
5
);
//'1';
Feedback
::
insert
(
$arr
);
unset
(
$arr
);
//图片6
//图片6
$arr
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
6
[
'gl_id'
]
=
$orderListArr
[
'id'
];
$arr
[
'type'
]
=
6
;
//'1';
$arr
6
[
'type'
]
=
6
;
//'1';
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
6
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
6
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
6
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
6
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$arr
6
[
'feedback_status'
]
=
'2'
;
if
(
$_POST
[
'file6'
]){
if
(
$_POST
[
'file6'
]){
$streamFilename
=
self
::
creact_url
();
$streamFilename
=
self
::
creact_url
();
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file6'
]))){
if
(
file_put_contents
(
$streamFilename
,
base64_decode
(
$request
[
'file6'
]))){
...
@@ -1128,22 +1118,33 @@ class OrderListService extends Model
...
@@ -1128,22 +1118,33 @@ class OrderListService extends Model
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
SERVER_FAILED
,
'ErrorMessage'
=>
$e
->
getMessage
(),
'Data'
=>
[]];
}
}
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$streamFilename
=
self
::
picurl
(
$streamFilename
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
6
[
'feedback_pic'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
$info
[
'installation_pictures'
]
=
$streamFilename
;
}
}
}
}
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr6
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr6
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'is_type'
]
=
1
;
$arr6
[
'is_type'
]
=
1
;
$arr
[
'type_name'
]
=
self
::
getPicName
(
6
);
//'1';
$arr6
[
'type_name'
]
=
self
::
getPicName
(
6
);
//'1';
Feedback
::
insert
(
$arr
);
unset
(
$arr
);
$management
=
Management
::
where
(
'trace_code'
,
$orderListArr
[
'serial_number'
])
->
update
(
$info
);
$management
=
Management
::
where
(
'trace_code'
,
$orderListArr
[
'serial_number'
])
->
update
(
$info
);
$time
=
date
(
"Y-m-d H:i:s"
);
$time
=
date
(
"Y-m-d H:i:s"
);
self
::
operating_time
(
$orderListArr
[
'serial_number'
],
'任务反馈时间'
,
$time
,
$orderListArr
[
'order_num'
],
$session
);
self
::
operating_time
(
$orderListArr
[
'serial_number'
],
'任务反馈时间'
,
$time
,
$orderListArr
[
'order_num'
],
$session
);
$post
[
'stauas'
]
=
'34'
;
//派工单列表
$post
[
'stauas'
]
=
'34'
;
//派工单列表
$post
[
'feeds_time'
]
=
$time
;
//反馈时间
$post
[
'feeds_time'
]
=
$time
;
//反馈时间
$post
[
'goods_type'
]
=
4
;
$post
[
'goods_type'
]
=
4
;
DB
::
beginTransaction
();
//开启事务
Feedback
::
insert
(
$arr1
);
unset
(
$arr1
);
Feedback
::
insert
(
$arr2
);
unset
(
$arr2
);
Feedback
::
insert
(
$arr3
);
unset
(
$arr3
);
Feedback
::
insert
(
$arr4
);
unset
(
$arr4
);
Feedback
::
insert
(
$arr5
);
unset
(
$arr5
);
Feedback
::
insert
(
$arr6
);
unset
(
$arr6
);
$rea
=
OrderList
::
where
(
'id'
,
$request
[
'id'
])
->
update
(
$post
);
$rea
=
OrderList
::
where
(
'id'
,
$request
[
'id'
])
->
update
(
$post
);
$OrderCount
=
OrderList
::
where
(
"sys_num"
,
$orderListArr
[
'sys_num'
])
->
where
(
"stauas"
,
34
)
->
count
();
$OrderCount
=
OrderList
::
where
(
"sys_num"
,
$orderListArr
[
'sys_num'
])
->
where
(
"stauas"
,
34
)
->
count
();
if
(
$OrderCount
==
1
){
if
(
$OrderCount
==
1
){
...
@@ -1158,7 +1159,15 @@ class OrderListService extends Model
...
@@ -1158,7 +1159,15 @@ class OrderListService extends Model
$setArr
[
'fahuo_type'
]
=
1
;
//已发货
$setArr
[
'fahuo_type'
]
=
1
;
//已发货
$setArr
[
'setfeeds_time'
]
=
$time
;
//反馈时间
$setArr
[
'setfeeds_time'
]
=
$time
;
//反馈时间
$ree
=
SettlementList
::
where
(
'list_id'
,
$orderListArr
[
'serial_number'
])
->
update
(
$setArr
);
$ree
=
SettlementList
::
where
(
'list_id'
,
$orderListArr
[
'serial_number'
])
->
update
(
$setArr
);
if
(
$rea
&&
$res
&&
$ree
)
{
DB
::
commit
();
$content
=
"订单("
.
$orderListArr
[
'serial_number'
]
.
")"
;
CommonService
::
inserting_log
(
'改派,'
,
$orderListArr
[
'sys_num'
],
$content
,
'派工单web'
,
$session
,
$ip
);
//日志
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'Data'
=>
[]];
}
else
{
DB
::
rollback
();
//回滚
return
[
'ErrorCode'
=>
ErrorInc
::
MYSQL_FAILED
,
'ErrorMessage'
=>
'操作失败'
,
'Data'
=>
[]];
}
}
else
{
}
else
{
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'未查询到订单'
,
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'未查询到订单'
,
'Data'
=>
[]];
}
}
...
...
app/Services/DealPicService.php
浏览文件 @
ce3cf3e9
...
@@ -23,10 +23,10 @@ class DealPicService extends Service{
...
@@ -23,10 +23,10 @@ class DealPicService extends Service{
* @author dou 2021/9/10 18:18
* @author dou 2021/9/10 18:18
* |---------------------------------------------------------------------------------
* |---------------------------------------------------------------------------------
*/
*/
public
static
function
addPic
(
$imge
,
$path
){
public
static
function
addPic
(
$imge
,
$path
,
$type
){
if
(
preg_match
(
'/(?<=\/)[^\/]+(?=\;)/'
,
$
_POST
[
'file'
]
,
$pregR
))
$streamFileType
=
'.'
.
$pregR
[
0
];
//读取扩展名,如果你的程序仅限于画板上来的,那一定是png,这句可以直接streamFileType 赋值png
if
(
preg_match
(
'/(?<=\/)[^\/]+(?=\;)/'
,
$
imge
,
$pregR
))
$streamFileType
=
'.'
.
$pregR
[
0
];
//读取扩展名,如果你的程序仅限于画板上来的,那一定是png,这句可以直接streamFileType 赋值png
preg_match
(
'/(?<=base64,)[\S|\s]+/'
,
$
_POST
[
'file'
]
,
$streamForW
);
preg_match
(
'/(?<=base64,)[\S|\s]+/'
,
$
imge
,
$streamForW
);
$dir
=
rtrim
(
$
_POST
[
'path'
]
,
'/'
);
$dir
=
rtrim
(
$
path
,
'/'
);
//$dir='./Feekimages/'.date('Ym');
//$dir='./Feekimages/'.date('Ym');
if
(
!
is_dir
(
$dir
)){
if
(
!
is_dir
(
$dir
)){
mkdir
(
$dir
);
mkdir
(
$dir
);
...
@@ -35,7 +35,7 @@ class DealPicService extends Service{
...
@@ -35,7 +35,7 @@ class DealPicService extends Service{
$streamFilename
=
self
::
creact_url
(
$dir
,
$streamFileType
);
$streamFilename
=
self
::
creact_url
(
$dir
,
$streamFileType
);
if
(
file_put_contents
(
$streamFilename
[
'streamFilename'
],
base64_decode
(
$streamForW
[
0
]))){
if
(
file_put_contents
(
$streamFilename
[
'streamFilename'
],
base64_decode
(
$streamForW
[
0
]))){
$file
=
$streamFilename
[
'streamFilename'
];
$file
=
$streamFilename
[
'streamFilename'
];
$file
=
self
::
addOss
(
$file
,
$dir
);
$file
=
self
::
addOss
(
$file
,
$dir
,
$type
);
return
$file
;
return
$file
;
}
else
{
}
else
{
return
false
;
return
false
;
...
@@ -50,16 +50,16 @@ class DealPicService extends Service{
...
@@ -50,16 +50,16 @@ class DealPicService extends Service{
* @author dou 2021/9/10 19:03
* @author dou 2021/9/10 19:03
* |---------------------------------------------------------------------------------
* |---------------------------------------------------------------------------------
*/
*/
public
static
function
addOss
(
$file
,
$dir
){
public
static
function
addOss
(
$file
,
$dir
,
$type
=
1
){
require_once
'aliyunoss/autoload.php'
;
require_once
'aliyunoss/autoload.php'
;
$accessKeyId
=
"LTAI4GAhRHWDjheUxeUQCE42"
;
//去阿里云后台获取秘钥
$accessKeyId
=
"LTAI4GAhRHWDjheUxeUQCE42"
;
//去阿里云后台获取秘钥
$accessKeySecret
=
"3SYbAgutMNDIHk5c7ELEn3aBig5fUV"
;
//去阿里云后台获取秘钥
$accessKeySecret
=
"3SYbAgutMNDIHk5c7ELEn3aBig5fUV"
;
//去阿里云后台获取秘钥
$endpoint
=
"http://oss-cn-beijing.aliyuncs.com"
;
//你的阿里云OSS地址
$endpoint
=
"http://oss-cn-beijing.aliyuncs.com"
;
//你的阿里云OSS地址
$ossClient
=
new
OssClient
(
$accessKeyId
,
$accessKeySecret
,
$endpoint
);
$ossClient
=
new
OssClient
(
$accessKeyId
,
$accessKeySecret
,
$endpoint
);
try
{
try
{
$filename
=
uniqid
()
.
'1
.jpeg'
;
$filename
=
uniqid
()
.
$type
.
'
.jpeg'
;
$bucket
=
"sdkb"
;
//oss中的文件上传空间
$bucket
=
"sdkb"
;
//oss中的文件上传空间
$object
=
'
test
/'
.
$dir
.
'/'
.
$filename
;
//想要保存文件的名称
$object
=
'
JdhData
/'
.
$dir
.
'/'
.
$filename
;
//想要保存文件的名称
$res
=
$ossClient
->
uploadFile
(
$bucket
,
$object
,
$file
);
$res
=
$ossClient
->
uploadFile
(
$bucket
,
$object
,
$file
);
if
(
$res
[
'info'
][
'url'
]
!=
''
){
if
(
$res
[
'info'
][
'url'
]
!=
''
){
$url
=
ltrim
(
$file
,
"/"
);
$url
=
ltrim
(
$file
,
"/"
);
...
...
routes/api.php
浏览文件 @
ce3cf3e9
...
@@ -1428,6 +1428,8 @@ Route::namespace('Api')->group(function () {
...
@@ -1428,6 +1428,8 @@ Route::namespace('Api')->group(function () {
Route
::
post
(
'w1/OrderList/lineStart'
,
'MobileWeb\OrderListController@lineStart'
);
//出发
Route
::
post
(
'w1/OrderList/lineStart'
,
'MobileWeb\OrderListController@lineStart'
);
//出发
Route
::
post
(
'w1/OrderList/lineArrive'
,
'MobileWeb\OrderListController@lineArrive'
);
//抵达
Route
::
post
(
'w1/OrderList/lineArrive'
,
'MobileWeb\OrderListController@lineArrive'
);
//抵达
Route
::
post
(
'w1/OrderList/startInstall'
,
'MobileWeb\OrderListController@startInstall'
);
//开始安装
Route
::
post
(
'w1/OrderList/startInstall'
,
'MobileWeb\OrderListController@startInstall'
);
//开始安装
Route
::
post
(
'w1/OrderList/addPic'
,
'MobileWeb\OrderListController@addPic'
);
//上传图片
Route
::
post
(
'w1/OrderList/deletPic'
,
'MobileWeb\OrderListController@deletPic'
);
//删除图片
Route
::
post
(
'w1/OrderList/installFeedback'
,
'MobileWeb\OrderListController@installFeedback'
);
//安装反馈
Route
::
post
(
'w1/OrderList/installFeedback'
,
'MobileWeb\OrderListController@installFeedback'
);
//安装反馈
Route
::
post
(
'w1/OrderList/inspect'
,
'MobileWeb\OrderListController@inspect'
);
//检验
Route
::
post
(
'w1/OrderList/inspect'
,
'MobileWeb\OrderListController@inspect'
);
//检验
Route
::
post
(
'w1/OrderList/info'
,
'MobileWeb\OrderListController@info'
);
//详情
Route
::
post
(
'w1/OrderList/info'
,
'MobileWeb\OrderListController@info'
);
//详情
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论