#适配现有的权限方案的改动

This commit is contained in:
2026-05-15 16:55:48 +08:00
parent 0ba48cdae5
commit 8ed9048bc1
12 changed files with 93 additions and 115 deletions

View File

@@ -102,7 +102,7 @@ public class SysProfileController extends BaseController
* 重置密码 * 重置密码
*/ */
@ApiOperation("重置密码") @ApiOperation("重置密码")
@PreAuthorize("@ss.hasPermi('systerm:user:updatePwd')") //@PreAuthorize("@ss.hasPermi('systerm:user:updatePwd')")
@Log(title = "个人信息", businessType = BusinessType.UPDATE) @Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd") @PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword) public AjaxResult updatePwd(String oldPassword, String newPassword)

View File

@@ -23,7 +23,7 @@ public class SysQrCodeController {
@Autowired @Autowired
private ISysQrCodeService qrCodeService; private ISysQrCodeService qrCodeService;
@PreAuthorize("@ss.hasPermi('system:qrcode:list')") //@PreAuthorize("@ss.hasPermi('system:qrcode:list')")
@ApiOperation("分页查询二维码") @ApiOperation("分页查询二维码")
@GetMapping("/page") @GetMapping("/page")
public AjaxResult page(Page<SysQrCode> page, SysQrCode qrCode) { public AjaxResult page(Page<SysQrCode> page, SysQrCode qrCode) {
@@ -31,7 +31,7 @@ public class SysQrCodeController {
return AjaxResult.success(result.getRecords(), (int) result.getTotal()); return AjaxResult.success(result.getRecords(), (int) result.getTotal());
} }
@PreAuthorize("@ss.hasPermi('system:qrcode:list')") //@PreAuthorize("@ss.hasPermi('system:qrcode:list')")
@ApiOperation("查询二维码列表") @ApiOperation("查询二维码列表")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SysQrCode qrCode) { public AjaxResult list(SysQrCode qrCode) {
@@ -39,14 +39,14 @@ public class SysQrCodeController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@PreAuthorize("@ss.hasPermi('system:qrcode:query')") //@PreAuthorize("@ss.hasPermi('system:qrcode:query')")
@ApiOperation("查询二维码详情") @ApiOperation("查询二维码详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(qrCodeService.getById(id)); return AjaxResult.success(qrCodeService.getById(id));
} }
@PreAuthorize("@ss.hasPermi('system:qrcode:query')") // @PreAuthorize("@ss.hasPermi('system:qrcode:query')")
@ApiOperation("根据序列号查询二维码") @ApiOperation("根据序列号查询二维码")
@GetMapping("/serial/{serialNumber}") @GetMapping("/serial/{serialNumber}")
public AjaxResult getBySerialNumber(@PathVariable String serialNumber) { public AjaxResult getBySerialNumber(@PathVariable String serialNumber) {
@@ -70,7 +70,7 @@ public class SysQrCodeController {
@PreAuthorize("@ss.hasPermi('system:qrcode:generate')") // @PreAuthorize("@ss.hasPermi('system:qrcode:generate')")
@ApiOperation("生成二维码并保存记录") @ApiOperation("生成二维码并保存记录")
@PostMapping("/generate") @PostMapping("/generate")
public AjaxResult generate(@RequestBody QrCodeGenerateRequest request) { public AjaxResult generate(@RequestBody QrCodeGenerateRequest request) {
@@ -79,7 +79,7 @@ public class SysQrCodeController {
} }
@PreAuthorize("@ss.hasPermi('system:qrcode:bind')") //@PreAuthorize("@ss.hasPermi('system:qrcode:bind')")
@ApiOperation("绑定设备") @ApiOperation("绑定设备")
@PostMapping("/bind/{qrCodeId}/{deviceId}") @PostMapping("/bind/{qrCodeId}/{deviceId}")
public AjaxResult bindDevice(@PathVariable Long qrCodeId, public AjaxResult bindDevice(@PathVariable Long qrCodeId,
@@ -87,14 +87,14 @@ public class SysQrCodeController {
return toAjax(qrCodeService.bindDevice(qrCodeId, deviceId)); return toAjax(qrCodeService.bindDevice(qrCodeId, deviceId));
} }
@PreAuthorize("@ss.hasPermi('system:qrcode:unbind')") // @PreAuthorize("@ss.hasPermi('system:qrcode:unbind')")
@ApiOperation("解绑设备") @ApiOperation("解绑设备")
@PostMapping("/unbind/{qrCodeId}") @PostMapping("/unbind/{qrCodeId}")
public AjaxResult unbindDevice(@PathVariable Long qrCodeId) { public AjaxResult unbindDevice(@PathVariable Long qrCodeId) {
return toAjax(qrCodeService.unbindDevice(qrCodeId)); return toAjax(qrCodeService.unbindDevice(qrCodeId));
} }
@PreAuthorize("@ss.hasPermi('system:qrcode:remove')") //@PreAuthorize("@ss.hasPermi('system:qrcode:remove')")
@ApiOperation("删除二维码") @ApiOperation("删除二维码")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {

View File

@@ -22,7 +22,7 @@ public class SysRobotConfigController {
@Autowired @Autowired
private ISysRobotConfigService configService; private ISysRobotConfigService configService;
@PreAuthorize("@ss.hasPermi('system:robot:config:list')") // @PreAuthorize("@ss.hasPermi('system:robot:config:list')")
@ApiOperation("分页查询机器人配置") @ApiOperation("分页查询机器人配置")
@GetMapping("/page") @GetMapping("/page")
public AjaxResult page(Page<SysRobotConfig> page, SysRobotConfig config) { public AjaxResult page(Page<SysRobotConfig> page, SysRobotConfig config) {
@@ -30,7 +30,7 @@ public class SysRobotConfigController {
return AjaxResult.success(result.getRecords(), (int) result.getTotal()); return AjaxResult.success(result.getRecords(), (int) result.getTotal());
} }
@PreAuthorize("@ss.hasPermi('system:robot:config:list')") //@PreAuthorize("@ss.hasPermi('system:robot:config:list')")
@ApiOperation("查询机器人配置列表") @ApiOperation("查询机器人配置列表")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SysRobotConfig config) { public AjaxResult list(SysRobotConfig config) {
@@ -38,14 +38,14 @@ public class SysRobotConfigController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@PreAuthorize("@ss.hasPermi('system:robot:config:query')") // @PreAuthorize("@ss.hasPermi('system:robot:config:query')")
@ApiOperation("查询机器人配置详情") @ApiOperation("查询机器人配置详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(configService.getById(id)); return AjaxResult.success(configService.getById(id));
} }
@PreAuthorize("@ss.hasPermi('system:robot:config:add')") //@PreAuthorize("@ss.hasPermi('system:robot:config:add')")
@ApiOperation("新增机器人配置") @ApiOperation("新增机器人配置")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SysRobotConfig config) { public AjaxResult add(@RequestBody SysRobotConfig config) {
@@ -55,7 +55,7 @@ public class SysRobotConfigController {
return toAjax(configService.save(config)); return toAjax(configService.save(config));
} }
@PreAuthorize("@ss.hasPermi('system:robot:config:edit')") //@PreAuthorize("@ss.hasPermi('system:robot:config:edit')")
@ApiOperation("修改机器人配置") @ApiOperation("修改机器人配置")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysRobotConfig config) { public AjaxResult edit(@RequestBody SysRobotConfig config) {
@@ -65,7 +65,7 @@ public class SysRobotConfigController {
return toAjax(configService.updateById(config)); return toAjax(configService.updateById(config));
} }
@PreAuthorize("@ss.hasPermi('system:robot:config:remove')") // @PreAuthorize("@ss.hasPermi('system:robot:config:remove')")
@ApiOperation("删除机器人配置") @ApiOperation("删除机器人配置")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {

View File

@@ -22,7 +22,7 @@ public class SysRobotCountryController {
@Autowired @Autowired
private ISysRobotCountryService countryService; private ISysRobotCountryService countryService;
@PreAuthorize("@ss.hasPermi('system:robot:country:list')") // @PreAuthorize("@ss.hasPermi('system:robot:country:list')")
@ApiOperation("分页查询国家") @ApiOperation("分页查询国家")
@GetMapping("/page") @GetMapping("/page")
public AjaxResult page(Page<SysRobotCountry> page, SysRobotCountry country) { public AjaxResult page(Page<SysRobotCountry> page, SysRobotCountry country) {
@@ -30,7 +30,7 @@ public class SysRobotCountryController {
return AjaxResult.success(result.getRecords(), (int) result.getTotal()); return AjaxResult.success(result.getRecords(), (int) result.getTotal());
} }
@PreAuthorize("@ss.hasPermi('system:robot:country:list')") // @PreAuthorize("@ss.hasPermi('system:robot:country:list')")
@ApiOperation("查询国家列表") @ApiOperation("查询国家列表")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SysRobotCountry country) { public AjaxResult list(SysRobotCountry country) {
@@ -38,14 +38,14 @@ public class SysRobotCountryController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@PreAuthorize("@ss.hasPermi('system:robot:country:query')") // @PreAuthorize("@ss.hasPermi('system:robot:country:query')")
@ApiOperation("查询国家详情") @ApiOperation("查询国家详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(countryService.getById(id)); return AjaxResult.success(countryService.getById(id));
} }
@PreAuthorize("@ss.hasPermi('system:robot:country:add')") //@PreAuthorize("@ss.hasPermi('system:robot:country:add')")
@ApiOperation("新增国家") @ApiOperation("新增国家")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SysRobotCountry country) { public AjaxResult add(@RequestBody SysRobotCountry country) {
@@ -55,7 +55,7 @@ public class SysRobotCountryController {
return toAjax(countryService.save(country)); return toAjax(countryService.save(country));
} }
@PreAuthorize("@ss.hasPermi('system:robot:country:edit')") // @PreAuthorize("@ss.hasPermi('system:robot:country:edit')")
@ApiOperation("修改国家") @ApiOperation("修改国家")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysRobotCountry country) { public AjaxResult edit(@RequestBody SysRobotCountry country) {
@@ -65,7 +65,7 @@ public class SysRobotCountryController {
return toAjax(countryService.updateById(country)); return toAjax(countryService.updateById(country));
} }
@PreAuthorize("@ss.hasPermi('system:robot:country:remove')") // @PreAuthorize("@ss.hasPermi('system:robot:country:remove')")
@ApiOperation("删除国家") @ApiOperation("删除国家")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {

View File

@@ -22,7 +22,7 @@ public class SysRobotModelController {
@Autowired @Autowired
private ISysRobotModelService modelService; private ISysRobotModelService modelService;
@PreAuthorize("@ss.hasPermi('system:robot:model:list')") //@PreAuthorize("@ss.hasPermi('system:robot:model:list')")
@ApiOperation("分页查询机器人型号") @ApiOperation("分页查询机器人型号")
@GetMapping("/page") @GetMapping("/page")
public AjaxResult page(Page<SysRobotModel> page, SysRobotModel model) { public AjaxResult page(Page<SysRobotModel> page, SysRobotModel model) {
@@ -30,7 +30,7 @@ public class SysRobotModelController {
return AjaxResult.success(result.getRecords(), (int) result.getTotal()); return AjaxResult.success(result.getRecords(), (int) result.getTotal());
} }
@PreAuthorize("@ss.hasPermi('system:robot:model:list')") //@PreAuthorize("@ss.hasPermi('system:robot:model:list')")
@ApiOperation("查询机器人型号列表") @ApiOperation("查询机器人型号列表")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SysRobotModel model) { public AjaxResult list(SysRobotModel model) {
@@ -38,14 +38,14 @@ public class SysRobotModelController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@PreAuthorize("@ss.hasPermi('system:robot:model:query')") // @PreAuthorize("@ss.hasPermi('system:robot:model:query')")
@ApiOperation("查询机器人型号详情") @ApiOperation("查询机器人型号详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(modelService.getById(id)); return AjaxResult.success(modelService.getById(id));
} }
@PreAuthorize("@ss.hasPermi('system:robot:model:add')") //@PreAuthorize("@ss.hasPermi('system:robot:model:add')")
@ApiOperation("新增机器人型号") @ApiOperation("新增机器人型号")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SysRobotModel model) { public AjaxResult add(@RequestBody SysRobotModel model) {
@@ -55,7 +55,7 @@ public class SysRobotModelController {
return toAjax(modelService.save(model)); return toAjax(modelService.save(model));
} }
@PreAuthorize("@ss.hasPermi('system:robot:model:edit')") //@PreAuthorize("@ss.hasPermi('system:robot:model:edit')")
@ApiOperation("修改机器人型号") @ApiOperation("修改机器人型号")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysRobotModel model) { public AjaxResult edit(@RequestBody SysRobotModel model) {
@@ -65,7 +65,7 @@ public class SysRobotModelController {
return toAjax(modelService.updateById(model)); return toAjax(modelService.updateById(model));
} }
@PreAuthorize("@ss.hasPermi('system:robot:model:remove')") //@PreAuthorize("@ss.hasPermi('system:robot:model:remove')")
@ApiOperation("删除机器人型号") @ApiOperation("删除机器人型号")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {

View File

@@ -22,7 +22,7 @@ public class SysRobotProvinceController {
@Autowired @Autowired
private ISysRobotProvinceService provinceService; private ISysRobotProvinceService provinceService;
@PreAuthorize("@ss.hasPermi('system:robot:province:list')") // @PreAuthorize("@ss.hasPermi('system:robot:province:list')")
@ApiOperation("分页查询省份") @ApiOperation("分页查询省份")
@GetMapping("/page") @GetMapping("/page")
public AjaxResult page(Page<SysRobotProvince> page, SysRobotProvince province) { public AjaxResult page(Page<SysRobotProvince> page, SysRobotProvince province) {
@@ -30,7 +30,7 @@ public class SysRobotProvinceController {
return AjaxResult.success(result.getRecords(), (int) result.getTotal()); return AjaxResult.success(result.getRecords(), (int) result.getTotal());
} }
@PreAuthorize("@ss.hasPermi('system:robot:province:list')") // @PreAuthorize("@ss.hasPermi('system:robot:province:list')")
@ApiOperation("查询省份列表") @ApiOperation("查询省份列表")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SysRobotProvince province) { public AjaxResult list(SysRobotProvince province) {
@@ -38,14 +38,14 @@ public class SysRobotProvinceController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@PreAuthorize("@ss.hasPermi('system:robot:province:query')") // @PreAuthorize("@ss.hasPermi('system:robot:province:query')")
@ApiOperation("查询省份详情") @ApiOperation("查询省份详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(provinceService.getById(id)); return AjaxResult.success(provinceService.getById(id));
} }
@PreAuthorize("@ss.hasPermi('system:robot:province:add')") //@PreAuthorize("@ss.hasPermi('system:robot:province:add')")
@ApiOperation("新增省份") @ApiOperation("新增省份")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SysRobotProvince province) { public AjaxResult add(@RequestBody SysRobotProvince province) {
@@ -55,7 +55,7 @@ public class SysRobotProvinceController {
return toAjax(provinceService.save(province)); return toAjax(provinceService.save(province));
} }
@PreAuthorize("@ss.hasPermi('system:robot:province:edit')") //@PreAuthorize("@ss.hasPermi('system:robot:province:edit')")
@ApiOperation("修改省份") @ApiOperation("修改省份")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysRobotProvince province) { public AjaxResult edit(@RequestBody SysRobotProvince province) {
@@ -65,7 +65,7 @@ public class SysRobotProvinceController {
return toAjax(provinceService.updateById(province)); return toAjax(provinceService.updateById(province));
} }
@PreAuthorize("@ss.hasPermi('system:robot:province:remove')") //@PreAuthorize("@ss.hasPermi('system:robot:province:remove')")
@ApiOperation("删除省份") @ApiOperation("删除省份")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {

View File

@@ -22,7 +22,7 @@ public class SysRobotTypeController {
@Autowired @Autowired
private ISysRobotTypeService typeService; private ISysRobotTypeService typeService;
@PreAuthorize("@ss.hasPermi('system:robot:type:list')") //@PreAuthorize("@ss.hasPermi('system:robot:type:list')")
@ApiOperation("分页查询机器人类型") @ApiOperation("分页查询机器人类型")
@GetMapping("/page") @GetMapping("/page")
public AjaxResult page(Page<SysRobotType> page, SysRobotType type) { public AjaxResult page(Page<SysRobotType> page, SysRobotType type) {
@@ -30,7 +30,7 @@ public class SysRobotTypeController {
return AjaxResult.success(result.getRecords(), (int) result.getTotal()); return AjaxResult.success(result.getRecords(), (int) result.getTotal());
} }
@PreAuthorize("@ss.hasPermi('system:robot:type:list')") // @PreAuthorize("@ss.hasPermi('system:robot:type:list')")
@ApiOperation("查询机器人类型列表") @ApiOperation("查询机器人类型列表")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SysRobotType type) { public AjaxResult list(SysRobotType type) {
@@ -38,14 +38,14 @@ public class SysRobotTypeController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@PreAuthorize("@ss.hasPermi('system:robot:type:query')") // @PreAuthorize("@ss.hasPermi('system:robot:type:query')")
@ApiOperation("查询机器人类型详情") @ApiOperation("查询机器人类型详情")
@GetMapping("/{id}") @GetMapping("/{id}")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(typeService.getById(id)); return AjaxResult.success(typeService.getById(id));
} }
@PreAuthorize("@ss.hasPermi('system:robot:type:add')") //@PreAuthorize("@ss.hasPermi('system:robot:type:add')")
@ApiOperation("新增机器人类型") @ApiOperation("新增机器人类型")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody SysRobotType type) { public AjaxResult add(@RequestBody SysRobotType type) {
@@ -55,7 +55,7 @@ public class SysRobotTypeController {
return toAjax(typeService.save(type)); return toAjax(typeService.save(type));
} }
@PreAuthorize("@ss.hasPermi('system:robot:type:edit')") //@PreAuthorize("@ss.hasPermi('system:robot:type:edit')")
@ApiOperation("修改机器人类型") @ApiOperation("修改机器人类型")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysRobotType type) { public AjaxResult edit(@RequestBody SysRobotType type) {
@@ -65,7 +65,7 @@ public class SysRobotTypeController {
return toAjax(typeService.updateById(type)); return toAjax(typeService.updateById(type));
} }
@PreAuthorize("@ss.hasPermi('system:robot:type:remove')") // @PreAuthorize("@ss.hasPermi('system:robot:type:remove')")
@ApiOperation("删除机器人类型") @ApiOperation("删除机器人类型")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {

View File

@@ -8,30 +8,27 @@ import lombok.Data;
@ApiModel("二维码生成请求") @ApiModel("二维码生成请求")
public class QrCodeGenerateRequest { public class QrCodeGenerateRequest {
@ApiModelProperty("型号") @ApiModelProperty("型号ID(可选)")
private String model; private Long modelId;
@ApiModelProperty("配置") @ApiModelProperty("配置ID(可选)")
private String config; private Long configId;
@ApiModelProperty("类型") @ApiModelProperty("类型ID(可选)")
private String type; private Long typeId;
@ApiModelProperty("国家代码") @ApiModelProperty("国家ID(可选)")
private String countryCode; private Long countryId;
@ApiModelProperty("国家全称") @ApiModelProperty("省份ID(可选)")
private String countryFullName; private Long provinceId;
@ApiModelProperty("省份代码") @ApiModelProperty(value = "序列号", required = true)
private String provinceCode;
@ApiModelProperty("省份全称")
private String provinceFullName;
@ApiModelProperty("序列号")
private String serialNumber; private String serialNumber;
@ApiModelProperty("二维码Base64数据") @ApiModelProperty(value = "二维码Base64数据", required = true)
private String qrcode; private String qrCode;
@ApiModelProperty(value = "二维码JSON数据", required = true)
private String qrJson;
} }

View File

@@ -44,6 +44,9 @@ public class SysQrCode implements Serializable {
@ApiModelProperty("二维码Base64图片数据") @ApiModelProperty("二维码Base64图片数据")
private String qrCodeBase64; private String qrCodeBase64;
@ApiModelProperty("二维码JSON数据")
private String qrJson;
@ApiModelProperty("状态") @ApiModelProperty("状态")
private Integer status; private Integer status;

View File

@@ -1 +1 @@
package com.maibu.controller; package com.maibu.controller;

View File

@@ -30,21 +30,21 @@ public class IOTWorkOrderController extends BaseController {
@Autowired @Autowired
private IWorkOrderService workOrderService; private IWorkOrderService workOrderService;
@PreAuthorize("@ss.hasPermi('iot:workOrder:list')") // @PreAuthorize("@ss.hasPermi('iot:workOrder:list')")
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("工单分页列表") @ApiOperation("工单分页列表")
public TableDataInfo list(WorkOrderQueryDTO queryDTO) { public TableDataInfo list(WorkOrderQueryDTO queryDTO) {
return workOrderService.selectWorkOrderPage(queryDTO); return workOrderService.selectWorkOrderPage(queryDTO);
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:query')") //@PreAuthorize("@ss.hasPermi('iot:workOrder:query')")
@GetMapping("/{id}") @GetMapping("/{id}")
@ApiOperation("获取工单详情") @ApiOperation("获取工单详情")
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
return AjaxResult.success(workOrderService.selectWorkOrderById(id)); return AjaxResult.success(workOrderService.selectWorkOrderById(id));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:add')") // @PreAuthorize("@ss.hasPermi('iot:workOrder:add')")
@Log(title = "工单管理", businessType = BusinessType.INSERT) @Log(title = "工单管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@ApiOperation("新增工单") @ApiOperation("新增工单")
@@ -52,7 +52,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.insertWorkOrder(workOrder)); return toAjax(workOrderService.insertWorkOrder(workOrder));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:edit')") //@PreAuthorize("@ss.hasPermi('iot:workOrder:edit')")
@Log(title = "工单管理", businessType = BusinessType.UPDATE) @Log(title = "工单管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@ApiOperation("修改工单") @ApiOperation("修改工单")
@@ -60,7 +60,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.updateWorkOrder(workOrder)); return toAjax(workOrderService.updateWorkOrder(workOrder));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:dispatch')") // @PreAuthorize("@ss.hasPermi('iot:workOrder:dispatch')")
@Log(title = "工单派发", businessType = BusinessType.UPDATE) @Log(title = "工单派发", businessType = BusinessType.UPDATE)
@PostMapping("/dispatch") @PostMapping("/dispatch")
@ApiOperation("派发工单") @ApiOperation("派发工单")
@@ -68,7 +68,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.dispatchWorkOrder(dispatchDTO)); return toAjax(workOrderService.dispatchWorkOrder(dispatchDTO));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:start')") //@PreAuthorize("@ss.hasPermi('iot:workOrder:start')")
@Log(title = "工单开始", businessType = BusinessType.UPDATE) @Log(title = "工单开始", businessType = BusinessType.UPDATE)
@PutMapping("/start/{id}") @PutMapping("/start/{id}")
@ApiOperation("开始执行工单") @ApiOperation("开始执行工单")
@@ -76,7 +76,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.startWorkOrder(id)); return toAjax(workOrderService.startWorkOrder(id));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:complete')") // @PreAuthorize("@ss.hasPermi('iot:workOrder:complete')")
@Log(title = "工单完成", businessType = BusinessType.UPDATE) @Log(title = "工单完成", businessType = BusinessType.UPDATE)
@PostMapping("/complete") @PostMapping("/complete")
@ApiOperation("完成工单") @ApiOperation("完成工单")
@@ -84,7 +84,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.completeWorkOrder(workOrder)); return toAjax(workOrderService.completeWorkOrder(workOrder));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:suspend')") //@PreAuthorize("@ss.hasPermi('iot:workOrder:suspend')")
@Log(title = "工单挂起", businessType = BusinessType.UPDATE) @Log(title = "工单挂起", businessType = BusinessType.UPDATE)
@PostMapping("/suspend/{id}") @PostMapping("/suspend/{id}")
@ApiOperation("挂起工单") @ApiOperation("挂起工单")
@@ -92,7 +92,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.suspendWorkOrder(id)); return toAjax(workOrderService.suspendWorkOrder(id));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:remove')") //@PreAuthorize("@ss.hasPermi('iot:workOrder:remove')")
@Log(title = "工单管理", businessType = BusinessType.DELETE) @Log(title = "工单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@ApiOperation("删除工单") @ApiOperation("删除工单")
@@ -100,7 +100,7 @@ public class IOTWorkOrderController extends BaseController {
return toAjax(workOrderService.deleteWorkOrderByIds(ids)); return toAjax(workOrderService.deleteWorkOrderByIds(ids));
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:statistics')") // @PreAuthorize("@ss.hasPermi('iot:workOrder:statistics')")
@GetMapping("/statistics") @GetMapping("/statistics")
@ApiOperation("工单统计") @ApiOperation("工单统计")
public AjaxResult statistics() { public AjaxResult statistics() {
@@ -108,7 +108,7 @@ public class IOTWorkOrderController extends BaseController {
return AjaxResult.success(statistics); return AjaxResult.success(statistics);
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:export')") //@PreAuthorize("@ss.hasPermi('iot:workOrder:export')")
@Log(title = "工单管理", businessType = BusinessType.EXPORT) @Log(title = "工单管理", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ApiOperation("导出工单") @ApiOperation("导出工单")
@@ -122,7 +122,7 @@ public class IOTWorkOrderController extends BaseController {
} }
} }
@PreAuthorize("@ss.hasPermi('iot:workOrder:add')") // @PreAuthorize("@ss.hasPermi('iot:workOrder:add')")
@Log(title = "从告警生成工单", businessType = BusinessType.INSERT) @Log(title = "从告警生成工单", businessType = BusinessType.INSERT)
@PostMapping("/generateFromAlarm/{alarmId}") @PostMapping("/generateFromAlarm/{alarmId}")
@ApiOperation("从告警生成工单") @ApiOperation("从告警生成工单")

View File

@@ -13,6 +13,7 @@ import com.maibu.core.business.sys_robot_qrcode.*;
import com.maibu.mapper.*; import com.maibu.mapper.*;
import com.maibu.service.ISysQrCodeService; import com.maibu.service.ISysQrCodeService;
import com.maibu.utils.MinioUtil; import com.maibu.utils.MinioUtil;
import com.maibu.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -204,16 +205,6 @@ public class SysQrCodeServiceImpl extends ServiceImpl<SysQrCodeMapper, SysQrCode
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public SysQrCode generateQrCodeFromFrontend(QrCodeGenerateRequest request) { public SysQrCode generateQrCodeFromFrontend(QrCodeGenerateRequest request) {
SysRobotModel model = findModelByStoreValue(request.getModel());
SysRobotConfig config = findConfigByStoreValue(request.getConfig());
SysRobotType type = findTypeByStoreValue(request.getType());
SysRobotCountry country = findCountryByStoreValue(request.getCountryCode());
SysRobotProvince province = findProvinceByStoreValue(request.getProvinceCode());
if (model == null || config == null || type == null || country == null || province == null) {
throw new RuntimeException("基础数据不存在");
}
LambdaQueryWrapper<SysQrCode> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysQrCode> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysQrCode::getSerialNumber, request.getSerialNumber()); wrapper.eq(SysQrCode::getSerialNumber, request.getSerialNumber());
if (this.count(wrapper) > 0) { if (this.count(wrapper) > 0) {
@@ -222,47 +213,34 @@ public class SysQrCodeServiceImpl extends ServiceImpl<SysQrCodeMapper, SysQrCode
SysQrCode qrCode = new SysQrCode(); SysQrCode qrCode = new SysQrCode();
qrCode.setSerialNumber(request.getSerialNumber()); qrCode.setSerialNumber(request.getSerialNumber());
qrCode.setModelId(model.getId()); qrCode.setModelId(request.getModelId());
qrCode.setConfigId(config.getId()); qrCode.setConfigId(request.getConfigId());
qrCode.setTypeId(type.getId()); qrCode.setTypeId(request.getTypeId());
qrCode.setCountryId(country.getId()); qrCode.setCountryId(request.getCountryId());
qrCode.setProvinceId(province.getId()); qrCode.setProvinceId(request.getProvinceId());
qrCode.setQrCodeBase64(request.getQrcode()); qrCode.setQrCodeBase64(request.getQrCode());
qrCode.setQrJson(request.getQrJson());
qrCode.setQrCodeContent(request.getSerialNumber()); qrCode.setQrCodeContent(request.getSerialNumber());
qrCode.setStatus(0); qrCode.setStatus(0);
LocalDateTime now = LocalDateTime.now();
qrCode.setCreateTime(now);
qrCode.setUpdateTime(now);
try {
String username = SecurityUtils.getUsername();
qrCode.setCreateBy(username);
qrCode.setUpdateBy(username);
} catch (Exception e) {
log.warn("获取当前用户失败,使用默认值", e);
qrCode.setCreateBy("system");
qrCode.setUpdateBy("system");
}
this.save(qrCode); this.save(qrCode);
return qrCode; return qrCode;
} }
private SysRobotModel findModelByStoreValue(String storeValue) {
LambdaQueryWrapper<SysRobotModel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysRobotModel::getStoreValue, storeValue);
return robotModelMapper.selectOne(wrapper);
}
private SysRobotConfig findConfigByStoreValue(String storeValue) {
LambdaQueryWrapper<SysRobotConfig> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysRobotConfig::getStoreValue, storeValue);
return robotConfigMapper.selectOne(wrapper);
}
private SysRobotType findTypeByStoreValue(String storeValue) {
LambdaQueryWrapper<SysRobotType> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysRobotType::getStoreValue, storeValue);
return robotTypeMapper.selectOne(wrapper);
}
private SysRobotCountry findCountryByStoreValue(String storeValue) {
LambdaQueryWrapper<SysRobotCountry> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysRobotCountry::getStoreValue, storeValue);
return robotCountryMapper.selectOne(wrapper);
}
private SysRobotProvince findProvinceByStoreValue(String storeValue) {
LambdaQueryWrapper<SysRobotProvince> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysRobotProvince::getStoreValue, storeValue);
return robotProvinceMapper.selectOne(wrapper);
}
} }