package com.matrix.system.hive.action;
|
|
import com.matrix.core.anotations.RemoveRequestToken;
|
import com.matrix.core.constance.MatrixConstance;
|
import com.matrix.core.exception.GlobleException;
|
import com.matrix.core.pojo.AjaxResult;
|
import com.matrix.core.pojo.PaginationVO;
|
import com.matrix.core.pojo.VerifyResult;
|
import com.matrix.core.tools.DateUtil;
|
import com.matrix.core.tools.StringUtils;
|
import com.matrix.core.tools.WebUtil;
|
import com.matrix.core.tools.excl.ExcelSheetPO;
|
import com.matrix.core.tools.excl.ExcelUtil;
|
import com.matrix.core.tools.excl.ExcelVersion;
|
import com.matrix.system.common.bean.SysUsers;
|
import com.matrix.system.common.service.SysUsersService;
|
import com.matrix.system.common.tools.ResponseHeadUtil;
|
import com.matrix.system.constance.Dictionary;
|
import com.matrix.system.hive.bean.*;
|
import com.matrix.system.hive.dao.*;
|
import com.matrix.core.tools.DateUtil;
|
import com.matrix.system.hive.pojo.TaoCanVo;
|
import com.matrix.system.hive.service.*;
|
import org.apache.commons.collections.CollectionUtils;
|
import org.jsoup.helper.DataUtil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.ModelMap;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import javax.annotation.Resource;
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.IOException;
|
import java.io.OutputStream;
|
import java.net.URLEncoder;
|
import java.util.*;
|
|
|
/**
|
* @description 订单服务信息管理
|
*/
|
@Controller
|
@RequestMapping(value = "admin/projService")
|
public class ProjServiceController extends BaseController {
|
@Resource
|
private SysProjServicesService projServicesSerivce;
|
@Resource
|
private SysProjUseService projUseService;
|
@Resource
|
private SysBedInfoService bedInfoService;
|
|
@Autowired
|
private SysBeauticianStateDao sysBeauticianStateDao;
|
|
@Autowired
|
SysProjGoodsDao sysProjGoodsDao;
|
|
@Resource
|
private SysVipInfoService vipInfoService;
|
|
@Resource
|
private SysProjServicesService sysProjServicesService;
|
|
@Resource
|
private SysUsersService usersService;
|
|
@Resource
|
private SysVipInfoService sysVipInfoService;
|
|
@Resource
|
private OnlinebookingService onlinebookingService;
|
|
@Autowired
|
private SysProjServicesDao sysProjServicesDao;
|
|
@Autowired
|
private SysBeauticianStateDao beauticianStateDao;
|
|
@Autowired
|
AchieveNewService achieveNewService;
|
|
@Autowired
|
private ProjUserTools projUserTools;
|
|
@Autowired
|
private SysBedStateDao sysBedStateDao;
|
|
@Autowired
|
private ShoppingGoodsDao shoppingGoodsDao;
|
|
@Autowired
|
ShoppingGoodsAssembleDao goodsAssembleDao;
|
|
@Autowired
|
SysShopInfoDao shopInfoDao;
|
|
/**
|
* 根据id查询服务单信息
|
*/
|
@RequestMapping(value = "/findProjServiceInfo")
|
public @ResponseBody
|
AjaxResult findProjServiceInfo(Long id) {
|
// 获取服务单信息
|
SysProjServices projServices = sysProjServicesService.findById(id);
|
if (projServices != null) {
|
// 获取会员信息
|
projServices.setVipInfo(sysVipInfoService.findById(projServices.getVipId()));
|
}
|
//补充服务单扩展信息===============
|
List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(id);
|
projServices.setServiceItems(beauticianStateList);
|
SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId());
|
projServices.setBedState(sysBedState);
|
//补充服务单扩展信息===============END
|
|
AjaxResult result = new AjaxResult();
|
result.putInMap("projService", projServices);
|
|
//打印需求加入门店信息
|
result.putInMap("shopInfo",shopInfoDao.selectById(projServices.getShopId()));
|
|
result.setStatus(AjaxResult.STATUS_SUCCESS);
|
return result;
|
}
|
|
|
/**
|
* 分页显示所有的订单服务信息
|
*/
|
@RequestMapping(value = "/showList")
|
public @ResponseBody
|
AjaxResult showList(SysProjServices projService, PaginationVO pageVo) {
|
//默认排序
|
if (StringUtils.isBlank(pageVo.getSort())) {
|
pageVo.setSort("create_time");
|
}
|
if (StringUtils.isBlank(pageVo.getOrder())) {
|
pageVo.setOrder("desc");
|
}
|
projService.setShopId(getMe().getShopId());
|
List<SysProjServices> dataList = projServicesSerivce.findInPage(projService, pageVo);
|
AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, projServicesSerivce.findTotal(projService));
|
return result;
|
}
|
|
/**
|
* 根据当前登录人参加的服务单进行查找
|
*/
|
@RequestMapping(value = "/getStaffServiceOrder")
|
public @ResponseBody
|
AjaxResult findService(SysProjServices projServvices, PaginationVO pageVo) {
|
projServvices.setQueryStaffId(getMe().getSuId());
|
return showList(projServvices, pageVo);
|
}
|
|
//==========================页面跳转==========================
|
|
/**
|
* 进入更新服务订单界面
|
*/
|
@RequestMapping(value = "/toServiceOrderUpdateTime")
|
public String toServiceOrderUpdateTime(Long id) {
|
// 根据id查到对应的订单信息
|
SysProjServices serviceOrder = sysProjServicesService.findById(id);
|
WebUtil.getRequest().setAttribute("serviceOrder", serviceOrder);
|
return "admin/hive/beautySalon/updateServiceOrderTime";
|
}
|
|
|
/**
|
* 获取用户所有可用的项目和套餐
|
* @return
|
*/
|
@RequestMapping(value = "/getUserProjInfo")
|
public @ResponseBody
|
AjaxResult getUserProjInfo(Long vipId) {
|
AjaxResult result = AjaxResult.buildSuccessInstance("查询成功");
|
|
SysProjUse queryUse = new SysProjUse();
|
if(Objects.nonNull(vipId)){
|
queryUse.setVipId(vipId);
|
}else{
|
SysVipInfo vipInfo = getCurrentVioInfo();
|
queryUse.setVipId(vipInfo.getId());
|
}
|
|
queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM);
|
queryUse.setTaocanId(-1L);
|
queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX);
|
queryUse.setIsOver(Dictionary.FLAG_NO_N);
|
List<SysProjUse> projList = projUseService.findInPage(queryUse, null);
|
//切换到套餐查询条件
|
queryUse.setTaocanId(null);
|
queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC);
|
List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null);
|
taoCanList.forEach(item->{
|
item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId()));
|
item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId()));
|
});
|
result.putInMap("projList", projList);
|
result.putInMap("taoCanList", taoCanList);
|
|
return result;
|
}
|
|
|
/**
|
* 进入划扣页面
|
*/
|
@RequestMapping(value = "/serviceHkPage")
|
public String serviceHkPage(Long id, int pageFlae) {
|
// 获取服务单信息
|
SysProjServices projServices = sysProjServicesService.findById(id);
|
|
projServices.setVipInfo(sysVipInfoService.findById(projServices.getVipId()));
|
|
//补充服务单扩展信息===============
|
List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(id);
|
projServices.setServiceItems(beauticianStateList);
|
|
SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId());
|
projServices.setBedState(sysBedState);
|
//补充服务单扩展信息===============END
|
|
// 获取服务单所有信息
|
WebUtil.getRequest().setAttribute("obj", projServices);
|
WebUtil.getRequest().setAttribute("serviceId", id);
|
WebUtil.getRequest().setAttribute("pageFlae", pageFlae);
|
|
// 准备页面数据
|
pageDate();
|
SysBedInfo bedInfo = new SysBedInfo();
|
bedInfo.setShopId(getMe().getShopId());
|
WebUtil.getRequest().setAttribute("cw", bedInfoService.findByModel(bedInfo));
|
return "admin/hive/beautySalon/service-hk";
|
}
|
|
/**
|
* 编辑排班详情
|
*/
|
@RequestMapping(value = "/yypb")
|
public String findProject(Long id, int pageFlae, String dateTime) {
|
// 获取服务单信息
|
SysProjServices projServices = sysProjServicesService.findById(id);
|
// 获取操作的用户
|
projServices.setVipInfo(sysVipInfoService.findById(projServices.getVipId()));
|
|
// 设置排班的默认日期
|
if (dateTime == null || dateTime.equals("")) {
|
|
SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getBedId(), projServices.getId());
|
|
if (sysBedState != null && sysBedState.getStartTime() != null) {
|
dateTime = DateUtil.dateToString(sysBedState.getStartTime(), DateUtil.DATE_FORMAT_DD);
|
} else {
|
dateTime = DateUtil.dateToString(projServices.getYyTime(), DateUtil.DATE_FORMAT_DD);
|
}
|
}
|
WebUtil.getRequest().setAttribute("dateTime", dateTime);
|
// 获取服务单所有信息
|
WebUtil.getRequest().setAttribute("obj", projServices);
|
WebUtil.getRequest().setAttribute("pageFlae", pageFlae);
|
|
// 获取服务单对一下的项目信息
|
// 准备页面数据
|
pageDate();
|
|
SysBedInfo bedInfo = new SysBedInfo();
|
bedInfo.setShopId(getMe().getShopId());
|
// 床位
|
WebUtil.getRequest().setAttribute("cw", bedInfoService.findByModel(bedInfo));
|
// 显示当前查询的服务订单的项目信息
|
return "admin/hive/beautySalon/yypb-form";
|
}
|
|
/**
|
* 进入预约排班详情
|
*
|
* @author 姜友瑶
|
*/
|
@RequestMapping(value = "/serviceInfo")
|
public String findPbxq(SysProjServices projServicesVo) {
|
|
|
// 获取服务单信息
|
SysProjServices projServices = null;
|
if(projServicesVo.getId()!=null){
|
projServices= sysProjServicesService.findById(projServicesVo.getId());
|
}else if(StringUtils.isNotBlank(projServicesVo.getServiceNo())) {
|
List<SysProjServices> byModel = sysProjServicesService.findByModel(projServicesVo);
|
if (byModel.size() == 1) {
|
projServices= sysProjServicesService.findById( byModel.get(0).getId());
|
}
|
}
|
if(projServices==null){
|
throw new GlobleException("未查询到单据信息");
|
}
|
|
// 获取服务单所有信息
|
|
// 设置会员信息
|
projServices.setVipInfo(sysVipInfoService.findById(projServices.getVipId()));
|
|
//补充服务单扩展信息===============
|
List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId());
|
projServices.setServiceItems(beauticianStateList);
|
|
SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId());
|
projServices.setBedState(sysBedState);
|
//补充服务单扩展信息===============END
|
|
WebUtil.getRequest().setAttribute("obj", projServices);
|
WebUtil.getRequest().setAttribute("serviceId", projServicesVo.getId());
|
WebUtil.getRequest().setAttribute("pageFlae", projServicesVo.getPageFlae());
|
pageDate();
|
|
SysBedInfo bedInfo = new SysBedInfo();
|
bedInfo.setShopId(getMe().getShopId());
|
WebUtil.getRequest().setAttribute("cw", bedInfoService.findByModel(bedInfo));
|
// 显示当前查询的服务订单的项目信息
|
|
if ("pc".equals(projServicesVo.getPageFlae())) {
|
return "admin/hive/beautySalon/pbxq-form";
|
} else {
|
return "admin/hive/mobile/order-use-look-endService";
|
}
|
|
|
}
|
|
|
/**
|
* 弹出框,开始配料
|
*/
|
@RequestMapping(value = "/startpl")
|
public String startpl(Long id) {
|
// 将服务状态为待配料的更新为配料中
|
SysProjServices sysProjServices = projServicesSerivce.findById(id);
|
List<SysBeauticianState> beauticianStateList = sysBeauticianStateDao.selectBySerIds(sysProjServices.getId());
|
List<ShoppingGoods> projInfoList = new ArrayList<>();
|
for (SysBeauticianState beauticianState : beauticianStateList) {
|
ShoppingGoods sysProjInfo = shoppingGoodsDao.selectById(beauticianState.getProjId());
|
sysProjInfo.setAssembleGoods(goodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysProjInfo.getId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP));
|
projInfoList.add(sysProjInfo);
|
}
|
WebUtil.getRequest().setAttribute("serviceId", id);
|
WebUtil.getRequest().setAttribute("projInfoList", projInfoList);
|
|
return "admin/hive/store/projServiceStartpl-list";
|
}
|
//==========================页面跳转END==========================
|
|
/**
|
* @author jiangyouyao
|
* @date 2016-07-26
|
* 将预约成功待处理状态改变为服务中
|
*/
|
@RequestMapping(value = "/startService")
|
public @ResponseBody
|
AjaxResult startService(SysProjServices projServvices) {
|
int result = sysProjServicesService.modifyFWKSProjServices(projServvices);
|
if (result > 0) {
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "开始服务成功");
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "开始服务失败");
|
}
|
}
|
|
|
/**
|
* @author jiangyouyao
|
* @date 2016-07-26
|
* 将服务中改为服务完成
|
*/
|
@RequestMapping(value = "/endService")
|
public @ResponseBody
|
AjaxResult endService(Long id) {
|
SysProjServices projServvices = new SysProjServices();
|
projServvices.setId(id);
|
int result = sysProjServicesService.modifyFWJSrojServices(projServvices);
|
if (result > 0) {
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "结束服务成功");
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "结束服务失败");
|
}
|
}
|
|
/**
|
* 更新订单的时间
|
*/
|
@RequestMapping(value = "/updateOrderTime")
|
public @ResponseBody
|
AjaxResult updateOrderTime(SysProjServices serviceQuery) {
|
SysProjServices services = sysProjServicesDao.selectById(serviceQuery.getId());
|
sysProjServicesDao.updateOrderTime(serviceQuery.getCreateTime(), serviceQuery.getId());
|
// 更新业绩时间
|
AchieveNew achieveNew = new AchieveNew();
|
achieveNew.setServiceOrderId(serviceQuery.getId());
|
achieveNew.setDatatime(serviceQuery.getCreateTime());
|
achieveNewService.modifyAchieveTime(achieveNew);
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
|
}
|
|
/**
|
* 手动调接口划扣所有服务完成的为服务
|
*/
|
@RequestMapping(value = "/autoHk")
|
public @ResponseBody
|
AjaxResult autoHk() {
|
// 根据id查到对应的订单信息
|
SysProjServices sysProjServices = new SysProjServices();
|
sysProjServices.setState(Dictionary.SERVICE_STATU_FWWC);
|
sysProjServices.setBeginTime(DateUtil.stringToDate("2019-03-01", DateUtil.DATE_FORMAT_DD));
|
List<SysProjServices> serviceOrders = sysProjServicesService.findByModel(sysProjServices);
|
System.out.println("共找到服务单" + serviceOrders.size());
|
for (SysProjServices itemService : serviceOrders) {
|
if (itemService != null) {
|
achieveNewService.addAchieveByServiceOrder(itemService);
|
System.out.println("处理完成" + itemService.getId());
|
}
|
}
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "成功");
|
}
|
|
|
/**
|
* 根据id对服务单进行派单
|
*/
|
@RequestMapping(value = "/paidan")
|
public @ResponseBody
|
AjaxResult paidan(Long id) {
|
SysProjServices services = sysProjServicesService.findById(id);
|
int i = sysProjServicesService.modifyPDProjServices(services);
|
if (i > 0) {
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "派单成功");
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "派单失败");
|
}
|
}
|
|
/**
|
* 根据id取消预约
|
*/
|
@RequestMapping(value = "/cancelOrder")
|
public @ResponseBody
|
AjaxResult cancelOrder(SysProjServices services) {
|
int i = sysProjServicesService.modifyCancelProjServices(services);
|
if (i > 0) {
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "取消预约成功");
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "取消预约失败");
|
}
|
}
|
|
|
/**
|
* 设置服务单划扣成功
|
*/
|
@RequestMapping(value = "/hkService")
|
public @ResponseBody
|
AjaxResult hkService(Long id) {
|
SysProjServices services = new SysProjServices();
|
services.setId(id);
|
int i = sysProjServicesService.modifyHKProjServices(services);
|
if (i > 0) {
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "划扣成功");
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "划扣失败");
|
}
|
}
|
|
|
/**
|
* @Title: servicceAdd @param projIds 使用情况 id串
|
*/
|
@RequestMapping(value = "/addService")
|
public @ResponseBody
|
AjaxResult servicceAdd(@RequestBody SysProjServices sysProjServices) {
|
SysVipInfo vipInfo = getCurrentVioInfo();
|
sysProjServices.setVipId(vipInfo.getId());
|
|
if (CollectionUtils.isEmpty(sysProjServices.getServiceItems())) {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "没有选中可消耗的项目");
|
}
|
//检测欠款
|
VerifyResult arrearsVerifyResult = sysProjServicesService.checkArrears(sysProjServices);
|
if (arrearsVerifyResult.isError()) {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, arrearsVerifyResult.getMsg());
|
}
|
//检测余次
|
VerifyResult balanceverifyResult = sysProjServicesService.checkBalance(sysProjServices);
|
if (balanceverifyResult.isError()) {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg());
|
}
|
SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices);
|
if (newSysProjServices != null) {
|
return AjaxResult.buildSuccessInstance(Arrays.asList(newSysProjServices));
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!");
|
}
|
}
|
|
/**
|
* @Title: servicceAdd @param projIds 使用情况 id串
|
*/
|
@RequestMapping(value = "/addServiceForForm")
|
public @ResponseBody
|
AjaxResult servicceAddForForm(SysProjServices sysProjServices) {
|
SysVipInfo vipInfo = getCurrentVioInfo();
|
sysProjServices.setVipId(vipInfo.getId());
|
|
if (CollectionUtils.isEmpty(sysProjServices.getServiceItems())) {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "没有选中可消耗的项目");
|
}
|
//检测欠款
|
VerifyResult arrearsVerifyResult = sysProjServicesService.checkArrears(sysProjServices);
|
if (arrearsVerifyResult.isError()) {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, arrearsVerifyResult.getMsg());
|
}
|
//检测余次
|
VerifyResult balanceverifyResult = sysProjServicesService.checkBalance(sysProjServices);
|
if (balanceverifyResult.isError()) {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg());
|
}
|
SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices);
|
if (newSysProjServices != null) {
|
return AjaxResult.buildSuccessInstance(Arrays.asList(newSysProjServices));
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!");
|
}
|
}
|
|
|
/**
|
* @param projServices
|
*/
|
@RequestMapping(value = "/servicePaiBan")
|
public @ResponseBody
|
AjaxResult servicePaiBan(@RequestBody SysProjServices projServices, String dataTime) throws GlobleException {
|
int i = sysProjServicesService.paiban(projServices, dataTime);
|
if (i > 0) {
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "排班成功");
|
} else {
|
return new AjaxResult(AjaxResult.STATUS_FAIL, "排班失败");
|
}
|
}
|
|
|
// 准备页面数据
|
private void pageDate() {
|
// 根据岗位名称查询员工
|
List<SysUsers> pls = usersService.findByRoleName(true, Dictionary.STAFF_POST_PLS);
|
pls.addAll(usersService.findByRoleName(true, Dictionary.STAFF_POST_PLZG));
|
List<SysUsers> mls = usersService.findByRoleName(true, Dictionary.STAFF_POST_MLS);
|
WebUtil.getRequest().setAttribute("pls", pls);
|
WebUtil.getRequest().setAttribute("mls", mls);
|
}
|
|
/**
|
* 配料出库
|
*/
|
@RequestMapping(value = "/endPl")
|
@RemoveRequestToken
|
public @ResponseBody
|
AjaxResult endPl(SysProjServices projServices) {
|
projServicesSerivce.modifyPLProjServices(projServices);
|
return new AjaxResult(AjaxResult.STATUS_SUCCESS, "配料成功!");
|
}
|
|
/**
|
* 服务单导出
|
*/
|
@RequestMapping(value = "/exportExcel")
|
public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, SysProjServices projServices) throws Exception {
|
|
SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
|
projServices.setShopId(sysUsers.getShopId());
|
doExportServiceOrder(response, projServices);
|
}
|
|
/**
|
* 总部导出服务单导出,不限门店
|
*/
|
@RequestMapping(value = "/erpExportExcel")
|
public void erpExportExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, SysProjServices projServices) throws Exception {
|
|
|
doExportServiceOrder(response, projServices);
|
}
|
|
|
|
private void doExportServiceOrder(HttpServletResponse response, SysProjServices projServices) throws IOException {
|
List<ExcelSheetPO> res = new ArrayList<>();
|
ExcelSheetPO orderSheet = new ExcelSheetPO();
|
String title = "服务订单明细";
|
orderSheet.setSheetName(title);
|
orderSheet.setTitle(title);
|
String[] header = {"服务单号","会员名称", "会员手机号", "消耗金额","服务状态", "下单时间","预约时间","是否超时(超时分钟)", "床位", "美疗师", "配料师", "健康顾问", "所属门店"};
|
orderSheet.setHeaders(header);
|
|
List<SysProjServices> dataList = projServicesSerivce.findByModel(projServices);
|
List<List<Object>> list = new ArrayList<>();
|
if (dataList.size() > 0) {
|
for (SysProjServices item : dataList) {
|
List<Object> temp = new ArrayList<>();
|
temp.add(item.getServiceNo());
|
temp.add(item.getVipInfo().getVipName());
|
temp.add(item.getVipInfo().getPhone());
|
temp.add(item.getMoney());
|
temp.add(item.getState());
|
temp.add(DateUtil.dateToString(item.getCreateTime(), DateUtil.DATE_FORMAT_MM));
|
temp.add(DateUtil.dateToString(item.getYyTime(), DateUtil.DATE_FORMAT_MM));
|
temp.add(item.getState());
|
temp.add(item.getIsOverTime());
|
temp.add(item.getBedName());
|
temp.add(item.getBeautiName());
|
temp.add(item.getPlsName());
|
temp.add(item.getCreateStaffName());
|
temp.add(item.getShopName());
|
list.add(temp);
|
}
|
}
|
orderSheet.setDataList(list);
|
res.add(orderSheet);
|
response = ResponseHeadUtil.setExcelHead(response);
|
response.setHeader("Content-Disposition",
|
"attachment;filename=" + URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8"));
|
OutputStream os = response.getOutputStream();
|
ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true);
|
}
|
}
|