md
This commit is contained in:
parent
6314ab8faf
commit
1208a28151
@ -15,6 +15,7 @@ import java.util.List;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.xdadan.erp.oms.common.annotation.filter.jackson.JacksonFilter;
|
import com.xdadan.erp.oms.common.annotation.filter.jackson.JacksonFilter;
|
||||||
|
import com.xdadan.erp.oms.utils.WaybillHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -199,6 +200,7 @@ public class Oms2cGoodsController extends BaseController
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody EmisGoods emisGoods)
|
public AjaxResult add(@RequestBody EmisGoods emisGoods)
|
||||||
{
|
{
|
||||||
|
emisGoods.setGoodsCode(WaybillHelper.genGoodsCode());
|
||||||
emisGoods.setOwnerCode(getLoginUser().getUser().getCustomerCode());
|
emisGoods.setOwnerCode(getLoginUser().getUser().getCustomerCode());
|
||||||
return toAjax(emisGoodsService.insertEmisGoods(emisGoods));
|
return toAjax(emisGoodsService.insertEmisGoods(emisGoods));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,16 @@ public class WaybillHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品号生成逻辑,雪花算法
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String genGoodsCode(){
|
||||||
|
Snowflake snowflake = IdUtil.getSnowflake(0, 0);
|
||||||
|
Long goodsCode = snowflake.nextId();
|
||||||
|
return goodsCode.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user