md
This commit is contained in:
parent
e6d58340d9
commit
2909ad57dd
@ -107,6 +107,7 @@ public class EmisSettlePayRecordController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisSettlePayRecord emisSettlePayRecord)
|
||||
{
|
||||
// 生成支付流水号
|
||||
return toAjax(emisSettlePayRecordService.insertEmisSettlePayRecord(emisSettlePayRecord));
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
package com.xdadan.erp.emis.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xdadan.erp.emis.domain.EmisSettlePayRecord;
|
||||
@ -75,6 +77,8 @@ public class EmisSettlePayRecordServiceImpl implements IEmisSettlePayRecordServi
|
||||
@Override
|
||||
public int insertEmisSettlePayRecord(EmisSettlePayRecord emisSettlePayRecord)
|
||||
{
|
||||
String payId= "PM"+WaybillHelper.genPayId();
|
||||
emisSettlePayRecord.setPayId(payId);
|
||||
return emisSettlePayRecordMapper.insertEmisSettlePayRecord(emisSettlePayRecord);
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,16 @@ public class WaybillHelper {
|
||||
return orderId.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付单号生成逻辑,雪花算法
|
||||
* @return
|
||||
*/
|
||||
public static String genPayId(){
|
||||
Snowflake snowflake = IdUtil.getSnowflake(0, 0);
|
||||
Long payId = snowflake.nextId();
|
||||
return payId.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user