Skip to content

Commit

Permalink
feat: 获取所有的订单记录
Browse files Browse the repository at this point in the history
  • Loading branch information
damingerdai committed Feb 1, 2024
1 parent cb72072 commit 7ceca15
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/angular
Submodule angular updated 69 files
+1 −0 .env
+48 −47 .eslintrc.json
+5 −5 .github/workflows/build-and-publish.yml
+2 −2 .github/workflows/ci.yml
+1 −1 .nvmrc
+2 −5 .stylelintrc
+2 −2 Dockerfile
+26 −15 angular.json
+11 −0 docker-compose.yaml
+92 −95 package.json
+9 −0 prettier.config.mjs
+1 −2 src/_app-theme.scss
+0 −123 src/app/app-routing.module.ts
+30 −7 src/app/app.component.spec.ts
+12 −4 src/app/app.component.ts
+55 −0 src/app/app.config.ts
+0 −41 src/app/app.module.ts
+165 −0 src/app/app.route.ts
+71 −54 src/app/core/pwa/check-for-update.service.ts
+0 −1 src/app/layout/admin-layout/_admin-layout-theme.scss
+21 −15 src/app/layout/admin-layout/admin-layout.component.html
+2 −3 src/app/routes/customer/customer-list/_customer-list-theme.scss
+125 −118 src/app/routes/customer/customer-list/customer-list.component.html
+3 −7 src/app/routes/customer/customer-list/customer-list.component.scss
+32 −19 src/app/routes/customer/dialog/create-customer-dialog/create-customer-dialog.component.html
+40 −19 src/app/routes/customer/dialog/update-customer-dialog/update-customer-dialog.component.html
+26 −22 src/app/routes/dashboard/dashboard/dashboard.component.html
+3 −8 src/app/routes/dashboard/dashboard/dashboard.component.scss
+22 −5 src/app/routes/dashboard/dialog/add-user-room/add-user-room.component.html
+0 −1 src/app/routes/login/_login-theme.scss
+13 −7 src/app/routes/login/login.component.html
+0 −1 src/app/routes/register/_register-theme.scss
+16 −14 src/app/routes/register/register.component.html
+5 −5 src/app/routes/room/dialog/add-customer-room-dialog/add-customer-room-dialog.component.html
+16 −12 src/app/routes/room/dialog/add-customer-room-dialog/add-customer-room-dialog.component.spec.ts
+6 −2 src/app/routes/room/dialog/create-room-dialog/create-room-dialog.component.html
+6 −2 src/app/routes/room/dialog/update-room-dialog/update-room-dialog.component.html
+117 −116 src/app/routes/room/room-list/room-list.component.html
+4 −6 src/app/routes/room/room-list/room-list.component.scss
+144 −102 src/app/routes/room/room-list/room-list.component.ts
+21 −24 src/app/routes/user/user-list/user-list.component.html
+24 −23 src/app/shared/components/carousel/carousel.component.html
+0 −1 src/app/shared/components/error-code/_long-shadow.scss
+10 −4 src/app/shared/components/error-code/error-code.component.html
+48 −46 src/app/shared/components/navbar/navbar.component.html
+1 −2 src/app/shared/components/navbar/navbar.component.ts
+1 −0 src/app/shared/components/page-header/_page-header-theme.scss
+24 −21 src/app/shared/components/skeleton-loader/skeleton-loader.component.html
+3 −2 src/app/shared/components/skeleton-loader/skeleton-loader.component.scss
+7 −12 src/app/shared/components/theme-picker/theme-picker.component.html
+1 −1 src/index.html
+7 −4 src/main.ts
+2 −2 src/styles.scss
+0 −1 src/styles/_apexcharts.scss
+23 −27 src/styles/_breakpoints.scss
+1 −0 src/styles/_input.scss
+14 −9 src/styles/_misc.scss
+1 −2 src/styles/custom-themes/deeppurple-amber.scss
+1 −2 src/styles/custom-themes/indigo-pink.scss
+1 −2 src/styles/custom-themes/pink-bluegrey.scss
+1 −2 src/styles/custom-themes/purple-green.scss
+1 −2 src/styles/custom-themes/pwc-dark.scss
+1 −2 src/styles/custom-themes/pwc-light.scss
+1 −0 src/styles/helpers/_functions.scss
+0 −3 src/styles/helpers/_variables.scss
+3 −11 tsconfig.app.json
+1 −0 tsconfig.json
+8 −0 vercel.json
+2,370 −4,895 yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.daming.hoteler.base.exceptions.HotelerException;
import org.daming.hoteler.constants.ErrorCodeConstants;
import org.daming.hoteler.pojo.CustomerCheckinRecord;
import org.daming.hoteler.pojo.request.CreateCustomerCheckinRecordRequest;
Expand Down Expand Up @@ -29,8 +30,8 @@
@RequestMapping("api/v1")
public class CustomerCheckinRecordController {

private ICustomerCheckinRecordService customerCheckinRecordService;
private IErrorService errorService;
private final ICustomerCheckinRecordService customerCheckinRecordService;
private final IErrorService errorService;

@Operation(summary = "创建用户入住记录", security = { @SecurityRequirement(name = "bearer-key") })
@PostMapping("customer-checkin-record")
Expand Down Expand Up @@ -87,8 +88,23 @@ public CommonResponse deleteUserRoomRelationship(@PathVariable("id") String user
}
}

public CustomerCheckinRecordController(ICustomerCheckinRecordService customerCheckinRecordService) {
@Operation(summary = "获取所有用户入住记录", security = { @SecurityRequirement(name = "bearer-key") })
@GetMapping("customer-checkin-records")
public CommonResponse listUserRoomRelationship() throws HotelerException {
try {
var ur = this.customerCheckinRecordService.list();
return new DataResponse<>(ur);
} catch (NumberFormatException nfe) {
var params = new Object[] { nfe.getMessage() };
throw errorService.createHotelerException(ErrorCodeConstants.BAD_REQUEST_ERROR_CODEE, params, nfe);
} catch (Exception ex) {
throw errorService.createHotelerException(ErrorCodeConstants.SYSTEM_ERROR_CODEE, ex);
}
}

public CustomerCheckinRecordController(ICustomerCheckinRecordService customerCheckinRecordService, IErrorService errorService) {
super();
this.customerCheckinRecordService = customerCheckinRecordService;
this.errorService = errorService;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void create(CustomerCheckinRecord customerCheckinRecord) throws HotelerEx
@Override
public void update(CustomerCheckinRecord customerCheckinRecord) throws HotelerException {
var in = Instant.now();
var sql = "update customer_checkin_record set customer_id = ?, room_id = ?, begin_date = ?, end_date = ?, update_dt = statement_timestamp(), update_user = 'system' where id = ?";
var sql = "update customer_checkin_record set customer_id= ?, room_id = ?, begin_date = ?, end_date = ?, update_dt = statement_timestamp(), update_user = 'system' where id = ?";
var params = new Object[] { customerCheckinRecord.getCustomerId(), customerCheckinRecord.getRoomId(), customerCheckinRecord.getBeginDate(), customerCheckinRecord.getEndDate(), customerCheckinRecord.getId() };
try {
jdbcTemplate.update(sql, params);
Expand All @@ -64,7 +64,7 @@ public void update(CustomerCheckinRecord customerCheckinRecord) throws HotelerEx
@Override
public CustomerCheckinRecord get(long id) throws HotelerException {
var in = Instant.now();
var sql = "select id, user_id, room_id, begin_date, end_date from customer_checkin_record where id = ? and deleted_at is null";
var sql = "select id, customer_id, room_id, begin_date, end_date from customer_checkin_record where id = ? and deleted_at is null";
var params = new Object[] { id };
try {
return jdbcTemplate.query(sql, rs -> {
Expand Down Expand Up @@ -97,7 +97,7 @@ public void delete(long id) throws HotelerException {

@Override
public List<CustomerCheckinRecord> list() throws HotelerException {
var sql = "select id, user_id, room_id, begin_date, end_date from customer_checkin_record where deleted_at is null order by create_dt desc, update_dt desc ";
var sql = "select id, customer_id, room_id, begin_date, end_date from customer_checkin_record where deleted_at is null order by create_dt desc, update_dt desc ";
try {
return this.jdbcTemplate.query(sql, (rs, i) -> getCustomerCheckinRecord(rs));
} catch (Exception ex) {
Expand All @@ -108,7 +108,7 @@ public List<CustomerCheckinRecord> list() throws HotelerException {

@Override
public List<CustomerCheckinRecord> list(LocalDate date) throws HotelerException {
var sql = "select id, user_id, room_id, begin_date, end_date from customer_checkin_record where begin_date <= ? and ? <= end_date and deleted_at is null order by create_dt desc, update_dt desc";
var sql = "select id, customer_id, room_id, begin_date, end_date from customer_checkin_record where begin_date <= ? and ? <= end_date and deleted_at is null order by create_dt desc, update_dt desc";
var params = new Object[] { date, date };
try {
return this.jdbcTemplate.query(sql, (rs, i) -> getCustomerCheckinRecord(rs), params);
Expand Down

0 comments on commit 7ceca15

Please sign in to comment.