mirror of https://github.com/elunez/eladmin
初始化供应商编号
parent
4e890f4a01
commit
b5d26b09f8
|
@ -13,6 +13,8 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
|
@ -40,14 +42,8 @@ public class SupplierInfoController {
|
|||
@GetMapping(value = "/initSupplierCode")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','BDSUPPLIERINFO_ALL','BDSUPPLIERINFO_SELECT')")
|
||||
public ResponseEntity initSupplierCode(){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
int month = calendar.get(Calendar.MONTH);
|
||||
int day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
int second = calendar.get(Calendar.SECOND);
|
||||
String supplierCode = "GYS" + year + month + day + hour + minute + second;
|
||||
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");//设置日期格式
|
||||
String supplierCode = "GYS"+ LocalDateTime.now().format(fmt);
|
||||
return new ResponseEntity(supplierCode,HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,10 @@ import org.springframework.http.ResponseEntity;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
|
||||
|
||||
/**
|
||||
* @author 黄星星
|
||||
|
@ -35,6 +39,15 @@ public class WareHouseController {
|
|||
return new ResponseEntity(wareHouseService.create(resources), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@Log("初始化仓库编号")
|
||||
@GetMapping(value = "/initWareHouseCode")
|
||||
public ResponseEntity initWareHouseCode(){
|
||||
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");//设置日期格式
|
||||
String supplierCode = "CK"+ LocalDateTime.now().format(fmt);
|
||||
return new ResponseEntity(supplierCode,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("查看仓库详情")
|
||||
@GetMapping(value = "/wareHouse/{id}")
|
||||
public ResponseEntity getMessureUnits(@PathVariable Long id){
|
||||
|
|
Loading…
Reference in New Issue