当手术计费弹窗中点击"签发"耗材时,因耗材的locationId(发放库房)为空导致后端异常。 在DoctorStationAdviceAppServiceImpl.handDevice方法中,当locationId为null时,使用登录用户的科室ID作为默认值, 与NurseBillingAppService中的处理方式保持一致。
1.3 KiB
Executable File
1.3 KiB
Executable File
Web Layer - API Controllers
Module: openhis-application/web
Role: API endpoint layer - all REST controllers for frontend communication
OVERVIEW
46 web modules serving REST APIs for all business functionality.
STRUCTURE
web/
├── [module-name]/
│ ├── controller/ # REST endpoints (@RestController)
│ ├── dto/ # Data transfer objects
│ ├── mapper/ # MyBatis mappers (if module-specific)
│ └── appservice/ # Application service layer
│ └── impl/
WHERE TO LOOK
| Task | Location |
|---|---|
| API endpoints | */controller/*Controller.java |
| Request/Response schemas | */dto/*.java |
| Business logic orchestration | */appservice/*.java |
CONVENTIONS
- Controllers:
@RestController,@RequestMapping("/module-name") - Standard response:
AjaxResultfrom core-common - DTO naming:
XxxRequest,XxxResponse,XxxDTO - Service pattern: interface in
appservice/, impl inappservice/impl/ - API naming:
listXxx(),getXxx(),addXxx(),updateXxx(),deleteXxx()
ANTI-PATTERNS
- Never put business logic in controllers - delegate to appservice
- Never return raw entities - use DTOs
- Never bypass
AjaxResultwrapper - Never create module-specific mappers without justification