|
|
@@ -7,6 +7,7 @@ import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
+import com.fs.common.core.domain.model.LoginUser;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.CloudHostUtils;
|
|
|
@@ -82,83 +83,82 @@ public class FsStoreHealthOrderScrmController extends BaseController {
|
|
|
// @PreAuthorize("@ss.hasPermi('store:healthStoreOrder:list')")
|
|
|
@PostMapping("/healthList")
|
|
|
public TableDataInfo healthStoreList(@RequestBody FsStoreOrderParam param) {
|
|
|
-// PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
-// if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
-// param.setCreateTimeList(param.getCreateTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getPayTimeRange())){
|
|
|
-// param.setPayTimeList(param.getPayTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
|
|
|
-// param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
|
|
|
-// param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// param.setIsHealth("1");
|
|
|
-// List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
|
|
|
-// //金牛需求 区别其他项目 status = 6 (金牛代服管家) ,其他项目请避免使用订单状态status = 6
|
|
|
-// TableDataInfo dataTable = getDataTable(list);
|
|
|
-// if (CloudHostUtils.hasCloudHostName("康年堂")){
|
|
|
-// dataTable.setMsg("knt");
|
|
|
-// }
|
|
|
-// if (list != null) {
|
|
|
-// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-// for (FsStoreOrderVO vo : list) {
|
|
|
-// if(StringUtils.isNotEmpty(vo.getPhone())){
|
|
|
-// vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(vo.getUserPhone())){
|
|
|
-// vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
-// }
|
|
|
-// if (CloudHostUtils.hasCloudHostName("康年堂")){
|
|
|
-// //查询顺丰代服账号
|
|
|
-// FsStoreOrderDf df = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(vo.getId());
|
|
|
-// if (df != null){
|
|
|
-// vo.setErpAccount(df.getLoginAccount());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //
|
|
|
-// if (loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) {
|
|
|
-// if((vo.getCost() !=null && vo.getTotalNum() != null)){
|
|
|
-// vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// vo.setPayPostage(BigDecimal.ZERO);
|
|
|
-// vo.setCost(BigDecimal.ZERO);
|
|
|
-// vo.setFPrice(BigDecimal.ZERO);
|
|
|
-// vo.setPayDelivery(BigDecimal.ZERO);
|
|
|
-// vo.setBarCode("");
|
|
|
-// vo.setCateName("");
|
|
|
-// vo.setBankTransactionId("");
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// FsStoreOrderListAndStatisticsVo vo = new FsStoreOrderListAndStatisticsVo();
|
|
|
-// BeanUtils.copyProperties(dataTable, vo);
|
|
|
-// if (dataTable.getTotal()>0){
|
|
|
-// Map<String, BigDecimal> statistics= fsStoreOrderService.selectFsStoreOrderStatistics(param);
|
|
|
-// if (statistics != null && statistics.size() >= 3){
|
|
|
-// vo.setPayPriceTotal(statistics.get("pay_price").toString());
|
|
|
-// vo.setPayMoneyTotal(statistics.get("pay_money").toString());
|
|
|
-// vo.setPayRemainTotal(statistics.get("pay_remain").toString());
|
|
|
-// }else {
|
|
|
-// vo.setPayPriceTotal("0");
|
|
|
-// vo.setPayMoneyTotal("0");
|
|
|
-// vo.setPayRemainTotal("0");
|
|
|
-// }
|
|
|
-// //商品数量合计
|
|
|
-// String productStatistics= fsStoreOrderService.selectFsStoreOrderProductStatistics(param);
|
|
|
-// if (StringUtils.isNotBlank(productStatistics)){
|
|
|
-// vo.setProductInfo(productStatistics);
|
|
|
-// } else {
|
|
|
-// vo.setProductInfo("");
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// return vo;
|
|
|
- throw new RuntimeException("未实现");
|
|
|
+ PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
+ if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
+ param.setCreateTimeList(param.getCreateTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getPayTimeRange())){
|
|
|
+ param.setPayTimeList(param.getPayTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
|
|
|
+ param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
|
|
|
+ param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ param.setIsHealth("1");
|
|
|
+ List<FsStoreOrderVO> list = fsStoreOrderService.selectFsStoreOrderListVO(param);
|
|
|
+ //金牛需求 区别其他项目 status = 6 (金牛代服管家) ,其他项目请避免使用订单状态status = 6
|
|
|
+ TableDataInfo dataTable = getDataTable(list);
|
|
|
+ if (CloudHostUtils.hasCloudHostName("康年堂")){
|
|
|
+ dataTable.setMsg("knt");
|
|
|
+ }
|
|
|
+ if (list != null) {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ for (FsStoreOrderVO vo : list) {
|
|
|
+ if(StringUtils.isNotEmpty(vo.getPhone())){
|
|
|
+ vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(vo.getUserPhone())){
|
|
|
+ vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+ if (CloudHostUtils.hasCloudHostName("康年堂")){
|
|
|
+ //查询顺丰代服账号
|
|
|
+ FsStoreOrderDf df = fsStoreOrderDfService.selectFsStoreOrderDfByOrderId(vo.getId());
|
|
|
+ if (df != null){
|
|
|
+ vo.setErpAccount(df.getLoginAccount());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if (loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) {
|
|
|
+ if((vo.getCost() !=null && vo.getTotalNum() != null)){
|
|
|
+ vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ vo.setPayPostage(BigDecimal.ZERO);
|
|
|
+ vo.setCost(BigDecimal.ZERO);
|
|
|
+ vo.setFPrice(BigDecimal.ZERO);
|
|
|
+ vo.setPayDelivery(BigDecimal.ZERO);
|
|
|
+ vo.setBarCode("");
|
|
|
+ vo.setCateName("");
|
|
|
+ vo.setBankTransactionId("");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ FsStoreOrderListAndStatisticsVo vo = new FsStoreOrderListAndStatisticsVo();
|
|
|
+ BeanUtils.copyProperties(dataTable, vo);
|
|
|
+ if (dataTable.getTotal()>0){
|
|
|
+ Map<String, BigDecimal> statistics= fsStoreOrderService.selectFsStoreOrderStatistics(param);
|
|
|
+ if (statistics != null && statistics.size() >= 3){
|
|
|
+ vo.setPayPriceTotal(statistics.get("pay_price").toString());
|
|
|
+ vo.setPayMoneyTotal(statistics.get("pay_money").toString());
|
|
|
+ vo.setPayRemainTotal(statistics.get("pay_remain").toString());
|
|
|
+ }else {
|
|
|
+ vo.setPayPriceTotal("0");
|
|
|
+ vo.setPayMoneyTotal("0");
|
|
|
+ vo.setPayRemainTotal("0");
|
|
|
+ }
|
|
|
+ //商品数量合计
|
|
|
+ String productStatistics= fsStoreOrderService.selectFsStoreOrderProductStatistics(param);
|
|
|
+ if (StringUtils.isNotBlank(productStatistics)){
|
|
|
+ vo.setProductInfo(productStatistics);
|
|
|
+ } else {
|
|
|
+ vo.setProductInfo("");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -274,150 +274,148 @@ public class FsStoreHealthOrderScrmController extends BaseController {
|
|
|
@Log(title = "商城订单明细导出", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/healthExportItems")
|
|
|
public AjaxResult exportItems1(FsStoreOrderParam param) {
|
|
|
-// if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
|
|
|
-// param.setBeginTime(null);
|
|
|
-// param.setEndTime(null);
|
|
|
-// }
|
|
|
-// if (fsStoreOrderService.isEntityNull(param)){
|
|
|
-// return AjaxResult.error("请筛选数据导出");
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
-// param.setCreateTimeList(param.getCreateTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getPayTimeRange())){
|
|
|
-// param.setPayTimeList(param.getPayTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
|
|
|
-// param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
|
|
|
-// param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// param.setIsHealth("1");
|
|
|
-// List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
|
|
|
-// //对手机号脱敏
|
|
|
-// if (list != null) {
|
|
|
-// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-// for (FsStoreOrderItemExportVO vo : list) {
|
|
|
-// if (vo.getUserPhone() != null) {
|
|
|
-// String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
|
|
|
-// vo.setUserPhone(phone);
|
|
|
-// }
|
|
|
-// if (!StringUtils.isEmpty(vo.getJsonInfo())) {
|
|
|
-// try {
|
|
|
-// StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
-// BeanUtil.copyProperties(orderProductDTO, vo);
|
|
|
-// } catch (Exception e) {
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //
|
|
|
-// if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) && !Objects.isNull(vo.getCost())) {
|
|
|
-// vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
-// } else {
|
|
|
-// vo.setPayPostage(BigDecimal.ZERO);
|
|
|
-// vo.setCost(BigDecimal.ZERO);
|
|
|
-// vo.setFPrice(BigDecimal.ZERO);
|
|
|
-// vo.setBarCode("");
|
|
|
-// vo.setCateName("");
|
|
|
-// vo.setBankTransactionId("");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
|
|
|
-// return util.exportExcel(list, "订单明细数据");
|
|
|
- throw new RuntimeException("未实现");
|
|
|
+ if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
|
|
|
+ param.setBeginTime(null);
|
|
|
+ param.setEndTime(null);
|
|
|
+ }
|
|
|
+ if (fsStoreOrderService.isEntityNull(param)){
|
|
|
+ return AjaxResult.error("请筛选数据导出");
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
+ param.setCreateTimeList(param.getCreateTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getPayTimeRange())){
|
|
|
+ param.setPayTimeList(param.getPayTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
|
|
|
+ param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
|
|
|
+ param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ param.setIsHealth("1");
|
|
|
+ List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
|
|
|
+ //对手机号脱敏
|
|
|
+ if (list != null) {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ for (FsStoreOrderItemExportVO vo : list) {
|
|
|
+ if (vo.getUserPhone() != null) {
|
|
|
+ String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
|
|
|
+ vo.setUserPhone(phone);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(vo.getJsonInfo())) {
|
|
|
+ try {
|
|
|
+ StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
+ BeanUtil.copyProperties(orderProductDTO, vo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) && !Objects.isNull(vo.getCost())) {
|
|
|
+ vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
+ } else {
|
|
|
+ vo.setPayPostage(BigDecimal.ZERO);
|
|
|
+ vo.setCost(BigDecimal.ZERO);
|
|
|
+ vo.setFPrice(BigDecimal.ZERO);
|
|
|
+ vo.setBarCode("");
|
|
|
+ vo.setCateName("");
|
|
|
+ vo.setBankTransactionId("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
|
|
|
+ return util.exportExcel(list, "订单明细数据");
|
|
|
}
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('store:healthStoreOrder:exportItems:details')")
|
|
|
@Log(title = "商城订单明细导出", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/healthExportItemsDetails")
|
|
|
public AjaxResult healthExportItemsDetails(FsStoreOrderParam param) {
|
|
|
-// if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
|
|
|
-// param.setBeginTime(null);
|
|
|
-// param.setEndTime(null);
|
|
|
-// }
|
|
|
-// if (fsStoreOrderService.isEntityNull(param)){
|
|
|
-// return AjaxResult.error("请筛选数据导出");
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
-// param.setCreateTimeList(param.getCreateTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getPayTimeRange())){
|
|
|
-// param.setPayTimeList(param.getPayTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
|
|
|
-// param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
|
|
|
-// param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
|
|
|
-// }
|
|
|
-// param.setIsHealth("1");
|
|
|
-// List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
|
|
|
-// if("北京卓美".equals(com.fs.config.saas.ProjectConfig.getFromDB(sysConfigMapper).getCloudHost().getCompanyName())){
|
|
|
-// List<FsStoreOrderItemExportZMVO> zmvoList = list.stream()
|
|
|
-// .map(vo -> {
|
|
|
-// FsStoreOrderItemExportZMVO zmvo = new FsStoreOrderItemExportZMVO();
|
|
|
-// try {
|
|
|
-// BeanUtil.copyProperties( vo,zmvo);
|
|
|
-// } catch (Exception e) {
|
|
|
-// // 处理异常
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// return zmvo;
|
|
|
-// })
|
|
|
-// .collect(Collectors.toList());
|
|
|
-// //对手机号脱敏
|
|
|
-// if (zmvoList != null) {
|
|
|
-// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-// for (FsStoreOrderItemExportZMVO vo : zmvoList) {
|
|
|
-// if (!StringUtils.isEmpty(vo.getJsonInfo())) {
|
|
|
-// try {
|
|
|
-// StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
-// BeanUtil.copyProperties(orderProductDTO, vo);
|
|
|
-// } catch (Exception e) {
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) && !Objects.isNull(vo.getCost())) {
|
|
|
-// vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
-// } else {
|
|
|
-// vo.setPayPostage(BigDecimal.ZERO);
|
|
|
-// vo.setCost(BigDecimal.ZERO);
|
|
|
-// vo.setFPrice(BigDecimal.ZERO);
|
|
|
-// vo.setBarCode("");
|
|
|
-// vo.setCateName("");
|
|
|
-// vo.setBankTransactionId("");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// ExcelUtil<FsStoreOrderItemExportZMVO> util = new ExcelUtil<FsStoreOrderItemExportZMVO>(FsStoreOrderItemExportZMVO.class);
|
|
|
-// return util.exportExcel(zmvoList, "订单明细数据");
|
|
|
-// }
|
|
|
-// //对手机号脱敏
|
|
|
-// if (list != null) {
|
|
|
-// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-// for (FsStoreOrderItemExportVO vo : list) {
|
|
|
-// if (!StringUtils.isEmpty(vo.getJsonInfo())) {
|
|
|
-// try {
|
|
|
-// StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
-// BeanUtil.copyProperties(orderProductDTO, vo);
|
|
|
-// } catch (Exception e) {
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) && !Objects.isNull(vo.getCost())) {
|
|
|
-// vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
-// } else {
|
|
|
-// vo.setPayPostage(BigDecimal.ZERO);
|
|
|
-// vo.setCost(BigDecimal.ZERO);
|
|
|
-// vo.setFPrice(BigDecimal.ZERO);
|
|
|
-// vo.setBarCode("");
|
|
|
-// vo.setCateName("");
|
|
|
-// vo.setBankTransactionId("");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
|
|
|
-// return util.exportExcel(list, "订单明细数据");
|
|
|
- throw new RuntimeException("未实现");
|
|
|
+ if ("".equals(param.getBeginTime()) && "".equals(param.getEndTime())){
|
|
|
+ param.setBeginTime(null);
|
|
|
+ param.setEndTime(null);
|
|
|
+ }
|
|
|
+ if (fsStoreOrderService.isEntityNull(param)){
|
|
|
+ return AjaxResult.error("请筛选数据导出");
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
+ param.setCreateTimeList(param.getCreateTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getPayTimeRange())){
|
|
|
+ param.setPayTimeList(param.getPayTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getDeliverySendTimeRange())){
|
|
|
+ param.setDeliverySendTimeList(param.getDeliverySendTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ if(!StringUtils.isEmpty(param.getDeliveryImportTimeRange())){
|
|
|
+ param.setDeliveryImportTimeList(param.getDeliveryImportTimeRange().split("--"));
|
|
|
+ }
|
|
|
+ param.setIsHealth("1");
|
|
|
+ List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
|
|
|
+ if("北京卓美".equals(com.fs.config.saas.ProjectConfig.getFromDB(sysConfigMapper).getCloudHost().getCompanyName())){
|
|
|
+ List<FsStoreOrderItemExportZMVO> zmvoList = list.stream()
|
|
|
+ .map(vo -> {
|
|
|
+ FsStoreOrderItemExportZMVO zmvo = new FsStoreOrderItemExportZMVO();
|
|
|
+ try {
|
|
|
+ BeanUtil.copyProperties( vo,zmvo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 处理异常
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return zmvo;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ //对手机号脱敏
|
|
|
+ if (zmvoList != null) {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ for (FsStoreOrderItemExportZMVO vo : zmvoList) {
|
|
|
+ if (!StringUtils.isEmpty(vo.getJsonInfo())) {
|
|
|
+ try {
|
|
|
+ StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
+ BeanUtil.copyProperties(orderProductDTO, vo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) && !Objects.isNull(vo.getCost())) {
|
|
|
+ vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
+ } else {
|
|
|
+ vo.setPayPostage(BigDecimal.ZERO);
|
|
|
+ vo.setCost(BigDecimal.ZERO);
|
|
|
+ vo.setFPrice(BigDecimal.ZERO);
|
|
|
+ vo.setBarCode("");
|
|
|
+ vo.setCateName("");
|
|
|
+ vo.setBankTransactionId("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ExcelUtil<FsStoreOrderItemExportZMVO> util = new ExcelUtil<FsStoreOrderItemExportZMVO>(FsStoreOrderItemExportZMVO.class);
|
|
|
+ return util.exportExcel(zmvoList, "订单明细数据");
|
|
|
+ }
|
|
|
+ //对手机号脱敏
|
|
|
+ if (list != null) {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ for (FsStoreOrderItemExportVO vo : list) {
|
|
|
+ if (!StringUtils.isEmpty(vo.getJsonInfo())) {
|
|
|
+ try {
|
|
|
+ StoreOrderProductDTO orderProductDTO = JSONObject.parseObject(vo.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
+ BeanUtil.copyProperties(orderProductDTO, vo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((loginUser.getPermissions().contains("his:storeAfterSales:finance") || loginUser.getPermissions().contains("*:*:*") ) && !Objects.isNull(vo.getCost())) {
|
|
|
+ vo.setFPrice(vo.getCost().multiply(BigDecimal.valueOf(vo.getTotalNum())));
|
|
|
+ } else {
|
|
|
+ vo.setPayPostage(BigDecimal.ZERO);
|
|
|
+ vo.setCost(BigDecimal.ZERO);
|
|
|
+ vo.setFPrice(BigDecimal.ZERO);
|
|
|
+ vo.setBarCode("");
|
|
|
+ vo.setCateName("");
|
|
|
+ vo.setBankTransactionId("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ExcelUtil<FsStoreOrderItemExportVO> util = new ExcelUtil<FsStoreOrderItemExportVO>(FsStoreOrderItemExportVO.class);
|
|
|
+ return util.exportExcel(list, "订单明细数据");
|
|
|
}
|
|
|
|
|
|
//订单发货批量导入
|