开票、充电推送修改时间、手机号授权
This commit is contained in:
parent
38dfa13a71
commit
52d5b1afff
@ -43,7 +43,7 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher {
|
||||
* 设备充电中状态变化推送(我们平台推送成都市平台) --已推送
|
||||
* 实时数据没40秒
|
||||
*/
|
||||
@Scheduled(fixedDelay = 1000 * 40)
|
||||
//@Scheduled(fixedDelay = 1000 * 40)
|
||||
public void run() throws Exception{
|
||||
|
||||
List<Long> longList =new ArrayList<>();
|
||||
|
||||
@ -20,7 +20,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -60,7 +59,7 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
*订单信息推送 ---已推送--推送服务使用
|
||||
* @throws IOException
|
||||
*/
|
||||
@Scheduled(fixedDelay = 1000 * 60)
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
|
||||
@ -31,7 +31,7 @@ public class CDNotificationStationFeeTask extends CoreDispatcher {
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationFeeTask.class);
|
||||
|
||||
//--推送服务使用
|
||||
@Scheduled(fixedDelay = 1000 * 60)
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
|
||||
@ -0,0 +1,89 @@
|
||||
package com.xhpc.evcs.cdjgpc.notification;
|
||||
|
||||
import com.xhpc.common.api.dto.ChargingStationDto;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDEquipmentInfo;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDStationInfo;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.domain.XhpcStationInternetBlacklist;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcStationInternetBlacklistRepository;
|
||||
import com.xhpc.evcs.notification.CoreDispatcher;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
public class CDNotificationStationInfoTask extends CoreDispatcher {
|
||||
|
||||
|
||||
@Resource
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
@Resource
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationInfoTask.class);
|
||||
|
||||
//推送新平台场站信息
|
||||
//@Scheduled(cron = "0 0 0 1/15 * ? ")
|
||||
public void run() throws IOException {
|
||||
try{
|
||||
List<XhpcStationInternetBlacklist> xhpcStationInternetBlacklist =
|
||||
xhpcStationInternetBlacklistRepo.findByInternetUserId(6L);
|
||||
List<String> stationKeys = new ArrayList<>(REDIS.keys("station:*"));
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA6CC2LK7", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
for (String stationKey : stationKeys) {
|
||||
//查询不合作的电桩
|
||||
for (XhpcStationInternetBlacklist xhpcStationInternetBlack : xhpcStationInternetBlacklist) {
|
||||
if (!stationKey.substring(8).equals(xhpcStationInternetBlack.getChargingStationId().toString())) {
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
String chargingStationId = xhpcStationInternetBlack.getChargingStationId().toString();
|
||||
//获取场站信息
|
||||
String key = "cdjgpc:station:".concat(chargingStationId)+".notification";
|
||||
CDStationInfo cdStationInfo =REDIS.getCacheObject(key);
|
||||
cdStationInfo.setEquipmentInfos(new ArrayList<>());
|
||||
//查询场站是桩是否对应上
|
||||
ChargingStationDto stationDto = REDIS.getCacheObject("station:"+chargingStationId);
|
||||
Set<String> pks = stationDto.getPiles();
|
||||
if (pks != null) {
|
||||
List<CDEquipmentInfo> cdEquipmentInfos = new ArrayList<>();
|
||||
for (String pileNo : pks) {
|
||||
String pk = "pile:".concat(pileNo);
|
||||
String skey = "cdjgpc:".concat(pk)+".notification";
|
||||
CDEquipmentInfo cdEquipmentInfo = REDIS.getCacheObject(skey);
|
||||
if(cdEquipmentInfo==null || "".equals(cdEquipmentInfo.getEquipmentID())){
|
||||
logger.info("该场站下面:"+pileNo+"桩未录入");
|
||||
}else{
|
||||
cdEquipmentInfos.add(cdEquipmentInfo);
|
||||
}
|
||||
}
|
||||
cdStationInfo.setEquipmentInfos(cdEquipmentInfos);
|
||||
}
|
||||
cdStationInfo.setSwapMatchCarsName(null);
|
||||
CommonRequest<CDStationInfo> commonRequest = new CommonRequest<>();
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("StationInfo",cdStationInfo);
|
||||
String data = JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_stationInfo",authSecretTokenOut);
|
||||
System.out.println("=====推送充电站信息==result========"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -50,7 +50,7 @@ public class CDNotificationStationStatusTask extends CoreDispatcher {
|
||||
@Resource
|
||||
private XhpcTerminalRepository terminalRepository;
|
||||
//--推送服务使用
|
||||
@Scheduled(fixedRate = 1000 * 45)
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
protected void run() throws IOException {
|
||||
|
||||
Collection<String> stationTerminalKeys = REDIS.keys("stationTerminalStatus:*");
|
||||
|
||||
@ -31,7 +31,7 @@ public class NotificationCancelOrderTask extends CoreDispatcher {
|
||||
//private Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
|
||||
//推送不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
//Getting the orders, which need to be notified.
|
||||
|
||||
@ -46,7 +46,7 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher {
|
||||
* 推送充电订单信息(运营奖补)(测试环境开)
|
||||
* @throws IOException
|
||||
*/
|
||||
@Scheduled(fixedDelay = 1000 * 60)
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
|
||||
@ -39,7 +39,7 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
//推送不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
Collection<String> orderKeys = REDIS.keys("order:*");
|
||||
|
||||
@ -49,7 +49,7 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher {
|
||||
* @throws IOException
|
||||
*/
|
||||
//推送不开放
|
||||
//@Scheduled(fixedRate = 1000 * 50)
|
||||
@Scheduled(fixedRate = 1000 * 30)
|
||||
public void run() throws IOException {
|
||||
|
||||
List<AuthSecretToken> authSecretTokenOutList = authSecretTokenRepository.findBySecretTokenType(SECRET_TOKEN_TYPE_OUT);
|
||||
|
||||
@ -34,7 +34,7 @@ public class NotificationStartChargeResultTask extends CoreDispatcher {
|
||||
* Judging the 3rd whether it has got the start charging task.
|
||||
*/
|
||||
//推送不开放
|
||||
//@Scheduled(fixedRate = 1000 * 3)
|
||||
@Scheduled(fixedRate = 1000 * 30)
|
||||
public void run() throws IOException {
|
||||
|
||||
//Getting the charge orders which from 3rd.
|
||||
|
||||
@ -50,7 +50,7 @@ public class NotificationStationStatusTask extends CoreDispatcher {
|
||||
private XhpcTerminalRepository terminalRepository;
|
||||
|
||||
//推送不开放
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
@Scheduled(fixedRate = 1000 * 45)
|
||||
protected void run() throws IOException {
|
||||
|
||||
Collection<String> stationTerminalKeys = REDIS.keys("stationTerminalStatus:*");
|
||||
|
||||
@ -26,7 +26,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
||||
@Autowired
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
|
||||
//@Scheduled(fixedRate = 1000 * 3)
|
||||
@Scheduled(fixedRate = 1000 * 3)
|
||||
public void run() throws Exception {
|
||||
|
||||
notifyService();
|
||||
|
||||
@ -96,8 +96,7 @@ public class TokenController extends BaseController
|
||||
|
||||
}else{
|
||||
String captcha = redisService.getCacheObject("pcToken:" + form.getUsername());
|
||||
|
||||
if (!form.getPassword().equals(captcha) && !form.getPassword().equals("741852963")) {
|
||||
if (!form.getPassword().equals(captcha)) {
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "手机号验证码错误");
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,4 +58,14 @@ public class RemoteStartReplyData extends BaseData {
|
||||
this.failReason = failReason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RemoteStartReplyData{" +
|
||||
"orderNo='" + orderNo + '\'' +
|
||||
", pileNo='" + pileNo + '\'' +
|
||||
", gunId='" + gunId + '\'' +
|
||||
", startResult='" + startResult + '\'' +
|
||||
", failReason='" + failReason + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,13 +17,13 @@ public class ConnectionRabbitMQUtil {
|
||||
//定义连接工厂
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
//设置服务地址
|
||||
factory.setHost("118.24.137.203");
|
||||
factory.setHost("47.109.133.116");
|
||||
//端口
|
||||
factory.setPort(5673);
|
||||
factory.setPort(5672);
|
||||
//设置账号信息,用户名、密码、vhost
|
||||
//factory.setVirtualHost("/guest");//设置虚拟机,一个mq服务可以设置多个虚拟机,每个虚拟机就相当于一个独立的mq
|
||||
factory.setUsername("admin");
|
||||
factory.setPassword("admin");
|
||||
factory.setPassword("123456");
|
||||
// 通过工厂获取连接
|
||||
Connection connection = factory.newConnection();
|
||||
return connection;
|
||||
|
||||
@ -192,7 +192,8 @@ public class XhpcChargeOrderController extends BaseController {
|
||||
public R pileVin(String serialNumber,String vinNumber)
|
||||
{
|
||||
logger.info("<<<<<<<<<<VIN码启动前判断<<<<<<<<<<<<<<serialNumber>>>>>>>>"+serialNumber+">>>vinNumber>>>"+vinNumber+">>>");
|
||||
return iXhpcChargeOrderService.pileVin(serialNumber,vinNumber);
|
||||
return R.fail(1880, "无效VIN码");
|
||||
// return iXhpcChargeOrderService.pileVin(serialNumber,vinNumber);
|
||||
}
|
||||
|
||||
@GetMapping("/constantSoc")
|
||||
|
||||
@ -311,8 +311,6 @@ public class XhpcPileOrderController extends BaseController {
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
powerPileService.stopCharging(orderNo, substring,orderNo.substring(0, 16), "0A");
|
||||
System.out.println("=====================p平台下发停止充电=============================="+xhpcChargeOrder.getSerialNumber());
|
||||
System.out.println("=====================p平台下发停止充电=============================="+xhpcChargeOrder.getSerialNumber());
|
||||
System.out.println("=====================p平台下发停止充电=============================="+xhpcChargeOrder.getSerialNumber());
|
||||
return R.fail(500,"充电桩校验故障");
|
||||
}
|
||||
}
|
||||
@ -479,8 +477,8 @@ public class XhpcPileOrderController extends BaseController {
|
||||
}
|
||||
BigDecimal bigDecimal = new BigDecimal(10000);
|
||||
BigDecimal totalPowerQuantity = new BigDecimal(cacheOrderData.getTotalPowerQuantity()).divide(bigDecimal,4,BigDecimal.ROUND_HALF_UP);
|
||||
if(totalPowerQuantity.compareTo(new BigDecimal(400)) > -1){
|
||||
logger.info("结算电量大于400度>>"+totalPowerQuantity+">>>orderNo:" + orderNo);
|
||||
if(totalPowerQuantity.compareTo(new BigDecimal(500)) > -1){
|
||||
logger.info("结算电量大于500度>>"+totalPowerQuantity+">>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setChargingDegree(totalPowerQuantity);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
|
||||
@ -1175,4 +1175,14 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
public AjaxResult updateChengDuPush(Long historyOrderId) {
|
||||
return xhpcHistoryOrderService.updateChengDuPush(historyOrderId);
|
||||
}
|
||||
|
||||
//有争议的订单,平台自己修改订单转改
|
||||
@GetMapping("/cancelOrders")
|
||||
public AjaxResult cancelOrders(Long historyOrderId) {
|
||||
return xhpcHistoryOrderService.cancelOrders(historyOrderId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -150,6 +150,7 @@ public interface XhpcHistoryOrderMapper {
|
||||
|
||||
int updateOrderInternetPush(Long historyOrderId);
|
||||
|
||||
int cancelOrders(Long historyOrderId);
|
||||
int updateChengDuPush(Long historyOrderId);
|
||||
|
||||
Map<String, Object> getXhpcRateTimeFee(@Param("date") String date, @Param("rateModelId") Long rateModelId);
|
||||
|
||||
@ -4,6 +4,8 @@ import com.rabbitmq.client.*;
|
||||
import com.xhpc.common.util.ConnectionRabbitMQUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/**
|
||||
@ -28,7 +30,11 @@ public class RecvDemo {
|
||||
* 4、autoDelete 自动删除,队列不再使用时是否自动删除此队列,如果将此参数和exclusive参数设置为true就可以实现临时队列(队列不用了就自动删除)
|
||||
* 5、arguments 参数,可以设置一个队列的扩展参数,比如:可设置存活时间
|
||||
*/
|
||||
Map<String,Object> map =new HashMap<>();
|
||||
|
||||
|
||||
channel.queueDeclare(NAME, false, false, false, null);
|
||||
|
||||
//实现消费方法
|
||||
DefaultConsumer consumer = new DefaultConsumer(channel){
|
||||
// 获取消息,并且处理,这个方法类似事件监听,如果有消息的时候,会被自动调用
|
||||
|
||||
@ -146,5 +146,7 @@ public interface IXhpcHistoryOrderService {
|
||||
|
||||
AjaxResult updateChengDuPush(Long historyOrderId);
|
||||
|
||||
AjaxResult cancelOrders(Long historyOrderId);
|
||||
|
||||
Map<String, Object> getXhpcRateTimeFee(Long rateModelId);
|
||||
}
|
||||
|
||||
@ -645,6 +645,14 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis
|
||||
}
|
||||
return AjaxResult.error("修改推送订单失败请联系管理员");
|
||||
}
|
||||
@Override
|
||||
public AjaxResult cancelOrders(Long historyOrderId) {
|
||||
int i = xhpcHistoryOrderMapper.cancelOrders(historyOrderId);
|
||||
if(i>0){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error("修改推送订单失败请联系管理员");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult updateChengDuPush(Long historyOrderId) {
|
||||
|
||||
@ -1702,6 +1702,11 @@
|
||||
UPDATE xhpc_history_order set confirm_Result =-1 where history_order_id=#{historyOrderId}
|
||||
</update>
|
||||
|
||||
<update id="cancelOrders">
|
||||
UPDATE xhpc_history_order set confirm_Result =0 where history_order_id=#{historyOrderId}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateChengDuPush">
|
||||
UPDATE et_auth_sec_token set last_push_order =#{historyOrderId} where id=2
|
||||
</update>
|
||||
|
||||
@ -4,6 +4,9 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xhpc.common.api.PileOrderService;
|
||||
import com.xhpc.common.data.up.RemoteStartReplyData;
|
||||
import com.xhpc.common.enums.StationDeviceEnum;
|
||||
import com.xhpc.pp.domain.XhpcDeviceMessage;
|
||||
import com.xhpc.pp.mapper.XhpcDeviceMessageMapper;
|
||||
import com.xhpc.pp.tx.ServiceParameter;
|
||||
import com.xhpc.pp.tx.ServiceResult;
|
||||
import com.xhpc.pp.tx.logic.ServiceLogic;
|
||||
@ -13,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -40,10 +44,11 @@ public class RemoteStartReplyDataLogic implements ServiceLogic {
|
||||
|
||||
@Autowired
|
||||
private PileOrderService pileOrderService;
|
||||
@Resource
|
||||
XhpcDeviceMessageMapper deviceMessageMapper;
|
||||
|
||||
@Override
|
||||
public ServiceResult service(ServiceParameter sp) throws Exception {
|
||||
|
||||
Map<String, Object> req = sp.getParameters();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
RemoteStartReplyData remoteStartReplyData = objectMapper.convertValue(req, RemoteStartReplyData.class);
|
||||
@ -58,13 +63,16 @@ public class RemoteStartReplyDataLogic implements ServiceLogic {
|
||||
REDIS.setCacheMap(gunkey, cacheGun);
|
||||
String pushOrderKey = orderkey.replace("order:", "pushOrder:");
|
||||
Map<String, Object> pushOrder = REDIS.getCacheMap(pushOrderKey);
|
||||
|
||||
if (HEX_01.equals(remoteStartReplyData.getStartResult())) {
|
||||
final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT);
|
||||
cacheGun.put("pileStartTime", orderstarttime);
|
||||
cacheGun.put("orderstoptime", null);
|
||||
cacheGun.put("orderkey", orderkey);
|
||||
cacheOrder.put("pileStartTime", orderstarttime);
|
||||
REDIS.setCacheMap(gunkey, cacheGun);
|
||||
String substring = "gun:"+orderNo.substring(0, 16);
|
||||
|
||||
REDIS.setCacheMap(substring, cacheGun);
|
||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
||||
pileOrderService.pileStartup(orderNo, 1, "启动充电成功");
|
||||
if (pushOrder != null) {
|
||||
@ -85,7 +93,19 @@ public class RemoteStartReplyDataLogic implements ServiceLogic {
|
||||
REDIS.setCacheMap(pushOrderKey, map);
|
||||
}
|
||||
}
|
||||
XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();
|
||||
deviceMessage.setType(StationDeviceEnum.PILE.getCode());
|
||||
deviceMessage.setSerialNumber(sp.getPileNo());
|
||||
deviceMessage.setRemark("远程启动充电命令回复");
|
||||
deviceMessage.setStatus(0);
|
||||
deviceMessage.setContent((String) req.get("hex"));
|
||||
deviceMessage.setChargeOrderNo((String) req.get("orderNo"));
|
||||
deviceMessageMapper.insertByDomain(deviceMessage);
|
||||
return new ServiceResult(false);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String st ="80836000100009012401271201045239";
|
||||
System.out.println(st.substring(0,16));
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,8 @@ public class HBCheckTask {
|
||||
@Resource
|
||||
XhpcDeviceMessageMapper deviceMessageMapper;
|
||||
|
||||
//111@Scheduled(fixedRate = 10000)
|
||||
//每5分钟执行一次
|
||||
@Scheduled(cron = "0 0/5 * * * ?")
|
||||
protected void run() {
|
||||
|
||||
String svcSrvKey = "svcSrvGuns:".concat(getLocalIPAndPort());
|
||||
|
||||
@ -62,4 +62,13 @@ public class ServiceParameter implements Serializable {
|
||||
this.pileNo = pileNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServiceParameter{" +
|
||||
"serviceName='" + serviceName + '\'' +
|
||||
", pileNo='" + pileNo + '\'' +
|
||||
", version='" + version + '\'' +
|
||||
", parameters=" + parameters +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,10 +59,15 @@ public class AllInvoiceOrdersResponse {
|
||||
@JsonProperty("creatorType")
|
||||
private Integer creatorType;
|
||||
/**
|
||||
* 发票类型 0为普票,1为专票
|
||||
*
|
||||
*/
|
||||
@JsonProperty("invoiceType")
|
||||
private Integer invoiceType;
|
||||
/**
|
||||
* 发票类型 0为普票,1为专票
|
||||
*/
|
||||
@JsonProperty("invoiceStatus")
|
||||
private Integer invoiceStatus;
|
||||
/**
|
||||
* 发票金额
|
||||
*/
|
||||
|
||||
@ -51,6 +51,9 @@ public class SaveInvoiceInfoRequest {
|
||||
private String creator;
|
||||
@JsonProperty("createTime")
|
||||
private String createTime;
|
||||
@JsonProperty("invoiceStatus")
|
||||
private Integer invoiceStatus;
|
||||
|
||||
@JsonProperty("historyOrderIds")
|
||||
private List<Integer> historyOrderIds;
|
||||
|
||||
|
||||
@ -53,6 +53,11 @@ public class SpecificInvoiceWrap {
|
||||
*/
|
||||
@JsonProperty("titleType")
|
||||
private Integer titleType;
|
||||
/**
|
||||
* 发票类型
|
||||
*/
|
||||
@JsonProperty("invoiceStatus")
|
||||
private Integer invoiceStatus;
|
||||
/**
|
||||
* 发票抬头内容
|
||||
*/
|
||||
|
||||
@ -103,12 +103,14 @@ public interface XhpcAppUserMapper {
|
||||
Map<String, Object> getUserLoginTime(@Param("type")Integer type,@Param("openid")String openid,@Param("tenantId")String tenantId);
|
||||
|
||||
/**
|
||||
* 该账号之前的登录信息,进行退出操作
|
||||
* 修改该账号之前的登录信息,进行退出操作
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
int updateUserLoginTime(@Param("account")String account);
|
||||
|
||||
int updateopenIdUserLoginTime(@Param("openId")String openId);
|
||||
|
||||
/**
|
||||
* 查询开始时间是否在活动中
|
||||
*/
|
||||
|
||||
@ -161,6 +161,9 @@ public class XhpcInvoice implements Serializable {
|
||||
|
||||
private String tenantId;
|
||||
|
||||
//0增值税普通发票 1增值税专用发票
|
||||
private Integer invoiceStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
||||
@ -448,6 +448,9 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
||||
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
|
||||
logger.info("<<<<<<<<<<自动登录openid>>>>>>>>>>>>"+openid);
|
||||
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
|
||||
if("".equals(openid)|| openid==null){
|
||||
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
||||
}
|
||||
Map<String, Object> userLoginTime = xhpcAppUserMapper.getUserLoginTime(Integer.valueOf(type), openid,tenantId);
|
||||
if(userLoginTime ==null){
|
||||
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
||||
@ -456,6 +459,8 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
||||
if(userLoginTime.get("status") == null){
|
||||
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
||||
} else if(UserTypeUtil.NO_LOGIN.equals(userLoginTime.get("status").toString())){
|
||||
//删除记录
|
||||
xhpcAppUserMapper.updateopenIdUserLoginTime(openid);
|
||||
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
||||
}
|
||||
logger.info("-------status---"+userLoginTime.get("status").toString());
|
||||
|
||||
@ -92,6 +92,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
AllInvoiceOrdersResponse.ItemsDTO itemsDTO = new AllInvoiceOrdersResponse.ItemsDTO();
|
||||
itemsDTO.setInvoiceId(xhpcInvoice.getInvoiceId());
|
||||
itemsDTO.setInvoiceType(xhpcInvoice.getInvoiceType());
|
||||
itemsDTO.setInvoiceStatus(xhpcInvoice.getInvoiceStatus());
|
||||
itemsDTO.setCreator(xhpcInvoice.getCreator());
|
||||
itemsDTO.setCreatorType(xhpcInvoice.getCreatorType());
|
||||
itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney());
|
||||
@ -101,6 +102,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime()));
|
||||
}
|
||||
itemsDTO.setDrawer(xhpcInvoice.getDrawer());
|
||||
|
||||
itemsDTOList.add(itemsDTO);
|
||||
}
|
||||
AllInvoiceOrdersResponse allInvoiceOrdersResponse = new AllInvoiceOrdersResponse();
|
||||
@ -588,6 +590,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
xhpcInvoice.setCreator(saveInvoiceInfoRequest.getCreator());
|
||||
xhpcInvoice.setCreateTime(DateUtils.parseDate(saveInvoiceInfoRequest.getCreateTime()));
|
||||
xhpcInvoice.setStatus(0);
|
||||
xhpcInvoice.setInvoiceStatus(saveInvoiceInfoRequest.getInvoiceStatus());
|
||||
xhpcInvoiceMapper.insertSelectiveAndReturnId(xhpcInvoice);
|
||||
//建立订单与发票之间的关联
|
||||
List<XhpcHistoryOrder> xhpcHistoryOrderList = xhpcHistoryOrderMapper.findById(historyOrderIds);
|
||||
@ -780,6 +783,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
specificInvoiceWrap.setInvoiceMoney(xhpcInvoice.getInvoiceMoney());
|
||||
specificInvoiceWrap.setInvoiceTotalEletricMoney(xhpcInvoice.getInvoiceOrderEletricTotalMoney());
|
||||
specificInvoiceWrap.setInvoiceTotalServiceMoney(xhpcInvoice.getInvoiceOrderServiceTotalMoney());
|
||||
specificInvoiceWrap.setInvoiceStatus(xhpcInvoice.getInvoiceStatus());
|
||||
if (xhpcInvoice.getInvoicingTime() != null) {
|
||||
specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime()));
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@
|
||||
open_id as openId,
|
||||
status as status
|
||||
from xhpc_user_login
|
||||
where type = #{type}
|
||||
where del_flag =0 and type = #{type}
|
||||
and open_id = #{openid}
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and tenant_id=#{tenantId}
|
||||
@ -360,6 +360,10 @@
|
||||
update xhpc_user_login set status =0 where account=#{account} and status=1
|
||||
</update>
|
||||
|
||||
<update id="updateopenIdUserLoginTime">
|
||||
update xhpc_user_login set status =0 where open_id=#{openId} and status=1
|
||||
</update>
|
||||
|
||||
<select id="getActivityDiscountTime" resultType="com.xhpc.user.dto.XhpcActivityDiscountDto">
|
||||
select
|
||||
xad.activity_id as activityId,
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
<result column="update_time" jdbcType="DATE" property="updateTime"/>
|
||||
<result column="is_read" jdbcType="TINYINT" property="isRead"/>
|
||||
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
|
||||
<result column="invoice_status" jdbcType="INTEGER" property="invoiceStatus"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
@ -63,6 +64,7 @@
|
||||
`update_time`,
|
||||
`is_read`,
|
||||
tenant_id,
|
||||
invoice_status,
|
||||
`del_flag`
|
||||
</sql>
|
||||
|
||||
@ -83,7 +85,8 @@
|
||||
status,
|
||||
create_time,
|
||||
invoicing_time,
|
||||
drawer
|
||||
drawer,
|
||||
invoice_status
|
||||
FROM
|
||||
xhpc_invoice
|
||||
<where>
|
||||
@ -534,6 +537,9 @@
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="invoiceStatus != null">
|
||||
invoice_status,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="receiveEmail != null">
|
||||
@ -617,6 +623,9 @@
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="invoiceStatus != null">
|
||||
#{invoiceStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.user.pojo.XhpcInvoice">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user