| | |
| | | package com.ruoyi.envaccess.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.handler.CustomTenantLineHandler; |
| | | import com.ruoyi.envaccess.pojo.EnvWeighbridgeSystem; |
| | | import com.ruoyi.envaccess.service.IEnvWeighbridgeSystemService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | |
| | | public AjaxResult add(@RequestBody EnvWeighbridgeSystem req) { |
| | | req.setId(null); |
| | | fillNetWeight(req); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | req.setCreateTime(now); |
| | | req.setUpdateTime(now); |
| | | return envWeighbridgeSystemService.save(req) ? AjaxResult.success() : AjaxResult.error("新增失败"); |
| | | // 租户插件在本表 insert 时会抛 SetOperationList 解析异常,临时跳过; |
| | | // tenant_id / create_time / update_time 由实体上的 @TableField(fill=...) 自动填充 |
| | | CustomTenantLineHandler.TEMP_IGNORE.set(Boolean.TRUE); |
| | | try { |
| | | return envWeighbridgeSystemService.save(req) ? AjaxResult.success() : AjaxResult.error("新增失败"); |
| | | } finally { |
| | | CustomTenantLineHandler.TEMP_IGNORE.remove(); |
| | | } |
| | | } |
| | | |
| | | @PutMapping("/weighbridgeSystemUpdate") |
| | | @Log(title = "无人值守地磅-修改", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EnvWeighbridgeSystem req) { |
| | | fillNetWeight(req); |
| | | req.setUpdateTime(LocalDateTime.now()); |
| | | return envWeighbridgeSystemService.updateById(req) ? AjaxResult.success() : AjaxResult.error("修改失败"); |
| | | CustomTenantLineHandler.TEMP_IGNORE.set(Boolean.TRUE); |
| | | try { |
| | | return envWeighbridgeSystemService.updateById(req) ? AjaxResult.success() : AjaxResult.error("修改失败"); |
| | | } finally { |
| | | CustomTenantLineHandler.TEMP_IGNORE.remove(); |
| | | } |
| | | } |
| | | |
| | | @DeleteMapping("/weighbridgeSystemDelete") |
| | | @Log(title = "无人值守地磅-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return envWeighbridgeSystemService.removeByIds(ids) ? AjaxResult.success() : AjaxResult.error("删除失败"); |
| | | CustomTenantLineHandler.TEMP_IGNORE.set(Boolean.TRUE); |
| | | try { |
| | | return envWeighbridgeSystemService.removeByIds(ids) ? AjaxResult.success() : AjaxResult.error("删除失败"); |
| | | } finally { |
| | | CustomTenantLineHandler.TEMP_IGNORE.remove(); |
| | | } |
| | | } |
| | | |
| | | /** |