Commit fad8906e by chongli

后台占位的时候可以录入多个客人的手机号、姓名、性别。并在赛事活动分组导出的时候导出这些信息

parent e0f775f9
...@@ -121,7 +121,7 @@ public class EventCustomerInfoConttroller { ...@@ -121,7 +121,7 @@ public class EventCustomerInfoConttroller {
private XSSFWorkbook build(Map<String, List<OrderPlayerBean>> beansMap) { private XSSFWorkbook build(Map<String, List<OrderPlayerBean>> beansMap) {
XSSFWorkbook workBook = new XSSFWorkbook(); XSSFWorkbook workBook = new XSSFWorkbook();
XSSFSheet sheet = workBook.createSheet("playerGroup"); XSSFSheet sheet = workBook.createSheet("playerGroup");
String[] titles = { "编号", "打球日期", "TeeTime", "产品名称", "总金额", "下单人UID", "订单号", "手机号", "姓名", String[] titles = { "编号", "打球日期", "TeeTime", "产品名称", "总金额", "下单人UID", "订单号", "手机号", "姓名", "性别",
"实时/非实时", "来源", "优惠名称", "优惠金额", "社员/非社员" }; "实时/非实时", "来源", "优惠名称", "优惠金额", "社员/非社员" };
int[] sheetWitdh = { 32 * 256, 16 * 256, 8 * 256, 40 * 256, 8 * 256, 16 * 256, 16 * 256, int[] sheetWitdh = { 32 * 256, 16 * 256, 8 * 256, 40 * 256, 8 * 256, 16 * 256, 16 * 256,
16 * 256, 16 * 256, 16 * 256, 16 * 256, 32 * 256, 16 * 256, 16 * 256 }; 16 * 256, 16 * 256, 16 * 256, 16 * 256, 32 * 256, 16 * 256, 16 * 256 };
...@@ -152,11 +152,12 @@ public class EventCustomerInfoConttroller { ...@@ -152,11 +152,12 @@ public class EventCustomerInfoConttroller {
int orderId_cell_column = 6; int orderId_cell_column = 6;
int mobile_phone_cell_column = 7; int mobile_phone_cell_column = 7;
int player_name_cell_column = 8; int player_name_cell_column = 8;
int type_cell_column = 9; int player_gender_cell_column = 9;
int source_cell_column = 10; int type_cell_column = 10;
int voucherName_cell_column = 11; int source_cell_column = 11;
int voucherAmount_cell_column = 12; int voucherName_cell_column = 12;
int userGrade_cell_column = 13; int voucherAmount_cell_column = 13;
int userGrade_cell_column = 14;
if (i == 0) { if (i == 0) {
// 填充编号 // 填充编号
...@@ -210,6 +211,20 @@ public class EventCustomerInfoConttroller { ...@@ -210,6 +211,20 @@ public class EventCustomerInfoConttroller {
XSSFCell dataCell_8 = dataRow.createCell(player_name_cell_column); XSSFCell dataCell_8 = dataRow.createCell(player_name_cell_column);
dataCell_8.setCellValue(bean.getPlayerName()); dataCell_8.setCellValue(bean.getPlayerName());
// 填充性别
XSSFCell dataCell_20 = dataRow.createCell(player_gender_cell_column);
if(bean.getGender()!=null&&!"".equals(bean.getGender())){
if("M".equals(bean.getGender())){
dataCell_20.setCellValue("男");
}else if("F".equals(bean.getGender())){
dataCell_20.setCellValue("女");
}else{
dataCell_20.setCellValue("未知");
}
}else{
dataCell_20.setCellValue("未知");
}
dataCell_8.setCellValue(bean.getPlayerName());
// 填充来源 // 填充来源
XSSFCell dataCell_10 = dataRow.createCell(source_cell_column); XSSFCell dataCell_10 = dataRow.createCell(source_cell_column);
dataCell_10.setCellValue(bean.getSource()); dataCell_10.setCellValue(bean.getSource());
......
...@@ -29,6 +29,8 @@ import com.ctrip.fun.admin.template.FlashMessageDirective; ...@@ -29,6 +29,8 @@ import com.ctrip.fun.admin.template.FlashMessageDirective;
import com.ctrip.fun.common.core.util.DateUtil; import com.ctrip.fun.common.core.util.DateUtil;
import com.ctrip.fun.common.vo.Response; import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.ResponseStatusEnum; import com.ctrip.fun.common.vo.ResponseStatusEnum;
import com.ctrip.fun.common.vo.order.CustomerBean;
import com.ctrip.fun.common.vo.order.OfflineEventCustomerInfoBean;
import com.ctrip.fun.common.vo.order.RealTimeTeeTimeResourceInfoBean; import com.ctrip.fun.common.vo.order.RealTimeTeeTimeResourceInfoBean;
/** /**
...@@ -92,43 +94,41 @@ public class TeeTimeController { ...@@ -92,43 +94,41 @@ public class TeeTimeController {
* 临时占座 * 临时占座
*/ */
@RequestMapping(value = "/tempConfirm", method = RequestMethod.POST) @RequestMapping(value = "/tempConfirm", method = RequestMethod.POST)
public String tempConfirm(String resourceId, Date date, public String tempConfirm(ModelMap model,
@RequestParam(value = "phones[]") String[] phones, ModelMap model, RedirectAttributes redirectAttributes,OfflineEventCustomerInfoBean customerInfoBean) {
RedirectAttributes redirectAttributes) { model.put("resourceId", customerInfoBean.getResourceId());
model.put("resourceId", resourceId); model.put("date", customerInfoBean.getPriceDate());
model.put("date", date);
int rid = 0; int rid = 0;
try { try {
rid = Integer.valueOf(resourceId); rid = Integer.valueOf(customerInfoBean.getResourceId());
} catch (Exception e) { } catch (Exception e) {
} }
if (rid < 1 || date == null) { if (rid < 1 || customerInfoBean.getPriceDate() == null) {
addFlashMessage(redirectAttributes, "占座失败,参数错误"); addFlashMessage(redirectAttributes, "占座失败,参数错误");
return "redirect:search"; return "redirect:search";
} }
String redirectUrl = "redirect:search?resourceId=" + resourceId + "&date=" String redirectUrl = "redirect:search?resourceId=" + customerInfoBean.getResourceId() + "&date="
+ DateUtil.getDateStr(date); + DateUtil.getDateStr(customerInfoBean.getPriceDate());
if (phones == null || phones.length == 0) { if (customerInfoBean.getCustomerInfos() == null || customerInfoBean.getCustomerInfos().size() == 0) {
addFlashMessage(redirectAttributes, "占座失败,请输入客户电话号码"); addFlashMessage(redirectAttributes, "占座失败,请输入客户电话号码");
return redirectUrl; return redirectUrl;
} }
Set<String> distinctPhones = new HashSet<String>(); Set<String> distinctPhones = new HashSet<String>();
for (String phone : phones) { for (CustomerBean customerBean : customerInfoBean.getCustomerInfos()) {
if (StringUtils.isEmpty(phone)) { if (StringUtils.isEmpty(customerBean.getMobileNo())) {
addFlashMessage(redirectAttributes, "电话号码填写不完整"); addFlashMessage(redirectAttributes, "电话号码填写不完整");
return redirectUrl; return redirectUrl;
} }
if (!phone.matches("^(13|15|18|17|14)[0-9]{9}+$")) { if (!customerBean.getMobileNo().matches("^(13|15|18|17|14)[0-9]{9}+$")) {
addFlashMessage(redirectAttributes, "电话号码不符合规范(" + phone + ")"); addFlashMessage(redirectAttributes, "电话号码不符合规范(" + customerBean.getMobileNo() + ")");
return redirectUrl; return redirectUrl;
} }
if (!distinctPhones.add(phone)) { if (!distinctPhones.add(customerBean.getMobileNo())) {
addFlashMessage(redirectAttributes, "手机号码不能重复"); addFlashMessage(redirectAttributes, "手机号码不能重复");
return redirectUrl; return redirectUrl;
} }
} }
List<String> mobilePhones = Arrays.asList(phones); Response<Serializable> response = teeTimeService.tempConfirm(rid, customerInfoBean.getPriceDate(), customerInfoBean.getCustomerInfos());
Response<Serializable> response = teeTimeService.tempConfirm(rid, date, mobilePhones);
if (redirectAttributes == null) { if (redirectAttributes == null) {
addFlashMessage(redirectAttributes, "占座失败,请重试"); addFlashMessage(redirectAttributes, "占座失败,请重试");
} else if (response.getStatus() == ResponseStatusEnum.SUCCESS.getValue()) { } else if (response.getStatus() == ResponseStatusEnum.SUCCESS.getValue()) {
......
...@@ -145,6 +145,11 @@ public class OpEventActivityOrderController extends AbstractOpOrderController<Ev ...@@ -145,6 +145,11 @@ public class OpEventActivityOrderController extends AbstractOpOrderController<Ev
if (response.getResult() != null) { if (response.getResult() != null) {
for (EventActivityOrderListBean bean : response.getResult()) { for (EventActivityOrderListBean bean : response.getResult()) {
bean.setOrderStatusString(OrderStatusEnum.getOrderStatusEnum(bean.getOrderStatus()).getShowStatusName()); bean.setOrderStatusString(OrderStatusEnum.getOrderStatusEnum(bean.getOrderStatus()).getShowStatusName());
if (bean.getInvoiceId() == null || bean.getInvoiceId() == 0) {
bean.setIsInvoiceDesc("否");
} else {
bean.setIsInvoiceDesc("是");
}
} }
} }
......
...@@ -21,6 +21,7 @@ import com.ctrip.fun.admin.utility.SpringSecurityUtil; ...@@ -21,6 +21,7 @@ import com.ctrip.fun.admin.utility.SpringSecurityUtil;
import com.ctrip.fun.common.vo.Request; import com.ctrip.fun.common.vo.Request;
import com.ctrip.fun.common.vo.Response; import com.ctrip.fun.common.vo.Response;
import com.ctrip.fun.common.vo.ResponseStatusEnum; import com.ctrip.fun.common.vo.ResponseStatusEnum;
import com.ctrip.fun.common.vo.order.CustomerBean;
import com.ctrip.fun.common.vo.order.EventCustomerInfoOfflineLogBean; import com.ctrip.fun.common.vo.order.EventCustomerInfoOfflineLogBean;
import com.ctrip.fun.common.vo.order.OfflineEventCustomerInfoBean; import com.ctrip.fun.common.vo.order.OfflineEventCustomerInfoBean;
import com.ctrip.fun.common.vo.order.OpEventCustomerInfoQuery; import com.ctrip.fun.common.vo.order.OpEventCustomerInfoQuery;
...@@ -82,12 +83,12 @@ public class TeeTimeService extends BaseService { ...@@ -82,12 +83,12 @@ public class TeeTimeService extends BaseService {
* @return * @return
*/ */
public Response<Serializable> tempConfirm(int resourceId, Date priceDate, public Response<Serializable> tempConfirm(int resourceId, Date priceDate,
List<String> mobilePhones) { List<CustomerBean> customerBeans) {
String uri = super.getServiceUri("uri.teetime.tempConfirm"); String uri = super.getServiceUri("uri.teetime.tempConfirm");
Request<OfflineEventCustomerInfoBean> request = new Request<OfflineEventCustomerInfoBean>(); Request<OfflineEventCustomerInfoBean> request = new Request<OfflineEventCustomerInfoBean>();
request.setUserId(""); request.setUserId("");
OfflineEventCustomerInfoBean bean = new OfflineEventCustomerInfoBean(); OfflineEventCustomerInfoBean bean = new OfflineEventCustomerInfoBean();
bean.setMobilePhones(mobilePhones); bean.setCustomerInfos(customerBeans);
bean.setPriceDate(priceDate); bean.setPriceDate(priceDate);
bean.setResourceId(resourceId); bean.setResourceId(resourceId);
bean.setOperator(SpringSecurityUtil.getCurrentUserName()); bean.setOperator(SpringSecurityUtil.getCurrentUserName());
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<th>下单时间</th> <th>下单时间</th>
<th>状态</th> <th>状态</th>
<th>接管人</th> <th>接管人</th>
<th>已存发票信息</th>
<th>订单来源</th> <th>订单来源</th>
</tr> </tr>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td> <td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td>
<td>${item.orderStatusString!}</td> <td>${item.orderStatusString!}</td>
<td>${item.receiver!}</td> <td>${item.receiver!}</td>
<td>${item.isInvoiceDesc!}</td>
<td>${item.orderSourceCategory!}</td> <td>${item.orderSourceCategory!}</td>
</tr> </tr>
</#list> </#list>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<th>下单时间</th> <th>下单时间</th>
<th>状态</th> <th>状态</th>
<th>接管人</th> <th>接管人</th>
<th>已存发票信息</th>
<th>订单来源</th> <th>订单来源</th>
</tr> </tr>
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
<td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td> <td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td>
<td>${item.orderStatusString!}</td> <td>${item.orderStatusString!}</td>
<td>${item.receiver!}</td> <td>${item.receiver!}</td>
<td>${item.isInvoiceDesc!}</td>
<td>${item.orderSourceCategory!}</td> <td>${item.orderSourceCategory!}</td>
</tr> </tr>
</#list> </#list>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<th>下单时间</th> <th>下单时间</th>
<th>状态</th> <th>状态</th>
<th>接管人</th> <th>接管人</th>
<th>已存发票信息</th>
<th>订单来源</th> <th>订单来源</th>
</tr> </tr>
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
<td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td> <td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td>
<td>${item.orderStatusString!}</td> <td>${item.orderStatusString!}</td>
<td>${item.receiver!}</td> <td>${item.receiver!}</td>
<td>${item.isInvoiceDesc!}</td>
<td>${item.orderSourceCategory!}</td> <td>${item.orderSourceCategory!}</td>
</tr> </tr>
</#list> </#list>
......
...@@ -53,6 +53,7 @@ $(function(){ ...@@ -53,6 +53,7 @@ $(function(){
<th>订单号</th> <th>订单号</th>
<th>手机号</th> <th>手机号</th>
<th>姓名</th> <th>姓名</th>
<th>性别</th>
<th>实时/非实时</th> <th>实时/非实时</th>
<th>来源</th> <th>来源</th>
<th>优惠名称</th> <th>优惠名称</th>
...@@ -85,6 +86,19 @@ $(function(){ ...@@ -85,6 +86,19 @@ $(function(){
<td>${item.orderNo!""}</td> <td>${item.orderNo!""}</td>
<td>${item.mobilePhone!""}</td> <td>${item.mobilePhone!""}</td>
<td>${item.playerName}</td> <td>${item.playerName}</td>
<#if item.gender??>
<#if (item.gender=="M")>
<td>男</td>
<#elseif (item.gender=="F")>
<td>女</td>
<#else>
<td>未知</td>
</#if>
<#else>
<td>未知</td>
</#if>
<#if item_index==0> <#if item_index==0>
<td rowspan='${size}'>${item.type!""}</td> <td rowspan='${size}'>${item.type!""}</td>
</#if> </#if>
......
...@@ -21,6 +21,7 @@ $(function(){ ...@@ -21,6 +21,7 @@ $(function(){
return; return;
} }
$('#placehold_form').show(); $('#placehold_form').show();
createCustomInfo($('#number').val());
}) })
</#if> </#if>
<#if (teeTime.inventorySize>1) > <#if (teeTime.inventorySize>1) >
...@@ -30,17 +31,25 @@ $(function(){ ...@@ -30,17 +31,25 @@ $(function(){
} }
$('#number').change(function(){ $('#number').change(function(){
var value = $(this).val(); var value = $(this).val();
$('.phone_div:gt('+(value-1)+')').remove(); createCustomInfo(value)
var size = $('.phone_div').length;
if(value>size){
for(i=0;i<value-size;i++){
var phone_div = '<div class="long_content_div control-group phone_div"><label class="control-label" ></label><div class="controls"><input type="text" name="phones[]" value="" placeholder="电话号码" class="input-medium"><span class="help-inline"><font color=red>*</font></span></div></div>';
// $('.phone_div:eq(0)').after(phone_div);
$('.phone_div:last').after(phone_div);
}
}
}) })
</#if> </#if>
//建立占座客户信息
function createCustomInfo(num){
$('#customInfo').html('');
var len = num || 0,phone_div = ''
if(len>=1){
for(var i=0;i<len;i++){
phone_div += '<div class="long_content_div control-group phone_div">电话号码<input type="text" name="customerInfos['+ i +'].mobileNo" value="" placeholder="电话号码" class="width:150px">'+
'姓名<input type="text" name="customerInfos['+ i +'].name"" value="" placeholder="姓名" class="width:150px">'+
'性别<input type="radio" name="customerInfos['+ i +'].gender" value="M" checked>男<input type="radio" name="customerInfos['+ i +'].gender" value="F">女</div>'
}
$('#customInfo').html(phone_div);
}
}
</#if> </#if>
}) })
...@@ -93,7 +102,7 @@ $(function(){ ...@@ -93,7 +102,7 @@ $(function(){
<#if teeTime?? && (teeTime.inventorySize>0)> <#if teeTime?? && (teeTime.inventorySize>0)>
<form class="form-inline form-horizontal" action="tempConfirm" method="post" id="placehold_form" style="display:none"> <form class="form-inline form-horizontal" action="tempConfirm" method="post" id="placehold_form" style="display:none">
<input type="hidden" name="resourceId" id="resourceId" value="${resourceId!""}"/> <input type="hidden" name="resourceId" id="resourceId" value="${resourceId!""}"/>
<input type="hidden" name="date" id="date" value="<#if date??>${date?string("yyyy-MM-dd")}</#if>"/> <input type="hidden" name="priceDate" id="date" value="<#if date??>${date?string("yyyy-MM-dd")}</#if>"/>
<div id="course_container"> <div id="course_container">
<div class="row-fluid show-grid"> <div class="row-fluid show-grid">
<h3 class="span12" data-collapse-summary="" aria-expanded="true">TeeTime选择</h3> <h3 class="span12" data-collapse-summary="" aria-expanded="true">TeeTime选择</h3>
...@@ -105,12 +114,8 @@ $(function(){ ...@@ -105,12 +114,8 @@ $(function(){
</select> </select>
</div> </div>
<div class="long_content_div control-group phone_div"> <div class="long_content_div control-group phone_div" id="customInfo">
<label class="control-label" for="phones">电话号码</label>
<div class="controls">
<input type="text" name="phones[]" value="" placeholder="电话号码" class="input-medium">
<span class="help-inline"><font color=red>*</font></span>
</div>
</div> </div>
<div class="long_content_div control-group"> <div class="long_content_div control-group">
......
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 sign in to comment