diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/controller/MaTypeController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/controller/MaTypeController.java index d8f6548..935ad4c 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/controller/MaTypeController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/controller/MaTypeController.java @@ -15,11 +15,13 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; + import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; + import static com.bonus.common.core.constant.Constants.PAGE_NUM; import static com.bonus.common.core.constant.Constants.PAGE_SIZE; @@ -227,31 +229,6 @@ public class MaTypeController extends BaseController { return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, listByParentId)); } - /** - * 根据左列表类型id查询右表格 - * @param typeId - * @return - */ -// @ApiOperation(value = "根据左列表类型id查询右表格") -// @GetMapping("/getListByMaType") -// public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId, -// @RequestParam(required = false) String typeName, -// @RequestParam(required = false) Integer pageSize, -// @RequestParam(required = false) Integer pageNum){ -// if(typeId==null){ -// return null; -// } -// List listByMaType = iTypeService.getListByMaType(typeId, typeName); -// TableDataInfo rspData = new TableDataInfo(); -// rspData.setTotal(listByMaType.size()); -// rspData.setCode(HttpStatus.SUCCESS); -// // listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); -// rspData.setRows(listByMaType); -// rspData.setMsg("查询成功"); -// -// return rspData; -// } - /** * 获取机具类型管理ma_type详细信息 */ @@ -265,7 +242,7 @@ public class MaTypeController extends BaseController { * 新增机具类型管理ma_type */ @ApiOperation(value = "新增机具类型管理ma_type") - @SysLog(title = "入库记录", businessType = OperaType.INSERT, logType = 1,module = "新增机具类型管理ma_type") + @SysLog(title = "入库记录", businessType = OperaType.INSERT, logType = 1, module = "新增机具类型管理ma_type") @PostMapping public AjaxResult add(@RequestBody MaType maType) { int result = iTypeService.insertMaType(maType); @@ -276,11 +253,25 @@ public class MaTypeController extends BaseController { } } + @ApiOperation(value = "租赁价(批量)修改") + @PostMapping("/updateLeasePrice") + public AjaxResult updateLeasePrice(@RequestBody List typeIds) { + if (typeIds.isEmpty()) { + return AjaxResult.error("请选择要修改的机具"); + } + Integer i = iTypeService.updateLeasePrice(typeIds); + if (i > 0){ + return AjaxResult.success("修改成功"); + }else { + return AjaxResult.error("修改失败"); + } + } + /** * 修改机具类型管理ma_type */ @ApiOperation(value = "修改机具类型管理ma_type") - @SysLog(title = "入库记录", businessType = OperaType.UPDATE, logType = 1,module = "修改机具类型管理ma_type") + @SysLog(title = "入库记录", businessType = OperaType.UPDATE, logType = 1, module = "修改机具类型管理ma_type") @PutMapping public AjaxResult edit(@RequestBody MaType maType) { Long parentId = maType.getParentId(); @@ -300,7 +291,7 @@ public class MaTypeController extends BaseController { * 删除机具类型管理ma_type */ @ApiOperation(value = "删除机具类型管理ma_type") - @SysLog(title = "入库记录", businessType = OperaType.DELETE, logType = 1,module = "删除机具类型管理ma_type") + @SysLog(title = "入库记录", businessType = OperaType.DELETE, logType = 1, module = "删除机具类型管理ma_type") @DeleteMapping("/{typeId}") public AjaxResult remove(@PathVariable Long typeId) throws Exception { return toAjax(iTypeService.deleteMaTypeByTypeId(typeId)); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/mapper/MaTypeMapper.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/mapper/MaTypeMapper.java index 0264eaa..67eef0f 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/mapper/MaTypeMapper.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/mapper/MaTypeMapper.java @@ -83,5 +83,7 @@ public interface MaTypeMapper { List selectMaTypeByUserId(Long userId); - List selectParentId( @Param("typeId")Long typeId, @Param("level")Integer level); + List selectParentId(@Param("typeId")Long typeId, @Param("level")Integer level); + + Integer updateLeasePrice(@Param("typeIds")List typeIds); } \ No newline at end of file diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/ITypeService.java index 01a7358..bc44c59 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -68,4 +68,5 @@ public interface ITypeService { List getEquipmentType(Long typeId, String typeName); + Integer updateLeasePrice(List typeIds); } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/impl/MaTypeServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/impl/MaTypeServiceImpl.java index 114c9ba..3955130 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/impl/MaTypeServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/ma/service/impl/MaTypeServiceImpl.java @@ -371,6 +371,11 @@ public class MaTypeServiceImpl implements ITypeService { return list; } + @Override + public Integer updateLeasePrice(List typeIds) { + return maTypeMapper.updateLeasePrice(typeIds); + } + /** * @Author dingjie * @Date 2023/12/14 diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/ma/MaMachineTypeMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/ma/MaMachineTypeMapper.xml index 99ac297..2992843 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/ma/MaMachineTypeMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/ma/MaMachineTypeMapper.xml @@ -447,4 +447,11 @@ update ma_type set storage_num = IFNULL( storage_num, 0 ) + 1 where type_id = #{typeId} + + update ma_type set lease_price = #{leasePrice} where type_id in + + #{typeId} + + and del_flag = 0 + \ No newline at end of file diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml index d47a2ad..b007a86 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/order/OrderInfoMapper.xml @@ -54,8 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ,rent_over_time = now() - ,rent_over_user = #{userName} - ,rent_over_time = now() + ,refuse_user = #{userName} + ,refuse_time = now() where order_id = #{orderId}