装备设备库存修改(批量),增加驳回人驳回时间

This commit is contained in:
liang.chao 2024-12-03 17:36:10 +08:00
parent 1726130093
commit c54c474627
6 changed files with 37 additions and 31 deletions

View File

@ -15,11 +15,13 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.bonus.common.core.constant.Constants.PAGE_NUM; import static com.bonus.common.core.constant.Constants.PAGE_NUM;
import static com.bonus.common.core.constant.Constants.PAGE_SIZE; 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)); 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<MaType> 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详细信息 * 获取机具类型管理ma_type详细信息
*/ */
@ -265,7 +242,7 @@ public class MaTypeController extends BaseController {
* 新增机具类型管理ma_type * 新增机具类型管理ma_type
*/ */
@ApiOperation(value = "新增机具类型管理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 @PostMapping
public AjaxResult add(@RequestBody MaType maType) { public AjaxResult add(@RequestBody MaType maType) {
int result = iTypeService.insertMaType(maType); int result = iTypeService.insertMaType(maType);
@ -276,11 +253,25 @@ public class MaTypeController extends BaseController {
} }
} }
@ApiOperation(value = "租赁价(批量)修改")
@PostMapping("/updateLeasePrice")
public AjaxResult updateLeasePrice(@RequestBody List<Integer> typeIds) {
if (typeIds.isEmpty()) {
return AjaxResult.error("请选择要修改的机具");
}
Integer i = iTypeService.updateLeasePrice(typeIds);
if (i > 0){
return AjaxResult.success("修改成功");
}else {
return AjaxResult.error("修改失败");
}
}
/** /**
* 修改机具类型管理ma_type * 修改机具类型管理ma_type
*/ */
@ApiOperation(value = "修改机具类型管理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 @PutMapping
public AjaxResult edit(@RequestBody MaType maType) { public AjaxResult edit(@RequestBody MaType maType) {
Long parentId = maType.getParentId(); Long parentId = maType.getParentId();
@ -300,7 +291,7 @@ public class MaTypeController extends BaseController {
* 删除机具类型管理ma_type * 删除机具类型管理ma_type
*/ */
@ApiOperation(value = "删除机具类型管理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}") @DeleteMapping("/{typeId}")
public AjaxResult remove(@PathVariable Long typeId) throws Exception { public AjaxResult remove(@PathVariable Long typeId) throws Exception {
return toAjax(iTypeService.deleteMaTypeByTypeId(typeId)); return toAjax(iTypeService.deleteMaTypeByTypeId(typeId));

View File

@ -83,5 +83,7 @@ public interface MaTypeMapper {
List<MaTypeKeeper> selectMaTypeByUserId(Long userId); List<MaTypeKeeper> selectMaTypeByUserId(Long userId);
List<Integer> selectParentId( @Param("typeId")Long typeId, @Param("level")Integer level); List<Integer> selectParentId(@Param("typeId")Long typeId, @Param("level")Integer level);
Integer updateLeasePrice(@Param("typeIds")List<Integer> typeIds);
} }

View File

@ -68,4 +68,5 @@ public interface ITypeService {
List<MaType> getEquipmentType(Long typeId, String typeName); List<MaType> getEquipmentType(Long typeId, String typeName);
Integer updateLeasePrice(List<Integer> typeIds);
} }

View File

@ -371,6 +371,11 @@ public class MaTypeServiceImpl implements ITypeService {
return list; return list;
} }
@Override
public Integer updateLeasePrice(List<Integer> typeIds) {
return maTypeMapper.updateLeasePrice(typeIds);
}
/** /**
* @Author dingjie * @Author dingjie
* @Date 2023/12/14 * @Date 2023/12/14

View File

@ -447,4 +447,11 @@
<update id="updateTypeNum"> <update id="updateTypeNum">
update ma_type set storage_num = IFNULL( storage_num, 0 ) + 1 where type_id = #{typeId} update ma_type set storage_num = IFNULL( storage_num, 0 ) + 1 where type_id = #{typeId}
</update> </update>
<update id="updateLeasePrice">
update ma_type set lease_price = #{leasePrice} where type_id in
<foreach item="typeId" collection="typeIds" open="(" separator="," close=")">
#{typeId}
</foreach>
and del_flag = 0
</update>
</mapper> </mapper>

View File

@ -54,8 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
,rent_over_time = now() ,rent_over_time = now()
</if> </if>
<if test="orderStatus == 7"> <if test="orderStatus == 7">
,rent_over_user = #{userName} ,refuse_user = #{userName}
,rent_over_time = now() ,refuse_time = now()
</if> </if>
where order_id = #{orderId} where order_id = #{orderId}
</update> </update>