|
@@ -1,6 +1,5 @@
|
|
package com.fdkankan.backend.service.impl;
|
|
package com.fdkankan.backend.service.impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fdkankan.agent.entity.AgentEntity;
|
|
import com.fdkankan.agent.entity.AgentEntity;
|
|
@@ -23,7 +22,6 @@ import com.fdkankan.common.constant.ConstantUrl;
|
|
import com.fdkankan.common.exception.BaseRuntimeException;
|
|
import com.fdkankan.common.exception.BaseRuntimeException;
|
|
import com.fdkankan.common.jedis.JedisUtil;
|
|
import com.fdkankan.common.jedis.JedisUtil;
|
|
import com.fdkankan.common.model.Result;
|
|
import com.fdkankan.common.model.Result;
|
|
-import com.fdkankan.common.model.SSOUser;
|
|
|
|
import com.fdkankan.common.util.*;
|
|
import com.fdkankan.common.util.*;
|
|
import com.fdkankan.common.validation.Variable;
|
|
import com.fdkankan.common.validation.Variable;
|
|
import com.fdkankan.common.vo.request.*;
|
|
import com.fdkankan.common.vo.request.*;
|
|
@@ -34,7 +32,10 @@ import com.fdkankan.goods.feign.GoodsFeignClient;
|
|
import com.fdkankan.goods.mapper.ICameraMapper;
|
|
import com.fdkankan.goods.mapper.ICameraMapper;
|
|
import com.fdkankan.goods.service.ICameraDetailService;
|
|
import com.fdkankan.goods.service.ICameraDetailService;
|
|
import com.fdkankan.goods.service.ICameraService;
|
|
import com.fdkankan.goods.service.ICameraService;
|
|
-import com.fdkankan.order.entity.*;
|
|
|
|
|
|
+import com.fdkankan.order.entity.ExpansionOrderEntity;
|
|
|
|
+import com.fdkankan.order.entity.OrderEntity;
|
|
|
|
+import com.fdkankan.order.entity.TradeLogEntity;
|
|
|
|
+import com.fdkankan.order.entity.VirtualOrderEntity;
|
|
import com.fdkankan.order.feign.OrderFeignClient;
|
|
import com.fdkankan.order.feign.OrderFeignClient;
|
|
import com.fdkankan.scene.entity.Scene3dNumNewEntity;
|
|
import com.fdkankan.scene.entity.Scene3dNumNewEntity;
|
|
import com.fdkankan.scene.entity.SceneEntity;
|
|
import com.fdkankan.scene.entity.SceneEntity;
|
|
@@ -136,9 +137,6 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
private IUserService iUserService;
|
|
private IUserService iUserService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IReceiverInfoService iReceiverInfoService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
private IAgentFrameworkService agentFrameworkService;
|
|
private IAgentFrameworkService agentFrameworkService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -610,20 +608,6 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
if(expansionOrder != null){
|
|
if(expansionOrder != null){
|
|
param.setOrderId(expansionOrder.getId());
|
|
param.setOrderId(expansionOrder.getId());
|
|
param.setConsumeType(1);
|
|
param.setConsumeType(1);
|
|
- }else{
|
|
|
|
- IncrementOrderEntity incrementOrderEntity = orderService.findEntityIncrementOrderByOrderSn(param.getOrderSn());
|
|
|
|
- if(incrementOrderEntity!=null){
|
|
|
|
- param.setIncrementId(incrementOrderEntity.getId());
|
|
|
|
- param.setConsumeType(2);
|
|
|
|
- }else{
|
|
|
|
- DownloadOrderEntity downloadOrderEntity = orderService.findEntityDownloadOrderByOrderSn(param.getOrderSn());
|
|
|
|
- if(downloadOrderEntity!=null){
|
|
|
|
- param.setDownloadId(downloadOrderEntity.getId());
|
|
|
|
- param.setConsumeType(3);
|
|
|
|
- }else{
|
|
|
|
- param.setOrderId(9999999999999L);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -631,11 +615,9 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
ResponseOrder orderDetail = new ResponseOrder();
|
|
ResponseOrder orderDetail = new ResponseOrder();
|
|
ResponseVirtualOrder virtualOrderDetail = new ResponseVirtualOrder();
|
|
ResponseVirtualOrder virtualOrderDetail = new ResponseVirtualOrder();
|
|
ResponseIncrementOrder incrementDetail = new ResponseIncrementOrder();
|
|
ResponseIncrementOrder incrementDetail = new ResponseIncrementOrder();
|
|
- ResponseDownloadOrder downloadDetail = new ResponseDownloadOrder();
|
|
|
|
List<ResponseOrderItem> orderItems = null;
|
|
List<ResponseOrderItem> orderItems = null;
|
|
ResponseOrderItem orderItem = null;
|
|
ResponseOrderItem orderItem = null;
|
|
StringBuilder goodsName = null;
|
|
StringBuilder goodsName = null;
|
|
- ReceiverInfoEntity receiverInfoEntity = new ReceiverInfoEntity();
|
|
|
|
for(ResponseInvoice invoice : pageInfo.getList()){
|
|
for(ResponseInvoice invoice : pageInfo.getList()){
|
|
//购买相机的订单
|
|
//购买相机的订单
|
|
if(invoice.getConsumeType() == 0){
|
|
if(invoice.getConsumeType() == 0){
|
|
@@ -657,27 +639,11 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
if(invoice.getConsumeType() == 2){
|
|
if(invoice.getConsumeType() == 2){
|
|
Result orderResul = orderService.findByIncrementOrderId(invoice.getIncrementOrderId());
|
|
Result orderResul = orderService.findByIncrementOrderId(invoice.getIncrementOrderId());
|
|
incrementDetail = mapper.convertValue(orderResul.getData(), ResponseIncrementOrder.class);
|
|
incrementDetail = mapper.convertValue(orderResul.getData(), ResponseIncrementOrder.class);
|
|
- if(incrementDetail!=null){
|
|
|
|
|
|
+ if(orderDetail!=null){
|
|
invoice.setResponseIncrementOrder(incrementDetail);
|
|
invoice.setResponseIncrementOrder(incrementDetail);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //会员权益
|
|
|
|
- if(invoice.getConsumeType() == 3){
|
|
|
|
- Result orderResul = orderService.findByDownloadOrderId(invoice.getDownloadOrderId());
|
|
|
|
- downloadDetail = mapper.convertValue(orderResul.getData(), ResponseDownloadOrder.class);
|
|
|
|
- if(downloadDetail!=null){
|
|
|
|
- invoice.setResponseDownloadOrder(downloadDetail);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- receiverInfoEntity = iReceiverInfoService.findDefaultByUserId(invoice.getUserId());
|
|
|
|
- if(receiverInfoEntity!=null){
|
|
|
|
- invoice.setShipName(receiverInfoEntity.getShipName() == null?"" : receiverInfoEntity.getShipName());
|
|
|
|
- invoice.setShipMobile(receiverInfoEntity.getShipMobile() == null?"" : receiverInfoEntity.getShipMobile());
|
|
|
|
- invoice.setShipAreaPath( receiverInfoEntity.getShipAreaPath()== null?"" : receiverInfoEntity.getShipAreaPath());
|
|
|
|
- invoice.setShipAddress(receiverInfoEntity.getShipAddress()== null?"" : receiverInfoEntity.getShipAddress());
|
|
|
|
- }
|
|
|
|
//相机充值的订单
|
|
//相机充值的订单
|
|
// if(invoice.getConsumeType() == 1){
|
|
// if(invoice.getConsumeType() == 1){
|
|
// ExpansionOrderEntity expansionOrderEntity = orderService.findEntityExpansionOrderByOrderId(invoice.getOrderId());
|
|
// ExpansionOrderEntity expansionOrderEntity = orderService.findEntityExpansionOrderByOrderId(invoice.getOrderId());
|
|
@@ -719,299 +685,114 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void exportInvoiceList(RequestTrade param, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
public void exportInvoiceList(RequestTrade param, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
- param.setPageSize(9999);
|
|
|
|
-
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(param.getOrderSn())){
|
|
|
|
+ OrderEntity orderEntity = orderService.findByOrderSn(param.getOrderSn());
|
|
|
|
+ if(orderEntity != null){
|
|
|
|
+ param.setOrderId(orderEntity.getId());
|
|
|
|
+ param.setConsumeType(0);
|
|
|
|
+ }else {
|
|
|
|
+ ExpansionOrderEntity expansionOrder = orderService.findEntityExpansionOrderByOrderSn(param.getOrderSn());
|
|
|
|
+ if(expansionOrder != null){
|
|
|
|
+ param.setOrderId(expansionOrder.getId());
|
|
|
|
+ param.setConsumeType(1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
List<ResponseInvoice> list = tradeService.findInvoiceAll(param);
|
|
List<ResponseInvoice> list = tradeService.findInvoiceAll(param);
|
|
ResponseOrder orderDetail = new ResponseOrder();
|
|
ResponseOrder orderDetail = new ResponseOrder();
|
|
ExpansionOrderEntity expansionOrderEntity = new ExpansionOrderEntity();
|
|
ExpansionOrderEntity expansionOrderEntity = new ExpansionOrderEntity();
|
|
List<ResponseOrderItem> orderItems = null;
|
|
List<ResponseOrderItem> orderItems = null;
|
|
StringBuilder goodsName = null;
|
|
StringBuilder goodsName = null;
|
|
- ResponseIncrementOrder incrementDetail = new ResponseIncrementOrder();
|
|
|
|
- ResponseDownloadOrder downloadDetail = new ResponseDownloadOrder();
|
|
|
|
- ReceiverInfoEntity receiverInfoEntity = new ReceiverInfoEntity();
|
|
|
|
|
|
|
|
//导出的数据
|
|
//导出的数据
|
|
int serNum = 1;
|
|
int serNum = 1;
|
|
Map<String, Object> item = null;
|
|
Map<String, Object> item = null;
|
|
List<Map> dataList = new ArrayList<Map>();
|
|
List<Map> dataList = new ArrayList<Map>();
|
|
for(ResponseInvoice invoice : list){
|
|
for(ResponseInvoice invoice : list){
|
|
-
|
|
|
|
- if(invoice.getOrderId()==null && invoice.getVirtualOrderId()==null &&
|
|
|
|
- invoice.getIncrementOrderId() == null && invoice.getDownloadOrderId() == null){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//购买相机的订单
|
|
//购买相机的订单
|
|
item = new HashMap();
|
|
item = new HashMap();
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[0], String.valueOf(serNum));
|
|
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[0], String.valueOf(serNum));
|
|
if(invoice.getType() == 2){
|
|
if(invoice.getType() == 2){
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[7], "增值税普通发票");
|
|
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[2], "增值税普通发票");
|
|
}
|
|
}
|
|
if(invoice.getType() == 3){
|
|
if(invoice.getType() == 3){
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[7], "增值税专用发票");
|
|
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[2], "增值税专用发票");
|
|
}
|
|
}
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[4], invoice.getExpressNumber()== null?"" : invoice.getExpressNumber());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[5], invoice.getMoney()== null?"" : String.valueOf(invoice.getMoney()));
|
|
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[3], invoice.getMoney());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[4], invoice.getTitle());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[5], invoice.getCode());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[6], invoice.getOrganizedName());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[7], invoice.getRegisterPhone());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[8], invoice.getBankName());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[9], invoice.getBankAccount());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[10], invoice.getShipAreaPath() + " " + invoice.getShipAddress());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[11], invoice.getEmailAddress());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[12], invoice.getShipMobile());
|
|
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[8], invoice.getTitle() == null?"" : invoice.getTitle());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[9], invoice.getCode() == null?"" : invoice.getCode());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[10], invoice.getOrganizedAddress() == null?"" : invoice.getOrganizedAddress());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[11], invoice.getRegisterPhone() == null?"" : invoice.getRegisterPhone());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[12], invoice.getBankName() == null?"" : invoice.getBankName());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[13], invoice.getBankAccount() == null?"" : invoice.getBankAccount());
|
|
|
|
-
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[17], invoice.getEmailAddress() == null?"" : invoice.getEmailAddress());
|
|
|
|
|
|
|
|
if(invoice.getConsumeType() == 0){
|
|
if(invoice.getConsumeType() == 0){
|
|
Result orderResul = orderService.findByOrderId(invoice.getOrderId());
|
|
Result orderResul = orderService.findByOrderId(invoice.getOrderId());
|
|
orderDetail = mapper.convertValue(orderResul.getData(), ResponseOrder.class);
|
|
orderDetail = mapper.convertValue(orderResul.getData(), ResponseOrder.class);
|
|
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[1], orderDetail.getOrderSn() == null?"" : orderDetail.getOrderSn());
|
|
|
|
-// item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[2], orderDetail.getUserName() == null?"" : orderDetail.getUserName());
|
|
|
|
-
|
|
|
|
- if(orderDetail.getUserId()!=null){
|
|
|
|
- UserEntity userEntity = iUserService.findById(orderDetail.getUserId());
|
|
|
|
- if(userEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[2], userEntity.getUserName() == null?"" : userEntity.getUserName());
|
|
|
|
-
|
|
|
|
- if(invoice.getType() == 3){
|
|
|
|
- //获取默认地址
|
|
|
|
- receiverInfoEntity = iReceiverInfoService.findDefaultByUserId(orderDetail.getUserId());
|
|
|
|
- if(receiverInfoEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[14], receiverInfoEntity.getShipName() == null?"" : receiverInfoEntity.getShipName());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[15], receiverInfoEntity.getShipMobile() == null?"" : receiverInfoEntity.getShipMobile());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[16], receiverInfoEntity.getShipAreaPath()== null?"" : receiverInfoEntity.getShipAreaPath()
|
|
|
|
- + " " + receiverInfoEntity.getShipAddress()== null?"" : receiverInfoEntity.getShipAddress());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if( orderDetail.getOrderTime() == null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], "");
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], DateUtil.date2String(orderDetail.getOrderTime(),null));
|
|
|
|
- }
|
|
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[1], orderDetail.getOrderSn());
|
|
|
|
|
|
- if (orderDetail.getPaymentTypeName() ==null || orderDetail.getPaymentTypeName() == -1) {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], "未支付");
|
|
|
|
- continue;
|
|
|
|
- } else {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], ConstantExcel.PAYFORM[orderDetail.getPaymentTypeName()]);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(orderDetail.getOrderStatus()!=null){
|
|
|
|
- if(orderDetail.getOrderStatus().equals("unprocessed")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "未处理");
|
|
|
|
- }else if(orderDetail.getOrderStatus().equals("processed")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "已确认");
|
|
|
|
- }else if(orderDetail.getOrderStatus().equals("completed")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "已完成");
|
|
|
|
- }else if(orderDetail.getOrderStatus().equals("invalid")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "已取消");
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(orderDetail.getShippingStatus()!=null){
|
|
|
|
- if(orderDetail.getShippingStatus().equals("unshipped")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "未发货");
|
|
|
|
- }else if(orderDetail.getShippingStatus().equals("partShipped")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "部分发货");
|
|
|
|
- }else if(orderDetail.getShippingStatus().equals("shipped")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "已发货");
|
|
|
|
- }else if(orderDetail.getShippingStatus().equals("partReshiped")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "部分退货");
|
|
|
|
- }else if(orderDetail.getShippingStatus().equals("reshiped")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "已退货");
|
|
|
|
- }else if(orderDetail.getShippingStatus().equals("received")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "已收货");
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(orderDetail.getPaymentStatus()!=null){
|
|
|
|
- if(orderDetail.getPaymentStatus().equals("unpaid")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "未付款");
|
|
|
|
- continue;
|
|
|
|
- }else if(orderDetail.getPaymentStatus().equals("paid")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已付款");
|
|
|
|
- }else if(orderDetail.getPaymentStatus().equals("cancel")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已取消");
|
|
|
|
- }else if(orderDetail.getPaymentStatus().equals("partPayment")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "部分支付");
|
|
|
|
- }else if(orderDetail.getPaymentStatus().equals("partRefund")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "部分退款");
|
|
|
|
- }else if(orderDetail.getPaymentStatus().equals("refunded")){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "全额退款");
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "");
|
|
|
|
- }
|
|
|
|
- }else if(invoice.getConsumeType() == 1){
|
|
|
|
- expansionOrderEntity = orderService.findEntityExpansionOrderByOrderId(invoice.getOrderId());
|
|
|
|
-
|
|
|
|
- if(expansionOrderEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[1], expansionOrderEntity.getOrderSn() == null?"" : expansionOrderEntity.getOrderSn());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[5], expansionOrderEntity.getAmount()== null?"" : String.valueOf(expansionOrderEntity.getAmount()));
|
|
|
|
- if(expansionOrderEntity.getUserId()!=null){
|
|
|
|
- UserEntity userEntity = iUserService.findById(expansionOrderEntity.getUserId());
|
|
|
|
- if(userEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[2], userEntity.getUserName() == null?"" : userEntity.getUserName());
|
|
|
|
- if(invoice.getType() == 3){
|
|
|
|
- //获取默认地址
|
|
|
|
- receiverInfoEntity = iReceiverInfoService.findDefaultByUserId(expansionOrderEntity.getUserId());
|
|
|
|
- if(receiverInfoEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[14], receiverInfoEntity.getShipName() == null?"" : receiverInfoEntity.getShipName());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[15], receiverInfoEntity.getShipMobile() == null?"" : receiverInfoEntity.getShipMobile());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[16], receiverInfoEntity.getShipAreaPath()== null?"" : receiverInfoEntity.getShipAreaPath()
|
|
|
|
- + " " + receiverInfoEntity.getShipAddress()== null?"" : receiverInfoEntity.getShipAddress());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if(orderDetail.getOrderItems() != null){
|
|
|
|
+ if(orderDetail.getOrderItems().size() >= 1){
|
|
|
|
+ ResponseOrderItem responseOrderItem = orderDetail.getOrderItems().get(1);
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[13], responseOrderItem.getGoodsName());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[14], responseOrderItem.getGoodsCount());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[15], responseOrderItem.getGoodsPrice());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[16], responseOrderItem.getGoodsPrice());
|
|
}
|
|
}
|
|
|
|
|
|
- if( expansionOrderEntity.getTradeTime() == null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], "");
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], DateUtil.date2String(expansionOrderEntity.getTradeTime(),null));
|
|
|
|
|
|
+ if(orderDetail.getOrderItems().size() >= 2){
|
|
|
|
+ ResponseOrderItem responseOrderItem = orderDetail.getOrderItems().get(2);
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[17], responseOrderItem.getGoodsName());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[18], responseOrderItem.getGoodsCount());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[19], responseOrderItem.getGoodsPrice());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[20], responseOrderItem.getGoodsPrice());
|
|
}
|
|
}
|
|
|
|
|
|
- if (expansionOrderEntity.getPayType() == -1) {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], "未支付");
|
|
|
|
- continue;
|
|
|
|
- } else {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], ConstantExcel.PAYFORM[expansionOrderEntity.getPayType()]);
|
|
|
|
|
|
+ if(orderDetail.getOrderItems().size() >= 3){
|
|
|
|
+ ResponseOrderItem responseOrderItem = orderDetail.getOrderItems().get(3);
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[21], responseOrderItem.getGoodsName());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[22], responseOrderItem.getGoodsCount());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[23], responseOrderItem.getGoodsPrice());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[24], responseOrderItem.getGoodsPrice());
|
|
}
|
|
}
|
|
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "");
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "");
|
|
|
|
-
|
|
|
|
- try{
|
|
|
|
- if(expansionOrderEntity.getPayStatus() == 0 || expansionOrderEntity.getPayStatus() ==-1 ){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "未付款");
|
|
|
|
- continue;
|
|
|
|
- }else if(expansionOrderEntity.getPayStatus() == -2 ){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已退款");
|
|
|
|
- }else if(expansionOrderEntity.getPayStatus() == 1){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已付款");
|
|
|
|
- }
|
|
|
|
- }catch (Exception e){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "");
|
|
|
|
|
|
+ if(orderDetail.getOrderItems().size() >= 4){
|
|
|
|
+ ResponseOrderItem responseOrderItem = orderDetail.getOrderItems().get(3);
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[25], "是");
|
|
|
|
+ }else {
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[25], "否");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- }else if(invoice.getConsumeType() == 2){
|
|
|
|
- Result orderResul = orderService.findByIncrementOrderId(invoice.getIncrementOrderId());
|
|
|
|
- incrementDetail = mapper.convertValue(orderResul.getData(), ResponseIncrementOrder.class);
|
|
|
|
-
|
|
|
|
- if(incrementDetail!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[1], incrementDetail.getOrderSn() == null?"" : incrementDetail.getOrderSn());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[5], incrementDetail.getAmount()== null?"" : String.valueOf(incrementDetail.getAmount()));
|
|
|
|
- if(incrementDetail.getUserId()!=null){
|
|
|
|
- UserEntity userEntity = iUserService.findById(incrementDetail.getUserId());
|
|
|
|
- if(userEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[2], userEntity.getUserName() == null?"" : userEntity.getUserName());
|
|
|
|
-
|
|
|
|
- if(invoice.getType() == 3){
|
|
|
|
- //获取默认地址
|
|
|
|
- receiverInfoEntity = iReceiverInfoService.findDefaultByUserId(incrementDetail.getUserId());
|
|
|
|
- if(receiverInfoEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[14], receiverInfoEntity.getShipName() == null?"" : receiverInfoEntity.getShipName());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[15], receiverInfoEntity.getShipMobile() == null?"" : receiverInfoEntity.getShipMobile());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[16], receiverInfoEntity.getShipAreaPath()== null?"" : receiverInfoEntity.getShipAreaPath()
|
|
|
|
- + " " + receiverInfoEntity.getShipAddress()== null?"" : receiverInfoEntity.getShipAddress());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if( incrementDetail.getTradeTime() == null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], "");
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], DateUtil.date2String(incrementDetail.getTradeTime(),null));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (incrementDetail.getPayType() == null || incrementDetail.getPayType() == -1) {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], "未支付");
|
|
|
|
- continue;
|
|
|
|
- } else {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], ConstantExcel.PAYFORM[incrementDetail.getPayType()]);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "");
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "");
|
|
|
|
-
|
|
|
|
- if(incrementDetail.getPayStatus()!=null){
|
|
|
|
- if(incrementDetail.getPayStatus().equals(0) || incrementDetail.getPayStatus().equals(-1)){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "未付款");
|
|
|
|
- continue;
|
|
|
|
- }else if(incrementDetail.getPayStatus().equals(-2)){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已退款");
|
|
|
|
- }else if(incrementDetail.getPayStatus().equals(1)){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已付款");
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "");
|
|
|
|
- }
|
|
|
|
|
|
+ //相机充值的订单
|
|
|
|
+ if(invoice.getConsumeType() == 1){
|
|
|
|
+ expansionOrderEntity = orderService.findEntityExpansionOrderByOrderId(invoice.getOrderId());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[1], expansionOrderEntity.getOrderSn());
|
|
|
|
+
|
|
|
|
+ goodsName = new StringBuilder();
|
|
|
|
+ if(expansionOrderEntity.getUnitSize() >= 1024){
|
|
|
|
+ goodsName.append(expansionOrderEntity.getUnitSize() / 1024);
|
|
|
|
+ goodsName.append("TB * ");
|
|
|
|
+ goodsName.append(expansionOrderEntity.getMonth());
|
|
|
|
+ goodsName.append("月");
|
|
|
|
+ }else {
|
|
|
|
+ goodsName.append(expansionOrderEntity.getUnitSize());
|
|
|
|
+ goodsName.append("GB * ");
|
|
|
|
+ goodsName.append(expansionOrderEntity.getMonth());
|
|
|
|
+ goodsName.append("月");
|
|
}
|
|
}
|
|
|
|
|
|
- }else if(invoice.getConsumeType() == 3){
|
|
|
|
- Result orderResul = orderService.findByDownloadOrderId(invoice.getDownloadOrderId());
|
|
|
|
- downloadDetail = mapper.convertValue(orderResul.getData(), ResponseDownloadOrder.class);
|
|
|
|
-
|
|
|
|
- if(downloadDetail!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[1], downloadDetail.getOrderSn() == null?"" : downloadDetail.getOrderSn());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[5], downloadDetail.getAmount()== null?"" : String.valueOf(downloadDetail.getAmount()));
|
|
|
|
- if(downloadDetail.getUserId()!=null){
|
|
|
|
- UserEntity userEntity = iUserService.findById(downloadDetail.getUserId());
|
|
|
|
- if(userEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[2], userEntity.getUserName() == null?"" : userEntity.getUserName());
|
|
|
|
-
|
|
|
|
- if(invoice.getType() == 3){
|
|
|
|
- //获取默认地址
|
|
|
|
- receiverInfoEntity = iReceiverInfoService.findDefaultByUserId(downloadDetail.getUserId());
|
|
|
|
- if(receiverInfoEntity!=null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[14], receiverInfoEntity.getShipName() == null?"" : receiverInfoEntity.getShipName());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[15], receiverInfoEntity.getShipMobile() == null?"" : receiverInfoEntity.getShipMobile());
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[16], receiverInfoEntity.getShipAreaPath()== null?"" : receiverInfoEntity.getShipAreaPath()
|
|
|
|
- + " " + receiverInfoEntity.getShipAddress()== null?"" : receiverInfoEntity.getShipAddress());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if( downloadDetail.getTradeTime() == null){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], "");
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[3], DateUtil.date2String(downloadDetail.getTradeTime(),null));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (downloadDetail.getPayType() == null || downloadDetail.getPayType() == -1) {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], "未支付");
|
|
|
|
- continue;
|
|
|
|
- } else {
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[6], ConstantExcel.PAYFORM[downloadDetail.getPayType()]);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[18], "");
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[19], "");
|
|
|
|
-
|
|
|
|
- if(downloadDetail.getPayStatus()!=null){
|
|
|
|
- if(downloadDetail.getPayStatus().equals(0) || downloadDetail.getPayStatus().equals(-1)){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "未付款");
|
|
|
|
- continue;
|
|
|
|
- }else if(downloadDetail.getPayStatus().equals(-2)){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已退款");
|
|
|
|
- }else if(downloadDetail.getPayStatus().equals(1)){
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "已付款");
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- item.put(ConstantExcel.INVOICEEXCELCOLENNAME2[20], "");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[13], goodsName.toString());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[14], 1);
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[15], expansionOrderEntity.getAmount());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[16], expansionOrderEntity.getAmount());
|
|
|
|
+ item.put(ConstantExcel.INVOICEEXCELCOLENNAME[25], "否");
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1019,10 +800,12 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
dataList.add(item);
|
|
dataList.add(item);
|
|
}
|
|
}
|
|
|
|
|
|
- String fileName = "发票数据-" + String.valueOf(System.currentTimeMillis()) + ".xls";
|
|
|
|
|
|
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ String dateStr = dateFormat.format(new Date());
|
|
|
|
+ String fileName = "发票数据-" + dateStr + ".xls";
|
|
File file = new File(ConstantFilePath.EXCEL_PATH + fileName + ".xls");
|
|
File file = new File(ConstantFilePath.EXCEL_PATH + fileName + ".xls");
|
|
|
|
|
|
- ExcelUtil.writeExcel(dataList, ConstantExcel.INVOICEEXCELCOLENNAME2.length, ConstantFilePath.EXCEL_PATH + fileName + ".xls", 6);
|
|
|
|
|
|
+ ExcelUtil.writeExcel(dataList, ConstantExcel.INVOICEEXCELCOLENNAME.length, ConstantFilePath.EXCEL_PATH + fileName + ".xls", 5);
|
|
|
|
|
|
String agent = request.getHeader("User-Agent");
|
|
String agent = request.getHeader("User-Agent");
|
|
if (agent != null && (agent.contains("MSIE")||agent.contains("Trident"))) {
|
|
if (agent != null && (agent.contains("MSIE")||agent.contains("Trident"))) {
|
|
@@ -1704,56 +1487,27 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result sendEInvoice(Long invoiceId, String remarks, String filePath) throws Exception {
|
|
public Result sendEInvoice(Long invoiceId, String remarks, String filePath) throws Exception {
|
|
|
|
+ String subject = SendMailAcceUtils.subject;
|
|
Result invoiceResult = tradeService.sendEInvoice(invoiceId, remarks, filePath);
|
|
Result invoiceResult = tradeService.sendEInvoice(invoiceId, remarks, filePath);
|
|
InvoiceEntity invoice = mapper.convertValue(invoiceResult.getData(), InvoiceEntity.class);
|
|
InvoiceEntity invoice = mapper.convertValue(invoiceResult.getData(), InvoiceEntity.class);
|
|
-
|
|
|
|
- String ordersn = "";
|
|
|
|
- Long userId = null;
|
|
|
|
if(invoice != null){
|
|
if(invoice != null){
|
|
if(StringUtils.isEmpty(invoice.getEmailAddress())){
|
|
if(StringUtils.isEmpty(invoice.getEmailAddress())){
|
|
throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3019, LoginConstant.FAILURE_MSG_3019);
|
|
throw new BaseRuntimeException(LoginConstant.FAILURE_CODE_3019, LoginConstant.FAILURE_MSG_3019);
|
|
}
|
|
}
|
|
- if(invoice.getOrderId() != null){
|
|
|
|
- Result orderResult = orderService.findByOrderId(invoice.getOrderId());
|
|
|
|
- ResponseOrder order = mapper.convertValue(orderResult.getData(), ResponseOrder.class);
|
|
|
|
- if(order == null) {
|
|
|
|
- ExpansionOrderEntity expansionOrderEntity = orderService.findEntityExpansionOrderByOrderId(invoice.getOrderId());
|
|
|
|
- if(expansionOrderEntity != null){
|
|
|
|
- ordersn = expansionOrderEntity.getOrderSn();
|
|
|
|
- userId = expansionOrderEntity.getUserId();
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- ordersn = order.getOrderSn();
|
|
|
|
- userId = order.getUserId();
|
|
|
|
- }
|
|
|
|
- }else if (invoice.getIncrementOrderId()!=null){
|
|
|
|
- IncrementOrderEntity incrementOrderEntity = orderService.findByIncrementOrderByOrderId(invoice.getIncrementOrderId());
|
|
|
|
- if(incrementOrderEntity!=null ){
|
|
|
|
- ordersn = incrementOrderEntity.getOrderSn();
|
|
|
|
- userId = incrementOrderEntity.getUserId();
|
|
|
|
- }
|
|
|
|
- }else if(invoice.getDownloadOrderId()!=null){
|
|
|
|
- DownloadOrderEntity downloadOrderEntity = orderService.findByDownloadOrderByOrderId(invoice.getDownloadOrderId());
|
|
|
|
- if(downloadOrderEntity!=null){
|
|
|
|
- ordersn = downloadOrderEntity.getOrderSn();
|
|
|
|
- userId = downloadOrderEntity.getUserId();
|
|
|
|
|
|
+ Result orderResult = orderService.findByOrderId(invoice.getOrderId());
|
|
|
|
+ ResponseOrder order = mapper.convertValue(orderResult.getData(), ResponseOrder.class);
|
|
|
|
+ if(order == null){
|
|
|
|
+ ExpansionOrderEntity expansionOrderEntity = orderService.findEntityExpansionOrderByOrderId(invoice.getOrderId());
|
|
|
|
+ if(expansionOrderEntity != null){
|
|
|
|
+ subject += "订单号:" + expansionOrderEntity.getOrderSn();
|
|
}
|
|
}
|
|
|
|
+ }else {
|
|
|
|
+ subject += "订单号:" + order.getOrderSn();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- String subject = SendMailAcceUtils.subjectinvoice.replace("${ordernum}", ordersn);
|
|
|
|
- String msg = SendMailAcceUtils.msg;
|
|
|
|
- msg = msg.replace("${ordernum}", ordersn);
|
|
|
|
- UserEntity userEntity = iUserService.findById(userId);
|
|
|
|
- if(userEntity!=null){
|
|
|
|
- msg = msg.replace("${username}", userEntity.getUserName() == null?"":userEntity.getUserName());
|
|
|
|
- }else{
|
|
|
|
- msg = msg.replace("${username}", "");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //TODO aa
|
|
|
|
//发送电子邮件
|
|
//发送电子邮件
|
|
- boolean falg = SendMailAcceUtils.sendMail(invoice.getEmailAddress(), subject, msg, ConstantFilePath.BASE_PATH + invoice.getEInvoice());
|
|
|
|
|
|
+ boolean falg = SendMailAcceUtils.sendMail(invoice.getEmailAddress(), subject, invoice.getShipName() + SendMailAcceUtils.msg, ConstantFilePath.BASE_PATH + invoice.getEInvoice());
|
|
log.info("邮件发送状态:{}", falg);
|
|
log.info("邮件发送状态:{}", falg);
|
|
return Result.success();
|
|
return Result.success();
|
|
}
|
|
}
|
|
@@ -1794,15 +1548,9 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
}
|
|
}
|
|
goodsService.updateCameraDetail(oldCameraDetail);
|
|
goodsService.updateCameraDetail(oldCameraDetail);
|
|
|
|
|
|
- // 判断相机是否绑定权益
|
|
|
|
- UserIncrementEntity incrementEntity = userIncrementService.findByCameraId(oldCameraDetail.getCameraId());
|
|
|
|
- if (!ObjectUtils.isEmpty(incrementEntity) && incrementEntity.getIsExpired() == 0) {
|
|
|
|
- //解封旧相机欠费的场景
|
|
|
|
- sceneService.unlockBeyondSpaceScenes(null, null, oldCameraDetail.getCameraId());
|
|
|
|
- } else {
|
|
|
|
- //解封旧相机欠费的场景
|
|
|
|
- sceneService.unlockBeyondSpaceScenes(sceneProEntity.getSpace(), null, oldCameraDetail.getCameraId());
|
|
|
|
- }
|
|
|
|
|
|
+ //解封旧相机欠费的场景
|
|
|
|
+ sceneService.unlockBeyondSpaceScenes(sceneProEntity.getSpace(), null, oldCameraDetail.getCameraId());
|
|
|
|
+
|
|
//修改场景的归属相机id和用户id,先将场景设置成封存,迁移完后看是否有空间恢复
|
|
//修改场景的归属相机id和用户id,先将场景设置成封存,迁移完后看是否有空间恢复
|
|
sceneProEntity.setCameraId(cameraEntity.getId());
|
|
sceneProEntity.setCameraId(cameraEntity.getId());
|
|
sceneProEntity.setUserId(cameraDetailEntity.getUserId());
|
|
sceneProEntity.setUserId(cameraDetailEntity.getUserId());
|
|
@@ -1820,14 +1568,10 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
goodsService.updateCameraDetail(cameraDetailEntity);
|
|
goodsService.updateCameraDetail(cameraDetailEntity);
|
|
|
|
|
|
//解封欠费的场景
|
|
//解封欠费的场景
|
|
- UserIncrementEntity incrementEntity = userIncrementService.findByCameraId(oldCameraDetail.getCameraId());
|
|
|
|
- if (!ObjectUtils.isEmpty(incrementEntity) && incrementEntity.getIsExpired() == 0) {
|
|
|
|
- //解封旧相机欠费的场景
|
|
|
|
- sceneService.unlockBeyondSpaceScenes(null, null, oldCameraDetail.getCameraId());
|
|
|
|
- } else {
|
|
|
|
- //解封旧相机欠费的场景
|
|
|
|
|
|
+ if(usableSpace.signum() > 0){
|
|
sceneService.unlockBeyondSpaceScenes(usableSpace, null, cameraEntity.getId());
|
|
sceneService.unlockBeyondSpaceScenes(usableSpace, null, cameraEntity.getId());
|
|
}
|
|
}
|
|
|
|
+
|
|
return Result.success();
|
|
return Result.success();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1854,22 +1598,12 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
numService.update(numEntity);
|
|
numService.update(numEntity);
|
|
|
|
|
|
String oldnum = oldScene.getNum();
|
|
String oldnum = oldScene.getNum();
|
|
- //复制数据库数据
|
|
|
|
- oldScene.setId(null);
|
|
|
|
- oldScene.setNum(newNum);
|
|
|
|
- if(StringUtils.isNotEmpty(sceneName)){
|
|
|
|
- oldScene.setSceneName(sceneName);
|
|
|
|
- }
|
|
|
|
- oldScene.setWebSite(oldScene.getWebSite().replace(sceneNum, newNum));
|
|
|
|
-// oldScene.setUserId(Long.valueOf(kankanMiniConfig.getCopySceneAccountId()));
|
|
|
|
- oldScene.setThumb(oldScene.getThumb().replace(sceneNum, newNum));
|
|
|
|
- oldScene.setSpace(new BigInteger("0"));
|
|
|
|
-
|
|
|
|
//更新video
|
|
//更新video
|
|
|
|
+
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
JSONObject object = new JSONObject();
|
|
JSONObject object = new JSONObject();
|
|
if(StringUtils.isNotEmpty(oldScene.getVideos())){
|
|
if(StringUtils.isNotEmpty(oldScene.getVideos())){
|
|
- object = JSONObject.parseObject(oldScene.getVideos());
|
|
|
|
|
|
+ object = JSONObject.parseObject(oldScene.getVideos());
|
|
if(object.containsKey("upPath")){
|
|
if(object.containsKey("upPath")){
|
|
String upPath = object.getString("upPath");
|
|
String upPath = object.getString("upPath");
|
|
|
|
|
|
@@ -1882,9 +1616,19 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
|
|
|
|
map.put("videos",oldScene.getVideos());
|
|
map.put("videos",oldScene.getVideos());
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ //复制数据库数据
|
|
|
|
+ oldScene.setId(null);
|
|
|
|
+ oldScene.setNum(newNum);
|
|
|
|
+ if(StringUtils.isNotEmpty(sceneName)){
|
|
|
|
+ oldScene.setSceneName(sceneName);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ oldScene.setWebSite(oldScene.getWebSite().replace(sceneNum, newNum));
|
|
|
|
+// oldScene.setUserId(Long.valueOf(kankanMiniConfig.getCopySceneAccountId()));
|
|
|
|
+ oldScene.setThumb(oldScene.getThumb().replace(sceneNum, newNum));
|
|
|
|
+ oldScene.setSpace(new BigInteger("0"));
|
|
sceneProService.save(oldScene);
|
|
sceneProService.save(oldScene);
|
|
|
|
|
|
oldEditScene.setId(null);
|
|
oldEditScene.setId(null);
|
|
@@ -1897,7 +1641,6 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
oldEditScene.setFloorPlanPng(oldEditScene.getFloorPlanPng() == null ? null : oldEditScene.getFloorPlanPng().replace(sceneNum, newNum));
|
|
oldEditScene.setFloorPlanPng(oldEditScene.getFloorPlanPng() == null ? null : oldEditScene.getFloorPlanPng().replace(sceneNum, newNum));
|
|
sceneProEditService.save(oldEditScene);
|
|
sceneProEditService.save(oldEditScene);
|
|
|
|
|
|
-
|
|
|
|
new Thread(){
|
|
new Thread(){
|
|
//重写run方法
|
|
//重写run方法
|
|
@Override
|
|
@Override
|
|
@@ -1935,7 +1678,7 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
private void copyOldSceneLocalToNew(String sceneNum, String newNum) throws IOException {
|
|
private void copyOldSceneLocalToNew(String sceneNum, String newNum) throws IOException {
|
|
FileUtils.copyFolderAllFiles(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/",
|
|
FileUtils.copyFolderAllFiles(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/",
|
|
ConstantFilePath.SCENE_PATH + "data/data" + newNum + "/", true);
|
|
ConstantFilePath.SCENE_PATH + "data/data" + newNum + "/", true);
|
|
-// log.info("成功拷贝完data文件夹-{}", sceneNum);
|
|
|
|
|
|
+ log.info("成功拷贝完data文件夹-{}", sceneNum);
|
|
|
|
|
|
// 复制本地视频
|
|
// 复制本地视频
|
|
FileUtils.copyFolderAllFiles(ConstantFilePath.SCENE_PATH + "video/video" + sceneNum + "/",
|
|
FileUtils.copyFolderAllFiles(ConstantFilePath.SCENE_PATH + "video/video" + sceneNum + "/",
|
|
@@ -1955,7 +1698,7 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
copySucc = FileUtils.copyFile(ConstantFilePath.SCENE_QR_CODE_PATH + sceneNum + "_en.png",
|
|
copySucc = FileUtils.copyFile(ConstantFilePath.SCENE_QR_CODE_PATH + sceneNum + "_en.png",
|
|
ConstantFilePath.SCENE_QR_CODE_PATH + newNum + "_en.png", true);
|
|
ConstantFilePath.SCENE_QR_CODE_PATH + newNum + "_en.png", true);
|
|
// log.info("成功拷贝完国际二维码文件-{}", sceneNum);
|
|
// log.info("成功拷贝完国际二维码文件-{}", sceneNum);
|
|
-
|
|
|
|
|
|
+//
|
|
// log.info("旧的场景码-{}", ConstantFilePath.SCENE_QR_CODE_PATH + sceneNum + "_en.png");
|
|
// log.info("旧的场景码-{}", ConstantFilePath.SCENE_QR_CODE_PATH + sceneNum + "_en.png");
|
|
// log.info("新的场景码-{}", ConstantFilePath.SCENE_QR_CODE_PATH + newNum + "_en.png");
|
|
// log.info("新的场景码-{}", ConstantFilePath.SCENE_QR_CODE_PATH + newNum + "_en.png");
|
|
// if (!copySucc) {
|
|
// if (!copySucc) {
|
|
@@ -2409,56 +2152,62 @@ public class ManagerServiceImpl extends BaseServiceImpl<ManagerEntity, Long> imp
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result insertIncrementls(String username,Date endTime,Integer incrementNum,Integer downloadNum, String managerName) throws Exception {
|
|
|
|
-
|
|
|
|
|
|
+ public Result insertIncrementls(RequestUserIncrement increment,String managerName){
|
|
TmIncrementLogEntity tmIncrementLogEntity = new TmIncrementLogEntity();
|
|
TmIncrementLogEntity tmIncrementLogEntity = new TmIncrementLogEntity();
|
|
|
|
+ Integer incrementNum = increment.getIncrementNum();
|
|
|
|
+ Integer downloadNum = increment.getDownloadNum();
|
|
//获取用户id
|
|
//获取用户id
|
|
- UserEntity userEntity = userService.findUserByUserName(username);
|
|
|
|
- if(userEntity!=null && userEntity.getId()!=null){
|
|
|
|
-
|
|
|
|
- if(incrementNum!=null && incrementNum>0 && endTime != null){
|
|
|
|
- tmIncrementLogEntity.setType("2");
|
|
|
|
- for(int i=1;i<=incrementNum;i++){
|
|
|
|
- //增加一条会员权益
|
|
|
|
- UserIncrementEntity userIncrementEntity = new UserIncrementEntity();
|
|
|
|
- userIncrementEntity.setKeyWord(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
- userIncrementEntity.setUserId(userEntity.getId());
|
|
|
|
- userIncrementEntity.setIncrementStartTime(new Date());
|
|
|
|
- userIncrementEntity.setIncrementEndTime(endTime);
|
|
|
|
- userIncrementEntity.setIsExpired(0);
|
|
|
|
- userIncrementService.save(userIncrementEntity);
|
|
|
|
-
|
|
|
|
- userEntity.setDownloadNumTotal(userEntity.getDownloadNumTotal() + 10);
|
|
|
|
- userService.update(userEntity);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- tmIncrementLogEntity.setDownloadNum(10 * incrementNum);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(downloadNum!=null && downloadNum > 0){
|
|
|
|
- //增加下载次数
|
|
|
|
- userEntity.setDownloadNumTotal(userEntity.getDownloadNumTotal() + downloadNum);
|
|
|
|
|
|
+ UserEntity userEntity = userService.findUserByUserName(increment.getUserName());
|
|
|
|
+ if(ObjectUtils.isEmpty(userEntity)){
|
|
|
|
+ return Result.failure("用户不存在");
|
|
|
|
+ }
|
|
|
|
+ Date endTime = increment.getIncrementEndTime();
|
|
|
|
+ if(!ObjectUtils.isEmpty(downloadNum)){
|
|
|
|
+ //增加下载次数
|
|
|
|
+ userEntity.setDownloadNumTotal(userEntity.getDownloadNumTotal() + downloadNum);
|
|
|
|
+ userService.update(userEntity);
|
|
|
|
+ tmIncrementLogEntity.setType("3");
|
|
|
|
+ tmIncrementLogEntity.setDownloadNum(downloadNum);
|
|
|
|
+ }else{
|
|
|
|
+ if(ObjectUtils.isEmpty(incrementNum) || incrementNum <=0){
|
|
|
|
+ return Result.failure("会员数量有误!");
|
|
|
|
+ }
|
|
|
|
+ endTime = increment.getIncrementEndTime();
|
|
|
|
+ if(ObjectUtils.isEmpty(endTime)){
|
|
|
|
+ return Result.failure("权益到期时间有误!");
|
|
|
|
+ }
|
|
|
|
+ UserIncrementEntity userIncrementEntity = new UserIncrementEntity();
|
|
|
|
+ for (int i = 1; i <= incrementNum; i++) {
|
|
|
|
+ userIncrementEntity.setId(null);
|
|
|
|
+ //增加一条会员权益
|
|
|
|
+ userIncrementEntity.setKeyWord(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
+ userIncrementEntity.setUserId(userEntity.getId());
|
|
|
|
+ userIncrementEntity.setIncrementStartTime(new Date());
|
|
|
|
+ userIncrementEntity.setIncrementEndTime(endTime);
|
|
|
|
+ userIncrementEntity.setIsExpired(0);
|
|
|
|
+ userIncrementEntity.setMemberLevels(increment.getMemberLevels());
|
|
|
|
+ userIncrementService.save(userIncrementEntity);
|
|
|
|
+ }
|
|
|
|
+ if(increment.getMemberLevels().equals("PR")){
|
|
|
|
+ userEntity.setDownloadNumTotal(userEntity.getDownloadNumTotal() + 10 * incrementNum);
|
|
userService.update(userEntity);
|
|
userService.update(userEntity);
|
|
- tmIncrementLogEntity.setType("3");
|
|
|
|
- tmIncrementLogEntity.setDownloadNum(downloadNum);
|
|
|
|
|
|
+ tmIncrementLogEntity.setDownloadNum(10 * incrementNum);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- //操作记录log
|
|
|
|
- managerName = managerName.substring(managerName.indexOf(":")+1,managerName.length());
|
|
|
|
- tmIncrementLogEntity.setUserId(userEntity.getId());
|
|
|
|
- tmIncrementLogEntity.setUserName(userEntity.getUserName());
|
|
|
|
- tmIncrementLogEntity.setOperateUesr(managerName);
|
|
|
|
- tmIncrementLogEntity.setIncrementNum(incrementNum == null ? 0:incrementNum);
|
|
|
|
-
|
|
|
|
- if(endTime!=null){
|
|
|
|
- tmIncrementLogEntity.setIncrementEndtime(endTime);
|
|
|
|
- }
|
|
|
|
- iIncrementDownloadLogService.save(tmIncrementLogEntity);
|
|
|
|
|
|
+ //操作记录log
|
|
|
|
+ managerName = managerName.substring(managerName.indexOf(":") + 1);
|
|
|
|
+ tmIncrementLogEntity.setUserId(userEntity.getId());
|
|
|
|
+ tmIncrementLogEntity.setUserName(userEntity.getUserName());
|
|
|
|
+ tmIncrementLogEntity.setOperateUesr(managerName);
|
|
|
|
+ tmIncrementLogEntity.setIncrementNum(incrementNum);
|
|
|
|
|
|
- return Result.success();
|
|
|
|
- }else{
|
|
|
|
- return Result.failure("用户不存在");
|
|
|
|
|
|
+ if(!ObjectUtils.isEmpty(endTime)){
|
|
|
|
+ tmIncrementLogEntity.setIncrementEndtime(endTime);
|
|
}
|
|
}
|
|
|
|
+ iIncrementDownloadLogService.save(tmIncrementLogEntity);
|
|
|
|
+ return Result.success();
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|