| | |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.bean.BeanUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.map.constant.I18nKeyConstant; |
| | | import com.xiaopeng.map.service.*; |
| | | import com.xiaopeng.map.service.serviceimpl.BootCommonService; |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "新增电子围栏") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ELECTRONIC_FENCE_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "新增电子围栏", |
| | | appendRequestData = true |
| | | ) |
| | | public R add(@Valid @RequestBody ElectronicFenceAddDto dto) { |
| | | validateFenceTime(dto.getStatus(), dto.getEffectType(), dto.getEffectTime(), dto.getFailureType(), dto.getFailureTime()); |
| | | return xpElectronicFenceService.addElectronic(dto); |
| | |
| | | @PostMapping("/updateStatus") |
| | | @ResponseBody |
| | | @ApiOperation(value = "修改状态") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ELECTRONIC_FENCE_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "修改电子围栏状态", |
| | | appendRequestData = true |
| | | ) |
| | | public R updateStatus(@RequestBody ElectronicFenceAreaUpdateStatusDto dto) { |
| | | XpElectronicFenceArea electronicFenceArea = xpElectronicFenceAreaService.getById(dto.getId()); |
| | | if (electronicFenceArea == null) { |
| | |
| | | @ApiOperation(value = "编辑电子围栏") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ELECTRONIC_FENCE_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "编辑电子围栏", |
| | | appendRequestData = true |
| | | ) |
| | | public R edit(@Validated @RequestBody ElectronicFenceUpdateDto dto) { |
| | | validateFenceTime(dto.getStatus(), dto.getEffectType(), dto.getEffectTime(), dto.getFailureType(), dto.getFailureTime()); |
| | | return xpElectronicFenceService.editElectronic(dto); |
| | |
| | | @ApiOperation(value = "复制电子围栏") |
| | | @Transactional |
| | | @ShardingSphereTransactionType(TransactionType.BASE) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ELECTRONIC_FENCE_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | contentExpression = "'复制电子围栏,id=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R<Long> copy(@RequestParam("id") Integer id) { |
| | | XpElectronicFence electronicFence = xpElectronicFenceService.getById(id); |
| | | if (electronicFence.getStatus()==2){ |