|
|
|
|
@@ -8,13 +8,13 @@ import com.chaozhanggui.system.cashierservice.entity.*;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.entity.po.OrderDetailPo;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.model.ReturnOrderReq;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.model.ReturnWTZInfo;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.model.ScanPayReq;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.model.TradeQueryReq;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.sign.Result;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.thirdpay.resp.MainScanResp;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.thirdpay.resp.OrderReturnResp;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.thirdpay.resp.OrderStatusQueryResp;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.thirdpay.resp.PublicResp;
|
|
|
|
|
import com.chaozhanggui.system.cashierservice.thirdpay.service.ThirdPayService;
|
|
|
|
|
@@ -30,8 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.text.NumberFormat;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@@ -74,37 +73,33 @@ public class PayService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
TbUserInfoMapper tbUserInfoMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
ThirdPayService thirdPayService;
|
|
|
|
|
@Autowired
|
|
|
|
|
TbShopInfoMapper tbShopInfoMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
TbQuickPayMapper tbQuickPayMapper;
|
|
|
|
|
@Value("${gateway.url}")
|
|
|
|
|
private String gateWayUrl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${client.backUrl}")
|
|
|
|
|
private String backUrl;
|
|
|
|
|
|
|
|
|
|
@Value("${thirdPay.payType}")
|
|
|
|
|
private String thirdPayType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${thirdPay.url}")
|
|
|
|
|
private String url;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${thirdPay.callBack}")
|
|
|
|
|
private String callBack;
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
ThirdPayService thirdPayService;
|
|
|
|
|
System.out.printf("%.2f%n", new BigDecimal(1).setScale(2, RoundingMode.DOWN));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Result queryPayType(String shopId) {
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS, tbShopPayTypeMapper.selectByShopId(shopId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result scanPay(String orderId, String authCode, String ip, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(authCode) || ObjectUtil.isEmpty(ip)) {
|
|
|
|
|
@@ -202,7 +197,7 @@ public class PayService {
|
|
|
|
|
scanPayReq.setTimestamp(System.currentTimeMillis());
|
|
|
|
|
scanPayReq.setAuthCode(authCode);
|
|
|
|
|
scanPayReq.setNotifyUrl(backUrl);
|
|
|
|
|
scanPayReq.setConsumeFee(payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
|
|
|
|
|
scanPayReq.setConsumeFee(payment.getAmount().setScale(2, RoundingMode.DOWN).toPlainString());
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = BeanUtil.transBean2Map(scanPayReq);
|
|
|
|
|
scanPayReq.setSign(MD5Util.encrypt(map, thirdApply.getAppToken(), true));
|
|
|
|
|
@@ -263,12 +258,12 @@ public class PayService {
|
|
|
|
|
String reqbody = "";
|
|
|
|
|
|
|
|
|
|
if (body.length() > 15) {
|
|
|
|
|
reqbody=body.substring(0,6).concat("....").concat(body.substring(body.length()-6,body.length())).toString();
|
|
|
|
|
reqbody = body.substring(0, 6).concat("....").concat(body.substring(body.length() - 6, body.length()));
|
|
|
|
|
} else {
|
|
|
|
|
reqbody = body.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PublicResp<MainScanResp> publicResp= thirdPayService.mainScan(url,thirdApply.getAppId(),reqbody,reqbody,payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),payType.equals("wechatPay")?"wx212769170d2c6b2a":null,authCode,orderInfo.getOrderNo(),"S2405103298",callBack,thirdApply.getAppToken());
|
|
|
|
|
PublicResp<MainScanResp> publicResp = thirdPayService.mainScan(url, thirdApply.getAppId(), reqbody, reqbody, payment.getAmount().setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(), payType.equals("wechatPay") ? thirdApply.getSmallAppid() : null, authCode, orderInfo.getOrderNo(), thirdApply.getStoreId(), callBack, thirdApply.getAppToken());
|
|
|
|
|
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
|
|
|
|
if ("000000".equals(publicResp.getCode())) {
|
|
|
|
|
MainScanResp mainScanResp = publicResp.getObjData();
|
|
|
|
|
@@ -318,7 +313,6 @@ public class PayService {
|
|
|
|
|
return Result.fail("失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Result queryOrder(String orderId, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(orderId)) {
|
|
|
|
|
return Result.fail(CodeEnum.PARAM);
|
|
|
|
|
@@ -375,7 +369,7 @@ public class PayService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
PublicResp<OrderStatusQueryResp> orderstatus=thirdPayService.queryOrder(url,thirdApply.getAppId(),orderInfo.getOrderNo(),null,thirdApply.getAppToken());
|
|
|
|
|
PublicResp<OrderStatusQueryResp> orderstatus = thirdPayService.queryOrder(url, thirdApply.getAppId(), null, orderInfo.getOrderNo(), thirdApply.getAppToken());
|
|
|
|
|
if (ObjectUtil.isNotNull(orderstatus) && ObjectUtil.isNotEmpty(orderstatus)) {
|
|
|
|
|
if ("000000".equals(orderstatus.getCode())) {
|
|
|
|
|
if ("TRADE_SUCCESS".equals(orderstatus.getObjData().getState())) {
|
|
|
|
|
@@ -408,7 +402,6 @@ public class PayService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result accountPay(String orderId, String memberId, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(memberId)) {
|
|
|
|
|
@@ -432,7 +425,6 @@ public class PayService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TbShopUser user = tbShopUserMapper.selectByPrimaryKey(Integer.valueOf(memberId));
|
|
|
|
|
if (ObjectUtil.isEmpty(user) || !"1".equals(user.getIsVip().toString())) {
|
|
|
|
|
return Result.fail(CodeEnum.MEMBERNOEXIST);
|
|
|
|
|
@@ -487,7 +479,6 @@ public class PayService {
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result memberScanPay(String orderId, String memberCode, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(memberCode)) {
|
|
|
|
|
@@ -545,7 +536,7 @@ public class PayService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
|
|
|
|
orderInfo.setMemberId(user.getUserId().toString());
|
|
|
|
|
orderInfo.setMemberId(user.getUserId());
|
|
|
|
|
orderInfo.setPayType("deposit");
|
|
|
|
|
orderInfo.setStatus("closed");
|
|
|
|
|
orderInfo.setPayOrderNo("deposit".concat(SnowFlakeUtil.generateOrderNo()));
|
|
|
|
|
@@ -572,7 +563,6 @@ public class PayService {
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result cashPay(String orderId, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(orderId)) {
|
|
|
|
|
@@ -621,7 +611,6 @@ public class PayService {
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result bankPay(String orderId, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(orderId)) {
|
|
|
|
|
@@ -669,7 +658,6 @@ public class PayService {
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result returnOrder(List<TbOrderDetail> list, String token) {
|
|
|
|
|
if (ObjectUtil.isEmpty(list) || list.size() <= 0) {
|
|
|
|
|
@@ -738,11 +726,11 @@ public class PayService {
|
|
|
|
|
}
|
|
|
|
|
OrderDetailPo detailPo = new OrderDetailPo();
|
|
|
|
|
// totalAmount = totalAmount.add(it.getPriceAmount());
|
|
|
|
|
totalAmount = totalAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
totalAmount = totalAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
saleAmount = saleAmount.add(it.getPrice());
|
|
|
|
|
payAmount = payAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
payAmount = payAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
// payAmount=payAmount.add(it.getPriceAmount());
|
|
|
|
|
packAMount = packAMount.add(it.getPackAmount().divide(new BigDecimal(it.getNum()), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
packAMount = packAMount.add(it.getPackAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
|
|
|
|
|
detailPo.setId(it.getId());
|
|
|
|
|
if (map1.get(it.getId()) + it.getReturnNum() >= it.getNum()) {
|
|
|
|
|
@@ -751,7 +739,7 @@ public class PayService {
|
|
|
|
|
detailPo.setStatus("closed");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
BigDecimal returnAmount = it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(map1.get(it.getId())));
|
|
|
|
|
BigDecimal returnAmount = it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId())));
|
|
|
|
|
detailPo.setReturnNum(map1.get(it.getId()));
|
|
|
|
|
detailPos.add(detailPo);
|
|
|
|
|
it.setNum(map1.get(it.getId()));
|
|
|
|
|
@@ -774,11 +762,13 @@ public class PayService {
|
|
|
|
|
if ("scanCode".equals(payType) || "wx_lite".equals(payType)) {
|
|
|
|
|
TbMerchantThirdApply thirdApply = tbMerchantThirdApplyMapper.selectByPrimaryKey(Integer.valueOf(merchantId));
|
|
|
|
|
MsgException.checkNull(thirdApply, "支付参数配置错误");
|
|
|
|
|
|
|
|
|
|
if ("ysk".equals(thirdPayType)) {
|
|
|
|
|
ReturnOrderReq req = new ReturnOrderReq();
|
|
|
|
|
req.setAppId(thirdApply.getAppId());
|
|
|
|
|
req.setTimestamp(System.currentTimeMillis());
|
|
|
|
|
req.setOrderNumber(orderInfo.getPayOrderNo());
|
|
|
|
|
req.setAmount(String.format("%.2f", newOrderInfo.getPayAmount().setScale(2, BigDecimal.ROUND_DOWN)));
|
|
|
|
|
req.setAmount(String.format("%.2f", newOrderInfo.getPayAmount().setScale(2, RoundingMode.DOWN)));
|
|
|
|
|
req.setMercRefundNo(orderInfo.getOrderNo());
|
|
|
|
|
req.setRefundReason("退货");
|
|
|
|
|
req.setPayPassword(thirdApply.getPayPassword());
|
|
|
|
|
@@ -794,6 +784,21 @@ public class PayService {
|
|
|
|
|
}
|
|
|
|
|
// newOrderInfo.setPayOrderNo(object.getJSONObject("data").getString("refundOrderNumber"));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
PublicResp<OrderReturnResp> publicResp = thirdPayService.returnOrder(url, thirdApply.getAppId(), newOrderInfo.getOrderNo(), null, orderInfo.getOrderNo(), "订单退款", newOrderInfo.getPayAmount().setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(), callBack, null, thirdApply.getAppToken());
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
|
|
|
|
if ("000000".equals(publicResp.getCode())) {
|
|
|
|
|
if (!publicResp.getObjData().getState().equals("ING") || "SUCCESS".equals(publicResp.getObjData().getState())) {
|
|
|
|
|
MsgException.check(true, "退款渠道调用失败");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
MsgException.check(true, "退款渠道调用失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -832,19 +837,11 @@ public class PayService {
|
|
|
|
|
producer.putOrderCollect(jsonObject.toJSONString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
producer.printMechine(newOrderInfo.getId() + "");
|
|
|
|
|
producer.printMechine(String.valueOf(newOrderInfo.getId()));
|
|
|
|
|
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
TbShopInfoMapper tbShopInfoMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
TbQuickPayMapper tbQuickPayMapper;
|
|
|
|
|
|
|
|
|
|
public Result quickPay(String token, String amount, String authCode, String payType) {
|
|
|
|
|
|
|
|
|
|
JSONObject info = TokenUtil.parseParamFromToken(token);
|
|
|
|
|
@@ -853,7 +850,7 @@ public class PayService {
|
|
|
|
|
String shopId = info.getString("shopId");
|
|
|
|
|
String staffId = info.getString("staffId");
|
|
|
|
|
|
|
|
|
|
BigDecimal payAmount=new BigDecimal(amount).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
BigDecimal payAmount = new BigDecimal(amount).setScale(2, RoundingMode.DOWN);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String orderNo = SnowFlakeUtil.generateOrderNo();
|
|
|
|
|
@@ -872,6 +869,7 @@ public class PayService {
|
|
|
|
|
if (ObjectUtil.isEmpty(thirdApply) || ObjectUtil.isNull(thirdApply)) {
|
|
|
|
|
return Result.fail(CodeEnum.NOCUSTOMER);
|
|
|
|
|
}
|
|
|
|
|
if ("ysk".equals(thirdPayType)) {
|
|
|
|
|
ScanPayReq scanPayReq = new ScanPayReq();
|
|
|
|
|
scanPayReq.setAppId(thirdApply.getAppId());
|
|
|
|
|
scanPayReq.setTimestamp(System.currentTimeMillis());
|
|
|
|
|
@@ -888,17 +886,25 @@ public class PayService {
|
|
|
|
|
tbQuickPay.setTradeNo(object.getJSONObject("data").get("orderNumber").toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
PublicResp<MainScanResp> publicResp = thirdPayService.mainScan(url, thirdApply.getAppId(), "快捷收款", "快捷收款", payAmount.setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(), payType.equals("wechatPay") ? thirdApply.getSmallAppid() : null, authCode, tbQuickPay.getOrderNo(), thirdApply.getStoreId(), callBack, thirdApply.getAppToken());
|
|
|
|
|
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
|
|
|
|
if ("000000".equals(publicResp.getCode())) {
|
|
|
|
|
MainScanResp mainScanResp = publicResp.getObjData();
|
|
|
|
|
if ("TRADE_SUCCESS".equals(mainScanResp.getState())) {
|
|
|
|
|
tbQuickPay.setTradeNo(mainScanResp.getPayOrderId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tbQuickPayMapper.insert(tbQuickPay);
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS, tbQuickPay);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Result queryQuickPayStatus(Integer id) {
|
|
|
|
|
|
|
|
|
|
TbQuickPay tbQuickPay = tbQuickPayMapper.selectByPrimaryKey(id);
|
|
|
|
|
@@ -912,6 +918,7 @@ public class PayService {
|
|
|
|
|
if (ObjectUtil.isEmpty(thirdApply) || ObjectUtil.isNull(thirdApply)) {
|
|
|
|
|
return Result.fail(CodeEnum.NOCUSTOMER);
|
|
|
|
|
}
|
|
|
|
|
if ("ysk".equals(thirdPayType)) {
|
|
|
|
|
TradeQueryReq tradeQueryReq = new TradeQueryReq();
|
|
|
|
|
tradeQueryReq.setAppId(thirdApply.getAppId());
|
|
|
|
|
tradeQueryReq.setTimestamp(System.currentTimeMillis());
|
|
|
|
|
@@ -932,12 +939,24 @@ public class PayService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
PublicResp<OrderStatusQueryResp> orderstatus = thirdPayService.queryOrder(url, thirdApply.getAppId(), null, tbQuickPay.getOrderNo(), thirdApply.getAppToken());
|
|
|
|
|
if (ObjectUtil.isNotNull(orderstatus) && ObjectUtil.isNotEmpty(orderstatus)) {
|
|
|
|
|
if ("000000".equals(orderstatus.getCode())) {
|
|
|
|
|
if ("TRADE_SUCCESS".equals(orderstatus.getObjData().getState())) {
|
|
|
|
|
|
|
|
|
|
tbQuickPay.setStatus("0");
|
|
|
|
|
tbQuickPay.setUpdateTime(new Date());
|
|
|
|
|
tbQuickPayMapper.updateByPrimaryKeySelective(tbQuickPay);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return Result.success(CodeEnum.SUCCESS, tbQuickPay);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Result queryQuickPay(String token, int pageNo, int pageSize) {
|
|
|
|
|
JSONObject info = TokenUtil.parseParamFromToken(token);
|
|
|
|
|
MsgException.checkNull(info, "获取信息失败");
|
|
|
|
|
@@ -953,18 +972,10 @@ public class PayService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String generateReturnOrderNumber() {
|
|
|
|
|
String date = DateUtils.getSdfTimes();
|
|
|
|
|
Random random = new Random();
|
|
|
|
|
int randomNum = random.nextInt(900) + 100;
|
|
|
|
|
return "RO" + date + randomNum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
|
|
System.out.println(String.format("%.2f", new BigDecimal(1).setScale(2, BigDecimal.ROUND_DOWN)));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|