Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f1f597ce
authored
Oct 25, 2018
by
Huang Linyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'f-6.6.9' into f-6.7.0
parents
e4adeb46
0130552f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
271 additions
and
0 deletions
src/main/java/com/ctrip/fun/admin/controller/market/CommuneExtConttroller.java
src/main/java/com/ctrip/fun/admin/service/market/CommuneExtService.java
src/main/resources/properties/service.properties
src/main/webapp/WEB-INF/templates/common/layout.ftl
src/main/webapp/WEB-INF/templates/market/communeExt/activeCustomerList.ftl
src/main/java/com/ctrip/fun/admin/controller/market/CommuneExtConttroller.java
View file @
f1f597ce
...
...
@@ -22,8 +22,10 @@ import org.springframework.ui.ModelMap;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.ctrip.fun.admin.form.PaginationForm
;
...
...
@@ -40,6 +42,8 @@ import com.ctrip.fun.common.vo.PagedResponseBean;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.basic.EntityImageBean
;
import
com.ctrip.fun.common.vo.basic.GenderEnum
;
import
com.ctrip.fun.common.vo.user.ActiveCustomerBean
;
import
com.ctrip.fun.common.vo.user.ActiveCustomerQuery
;
import
com.ctrip.fun.common.vo.user.CommuneAdmBean
;
import
com.ctrip.fun.common.vo.user.CommuneAdmQuery
;
import
com.ctrip.fun.common.vo.user.CommuneExtBean
;
...
...
@@ -97,6 +101,43 @@ public class CommuneExtConttroller {
return
"market/communeExt/list"
;
}
/**
* 待转正客户信息
*/
@RequestMapping
(
value
=
"activeCustomers"
,
method
=
RequestMethod
.
GET
)
public
String
queryActiveCustomerList
(
HttpServletRequest
request
,
@ModelAttribute
(
"dto"
)
ActiveCustomerQuery
query
,
ModelMap
model
)
{
int
currentPage
=
0
;
int
pageSize
;
int
total
;
int
pageCount
;
if
(
null
!=
request
.
getParameter
(
"page"
))
{
currentPage
=
Integer
.
parseInt
(
request
.
getParameter
(
"page"
));
}
query
.
setPagerOffset
(
currentPage
*
query
.
getPagerPerPage
());
PagedResponseBean
<
ActiveCustomerBean
>
response
=
communeExtService
.
queryActiveCustomerList
(
query
);
pageSize
=
query
.
getPagerPerPage
();
total
=
response
.
getCount
();
pageCount
=
(
0
==
total
%
pageSize
)
?
(
total
/
pageSize
)
:
(
total
/
pageSize
+
1
);
model
.
put
(
"list"
,
response
.
getResult
());
model
.
put
(
"paginationData"
,
new
PaginationForm
(
currentPage
,
pageSize
,
pageCount
,
total
));
return
"market/communeExt/activeCustomerList"
;
}
@RequestMapping
(
value
=
"/activeCustomer/updateState"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Response
<
Object
>
updateActiveCustomerState
(
@RequestBody
ActiveCustomerQuery
params
)
{
params
.
setAuditUser
(
SpringSecurityUtil
.
getCurrentUserName
());
Response
<
Object
>
response
=
communeExtService
.
updateActiveCustomerState
(
params
);
return
response
;
}
@RequestMapping
(
value
=
"create"
,
method
=
RequestMethod
.
GET
)
public
String
toCreate
(
HttpServletRequest
request
,
@ModelAttribute
(
"dto"
)
CommuneExtBean
dto
,
ModelMap
model
)
{
model
.
put
(
"action"
,
"/communeExt/create"
);
...
...
src/main/java/com/ctrip/fun/admin/service/market/CommuneExtService.java
View file @
f1f597ce
...
...
@@ -28,6 +28,8 @@ import com.ctrip.fun.common.vo.PagedResponseBean;
import
com.ctrip.fun.common.vo.Request
;
import
com.ctrip.fun.common.vo.Response
;
import
com.ctrip.fun.common.vo.basic.GenderEnum
;
import
com.ctrip.fun.common.vo.user.ActiveCustomerBean
;
import
com.ctrip.fun.common.vo.user.ActiveCustomerQuery
;
import
com.ctrip.fun.common.vo.user.CheckedRegionEnum
;
import
com.ctrip.fun.common.vo.user.CommuneExtBean
;
import
com.ctrip.fun.common.vo.user.CommuneExtQuery
;
...
...
@@ -460,4 +462,50 @@ public class CommuneExtService extends BaseService {
return
String
.
valueOf
(
xssfCell
.
getStringCellValue
());
}
}
/**
* TODO Auto-generated method stub
* @param query
* @return
*/
public
PagedResponseBean
<
ActiveCustomerBean
>
queryActiveCustomerList
(
ActiveCustomerQuery
query
)
{
String
uri
=
super
.
getServiceUri
(
"uri.communeExt.activeCustomer.list"
);
PagedResponseBean
<
ActiveCustomerBean
>
responseBean
=
new
PagedResponseBean
<
ActiveCustomerBean
>(
0
,
new
ArrayList
<
ActiveCustomerBean
>());
Request
<
ActiveCustomerQuery
>
request
=
new
Request
<
ActiveCustomerQuery
>(
""
,
query
);
HttpEntity
<
Request
<
ActiveCustomerQuery
>>
entity
=
new
HttpEntity
<
Request
<
ActiveCustomerQuery
>>(
request
);
Response
<
PagedResponseBean
<
ActiveCustomerBean
>>
response
=
null
;
try
{
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<
PagedResponseBean
<
ActiveCustomerBean
>>>()
{
}).
getBody
();
}
catch
(
RestClientException
e
)
{
e
.
printStackTrace
();
}
if
(
response
!=
null
&&
response
.
getStatus
()
==
0
)
{
responseBean
=
response
.
getBody
();
}
else
{
logger
.
error
(
String
.
format
(
"[公社会员扩展列表获取异常] status: %d, msg: %s"
,
response
.
getStatus
(),
response
.
getMessage
()));
}
return
responseBean
;
}
public
Response
<
Object
>
updateActiveCustomerState
(
ActiveCustomerQuery
params
)
{
String
uri
=
super
.
getServiceUri
(
"uri.communeExt.activeCustomer.updateState"
);
// String uri = super.getServiceUri("uri.communeExt.update");
Request
<
ActiveCustomerQuery
>
request
=
new
Request
<
ActiveCustomerQuery
>(
""
,
params
);
HttpEntity
<
Request
<
ActiveCustomerQuery
>>
entity
=
new
HttpEntity
<
Request
<
ActiveCustomerQuery
>>(
request
);
Response
<
Object
>
response
=
super
.
exchange
(
uri
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
Response
<
Object
>>()
{
}).
getBody
();
return
response
;
}
}
src/main/resources/properties/service.properties
View file @
f1f597ce
...
...
@@ -487,6 +487,10 @@ uri.communeExt.getByPhone=/fun-golf-service/communeExt/getByPhone
uri.communeExt.getByCommuneNo
=
/fun-golf-service/communeExt/getByCommuneNo
uri.communeExt.importCommuneExts
=
/fun-golf-service/communeExt/importCommuneExts
uri.communeExt.activeCustomer.list
=
/fun-golf-service/activeCustomer/list
uri.communeExt.activeCustomer.updateState
=
/fun-golf-service/activeCustomer/updateState
#communeAdm
uri.communeAdm.list
=
/fun-golf-service/communeAdm/list
...
...
src/main/webapp/WEB-INF/templates/common/layout.ftl
View file @
f1f597ce
...
...
@@ -371,6 +371,9 @@ ${pageCss}
<li
<#
if
current =
=
"
communeExt_import
"
>
class="active"
</
#
if>
>
<a
href=
"/communeExt/import"
>
导入
</a>
</li>
<li
<#
if
current =
=
"
communeExt_active_customer
"
>
class="active"
</
#
if>
>
<a
href=
"/communeExt/activeCustomers"
>
业务提交数据
</a>
</li>
<li
class=
"nav-header"
>
推广活动
</li>
<li
<#
if
current =
=
"
communeInviteActivity_list
"
>
class="active"
</
#
if>
>
...
...
src/main/webapp/WEB-INF/templates/market/communeExt/activeCustomerList.ftl
0 → 100644
View file @
f1f597ce
<#assign pageJsContent>
<script>
$("#selectButton").click(function(){
$("#formId").attr("action","/communeExt/activeCustomers").submit();
});
$("#excelButton").click(function(){
$("#formId").attr("action","/communeExt/excel").submit();
});
$("#communeBtn").click(function(){
var params = {id:$('#nids').val(),auditState:4,communeNo: $('#communeNo').val()};
//ajax请求
sendRequest(params);
});
function updateState(id,state){
if(state==2||state==4 ||(state == 99 && confirm("您确定要驳回该请求吗?"))){
var params = {id:id,auditState:state}
//ajax请求
sendRequest(params);
}
}
//添加到社员
function add2Commune(id,state){
$('#communeNoModal').modal('show');
$('#nids').val(id);
}
function sendRequest(params){
$.ajax({
url: "/communeExt/activeCustomer/updateState",
type: "post",
contentType: "application/json;charset=utf-8;",
data: JSON.stringify(params),
success: function (res) {
if(res.status == 0){
if(params.auditState==4){
if(confirm(res.message)){
window.open("/communeExt/update?id="+res.body+"&page=0");
}
$('#communeNoModal').modal('hide');
window.location.reload();
}else{
alert(res.message);
window.location.reload();
}
}
}
});
}
$('#communeNoModal').on('hidden.bs.modal', function (e) {
$('#nids').val("");
$('#communeNo').val("");
})
</script>
</#assign>
<#assign pageCssContent>
<style>
.table th, .table td{ text-align:center;vertical-align:middle;}
.widthShow {
width: 1100px;
}
</style>
</#assign>
<@com.layout title="审批社员信息" module="communeOrder" current="communeExt_active_customer" pageCss=pageCssContent pageJs=pageJsContent>
<form id="formId" class="form-inline search-box widthShow" action="" method="get" autocomplete="off" >
<@com.textInput "dto.productName" "style=\"margin-left: 5px;\"" "产品名称"/>
<@com.textInput "dto.customerName" "style=\"margin-left: 5px;\"" "客户姓名"/>
<@com.textInput "dto.customerMobile" "style=\"margin-left: 5px;\"" "客户姓号码"/>
<br />
<@com.textInput "dto.saleName" "style=\"margin-left: 5px;\"" "销售姓名"/>
<@com.textInput "dto.saleMobile" "style=\"margin-left: 5px;\"" "销售号码"/>
<br />
<@com.textInput "dto.auditUser" "style=\"margin-left: 5px;\"" "审批人"/>
<@com.singleSelectQuery path="dto.auditState" options=enums["com.ctrip.fun.common.vo.user.ActiveCustomerAuditStatusEnum"] label="审批状态"/>
<br />
<button type="button" id="selectButton" class="btn btn-primary">查询</button>
<button type="button" class="btn btn-success" onclick="javascript:location.href='/communeExt/activeCustomers';" style="margin-left:20px;">重置</button>
</form>
<table class="table table-bordered table-striped widthShow">
<thead>
<tr>
<th>产品名称</th>
<th>客户姓名</th>
<th>客户电话</th>
<th>客户性别</th>
<th>开单人</th>
<th>开单人手机号码</th>
<th>提交时间</th>
<th>审批状态</th>
<th>审批人</th>
<th colspan=1>操作</th>
</tr>
</thead>
<tbody>
<#list list as item>
<tr>
<td>${item.productName!}</td>
<td>${item.customerName!}</td>
<td>${item.customerMobile!}</td>
<td>
<#if item.sex == 'M'>男
<#elseif item.sex == 'F'>女
</#if>
</td>
<td>${item.saleName!}</td>
<td>${item.saleMobile!}</td>
<td><#if item.createTime??>${item.createTime?string("yyyy-MM-dd hh:mm:ss")}</#if></td>
<td>
<#if item.auditState == 1>未审批
<#elseif item.auditState == 2>财务确认
<#elseif item.auditState == 4>已录入公社
<#elseif item.auditState == 99>驳回
</#if>
</td>
<td>${item.auditUser!}</td>
<td>
<a href="${item.picUrl!}" target="_blank">查看凭据</a>
<#if item.auditState == 1>
<a href="#" onclick="updateState('${item.id!}',2);">确认收款</a>
<a href="#" onclick="updateState('${item.id!}',99);">驳回</a>
<#elseif item.auditState == 2>
<a href="#" onclick="add2Commune('${item.id!}',4);">录入公社</a>
<a href="#" onclick="updateState('${item.id!}',99);">驳回</a>
</#if>
</td>
</tr>
</#list>
</tbody>
</table>
<div class="pagination pagination-right widthShow">
<ul>
<@paginator.first />
<@paginator.previous />
<@paginator.numbers separator=""/>
<@paginator.next />
<@paginator.last />
</ul>
<@paginator.statistics />
</div>
<div class="modal hide fade" id="communeNoModal" style="display:none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>录入公社信息</h3>
</div>
<div class="modal-body">
<form class="form-inline form-horizontal" method="post" id="nameForm">
<div class="row-fluid show-grid">
<div class="control-group ">
<label class="control-label" for="communeNo">社员证编号:</label>
<div class="controls">
<input type="text" id="communeNo" name="communeNo" value="" required>
<font color="red">*</font>
</div>
</div>
</div>
<input type="hidden" id="nids" name="nids"/>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary pull-right bottom_margin" data-loading-text="执行中..."
id="communeBtn">提交
</button>
</div>
</div>
</@com.layout>
\ No newline at end of file
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