装备设备库存修改(批量),增加驳回人驳回时间
This commit is contained in:
parent
1726130093
commit
c54c474627
|
|
@ -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<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详细信息
|
||||
*/
|
||||
|
|
@ -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<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
|
||||
*/
|
||||
@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));
|
||||
|
|
|
|||
|
|
@ -83,5 +83,7 @@ public interface MaTypeMapper {
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
@ -68,4 +68,5 @@ public interface ITypeService {
|
|||
List<MaType> getEquipmentType(Long typeId, String typeName);
|
||||
|
||||
|
||||
Integer updateLeasePrice(List<Integer> typeIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -371,6 +371,11 @@ public class MaTypeServiceImpl implements ITypeService {
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateLeasePrice(List<Integer> typeIds) {
|
||||
return maTypeMapper.updateLeasePrice(typeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author dingjie
|
||||
* @Date 2023/12/14
|
||||
|
|
|
|||
|
|
@ -447,4 +447,11 @@
|
|||
<update id="updateTypeNum">
|
||||
update ma_type set storage_num = IFNULL( storage_num, 0 ) + 1 where type_id = #{typeId}
|
||||
</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>
|
||||
|
|
@ -54,8 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
,rent_over_time = now()
|
||||
</if>
|
||||
<if test="orderStatus == 7">
|
||||
,rent_over_user = #{userName}
|
||||
,rent_over_time = now()
|
||||
,refuse_user = #{userName}
|
||||
,refuse_time = now()
|
||||
</if>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue