Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
weixiuhui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
蒋林
weixiuhui
Commits
db3cce1f
Commit
db3cce1f
authored
Sep 22, 2016
by
蒋林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 安装单-添加明细信息,及对外接口
2. 安装单-删除明细信息,及对外接口
parent
04da49e2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
222 additions
and
23 deletions
+222
-23
Galanz.php
application/controllers/api/Galanz.php
+40
-0
Rgalanz.php
application/controllers/test/Rgalanz.php
+61
-8
ReceiveGalanz.php
application/libraries/Receive/ReceiveGalanz.php
+35
-0
SourceGalanz.php
application/libraries/Source/SourceGalanz.php
+86
-15
No files found.
application/controllers/api/Galanz.php
View file @
db3cce1f
...
@@ -268,6 +268,46 @@ class Galanz extends BaseController
...
@@ -268,6 +268,46 @@ class Galanz extends BaseController
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
}
//安装单-添加明细信息
public
function
addMachineUserProfileOrder
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckAddMachineUserProfileOrderValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'id'
],
'addMachineUserProfileOrder'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
$order
=
$obj
->
SetAddMachineUserProfileOrderValues
(
$order
,
$values
);
$result
=
$sourceGalanzObj
->
AddMachineUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//安装单-删除明细信息
public
function
delMachineUserProfileOrder
()
{
$param
=
$this
->
input
->
post
();
//验证参数
$obj
=
$this
->
receiveGalanzObj
();
$obj
->
SetValues
(
$param
);
$obj
->
CheckDelMachineUserProfileOrderValues
();
$values
=
$obj
->
GetValues
();
$this
->
saveLog
(
$values
[
'id'
],
'delMachineUserProfileOrder'
,
$param
);
$sourceGalanzObj
=
$this
->
sourceGalanzObj
(
$values
[
'account'
],
$values
[
'pwd'
]);
$order
=
$sourceGalanzObj
->
UserProfileOrderDetail
(
$values
[
'id'
]);
$order
=
$obj
->
SetDelMachineUserProfileOrderValues
(
$order
,
$values
);
$result
=
$sourceGalanzObj
->
DelMachineUserProfileOrder
(
$order
[
'new_id'
],
$order
);
$obj
->
ReturnMessage
(
true
,
''
,
$result
);
}
//发送安装单
//发送安装单
public
function
sendUserProfileOrder
()
public
function
sendUserProfileOrder
()
{
{
...
...
application/controllers/test/Rgalanz.php
View file @
db3cce1f
...
@@ -33,12 +33,15 @@ class Rgalanz extends BaseController
...
@@ -33,12 +33,15 @@ class Rgalanz extends BaseController
// self::$testu = 'W75509345';
// self::$testu = 'W75509345';
// self::$testp = 'dgqh!769';
// self::$testp = 'dgqh!769';
self
::
$testu
=
'C75500035'
;
//
self::$testu = 'C75500035';
self
::
$testp
=
'dgqh!769'
;
//
self::$testp = 'dgqh!769';
// self::$testu = 'c01000005';
// self::$testu = 'c01000005';
// self::$testp = 'weixiuhui010';
// self::$testp = 'weixiuhui010';
self
::
$testu
=
'C75500027'
;
self
::
$testp
=
'szwxh!755'
;
$this
->
load
->
library
(
'Receive/ReceiveGalanz'
,
null
,
'ReceiveGalanz'
);
$this
->
load
->
library
(
'Receive/ReceiveGalanz'
,
null
,
'ReceiveGalanz'
);
return
$this
->
ReceiveGalanz
;
return
$this
->
ReceiveGalanz
;
}
}
...
@@ -72,7 +75,7 @@ class Rgalanz extends BaseController
...
@@ -72,7 +75,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'mobile'
]
=
'13
925524202
'
;
$data
[
'mobile'
]
=
'13
424411750
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetValues
(
$data
);
...
@@ -140,7 +143,7 @@ class Rgalanz extends BaseController
...
@@ -140,7 +143,7 @@ class Rgalanz extends BaseController
$data
[
'appid'
]
=
'10001'
;
$data
[
'appid'
]
=
'10001'
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'account'
]
=
self
::
$testu
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'pwd'
]
=
self
::
$testp
;
$data
[
'id'
]
=
'
05a20b81-0a7d-4c3c-a478-c0a456ce309c
'
;
$data
[
'id'
]
=
'
1650bb3a-46b0-408c-9694-6549a8d9d068
'
;
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetValues
(
$data
);
...
@@ -560,15 +563,15 @@ class Rgalanz extends BaseController
...
@@ -560,15 +563,15 @@ class Rgalanz extends BaseController
'appid'
=>
'10001'
,
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
'pwd'
=>
self
::
$testp
,
'id'
=>
'
05a20b81-0a7d-4c3c-a478-c0a456ce309c
'
,
'id'
=>
'
1650bb3a-46b0-408c-9694-6549a8d9d068
'
,
'contactname'
=>
''
,
//姓名
'contactname'
=>
''
,
//姓名
'mobile'
=>
''
,
//手机
'mobile'
=>
''
,
//手机
'telephone'
=>
''
,
//电话
'telephone'
=>
''
,
//电话
'accountaddr'
=>
''
,
//地址
'accountaddr'
=>
''
,
//地址
'email'
=>
''
,
//邮箱
'email'
=>
''
,
//邮箱
'broughtdate'
=>
''
,
//购买时间
'broughtdate'
=>
strtotime
(
'2016-08-02 17:34:30'
)
,
//购买时间
'installdate'
=>
''
,
//安装时间
'installdate'
=>
strtotime
(
'2016-08-05 11:17:41'
)
,
//安装时间
'appointmenttime'
=>
''
,
//上门时间
'appointmenttime'
=>
strtotime
(
'2016-08-05 11:17:41'
)
,
//上门时间
'salesite'
=>
''
,
//商场
'salesite'
=>
''
,
//商场
'installer'
=>
''
,
//安装人员
'installer'
=>
''
,
//安装人员
'goldcard'
=>
''
,
//金卡
'goldcard'
=>
''
,
//金卡
...
@@ -590,6 +593,56 @@ class Rgalanz extends BaseController
...
@@ -590,6 +593,56 @@ class Rgalanz extends BaseController
$this
->
show
(
$result
[
'data'
]);
$this
->
show
(
$result
[
'data'
]);
}
}
public
function
addMachineUserProfileOrder
()
{
$obj
=
$this
->
galanzObj
();
$data
=
[
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
'id'
=>
'1650bb3a-46b0-408c-9694-6549a8d9d068'
,
'producenumber'
=>
'16Y101100021481'
];
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/addMachineUserProfileOrder"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
[
'data'
]);
}
public
function
delMachineUserProfileOrder
()
{
$obj
=
$this
->
galanzObj
();
$data
=
[
'appid'
=>
'10001'
,
'account'
=>
self
::
$testu
,
'pwd'
=>
self
::
$testp
,
'id'
=>
'1650bb3a-46b0-408c-9694-6549a8d9d068'
,
'chk'
=>
'de580f86-70db-4452-9c99-08d4aa273cbb'
];
$data
[
'nonce_str'
]
=
$obj
->
GetNonceStr
();
$obj
->
SetValues
(
$data
);
$obj
->
SetSign
();
$values
=
$obj
->
GetValues
();
$url
=
self
::
$apiUrl
.
"api/galanz/delMachineUserProfileOrder"
;
$result
=
$this
->
curlPost
(
$url
,
$values
);
$result
[
'data'
]
=
json_decode
(
$result
[
'data'
],
true
);
$this
->
show
(
$result
[
'data'
]);
}
private
function
show
(
$data
)
private
function
show
(
$data
)
{
{
echo
"<pre>"
;
echo
"<pre>"
;
...
...
application/libraries/Receive/ReceiveGalanz.php
View file @
db3cce1f
...
@@ -288,6 +288,41 @@ class ReceiveGalanz extends Receive
...
@@ -288,6 +288,41 @@ class ReceiveGalanz extends Receive
$this
->
SetDefaultValues
(
$dfields
);
$this
->
SetDefaultValues
(
$dfields
);
}
}
public
function
CheckAddMachineUserProfileOrderValues
()
{
$fileds
=
[
'id'
,
'producenumber'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
SetAddMachineUserProfileOrderValues
(
$order
,
$values
)
{
if
(
$values
[
'producenumber'
])
{
$order
[
'txtproducenumber'
]
=
trim
(
$values
[
'producenumber'
]);
}
return
$order
;
}
public
function
CheckDelMachineUserProfileOrderValues
()
{
$fileds
=
[
'id'
,
'chk'
];
$this
->
CheckValues
(
$fileds
);
}
public
function
SetDelMachineUserProfileOrderValues
(
$order
,
$values
)
{
if
(
$values
[
'chk'
]
&&
$order
[
'products'
])
{
foreach
(
$order
[
'products'
]
as
$kk
=>
$vv
)
{
if
(
$values
[
'chk'
]
==
$vv
[
'chk'
])
{
$vv
[
'checked'
]
=
1
;
$order
[
'products'
][
$kk
]
=
$vv
;
}
}
}
return
$order
;
}
public
function
SetSaveUserProfileOrderValues
(
$order
,
$values
)
public
function
SetSaveUserProfileOrderValues
(
$order
,
$values
)
{
{
//处理基本信息参数
//处理基本信息参数
...
...
application/libraries/Source/SourceGalanz.php
View file @
db3cce1f
...
@@ -625,10 +625,11 @@ class SourceGalanz extends Source
...
@@ -625,10 +625,11 @@ class SourceGalanz extends Source
foreach
(
$tr
[
1
]
as
$k
=>
$v
)
{
foreach
(
$tr
[
1
]
as
$k
=>
$v
)
{
$temp
=
$this
->
TableTdPreg
(
$v
);
$temp
=
$this
->
TableTdPreg
(
$v
);
$result
[]
=
[
$result
[]
=
[
'jqtm'
=>
$temp
[
1
],
//机器条码
'chk'
=>
$temp
[
0
],
'jxmc'
=>
$temp
[
2
],
//机型名称
'producenumber'
=>
$temp
[
1
],
//机器条码
'scrq'
=>
$temp
[
3
],
//生产日期
'productname'
=>
$temp
[
2
],
//机型名称
'ckrq'
=>
$temp
[
4
],
//出库日期
'shipdate'
=>
$temp
[
3
],
//生产日期
'outtime'
=>
$temp
[
4
],
//出库日期
];
];
}
}
}
}
...
@@ -650,6 +651,34 @@ class SourceGalanz extends Source
...
@@ -650,6 +651,34 @@ class SourceGalanz extends Source
return
$order
;
return
$order
;
}
}
/**
* 安装单-添加明细信息
* @param $id
* @param $data
* @return mixed
*/
public
function
AddMachineUserProfileOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelUserProfileOrder
(
$id
,
$data
,
'Add'
);
$this
->
HandelOrderError
(
$result
);
$order
=
$this
->
UserProfileOrderDetail
(
$id
);
return
$order
;
}
/**
* 安装单-删除明细信息
* @param $id
* @param $data
* @return mixed
*/
public
function
DelMachineUserProfileOrder
(
$id
,
$data
)
{
$result
=
$this
->
HandelUserProfileOrder
(
$id
,
$data
,
'Del'
);
$this
->
HandelOrderError
(
$result
);
$order
=
$this
->
UserProfileOrderDetail
(
$id
);
return
$order
;
}
/**
/**
* 安装单发送
* 安装单发送
* @param $id
* @param $id
...
@@ -1418,18 +1447,9 @@ class SourceGalanz extends Source
...
@@ -1418,18 +1447,9 @@ class SourceGalanz extends Source
*/
*/
private
function
HandelUserProfileOrder
(
$id
,
$data
,
$type
)
private
function
HandelUserProfileOrder
(
$id
,
$data
,
$type
)
{
{
switch
(
$type
){
case
'Save'
:
$target
=
'ctl00$ContentQuery$btnSave'
;
break
;
case
'Send'
:
$target
=
'ctl00$ContentQuery$btnSend'
;
break
;
}
$post
=
[
$post
=
[
'__EVENTTARGET'
=>
$target
,
'__EVENTTARGET'
=>
''
,
'__EVENTARGUMENT'
=>
''
,
'__EVENTARGUMENT'
=>
''
,
'__LASTFOCUS'
=>
''
,
'__LASTFOCUS'
=>
''
,
'__VIEWSTATE'
=>
$data
[
'__VIEWSTATE'
],
'__VIEWSTATE'
=>
$data
[
'__VIEWSTATE'
],
...
@@ -1478,7 +1498,7 @@ class SourceGalanz extends Source
...
@@ -1478,7 +1498,7 @@ class SourceGalanz extends Source
'ctl00$ContentData$new_installer'
=>
$data
[
'new_installer'
],
'ctl00$ContentData$new_installer'
=>
$data
[
'new_installer'
],
'ctl00$ContentData$new_goldcard'
=>
$data
[
'new_goldcard'
],
'ctl00$ContentData$new_goldcard'
=>
$data
[
'new_goldcard'
],
'ctl00$ContentData$new_remarks'
=>
$data
[
'new_remarks'
],
'ctl00$ContentData$new_remarks'
=>
$data
[
'new_remarks'
],
'ctl00$ContentData$txtproducenumber'
=>
$data
[
'txtproducenumber'
]
,
'ctl00$ContentData$txtproducenumber'
=>
''
,
'ctl00$ContentData$new_qualityresult'
=>
$data
[
'new_qualityresult'
],
'ctl00$ContentData$new_qualityresult'
=>
$data
[
'new_qualityresult'
],
'ctl00$ContentData$new_custadvice'
=>
$data
[
'new_custadvice'
],
'ctl00$ContentData$new_custadvice'
=>
$data
[
'new_custadvice'
],
'ctl00$ContentData$ownerid'
=>
$data
[
'ownerid'
],
'ctl00$ContentData$ownerid'
=>
$data
[
'ownerid'
],
...
@@ -1488,6 +1508,29 @@ class SourceGalanz extends Source
...
@@ -1488,6 +1508,29 @@ class SourceGalanz extends Source
'ctl00$ContentData$ifamount'
=>
$data
[
'ifamount'
],
'ctl00$ContentData$ifamount'
=>
$data
[
'ifamount'
],
];
];
switch
(
$type
){
case
'Save'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentQuery$btnSave'
;
break
;
case
'Send'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentQuery$btnSend'
;
break
;
case
'Add'
:
$post
[
'__EVENTTARGET'
]
=
'ctl00$ContentData$btnAdd'
;
$post
[
'ctl00$ContentData$txtproducenumber'
]
=
$data
[
'txtproducenumber'
];
break
;
case
'Del'
:
$post
[
'ctl00$ContentData$btnDelete'
]
=
'删除'
;
$products
=
$this
->
HandelUserProfileOrderProductsParam
(
$data
[
'products'
]);
$post
=
array_merge
(
$post
,
$products
);
break
;
}
//return_msg(true, '', $post);
$url
=
self
::
$host
.
'/Warranty/new_srv_userprofileEP.aspx?mainid=&mainidname=&attrcode=&id='
.
$id
;
$url
=
self
::
$host
.
'/Warranty/new_srv_userprofileEP.aspx?mainid=&mainidname=&attrcode=&id='
.
$id
;
$headers
=
$this
->
Header
(
$url
);
$headers
=
$this
->
Header
(
$url
);
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
$result
=
$this
->
CurlPost
(
$url
,
$post
,
$headers
);
...
@@ -1499,6 +1542,34 @@ class SourceGalanz extends Source
...
@@ -1499,6 +1542,34 @@ class SourceGalanz extends Source
return
$result
;
return
$result
;
}
}
/**
* 安装单-明细信息处理
* @param $data
* @return array
*/
private
function
HandelUserProfileOrderProductsParam
(
$data
)
{
$result
=
[];
if
(
$data
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$tempKey
=
str_pad
(
$k
,
2
,
'0'
,
STR_PAD_LEFT
);
$post
=
[
'ctl00$ContentData$rpt$ctl'
.
$tempKey
.
'$chk'
=>
$v
[
'chk'
],
];
if
(
!
isset
(
$v
[
'checked'
])
||
!
$v
[
'checked'
])
{
array_shift
(
$post
);
}
$post
&&
$result
=
array_merge
(
$result
,
$post
);
}
}
return
$result
;
}
/**
/**
* 派工单表单字段
* 派工单表单字段
* @return array
* @return array
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment