Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
fc56df65
Commit
fc56df65
authored
Dec 15, 2023
by
LiuLin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ymt):登记使用证生成
parent
6ff62da9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
0 deletions
+117
-0
DateUtils.java
...om/yeejoin/amos/boot/module/ymt/api/common/DateUtils.java
+39
-0
CreateCodeController.java
.../boot/module/ymt/api/controller/CreateCodeController.java
+66
-0
ICreateCodeService.java
.../amos/boot/module/ymt/api/service/ICreateCodeService.java
+12
-0
CreateCodeServiceImpl.java
...ot/module/ymt/api/service/impl/CreateCodeServiceImpl.java
+0
-0
No files found.
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/common/DateUtils.java
0 → 100644
View file @
fc56df65
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
common
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.ZoneId
;
import
java.util.Date
;
public
class
DateUtils
{
public
static
Date
calculateEndOfYear
(
Date
currentDate
)
{
LocalDateTime
localDateTime
=
toLocalDateTime
(
currentDate
);
LocalDateTime
endOfYear
=
localDateTime
.
with
(
LocalDateTime
.
of
(
localDateTime
.
getYear
(),
12
,
31
,
23
,
59
,
59
,
999999999
));
return
toDate
(
endOfYear
);
}
public
static
Date
calculateEndOfMonth
(
Date
currentDate
)
{
LocalDateTime
localDateTime
=
toLocalDateTime
(
currentDate
);
LocalDateTime
endOfMonth
=
localDateTime
.
with
(
localDateTime
.
withDayOfMonth
(
localDateTime
.
getMonth
().
maxLength
())
.
withHour
(
23
)
.
withMinute
(
59
)
.
withSecond
(
59
)
.
withNano
(
999999999
));
return
toDate
(
endOfMonth
);
}
public
static
Date
calculateEndOfDay
(
Date
currentDate
)
{
LocalDateTime
localDateTime
=
toLocalDateTime
(
currentDate
);
LocalDateTime
endOfDay
=
localDateTime
.
with
(
LocalDateTime
.
of
(
localDateTime
.
toLocalDate
(),
LocalTime
.
MAX
));
return
toDate
(
endOfDay
);
}
private
static
LocalDateTime
toLocalDateTime
(
Date
date
)
{
return
LocalDateTime
.
ofInstant
(
date
.
toInstant
(),
ZoneId
.
systemDefault
());
}
private
static
Date
toDate
(
LocalDateTime
localDateTime
)
{
return
Date
.
from
(
localDateTime
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
());
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/controller/CreateCodeController.java
0 → 100644
View file @
fc56df65
//package com.yeejoin.amos.boot.module.ymt.api.controller;
//
//import com.yeejoin.amos.boot.biz.common.controller.BaseController;
//import com.yeejoin.amos.boot.module.ymt.api.service.ICreateCodeService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//import org.typroject.tyboot.core.foundation.enumeration.UserType;
//import org.typroject.tyboot.core.restful.doc.TycloudOperation;
//import org.typroject.tyboot.core.restful.utils.ResponseHelper;
//import org.typroject.tyboot.core.restful.utils.ResponseModel;
//import java.util.List;
//
///**
// *
// * 生成顺序码
// * @author LiuLin
// * @date 2023-12-14
// */
//@RestController
//@Api(tags = "生成顺序码")
//@RequestMapping(value = "/code")
//public class CreateCodeController extends BaseController {
//
// @Autowired
// private ICreateCodeService createCodeService;
//
// /**
// * 申请单编号生成
// * @param type type
// * @param batchSize batchSize
// * @return List
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/ANCode")
// @ApiOperation(httpMethod = "POST", value = "申请单编号生成", notes = "申请单编号生成")
// public ResponseModel<List<String>> createANCode(@RequestParam("type") String type,
// @RequestParam("batchSize") int batchSize) {
// return ResponseHelper.buildResponse(createCodeService.createApplicationFormCode(type,batchSize));
// }
//
// /**
// * 生成设备注册编码
// * @param key key
// * @return String
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/DRCode")
// @ApiOperation(httpMethod = "POST", value = "生成设备注册编码", notes = "生成设备注册编码")
// public ResponseModel<String> createDRCode(@RequestParam("key") String key) {
// return ResponseHelper.buildResponse(createCodeService.createDeviceRegistrationCode(key));
// }
//
// /**
// * 使用登记证生成
// * @param key key
// * @return String
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/URCode")
// @ApiOperation(httpMethod = "POST", value = "使用登记证生成", notes = "使用登记证生成")
// public ResponseModel<String> createURCode(@RequestParam("key") String key) {
// return ResponseHelper.buildResponse(createCodeService.createUseRegistrationCode(key));
// }
//}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/service/ICreateCodeService.java
View file @
fc56df65
...
@@ -2,6 +2,11 @@ package com.yeejoin.amos.boot.module.ymt.api.service;
...
@@ -2,6 +2,11 @@ package com.yeejoin.amos.boot.module.ymt.api.service;
import
java.util.List
;
import
java.util.List
;
/**
* 生成码服务类
* @author LiuLin
* @date 2023-12-14
*/
public
interface
ICreateCodeService
{
public
interface
ICreateCodeService
{
/**
/**
...
@@ -20,4 +25,11 @@ public interface ICreateCodeService {
...
@@ -20,4 +25,11 @@ public interface ICreateCodeService {
*/
*/
String
createDeviceRegistrationCode
(
String
key
);
String
createDeviceRegistrationCode
(
String
key
);
/**
* 生成使用登记证编号(13位,起11陕C00001(23))
* @param key key
* @return 顺序编号
*/
String
createUseRegistrationCode
(
String
key
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/service/impl/CreateCodeServiceImpl.java
View file @
fc56df65
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment