fix:密品设备维修提交

pg_adapter
wangxy 8 months ago
parent 8bbf54d40b
commit e23e00d964

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.uuid.Seq;
import com.ruoyi.system.domain.TdPropertyInfo;
import com.ruoyi.system.service.ITdPropertyInfoService;
import com.ruoyi.system.service.TdPropertyEmentService;
import com.ruoyi.web.controller.manager.SysAreaManager;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -30,14 +31,13 @@ import javax.annotation.Resource;
/**
* Controller
*
*
* @author ruoyi
* @date 2024-04-26
*/
@Controller
@RequestMapping("/system/property")
public class TdPropertyManagerController extends BaseController
{
public class TdPropertyManagerController extends BaseController {
private String prefix = "system/property/property";
@Autowired
@ -45,13 +45,15 @@ public class TdPropertyManagerController extends BaseController
@Autowired
private ITdPropertyInfoService tdPropertyInfoService;
@Resource
private TdPropertyEmentService tdPropertyEmentService;
@Resource
private SysAreaManager sysAreaManager;
@RequiresPermissions("system:property:view")
@GetMapping()
public String property()
{
public String property() {
return prefix + "/property";
}
@ -61,8 +63,7 @@ public class TdPropertyManagerController extends BaseController
@RequiresPermissions("system:property:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(TdPropertyManager tdPropertyManager)
{
public TableDataInfo list(TdPropertyManager tdPropertyManager) {
startPage();
List<TdPropertyManager> list = tdPropertyManagerService.selectTdPropertyManagerList(tdPropertyManager);
return getDataTable(list);
@ -75,8 +76,7 @@ public class TdPropertyManagerController extends BaseController
@Log(title = "密品登记", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TdPropertyManager tdPropertyManager)
{
public AjaxResult export(TdPropertyManager tdPropertyManager) {
List<TdPropertyManager> list = tdPropertyManagerService.selectTdPropertyManagerList(tdPropertyManager);
list.forEach(tdPropertyManager1 -> {
tdPropertyManager1.setPart(sysAreaManager.getAreaName(tdPropertyManager1.getPart()));
@ -90,9 +90,8 @@ public class TdPropertyManagerController extends BaseController
*
*/
@GetMapping("/add")
public String add(ModelMap mmap)
{
mmap.put("sysuser",getSysUser());
public String add(ModelMap mmap) {
mmap.put("sysuser", getSysUser());
return prefix + "/add";
}
@ -103,9 +102,8 @@ public class TdPropertyManagerController extends BaseController
@Log(title = "密品登记", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(TdPropertyManager tdPropertyManager)
{
tdPropertyManager.setUseId("Property_"+ Seq.getId(Seq.commSeqType));
public AjaxResult addSave(TdPropertyManager tdPropertyManager) {
tdPropertyManager.setUseId("Property_" + Seq.getId(Seq.commSeqType));
return toAjax(tdPropertyManagerService.insertTdPropertyManager(tdPropertyManager));
}
@ -114,8 +112,7 @@ public class TdPropertyManagerController extends BaseController
*/
@RequiresPermissions("system:property:edit")
@GetMapping("/edit/{useId}")
public String edit(@PathVariable("useId") String useId, ModelMap mmap)
{
public String edit(@PathVariable("useId") String useId, ModelMap mmap) {
TdPropertyManager tdPropertyManager = tdPropertyManagerService.selectTdPropertyManagerByUseId(useId);
mmap.put("tdPropertyManager", tdPropertyManager);
return prefix + "/edit";
@ -128,8 +125,7 @@ public class TdPropertyManagerController extends BaseController
@Log(title = "密品登记", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(TdPropertyManager tdPropertyManager)
{
public AjaxResult editSave(TdPropertyManager tdPropertyManager) {
return toAjax(tdPropertyManagerService.updateTdPropertyManager(tdPropertyManager));
}
@ -138,13 +134,13 @@ public class TdPropertyManagerController extends BaseController
*/
@RequiresPermissions("system:property:remove")
@Log(title = "密品登记", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
QueryWrapper queryWrapper= new QueryWrapper();
queryWrapper.in("use_id",ids.split(","));
public AjaxResult remove(String ids) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("use_id", ids.split(","));
tdPropertyInfoService.remove(queryWrapper);
tdPropertyEmentService.remove(queryWrapper);
return toAjax(tdPropertyManagerService.deleteTdPropertyManagerByUseIds(ids));
}
@ -153,9 +149,8 @@ public class TdPropertyManagerController extends BaseController
*/
@RequiresPermissions("system:property:list")
@GetMapping("/detail/{useId}")
public String detail(@PathVariable("useId") String useId, ModelMap mmap)
{
mmap.put("useId",useId);
public String detail(@PathVariable("useId") String useId, ModelMap mmap) {
mmap.put("useId", useId);
return "system/property/data/propertyinfo";
}

Loading…
Cancel
Save