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

Commit 8eb5d790 authored by 张国柄's avatar 张国柄

Merge branch 'dev' into test

parents d1edf532 e9a78805
......@@ -20,14 +20,14 @@ public class AdamAddressesParam implements java.io.Serializable {
@Pattern(regexp = "\\d{11}", message = "手机号格式有误")
private String phone;
@ApiModelProperty(position = 13, required = true, value = "省份[30]", example = "北京")
@Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "省份必须为2~30位汉字")
@Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "省份必须为2~30位汉字")
private String province;
@ApiModelProperty(position = 14, required = true, value = "城市[30]", example = "北京城区")
@NotNull()
@Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "城市必须为2~30位汉字")
@Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "城市必须为2~30位汉字")
private String city;
@ApiModelProperty(position = 15, required = true, value = "区县[30]", example = "朝阳区")
@Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "区县必须为2~30位汉字")
@Pattern(regexp = LnsRegex.Valid.CN_PCD, message = "区县必须为2~30位汉字")
private String county;
@ApiModelProperty(position = 16, required = true, value = "详细地址[100]", example = "广渠路1号创1958园区")
@Size(max = 100)
......
......@@ -23,10 +23,10 @@ public class RefundApplyParam implements Serializable {
private String reason;
private Double RefundPriceExpress;
private BigDecimal RefundPriceExpress;
private List<String> ticketEntityIds;
private List<Double> entitiesPrice;
private List<BigDecimal> entitiesPrice;
private List<String> ids;
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.dto.param;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* <p>
......@@ -45,7 +46,7 @@ public class RefundCallbackParam implements Serializable {
private String refund_code;
private double refund_price;
private BigDecimal refund_price;
private String refund_reason;
......
......@@ -34,6 +34,9 @@ public class KylinOrderRefundBatchesVo implements Serializable {
private BigDecimal totalAlipay;
private BigDecimal totalWepay;
private Integer totalRefundNum;
private Integer totalCompleteRefundNum;
@ApiModelProperty(value = "添加时间")
private LocalDateTime createdAt;
......
......@@ -31,6 +31,16 @@
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.totalWepay}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">总处理数量:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.totalRefundNum}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">已完成退款数量:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.totalCompleteRefundNum}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">提交时间:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.createdAt}">
......
......@@ -70,8 +70,8 @@ public class KylinRefundExecuteServiceImpl {
refundApplyParam.setReason(reason);
refundApplyParam.setOrderTicketsId(order.getOrderTicketsId());
refundApplyParam.setTicketEntityIds(ticketEntityIds);
if (order.getPriceExpress() != null) {
refundApplyParam.setRefundPriceExpress(order.getPriceExpress().doubleValue());
if (null != order.getPriceExpress()) {
refundApplyParam.setRefundPriceExpress(order.getPriceExpress());
}
try {
ResponseDto res = kylinOrderRefundsServiceImpl.refundApply(refundApplyParam);
......
......@@ -14,8 +14,10 @@ import com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundBatchesVo;
import com.liquidnet.service.kylin.entity.KylinOrderRefundBatches;
import com.liquidnet.service.kylin.entity.KylinOrderRefunds;
import com.liquidnet.service.kylin.entity.KylinPerformances;
import com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import org.springframework.beans.BeanUtils;
......@@ -47,6 +49,9 @@ public class KylinRefundPerformancesAdminServiceImpl {
@Autowired
private KylinOrderRefundBatchesMapper kylinOrderRefundBatchesMapper;
@Autowired
private KylinOrderRefundsMapper kylinOrderRefundsMapper;
@Autowired
private KylinPerformancesMapper kylinPerformancesMapper;
......@@ -183,15 +188,29 @@ public class KylinRefundPerformancesAdminServiceImpl {
}
}
public KylinOrderRefundBatchesVo detail(String orderRefundId) {
public KylinOrderRefundBatchesVo detail(String refundBatchId) {
KylinOrderRefundBatches data = kylinOrderRefundBatchesMapper.selectOne(
new UpdateWrapper<KylinOrderRefundBatches>()
.eq("refund_batch_id", orderRefundId)
new QueryWrapper<KylinOrderRefundBatches>()
.eq("refund_batch_id", refundBatchId)
);
KylinOrderRefundBatchesVo kylinOrderRefundBatchesVo = new KylinOrderRefundBatchesVo();
BeanUtils.copyProperties(data, kylinOrderRefundBatchesVo);
Integer totalRefundNum = kylinOrderRefundsMapper.selectCount(
new QueryWrapper<KylinOrderRefunds>()
.eq("order_refund_batches_id", refundBatchId)
);
Integer totalCompleteRefundNum = kylinOrderRefundsMapper.selectCount(
new QueryWrapper<KylinOrderRefunds>()
.eq("order_refund_batches_id", refundBatchId)
.eq("status", KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED)
);
kylinOrderRefundBatchesVo.setTotalRefundNum(totalRefundNum);
kylinOrderRefundBatchesVo.setTotalCompleteRefundNum(totalCompleteRefundNum);
return kylinOrderRefundBatchesVo;
}
......
......@@ -91,8 +91,8 @@ public class KylinRefundsStatusServiceImpl {
public Boolean orderTicketRefunding(
RefundApplyParam refundApplyParam, KylinOrderTickets orderInfo, String orderTicketsId,
double RefundPriceExpress,
List<String> ticketEntityIds, List<Double> entitiesPrice
BigDecimal RefundPriceExpress,
List<String> ticketEntityIds, List<BigDecimal> entitiesPrice
) {
if (CollectionUtil.isEmpty(ticketEntityIds)) {
return false;
......@@ -103,7 +103,7 @@ public class KylinRefundsStatusServiceImpl {
String reason = refundApplyParam.getReason();
String orderRefundBatchesId = refundApplyParam.getOrderRefundBatchesId();
// 本次退款票总金额
double entitiesPriceSum = entitiesPrice.stream().mapToDouble(Double::doubleValue).sum();
BigDecimal entitiesPriceSum = entitiesPrice.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
// TODO: 2021/5/27 事物 and 部分退款
// 更新数据
......@@ -163,8 +163,8 @@ public class KylinRefundsStatusServiceImpl {
String orderRefundCode = orderInfo.getOrderCode();
String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0");
kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum));
kylinOrderRefunds.setPrice(BigDecimal.valueOf(entitiesPriceSum));
kylinOrderRefunds.setPriceExpress(BigDecimal.valueOf(RefundPriceExpress));
kylinOrderRefunds.setPrice(entitiesPriceSum);
kylinOrderRefunds.setPriceExpress(RefundPriceExpress);
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
kylinOrderRefunds.setType(KylinTableStatusConst.ORDER_REFUND_TYPE_APPLY);
......@@ -172,11 +172,11 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds.setApplicantName(authName);
kylinOrderRefunds.setApplicantAt(LocalDateTime.now());
kylinOrderRefunds.setReason(reason);
if (RefundPriceExpress > 0 && entitiesPriceSum > 0) {
if (RefundPriceExpress.compareTo(BigDecimal.ZERO) > 0 && entitiesPriceSum.compareTo(BigDecimal.ZERO) > 0) {
kylinOrderRefunds.setRefundCate(KylinTableStatusConst.ORDER_REFUND_CATE3);
} else if (RefundPriceExpress > 0) {
} else if (RefundPriceExpress.compareTo(BigDecimal.ZERO) > 0) {
kylinOrderRefunds.setRefundCate(KylinTableStatusConst.ORDER_REFUND_CATE2);
} else if (entitiesPriceSum > 0) {
} else if (entitiesPriceSum.compareTo(BigDecimal.ZERO) > 0) {
kylinOrderRefunds.setRefundCate(KylinTableStatusConst.ORDER_REFUND_CATE1);
}
kylinOrderRefunds.setCreatedAt(LocalDateTime.now());
......@@ -192,7 +192,7 @@ public class KylinRefundsStatusServiceImpl {
String orderRefundsEntitiesId = IDGenerator.nextSnowId();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId);
kylinOrderRefundEntities.setRefundPrice(BigDecimal.valueOf(entitiesPrice.get(i)));
kylinOrderRefundEntities.setRefundPrice(entitiesPrice.get(i));
kylinOrderRefundEntities.setOrderTicketEntitiesId(ticketEntityIds.get(i));
kylinOrderRefundEntities.setCreatedAt(LocalDateTime.now());
int rowsR = kylinOrderRefundsEntitiesMapper.insert(kylinOrderRefundEntities);
......@@ -237,7 +237,7 @@ public class KylinRefundsStatusServiceImpl {
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
if (orderInfo.getPriceRefund().doubleValue() > 0) { // 已经有退完的 那就是部分退款了
if (orderInfo.getPriceRefund().compareTo(BigDecimal.ZERO) > 0) { // 已经有退完的 那就是部分退款了
newStatus = KylinTableStatusConst.ORDER_STATUS6;
} else {
newStatus = KylinTableStatusConst.ORDER_STATUS1;
......@@ -276,7 +276,7 @@ public class KylinRefundsStatusServiceImpl {
KylinOrderTicketEntities entitiesInfo = kylinOrderTicketEntitiesMapper.selectOne(
new QueryWrapper<KylinOrderTicketEntities>().eq("order_ticket_entities_id", entitiesId)
);
if (entitiesInfo.getRefundPrice().doubleValue() > 0) { // 已经有退完的 那就是部分退款了
if (entitiesInfo.getRefundPrice().compareTo(BigDecimal.ZERO) > 0) { // 已经有退完的 那就是部分退款了
newIsPayment = KylinTableStatusConst.ENTITIES_IS_PAYMENT4;
} else {
newIsPayment = KylinTableStatusConst.ENTITIES_IS_PAYMENT1;
......@@ -406,7 +406,7 @@ public class KylinRefundsStatusServiceImpl {
new QueryWrapper<KylinOrderTickets>()
.eq("order_tickets_id", refund.getOrderTicketsId())
);
double refundPrice = refund.getPrice().doubleValue() + refund.getPriceExpress().doubleValue();
BigDecimal refundPrice = refund.getPrice().add(refund.getPriceExpress());
MultiValueMap<String, String> params = new LinkedMultiValueMap();
params.add("code", oderInfo.getPayCode());
params.add("order_refund_code", refund.getOrderRefundCode());
......@@ -468,7 +468,7 @@ public class KylinRefundsStatusServiceImpl {
);
KylinOrderTicketStatus orderStatusTable = new KylinOrderTicketStatus();
int newStatus = 0;
if (refundCallbackParam.getRefund_price() + orderInfo.getPriceRefund().doubleValue() == orderInfo.getPriceActual().doubleValue()) {
if (refundCallbackParam.getRefund_price().add(orderInfo.getPriceRefund()).compareTo(orderInfo.getPriceActual()) == 0) {
newStatus = KylinTableStatusConst.ORDER_STATUS4;
} else {
newStatus = KylinTableStatusConst.ORDER_STATUS6;
......@@ -535,11 +535,11 @@ public class KylinRefundsStatusServiceImpl {
}
// 订单表
double price = orderInfo.getPriceRefund().doubleValue() + refundCallbackParam.getRefund_price();
BigDecimal price = orderInfo.getPriceRefund().add(refundCallbackParam.getRefund_price());
Integer num = orderInfo.getRefundNumber() + refundNumber;
KylinOrderTickets update = new KylinOrderTickets();
update.setRefundNumber(num);
update.setPriceRefund(BigDecimal.valueOf(price));
update.setPriceRefund(price);
update.setUpdatedAt(LocalDateTime.now());
kylinOrderTicketsMapper.update(
update, new UpdateWrapper<KylinOrderTickets>()
......@@ -548,7 +548,7 @@ public class KylinRefundsStatusServiceImpl {
HashMap<String, Object> orderVo = new HashMap<>();
orderVo.put("updatedAt", DateUtil.getNowTime());
orderVo.put("priceRefund", BigDecimal.valueOf(price));
orderVo.put("priceRefund", price);
orderVo.put("status", newStatus);
orderVo.put("refundNumber", num);
BasicDBObject orderVov = new BasicDBObject("$set", mongoConverter.convertToMongoType(orderVo));
......
......@@ -10,21 +10,53 @@ public class LnsRegex {
* yyyy-MM-dd
*/
public static final String DATETIME_YMD = "^(((((0[48]|[2468][048]|[3579][26])00))|(([0-9]{2})(0[48]|[2468][048]|[13579][26])))[-|.|/| ]0?2[-|.|/| ]29|(((?!0{1,4})[0-9]{1,4})[-|.|/| ](((0[13-9]|1[0-2]|[13-9])[-|.|/| ](29|30))|((0[13578]|(10|12)|[13578])[-|.|/| ]31)|((0(?:[1-9])|1(?:[0-2])|[1-9])[-|.|/| ](0(?:[1-9])|1[0-9]|2[0-8]|[1-9])))))$";
/**
* 字母、数字组合
*/
public static final String LETTER_NUMBER = "^[A-Z0-9]+$";
/**
* 汉字-姓名(2~20位)
*/
public static final String CHINESE_HANZI = "^[\\u4e00-\\u9fa5]{2,20}$";
public static final String CN_HANZI = "^[\\u4e00-\\u9fa5]{2,20}$";
/**
* 汉字-省|市|区(2~30位)
*/
public static final String CHINESE_PCD = "^[\\u4e00-\\u9fa5]{2,30}$";
public static final String CN_PCD = "^[\\u4e00-\\u9fa5]{2,30}$";
/**
* 身份证号(15位||18位)
* 大陆居民身份证(15位||18位)
*/
public static final String CHINESE_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)";
public static final String CN_ID_CARD = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)";
/**
* 字母、数字组合
* 大陆居民身份证
*/
public static final String LETTER_NUMBER = "^[A-Z0-9]+$";
public static final String CN_ID_CARD_REF = "/(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)/";
/**
* 军官证
* 规则: 军/兵/士/文/职/广/(其他中文) + "字第" + 4到8位字母或数字 + "号"
* 样本: 军字第2001988号, 士字第P011816X号
*/
public static final String CN_ID_CARD_MO = "/^[\\x{4E00}-\\x{9FA5}](字第)([0-9a-zA-Z]{4,8})(号?)$/u";
/**
* 中国大陆护照
* 规则: 14/15开头 + 7位数字, P + 7位数字, G/E + 8位数字, S/D + 7或8位数字, 等
* 样本: 141234567, G12345678, P1234567
*/
public static final String CN_ID_CARD_PP = "/^(?:P\\d{7}|[GE]\\d{8}|[SD]\\d{7,8}|[PSD]E\\d{7}|1[45]\\d{7})$/";
/**
* 非中国大陆护照
*/
public static final String CN_ID_CARD_PP_NON = "/^([A-Z0-9]){5,17}$/";
/**
* 港澳居民来往内地通行证
* 规则: H/M + 8位数字, C + 8位数字, C + 1位字母除去IO + 7位数字
* 样本: H12345678
*/
public static final String CN_ID_CARD_HM = "/^(?:[HM]\\d{8}|C[A-HJ-NP-Z0-9]\\d{7})$/";
/**
* 台湾居民来往大陆通行证
* 规则: 8位数字, 18位数字, 10位数字 + 1位英文字母
* 样本: 12345678 1234567890B
*/
public static final String CN_ID_CARD_TW = "/^(?:\\d{8}|\\d{18}|\\d{10}[A-Z])$/";
}
}
......@@ -5,6 +5,7 @@ import com.liquidnet.service.kylin.dao.OrderRefundDao;
import com.liquidnet.service.kylin.entity.KylinOrderRefunds;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
......@@ -35,7 +36,7 @@ public interface KylinOrderRefundsMapper extends BaseMapper<KylinOrderRefunds> {
@Param("ticketEntityIds") List<String> ticketEntityIds
);
Double RefundPriceExpressSum(
BigDecimal RefundPriceExpressSum(
@Param("orderTicketsId") String orderTicketsId,
@Param("orderRefundStatusCancel") Integer orderRefundStatusCancel
);
......
......@@ -6,6 +6,7 @@ import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -22,13 +23,13 @@ public interface KylinOrderTicketEntitiesMapper extends BaseMapper<KylinOrderTic
List<KylinOrderTicketEntitiesDao> getRefundEntitiesList(String orderTicketsId);
Double getRefundEntitiesPrice(
BigDecimal getRefundEntitiesPrice(
@Param("orderTicketsId") String orderTicketsId,
@Param("orderRefundStatusCancel") Integer orderRefundStatusCancel,
@Param("orderTicketEntitiesId") String orderTicketEntitiesId
);
Double getRefundOverEntitiesPrice(
BigDecimal getRefundOverEntitiesPrice(
@Param("orderTicketsId") String orderTicketsId,
@Param("orderRefundStatus") Integer orderRefundStatus,
@Param("entitiesId") String entitiesId
......
......@@ -67,7 +67,7 @@
</foreach>
</where>
</select>
<select id="RefundPriceExpressSum" resultType="java.lang.Double">
<select id="RefundPriceExpressSum" resultType="java.math.BigDecimal">
SELECT SUM(price_express)
FROM kylin_order_refunds
<where>
......
......@@ -26,7 +26,7 @@
AND a.is_payment != 3
</where>
</select>
<select id="getRefundEntitiesPrice" resultType="java.lang.Double">
<select id="getRefundEntitiesPrice" resultType="java.math.BigDecimal">
SELECT SUM(b.refund_price)
FROM kylin_order_refunds AS a
JOIN kylin_order_refund_entities AS b ON a.order_refunds_id = b.order_refunds_id
......@@ -36,7 +36,7 @@
AND b.order_ticket_entities_id = #{orderTicketEntitiesId}
</where>
</select>
<select id="getRefundOverEntitiesPrice" resultType="java.lang.Double">
<select id="getRefundOverEntitiesPrice" resultType="java.math.BigDecimal">
SELECT SUM(b.refund_price)
FROM kylin_order_refunds AS a
JOIN kylin_order_refund_entities AS b ON a.order_refunds_id = b.order_refunds_id
......
......@@ -51,10 +51,38 @@ public class AdamEntersController {
@ApiOperation(value = "添加入场人")
@PostMapping("add")
public ResponseDto<String> add(@RequestBody @Valid AdamEntersParam parameter) {
if (1 == parameter.getType()) {
if (!Pattern.matches(LnsRegex.Valid.CHINESE_HANZI, parameter.getName())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "姓名必须为2~20位汉字");
}
switch (parameter.getType()) {// 证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
case 1:
if (!Pattern.matches(LnsRegex.Valid.CN_HANZI, parameter.getName())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "姓名必须为2~20位汉字");
}
if (!Pattern.matches(LnsRegex.Valid.CN_ID_CARD_REF, parameter.getIdCard())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "身份证号码不合规");
}
break;
case 2:
if (!Pattern.matches(LnsRegex.Valid.CN_ID_CARD_HM, parameter.getIdCard())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "港澳居民来往内地通行证号码不合规");
}
break;
case 3:
if (!Pattern.matches(LnsRegex.Valid.CN_ID_CARD_TW, parameter.getIdCard())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "台湾居民来往大陆通行证号码不合规");
}
break;
case 4:
if (Pattern.matches(LnsRegex.Valid.CN_ID_CARD_PP, parameter.getIdCard())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "不支持中国大陆护照");
}
if (!Pattern.matches(LnsRegex.Valid.CN_ID_CARD_PP_NON, parameter.getIdCard())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "护照号码不合规");
}
break;
case 5:
if (!Pattern.matches(LnsRegex.Valid.CN_ID_CARD_MO, parameter.getIdCard())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "军官证号不合规");
}
break;
}
List<AdamEntersVo> vos = adamRdmService.getEntersVoByUid(CurrentUtil.getCurrentUid());
......@@ -103,7 +131,7 @@ public class AdamEntersController {
@PostMapping("edit")
public ResponseDto<Object> edit(@RequestBody @Valid AdamEntersParam parameter) {
if (1 == parameter.getType()) {
if (!Pattern.matches(LnsRegex.Valid.CHINESE_HANZI, parameter.getName())) {
if (!Pattern.matches(LnsRegex.Valid.CN_HANZI, parameter.getName())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "姓名必须为2~20位汉字");
}
}
......
......@@ -202,9 +202,9 @@ public class AdamUserController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "idCard", value = "证件号"),
})
@PostMapping(value = {"identity"})
public ResponseDto<AdamRealInfoVo> identity(@Pattern(regexp = LnsRegex.Valid.CHINESE_HANZI, message = "姓名必须为2~20位汉字")
public ResponseDto<AdamRealInfoVo> identity(@Pattern(regexp = LnsRegex.Valid.CN_HANZI, message = "姓名必须为2~20位汉字")
@RequestParam String name,
@Pattern(regexp = LnsRegex.Valid.CHINESE_ID_CARD, message = "身份证号格式有误")
@Pattern(regexp = LnsRegex.Valid.CN_ID_CARD_REF, message = "身份证号码不合规")
@RequestParam String idCard) {
log.debug("name:{},idCard:{}", name, idCard);
AdamRealInfoVo vo = adamUserService.identity(CurrentUtil.getCurrentUid(), name, idCard);
......
......@@ -58,8 +58,8 @@ public class KylinRefundsStatusServiceImpl {
public Boolean orderTicketRefunding(
KylinOrderTicketVo orderInfo, String orderTicketsId,
double RefundPriceExpress,
List<String> ticketEntityIds, List<Double> entitiesPrice
BigDecimal RefundPriceExpress,
List<String> ticketEntityIds, List<BigDecimal> entitiesPrice
) {
if (CollectionUtil.isEmpty(ticketEntityIds)) {
return false;
......@@ -69,7 +69,7 @@ public class KylinRefundsStatusServiceImpl {
String authName = "system_overtime_order_refund";
String reason = "订单支付超时自动退款";
// 本次退款票总金额
double entitiesPriceSum = entitiesPrice.stream().mapToDouble(Double::doubleValue).sum();
BigDecimal entitiesPriceSum = entitiesPrice.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
// 更新数据
// 订单状态表 和 缓存
......@@ -127,19 +127,19 @@ public class KylinRefundsStatusServiceImpl {
String orderRefundCode = orderInfo.getOrderCode();
String codeNum = StringUtils.leftPad(String.valueOf(5), 3, "0");
kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum));
kylinOrderRefunds.setPrice(BigDecimal.valueOf(entitiesPriceSum));
kylinOrderRefunds.setPriceExpress(BigDecimal.valueOf(RefundPriceExpress));
kylinOrderRefunds.setPrice(entitiesPriceSum);
kylinOrderRefunds.setPriceExpress(RefundPriceExpress);
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
kylinOrderRefunds.setType(KylinTableStatusConst.ORDER_REFUND_TYPE_AUTO);
kylinOrderRefunds.setApplicantId(authId);
kylinOrderRefunds.setApplicantName(authName);
kylinOrderRefunds.setApplicantAt(nowTime);
kylinOrderRefunds.setReason(reason);
if (RefundPriceExpress > 0 && entitiesPriceSum > 0) {
if (RefundPriceExpress.compareTo(BigDecimal.ZERO) > 0 && entitiesPriceSum.compareTo(BigDecimal.ZERO) > 0) {
kylinOrderRefunds.setRefundCate(KylinTableStatusConst.ORDER_REFUND_CATE3);
} else if (RefundPriceExpress > 0) {
} else if (RefundPriceExpress.compareTo(BigDecimal.ZERO) > 0) {
kylinOrderRefunds.setRefundCate(KylinTableStatusConst.ORDER_REFUND_CATE2);
} else if (entitiesPriceSum > 0) {
} else if (entitiesPriceSum.compareTo(BigDecimal.ZERO) > 0) {
kylinOrderRefunds.setRefundCate(KylinTableStatusConst.ORDER_REFUND_CATE1);
}
kylinOrderRefunds.setCreatedAt(nowTime);
......@@ -158,7 +158,7 @@ public class KylinRefundsStatusServiceImpl {
for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
String orderRefundsEntitiesId = IDGenerator.nextSnowId();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setRefundPrice(BigDecimal.valueOf(entitiesPrice.get(i)));
kylinOrderRefundEntities.setRefundPrice(entitiesPrice.get(i));
kylinOrderRefundEntities.setOrderTicketEntitiesId(ticketEntityIds.get(i));
sqlsDataD.add(new Object[]{
......
......@@ -37,22 +37,22 @@ public class OrderRefundOvertimeServiceImpl implements IKylinOrderRefundsService
public Boolean refundApply(String orderTicketsId) {
KylinOrderTicketVo orderInfo = dataUtils.getOrderTicketVo(orderTicketsId);
// 快递费 未进行判断
Double RefundPriceExpress = orderInfo.getPriceExpress().doubleValue();
double priceActual = orderInfo.getPriceActual().doubleValue();
double priceExpress = orderInfo.getPriceExpress().doubleValue();
BigDecimal RefundPriceExpress = orderInfo.getPriceExpress();
BigDecimal priceActual = orderInfo.getPriceActual();
BigDecimal priceExpress = orderInfo.getPriceExpress();
// 查询订单入场人
List<KylinOrderTicketEntitiesVo> entitiesList = orderInfo.getEntitiesVoList();
if (!CollectionUtil.isEmpty(entitiesList)) {
int allEntitiesCount = entitiesList.size();// 总入场人数量 排出未付款的 用来计算单入场人的价格
double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价
BigDecimal onePrice = priceActual.subtract(priceExpress).divide(BigDecimal.valueOf(allEntitiesCount));//单价
for (KylinOrderTicketEntitiesVo entities : entitiesList) {
entities.setCanRefundedPrice(BigDecimal.valueOf(onePrice));
entities.setCanRefundedPrice(onePrice);
}
}
List<String> ticketEntityIds = entitiesList.stream().map(KylinOrderTicketEntities -> KylinOrderTicketEntities.getOrderTicketEntitiesId()).collect(Collectors.toList());
List<Double> entitiesPrice = entitiesList.stream().map(KylinOrderTicketEntities -> KylinOrderTicketEntities.getCanRefundedPrice().doubleValue()).collect(Collectors.toList());
List<BigDecimal> entitiesPrice = entitiesList.stream().map(KylinOrderTicketEntities -> KylinOrderTicketEntities.getCanRefundedPrice()).collect(Collectors.toList());
boolean res = kylinRefundsStatusServiceImpl.orderTicketRefunding(
orderInfo, orderTicketsId,
......
......@@ -35,7 +35,9 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
log.info("DM.flush.AdamEntersVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamEntersVo.class.getSimpleName()).getDeletedCount());
}
String sqlCount = "select count(1) from enters where (type <> 1 or (type = 1 and is_certification = 'yes')) and created_at" + (StringUtils.isBlank(incrDt) ? "<" : ">=") + "curdate()";
String sqlCount = "select count(1) from (\n" +
" select row_number() over (partition by user_id,type,idcode,name order by updated_at desc) rn,e.* from enters e where e.is_certification = 'yes' and e.deleted_at is null and created_at" + (StringUtils.isBlank(incrDt) ? "<" : ">=") + "curdate()\n" +
" ) tk where tk.rn=1 ";
if (null != dg) {
sqlCount = sqlCount + " and id%" + dG + "=" + dg;
}
......
......@@ -105,9 +105,7 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
thirdPartyList.add(thirdParty);
vos.add(vo);
if (currentYear.isBefore(createdAt)) {
dmRdmService.setUidByPlatformOpenId(thirdParty.getPlatform(), thirdParty.getOpenId(), uid);
}
dmRdmService.setUidByPlatformOpenId(thirdParty.getPlatform(), thirdParty.getOpenId(), uid);
}
if (thirdPartyList.size() == 500 || (thirdPartyList.size() > 0 && smFlg)) {
tl += thirdPartyList.size();
......
......@@ -142,8 +142,7 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
userInfoList.add(userInfo);
vos.add(vo);
if (StringUtils.length(mobile) == 11 &&
(currentYear.isBefore(createdAt) || currentYear.isBefore(updatedAt))) {
if (StringUtils.length(mobile) == 11) {
dmRdmService.setUidByMobile(mobile, uid);
}
}
......
......@@ -92,7 +92,7 @@ public class KylinRefundsStatusServiceImpl {
);
KylinOrderTicketStatus orderStatusTable = new KylinOrderTicketStatus();
int newStatus = 0;
if (refundCallbackParam.getRefund_price() + orderInfo.getPriceRefund().doubleValue() == orderInfo.getPriceActual().doubleValue()) {
if (refundCallbackParam.getRefund_price().add(orderInfo.getPriceRefund()).compareTo(orderInfo.getPriceActual()) == 0) {
newStatus = KylinTableStatusConst.ORDER_STATUS4;
} else {
newStatus = KylinTableStatusConst.ORDER_STATUS6;
......@@ -159,11 +159,11 @@ public class KylinRefundsStatusServiceImpl {
}
// 订单表
double price = orderInfo.getPriceRefund().doubleValue() + refundCallbackParam.getRefund_price();
BigDecimal price = orderInfo.getPriceRefund().add(refundCallbackParam.getRefund_price());
Integer num = orderInfo.getRefundNumber() + refundNumber;
KylinOrderTickets update = new KylinOrderTickets();
update.setRefundNumber(num);
update.setPriceRefund(BigDecimal.valueOf(price));
update.setPriceRefund(price);
update.setUpdatedAt(LocalDateTime.now());
kylinOrderTicketsMapper.update(
update, new UpdateWrapper<KylinOrderTickets>()
......@@ -172,7 +172,7 @@ public class KylinRefundsStatusServiceImpl {
HashMap<String, Object> orderVo = new HashMap<>();
orderVo.put("updatedAt", DateUtil.getNowTime());
orderVo.put("priceRefund", BigDecimal.valueOf(price));
orderVo.put("priceRefund", price);
orderVo.put("status", newStatus);
orderVo.put("refundNumber", num);
BasicDBObject orderVov = new BasicDBObject("$set", mongoConverter.convertToMongoType(orderVo));
......
......@@ -21,8 +21,6 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
......
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image)
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image)
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.5/maven-plugin/reference/html/#build-image)
* [Spring Native Reference Guide](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/)
### Additional Links
These additional references should also help you:
* [Configure the Spring AOT Plugin](https://docs.spring.io/spring-native/docs/0.9.2-SNAPSHOT/reference/htmlsingle/#spring-aot-maven)
## Spring Native
This project has been configured to let you generate a lightweight container running a native executable.
Docker should be installed and configured on your machine prior to creating the image, see [the Getting Started section of the reference guide](https://docs.spring.io/spring-native/docs/0.9.2-SNAPSHOT/reference/htmlsingle/#getting-started-buildpacks).
To create the image, run the following goal:
```
$ ./mvnw spring-boot:build-image
```
Then, you can run the app like any other container:
```
$ docker run --rm liquidnet-service-ticket-impl:0.0.1-SNAPSHOT
```
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