记得上下班打卡 | git大法好,push需谨慎

Commit f0c29780 authored by 姜秀龙's avatar 姜秀龙

同步票种 缺少库存 和 删除详情缓存

parent fb53d93a
...@@ -6,7 +6,7 @@ liquidnet: ...@@ -6,7 +6,7 @@ liquidnet:
username: user username: user
password: user123 password: user123
eureka: eureka:
host: 172.17.207.189:7001 host: 127.0.0.1:7001
# end-prod-这里是配置信息基本值 # end-prod-这里是配置信息基本值
spring: spring:
......
...@@ -2,7 +2,7 @@ spring: ...@@ -2,7 +2,7 @@ spring:
application: application:
name: liquidnet-service-kylin name: liquidnet-service-kylin
profiles: profiles:
active: dev active: prod
server: server:
tomcat: tomcat:
max-threads: 2000 max-threads: 2000
......
...@@ -11,8 +11,10 @@ import com.liquidnet.service.kylin.dto.vo.partner.KylinTicketPartnerVo; ...@@ -11,8 +11,10 @@ import com.liquidnet.service.kylin.dto.vo.partner.KylinTicketPartnerVo;
import com.liquidnet.service.kylin.dto.vo.partner.KylinTicketTimesPartnerVo; import com.liquidnet.service.kylin.dto.vo.partner.KylinTicketTimesPartnerVo;
import com.liquidnet.service.kylin.entity.KylinTicketRelations; import com.liquidnet.service.kylin.entity.KylinTicketRelations;
import com.liquidnet.service.kylin.entity.KylinTicketStatus; import com.liquidnet.service.kylin.entity.KylinTicketStatus;
import com.liquidnet.service.kylin.entity.KylinTickets;
import com.liquidnet.service.kylin.mapper.KylinTicketRelationsMapper; import com.liquidnet.service.kylin.mapper.KylinTicketRelationsMapper;
import com.liquidnet.service.kylin.mapper.KylinTicketStatusMapper; import com.liquidnet.service.kylin.mapper.KylinTicketStatusMapper;
import com.liquidnet.service.kylin.mapper.KylinTicketsMapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -48,6 +51,8 @@ public class JxlDataPerformancesController { ...@@ -48,6 +51,8 @@ public class JxlDataPerformancesController {
@Autowired @Autowired
private KylinTicketStatusMapper ticketStatusMapper; private KylinTicketStatusMapper ticketStatusMapper;
@Autowired @Autowired
private KylinTicketsMapper ticketsMapper;
@Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
@GetMapping("P001") @GetMapping("P001")
...@@ -58,76 +63,107 @@ public class JxlDataPerformancesController { ...@@ -58,76 +63,107 @@ public class JxlDataPerformancesController {
public ResponseDto P001( public ResponseDto P001(
@RequestParam("performancesId") String performancesId @RequestParam("performancesId") String performancesId
) { ) {
List<KylinTicketTimesPartnerVo> voTimes = mongoTemplate.find(Query.query(Criteria.where("performancesId").is(performancesId)), try {
KylinTicketTimesPartnerVo.class, KylinTicketTimesPartnerVo.class.getSimpleName()); List<KylinTicketTimesPartnerVo> voTimes = mongoTemplate.find(Query.query(Criteria.where("performancesId").is(performancesId)),
for (KylinTicketTimesPartnerVo voTime : voTimes) { KylinTicketTimesPartnerVo.class, KylinTicketTimesPartnerVo.class.getSimpleName());
List<KylinTicketPartnerVo> timesIdVo = mongoTemplate.find(Query.query( for (KylinTicketTimesPartnerVo voTime : voTimes) {
Criteria.where("timesId").is(voTime.getTicketTimesId())), List<KylinTicketPartnerVo> timesIdVo = mongoTemplate.find(Query.query(
KylinTicketPartnerVo.class, Criteria.where("timesId").is(voTime.getTicketTimesId())),
KylinTicketPartnerVo.class.getSimpleName()); KylinTicketPartnerVo.class,
for (KylinTicketPartnerVo ticketVo : timesIdVo) { KylinTicketPartnerVo.class.getSimpleName());
LocalDateTime timeC = null; for (KylinTicketPartnerVo ticketVo : timesIdVo) {
LocalDateTime timeU = null; PerformancePartnerVo performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
try {
timeC = DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getCreatedAt()));
} catch (Exception e) {
e.printStackTrace();
}
try {
timeU = DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getUpdatedAt()));
} catch (Exception e) {
e.printStackTrace();
}
String ticketsId = ticketVo.getTicketsId(); KylinTickets tickets = new KylinTickets();
KylinTicketRelations ticketRelations = new KylinTicketRelations(); BeanUtils.copyProperties(ticketVo, tickets);
BeanUtils.copyProperties(ticketVo, ticketRelations); tickets.setPayCountdownMinute(performanceData.getPayCountdownMinute());
ticketRelations.setCreatedAt(timeC); tickets.setPriceExpress(new BigDecimal("0.00"));
ticketRelations.setUpdatedAt(timeU); tickets.setPriceDiscountMember(new BigDecimal("0.00"));
ticketRelations.setTicketRelationsId(IDGenerator.nextSnowId()); tickets.setPriceDiscount(new BigDecimal("0.00"));
ticketRelations.setTicketId(ticketsId); tickets.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getTimeStart())));
// 场次与票种关联表 tickets.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getTimeEnd())));
ticketRelationsMapper.insert(ticketRelations); if (ticketVo.getIsExpress() == 1) {
tickets.setTimeEndExpress(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getTimeEndExpress())));
tickets.setDescribeExpress(ticketVo.getDescribeExpress());
}
// else{
// tickets.setTimeEndExpress(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2030-01-01 12:00:00")));
// }
if (ticketVo.getIsElectronic() == 1) {
tickets.setDescribeElectronic(ticketVo.getDescribeElectronic());
}
tickets.setUseStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(voTime.getUseStart())));
tickets.setUseEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(voTime.getUseEnd())));
tickets.setSaleRemindMinute(60);
tickets.setCreatedAt(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getCreatedAt())));
tickets.setUpdatedAt(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getUpdatedAt())));
ticketsMapper.insert(tickets);
KylinTicketStatus ticketStatusNew = new KylinTicketStatus();
BeanUtils.copyProperties(ticketVo, ticketStatusNew); LocalDateTime timeC = null;
ticketStatusNew.setTicketId(ticketsId); LocalDateTime timeU = null;
ticketStatusNew.setStatusExchange(7);
if (ticketVo.getExpressType() == null) {
ticketStatusNew.setExpressType(0);
}
PerformancePartnerVo performanceData = mongoTemplate.findOne(Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName());
ticketStatusNew.setIsTrueName(performanceData.getIsTrueName());
ticketStatusNew.setMemberLimitCount(1);
ticketStatusNew.setCreatedAt(timeC);
ticketStatusNew.setUpdatedAt(timeU);
if (ticketVo.getIsShowCode() == 1) {
try { try {
ticketStatusNew.setQrCodeShowTime(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getQrCodeShowTime()))); timeC = DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getCreatedAt()));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} try {
KylinTicketStatus ticketStatus = ticketStatusMapper.selectOne( timeU = DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getUpdatedAt()));
Wrappers.lambdaQuery(KylinTicketStatus.class) } catch (Exception e) {
.eq(KylinTicketStatus::getTicketId, ticketsId) e.printStackTrace();
); }
if (null == ticketStatus) {// 添加
ticketStatusNew.setTicketStatusId(IDGenerator.nextSnowId()); String ticketsId = ticketVo.getTicketsId();
ticketStatusMapper.insert(ticketStatusNew); KylinTicketRelations ticketRelations = new KylinTicketRelations();
System.out.println("新增---------------------------------"); BeanUtils.copyProperties(ticketVo, ticketRelations);
System.out.println(ticketsId); ticketRelations.setCreatedAt(timeC);
System.out.println(ticketStatusNew); ticketRelations.setUpdatedAt(timeU);
} else {// 编辑 ticketRelations.setTicketRelationsId(IDGenerator.nextSnowId());
ticketStatusMapper.update(ticketStatusNew, ticketRelations.setTicketId(ticketsId);
new UpdateWrapper<KylinTicketStatus>(). // 场次与票种关联表
eq("ticket_id", ticketsId) ticketRelationsMapper.insert(ticketRelations);
KylinTicketStatus ticketStatusNew = new KylinTicketStatus();
BeanUtils.copyProperties(ticketVo, ticketStatusNew);
ticketStatusNew.setTicketId(ticketsId);
ticketStatusNew.setStatusExchange(7);
if (ticketVo.getExpressType() == null) {
ticketStatusNew.setExpressType(0);
}
ticketStatusNew.setIsTrueName(performanceData.getIsTrueName());
ticketStatusNew.setMemberLimitCount(1);
ticketStatusNew.setCreatedAt(timeC);
ticketStatusNew.setUpdatedAt(timeU);
if (ticketVo.getIsShowCode() == 1) {
try {
ticketStatusNew.setQrCodeShowTime(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(ticketVo.getQrCodeShowTime())));
} catch (Exception e) {
e.printStackTrace();
}
}
KylinTicketStatus ticketStatus = ticketStatusMapper.selectOne(
Wrappers.lambdaQuery(KylinTicketStatus.class)
.eq(KylinTicketStatus::getTicketId, ticketsId)
); );
System.out.println("编辑---------------------------------"); if (null == ticketStatus) {// 添加
System.out.println(ticketsId); ticketStatusNew.setTicketStatusId(IDGenerator.nextSnowId());
System.out.println(ticketStatusNew); ticketStatusMapper.insert(ticketStatusNew);
System.out.println("新增---------------------------------");
System.out.println(ticketsId);
System.out.println(ticketStatusNew);
} else {// 编辑
ticketStatusMapper.update(ticketStatusNew,
new UpdateWrapper<KylinTicketStatus>().
eq("ticket_id", ticketsId)
);
System.out.println("编辑---------------------------------");
System.out.println(ticketsId);
System.out.println(ticketStatusNew);
}
} }
} }
} catch (Exception e) {
e.printStackTrace();
} }
// dataUtils.delPerformanceRedis(performancesId); // dataUtils.delPerformanceRedis(performancesId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment