| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | |
| | | import com.ruoyi.management.domain.vo.SlGoodsShelfVO; |
| | | import com.ruoyi.management.domain.vo.StoreManagementGoodSmaterialsVO; |
| | | import com.ruoyi.management.mapper.ManagementGoodsMaterialsMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionCkMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionRkMapper; |
| | | import com.ruoyi.management.mapper.SlVolumeProductionZyMapper; |
| | | import com.ruoyi.management.service.ManagementGoodsMaterialsService; |
| | | import com.ruoyi.management.service.SlGoodsMaterialsService; |
| | | import com.ruoyi.management.service.SlStoreManagementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | @RequestMapping("/sl-goods-materials") |
| | | @Api(value = "物资管理接口", tags = "物资管理接口", description = "物资管理接口") |
| | | public class SlGoodsMaterialsController { |
| | | @Resource |
| | | private SlGoodsMaterialsService slGoodsMaterialsService; |
| | | |
| | | @Resource |
| | | private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; |
| | | |
| | | @PostMapping("/getGoodSmaterialsList") |
| | | @ApiOperation(value = "分页获物资管理") |
| | |
| | | slGoodsMaterialsService.addSlGoodsShelf(slGoodsMaterialsDTO); |
| | | return R.ok(); |
| | | } |
| | | @Resource |
| | | private SlGoodsMaterialsService slGoodsMaterialsService; |
| | | |
| | | @Resource |
| | | private ManagementGoodsMaterialsMapper managementGoodsMaterialsMapper; |
| | | @Resource |
| | | private SlVolumeProductionRkMapper slVolumeProductionRkMapper; |
| | | @Resource |
| | | private SlVolumeProductionCkMapper slVolumeProductionCkMapper; |
| | | @Resource |
| | | private SlVolumeProductionZyMapper slVolumeProductionZyMapper; |
| | | @Resource |
| | | private SlStoreManagementService storeManagementService; |
| | | @ApiOperation("删除物资管理") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> delStoreManagement( |
| | | @ApiParam(name = "id", value = "货架管理id", required = true) @PathVariable("id") Long id) { |
| | | // 判断当前物资有没有存在于入库 出库 转移记录 和库存 |
| | | List<ManagementGoodsMaterials> goodsMaterialsId = managementGoodsMaterialsMapper.selectList(new QueryWrapper<ManagementGoodsMaterials>() |
| | | .eq("goods_materials_id", id) |
| | | .eq("del_flag",0)); |
| | | |
| | | if (!goodsMaterialsId.isEmpty()){ |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (ManagementGoodsMaterials managementGoodsMaterials : goodsMaterialsId) { |
| | | if (managementGoodsMaterials.getManagementId() != null) { |
| | | SlStoreManagement byId1 = storeManagementService.getById(managementGoodsMaterials.getManagementId()); |
| | | stringBuilder.append(byId1.getStoreManagementName()).append(","); |
| | | } |
| | | } |
| | | // 去除最后一位字符 |
| | | stringBuilder.deleteCharAt(stringBuilder.length() - 1); |
| | | return R.fail("删除失败," + stringBuilder + "仓库还有当前物资"); |
| | | } |
| | | SlGoodsMaterials byId = slGoodsMaterialsService.getById(id); |
| | | byId.setDelFlag("1"); |
| | | slGoodsMaterialsService.updateById(byId); |