Commit d0ee12d7cf503c45b5816dedc39315a0ee09c727
1 parent
0e22b45c
库存迁移
Showing
46 changed files
with
1452 additions
and
445 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInController.java deleted
| 1 | -package com.zteits.urbanops.module.garden.controller.admin.material; | |
| 2 | - | |
| 3 | -import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 4 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 5 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 7 | -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 8 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; | |
| 9 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; | |
| 10 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryInDO; | |
| 11 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryInMapper; | |
| 12 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; | |
| 13 | -import com.zteits.urbanops.module.garden.service.material.MaterialService; | |
| 14 | -import io.swagger.v3.oas.annotations.Operation; | |
| 15 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 16 | -import jakarta.annotation.Resource; | |
| 17 | -import jakarta.servlet.http.HttpServletResponse; | |
| 18 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 19 | -import org.springframework.transaction.annotation.Transactional; | |
| 20 | -import org.springframework.web.bind.annotation.*; | |
| 21 | - | |
| 22 | -import java.io.IOException; | |
| 23 | -import java.util.List; | |
| 24 | - | |
| 25 | -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 26 | - | |
| 27 | -@Tag(name = "管理后台 - 物料入库") | |
| 28 | -@RestController | |
| 29 | -@RequestMapping("/material/in") | |
| 30 | -public class MaterialInController { | |
| 31 | - | |
| 32 | - @Resource | |
| 33 | - private MaterialInventoryInMapper inMapper; | |
| 34 | - @Resource | |
| 35 | - private MaterialInventoryMapper inventoryMapper; | |
| 36 | - @Resource | |
| 37 | - private MaterialService materialService; | |
| 38 | - | |
| 39 | - @PostMapping("/listForPage") | |
| 40 | - @Operation(summary = "物料入库-分页") | |
| 41 | - @PreAuthorize("@ss.hasPermission('material:material/in:list')") | |
| 42 | - public CommonResult<PageResult<MaterialInventoryInDO>> listForPage(@RequestBody MaterialInventoryInDO where, | |
| 43 | - @RequestParam(value = "pageNum", required = false) Integer pageNum, | |
| 44 | - @RequestParam(value = "pageSize", required = false) Integer pageSize) { | |
| 45 | - PageParam page = new PageParam(); | |
| 46 | - page.setPageNo(pageNum == null ? 1 : pageNum); | |
| 47 | - page.setPageSize(pageSize == null ? 10 : pageSize); | |
| 48 | - PageResult<MaterialInventoryInDO> result = inMapper.selectPage(page, null, | |
| 49 | - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX<MaterialInventoryInDO>() | |
| 50 | - .eqIfPresent(MaterialInventoryInDO::getMaterialId, where.getMaterialId()) | |
| 51 | - .likeIfPresent(MaterialInventoryInDO::getMaterialName, where.getMaterialName()) | |
| 52 | - .eqIfPresent(MaterialInventoryInDO::getBelongCompanyId, where.getBelongCompanyId()) | |
| 53 | - .orderByDesc(MaterialInventoryInDO::getCreateTime)); | |
| 54 | - return success(result); | |
| 55 | - } | |
| 56 | - | |
| 57 | - @GetMapping("/export") | |
| 58 | - @Operation(summary = "物料入库-导出") | |
| 59 | - @PreAuthorize("@ss.hasPermission('material:material/in:export')") | |
| 60 | - public void export(MaterialInventoryInDO where, HttpServletResponse response) throws IOException { | |
| 61 | - List<MaterialInventoryInDO> list = inMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX<MaterialInventoryInDO>() | |
| 62 | - .eqIfPresent(MaterialInventoryInDO::getMaterialId, where.getMaterialId())); | |
| 63 | - ExcelUtils.write(response, "物料入库.xls", "数据", MaterialInventoryInDO.class, list); | |
| 64 | - } | |
| 65 | - | |
| 66 | - @GetMapping("/select/by/inventoryInNo") | |
| 67 | - @Operation(summary = "物料入库-详情") | |
| 68 | - @PreAuthorize("@ss.hasPermission('material:material/in:query')") | |
| 69 | - public CommonResult<MaterialInventoryInDO> getInfo(@RequestParam("inventoryIn_no") String inventoryInNo) { | |
| 70 | - return success(inMapper.selectByNo(inventoryInNo)); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @PostMapping("/add") | |
| 74 | - @Operation(summary = "物料入库-添加") | |
| 75 | - @PreAuthorize("@ss.hasPermission('material:material/in:add')") | |
| 76 | - @Transactional(rollbackFor = Throwable.class) | |
| 77 | - public CommonResult<Boolean> add(@RequestBody MaterialInventoryInDO req) { | |
| 78 | - Long userId = SecurityFrameworkUtils.getLoginUserId(); | |
| 79 | - MaterialDO material = materialService.getMaterial(req.getMaterialId()); | |
| 80 | - if (material == null) { | |
| 81 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "无效参数-materialId"); | |
| 82 | - } | |
| 83 | - req.setCreator(String.valueOf(userId)); | |
| 84 | - req.setUpdater(String.valueOf(userId)); | |
| 85 | - boolean inserted = inMapper.insert(req) > 0; | |
| 86 | - | |
| 87 | - MaterialInventoryDO inventory = new MaterialInventoryDO(); | |
| 88 | - inventory.setMaterialId(req.getMaterialId()); | |
| 89 | - inventory.setMaterialName(req.getMaterialName()); | |
| 90 | - inventory.setMaterialTypeId(req.getMaterialTypeId()); | |
| 91 | - inventory.setMaterialTypeName(req.getMaterialTypeName()); | |
| 92 | - inventory.setTypeId(material.getTypeId()); | |
| 93 | - inventory.setTypeName(material.getTypeName()); | |
| 94 | - inventory.setTypeDetailId(material.getTypeDetailId()); | |
| 95 | - inventory.setTypeDetailName(material.getTypeDetailName()); | |
| 96 | - inventory.setSpecifications(req.getSpecifications()); | |
| 97 | - inventory.setBelongCompanyId(req.getBelongCompanyId()); | |
| 98 | - inventory.setBelongCompanyName(req.getBelongCompanyName()); | |
| 99 | - inventory.setUnitId(req.getUnitId()); | |
| 100 | - inventory.setUnitName(req.getUnitName()); | |
| 101 | - inventory.setCurrentNum(req.getInInventoryNum()); | |
| 102 | - inventory.setOutTotalNum(0L); | |
| 103 | - inventory.setInventoryTotalNum(req.getInInventoryNum()); | |
| 104 | - inventory.setStatus("0"); | |
| 105 | - inventory.setDeptId(SecurityFrameworkUtils.getLoginUserDeptId()); | |
| 106 | - | |
| 107 | - MaterialInventoryDO existed = inventoryMapper.selectByTypeDetailId(inventory.getTypeDetailId(), inventory.getBelongCompanyId()); | |
| 108 | - if (existed != null) { | |
| 109 | - MaterialInventoryDO upd = new MaterialInventoryDO(); | |
| 110 | - upd.setInventoryId(existed.getInventoryId()); | |
| 111 | - upd.setInventoryTotalNum((existed.getInventoryTotalNum() == null ? 0 : existed.getInventoryTotalNum()) + inventory.getCurrentNum()); | |
| 112 | - upd.setCurrentNum((existed.getCurrentNum() == null ? 0 : existed.getCurrentNum()) + inventory.getCurrentNum()); | |
| 113 | - inventoryMapper.updateById(upd); | |
| 114 | - } else { | |
| 115 | - inventoryMapper.insert(inventory); | |
| 116 | - } | |
| 117 | - | |
| 118 | - return success(inserted); | |
| 119 | - } | |
| 120 | - | |
| 121 | - @PostMapping("/edit") | |
| 122 | - @Operation(summary = "物料入库-修改") | |
| 123 | - @PreAuthorize("@ss.hasPermission('material:material/in:edit')") | |
| 124 | - public CommonResult<Boolean> edit(@RequestBody MaterialInventoryInDO req) { | |
| 125 | - return success(inMapper.updateById(req) > 0); | |
| 126 | - } | |
| 127 | - | |
| 128 | - @GetMapping("/delete/by/id") | |
| 129 | - @Operation(summary = "物料入库-删除") | |
| 130 | - @PreAuthorize("@ss.hasPermission('material:material/in:remove')") | |
| 131 | - @Transactional(rollbackFor = Throwable.class) | |
| 132 | - public CommonResult<Boolean> remove(@RequestParam("id") Long id) { | |
| 133 | - MaterialInventoryInDO in = inMapper.selectById(id); | |
| 134 | - if (in == null) { | |
| 135 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); | |
| 136 | - } | |
| 137 | - MaterialInventoryDO inv = inventoryMapper.selectByMaterialId(in.getMaterialId()); | |
| 138 | - if (inv == null) { | |
| 139 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); | |
| 140 | - } | |
| 141 | - if (inv.getCurrentNum() < in.getInInventoryNum()) { | |
| 142 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "库存已使用"); | |
| 143 | - } | |
| 144 | - MaterialInventoryDO upd = new MaterialInventoryDO(); | |
| 145 | - upd.setInventoryId(inv.getInventoryId()); | |
| 146 | - upd.setCurrentNum(inv.getCurrentNum() - in.getInInventoryNum()); | |
| 147 | - upd.setInventoryTotalNum(inv.getInventoryTotalNum() - in.getInInventoryNum()); | |
| 148 | - inventoryMapper.updateById(upd); | |
| 149 | - return success(inMapper.deleteById(id) > 0); | |
| 150 | - } | |
| 151 | -} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialOutController.java deleted
| 1 | -package com.zteits.urbanops.module.garden.controller.admin.material; | |
| 2 | - | |
| 3 | -import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 4 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 5 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 7 | -import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | |
| 8 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; | |
| 9 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; | |
| 10 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryOutDO; | |
| 11 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; | |
| 12 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryOutMapper; | |
| 13 | -import com.zteits.urbanops.module.garden.service.material.MaterialService; | |
| 14 | -import io.swagger.v3.oas.annotations.Operation; | |
| 15 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 16 | -import jakarta.annotation.Resource; | |
| 17 | -import jakarta.servlet.http.HttpServletResponse; | |
| 18 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 19 | -import org.springframework.transaction.annotation.Transactional; | |
| 20 | -import org.springframework.web.bind.annotation.*; | |
| 21 | - | |
| 22 | -import java.io.IOException; | |
| 23 | -import java.util.List; | |
| 24 | - | |
| 25 | -import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 26 | - | |
| 27 | -@Tag(name = "管理后台 - 物料出库") | |
| 28 | -@RestController | |
| 29 | -@RequestMapping("/material/out") | |
| 30 | -public class MaterialOutController { | |
| 31 | - | |
| 32 | - @Resource | |
| 33 | - private MaterialInventoryOutMapper outMapper; | |
| 34 | - @Resource | |
| 35 | - private MaterialInventoryMapper inventoryMapper; | |
| 36 | - @Resource | |
| 37 | - private MaterialService materialService; | |
| 38 | - | |
| 39 | - @PostMapping("/listForPage") | |
| 40 | - @Operation(summary = "物料出库-分页") | |
| 41 | - @PreAuthorize("@ss.hasPermission('material:out:list')") | |
| 42 | - public CommonResult<PageResult<MaterialInventoryOutDO>> listForPage(@RequestBody MaterialInventoryOutDO where, | |
| 43 | - @RequestParam(value = "pageNum", required = false) Integer pageNum, | |
| 44 | - @RequestParam(value = "pageSize", required = false) Integer pageSize) { | |
| 45 | - PageParam page = new PageParam(); | |
| 46 | - page.setPageNo(pageNum == null ? 1 : pageNum); | |
| 47 | - page.setPageSize(pageSize == null ? 10 : pageSize); | |
| 48 | - PageResult<MaterialInventoryOutDO> result = outMapper.selectPage(page, null, | |
| 49 | - new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX<MaterialInventoryOutDO>() | |
| 50 | - .eqIfPresent(MaterialInventoryOutDO::getMaterialId, where.getMaterialId()) | |
| 51 | - .likeIfPresent(MaterialInventoryOutDO::getMaterialName, where.getMaterialName()) | |
| 52 | - .eqIfPresent(MaterialInventoryOutDO::getBelongCompanyId, where.getBelongCompanyId()) | |
| 53 | - .orderByDesc(MaterialInventoryOutDO::getCreateTime)); | |
| 54 | - return success(result); | |
| 55 | - } | |
| 56 | - | |
| 57 | - @GetMapping("/export") | |
| 58 | - @Operation(summary = "物料出库-导出") | |
| 59 | - @PreAuthorize("@ss.hasPermission('material:out:export')") | |
| 60 | - public void export(MaterialInventoryOutDO where, HttpServletResponse response) throws IOException { | |
| 61 | - List<MaterialInventoryOutDO> list = outMapper.selectList(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX<MaterialInventoryOutDO>() | |
| 62 | - .eqIfPresent(MaterialInventoryOutDO::getMaterialId, where.getMaterialId())); | |
| 63 | - ExcelUtils.write(response, "物料出库.xls", "数据", MaterialInventoryOutDO.class, list); | |
| 64 | - } | |
| 65 | - | |
| 66 | - @GetMapping("/{id}") | |
| 67 | - @Operation(summary = "物料出库-详情") | |
| 68 | - @PreAuthorize("@ss.hasPermission('material:out:query')") | |
| 69 | - public CommonResult<MaterialInventoryOutDO> getInfo(@RequestParam("id") Long id) { | |
| 70 | - return success(outMapper.selectById(id)); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @PostMapping("/add") | |
| 74 | - @Operation(summary = "物料出库-添加") | |
| 75 | - @PreAuthorize("@ss.hasPermission('material:out:add')") | |
| 76 | - @Transactional(rollbackFor = Throwable.class) | |
| 77 | - public CommonResult<Boolean> add(@RequestBody MaterialInventoryOutDO req) { | |
| 78 | - Long userId = SecurityFrameworkUtils.getLoginUserId(); | |
| 79 | - MaterialDO material = materialService.getMaterial(req.getMaterialId()); | |
| 80 | - if (material == null) { | |
| 81 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "无效参数"); | |
| 82 | - } | |
| 83 | - MaterialInventoryDO inventory = inventoryMapper.selectByTypeDetailId(material.getTypeDetailId(), SecurityFrameworkUtils.getLoginUserDeptId()); | |
| 84 | - if (inventory == null) { | |
| 85 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, req.getMaterialName() + "没有库存"); | |
| 86 | - } | |
| 87 | - if (inventory.getCurrentNum() < req.getOutInventoryNum()) { | |
| 88 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "当前库存不足,无法出库"); | |
| 89 | - } | |
| 90 | - req.setCreator(String.valueOf(userId)); | |
| 91 | - boolean inserted = outMapper.insert(req) > 0; | |
| 92 | - inventoryMapper.updateInventoryByMaterialId(inventory.getInventoryId(), req.getOutInventoryNum()); | |
| 93 | - return success(inserted); | |
| 94 | - } | |
| 95 | - | |
| 96 | - @PostMapping("/edit") | |
| 97 | - @Operation(summary = "物料出库-修改") | |
| 98 | - @PreAuthorize("@ss.hasPermission('material:out:edit')") | |
| 99 | - public CommonResult<Boolean> edit(@RequestBody MaterialInventoryOutDO req) { | |
| 100 | - return success(outMapper.updateById(req) > 0); | |
| 101 | - } | |
| 102 | - | |
| 103 | - @GetMapping("/delete/ById") | |
| 104 | - @Operation(summary = "物料出库-删除") | |
| 105 | - @PreAuthorize("@ss.hasPermission('material:out:remove')") | |
| 106 | - public CommonResult<Boolean> remove(@RequestParam("id") Long id) { | |
| 107 | - MaterialInventoryOutDO out = outMapper.selectById(id); | |
| 108 | - if (out == null) { | |
| 109 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); | |
| 110 | - } | |
| 111 | - MaterialInventoryDO inv = inventoryMapper.selectByMaterialId(out.getMaterialId()); | |
| 112 | - if (inv == null) { | |
| 113 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(400, "参数错误"); | |
| 114 | - } | |
| 115 | - if (inv.getCurrentNum() < out.getOutInventoryNum()) { | |
| 116 | - return com.zteits.urbanops.framework.common.pojo.CommonResult.error(409, "库存已使用"); | |
| 117 | - } | |
| 118 | - MaterialInventoryDO upd = new MaterialInventoryDO(); | |
| 119 | - upd.setInventoryId(inv.getInventoryId()); | |
| 120 | - upd.setCurrentNum(inv.getCurrentNum() + out.getOutInventoryNum()); | |
| 121 | - upd.setInventoryTotalNum(inv.getInventoryTotalNum() + out.getOutInventoryNum()); | |
| 122 | - upd.setOutTotalNum(inv.getOutTotalNum() - out.getOutInventoryNum()); | |
| 123 | - inventoryMapper.updateById(upd); | |
| 124 | - return success(outMapper.deleteById(id) > 0); | |
| 125 | - } | |
| 126 | -} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialInventoryController.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventory/MaterialInventoryController.java
| 1 | -package com.zteits.urbanops.module.garden.controller.admin.material; | |
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventory; | |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 5 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 6 | import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; |
| 7 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; | |
| 8 | -import com.zteits.urbanops.module.garden.service.material.MaterialInventoryService; | |
| 7 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; | |
| 8 | +import com.zteits.urbanops.module.garden.service.materialinventory.MaterialInventoryService; | |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | 11 | import jakarta.annotation.Resource; |
| ... | ... | @@ -53,4 +53,4 @@ public class MaterialInventoryController { |
| 53 | 53 | @RequestParam("alerm_num") Long alermNum) { |
| 54 | 54 | return success(inventoryService.updateInventoryAlarmNum(materialId, alermNum)); |
| 55 | 55 | } |
| 56 | -} | |
| 57 | 56 | \ No newline at end of file |
| 57 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/MaterialInventoryInController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.*; | |
| 4 | +import jakarta.annotation.Resource; | |
| 5 | +import org.springframework.validation.annotation.Validated; | |
| 6 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | + | |
| 11 | +import jakarta.validation.constraints.*; | |
| 12 | +import jakarta.validation.*; | |
| 13 | +import jakarta.servlet.http.*; | |
| 14 | +import java.util.*; | |
| 15 | +import java.io.IOException; | |
| 16 | + | |
| 17 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 18 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 19 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 20 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 24 | + | |
| 25 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 26 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 27 | + | |
| 28 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; | |
| 29 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; | |
| 30 | +import com.zteits.urbanops.module.garden.service.materialinventoryin.MaterialInventoryInService; | |
| 31 | + | |
| 32 | +@Tag(name = "管理后台 - 物料入库") | |
| 33 | +@RestController | |
| 34 | +@RequestMapping("/garden/material-inventory-in") | |
| 35 | +@Validated | |
| 36 | +public class MaterialInventoryInController { | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private MaterialInventoryInService materialInventoryInService; | |
| 40 | + | |
| 41 | + @PostMapping("/create") | |
| 42 | + @Operation(summary = "创建物料入库") | |
| 43 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:create')") | |
| 44 | + public CommonResult<Long> createMaterialInventoryIn(@Valid @RequestBody MaterialInventoryInSaveReqVO createReqVO) { | |
| 45 | + return success(materialInventoryInService.createMaterialInventoryIn(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PutMapping("/update") | |
| 49 | + @Operation(summary = "更新物料入库") | |
| 50 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:update')") | |
| 51 | + public CommonResult<Boolean> updateMaterialInventoryIn(@Valid @RequestBody MaterialInventoryInSaveReqVO updateReqVO) { | |
| 52 | + materialInventoryInService.updateMaterialInventoryIn(updateReqVO); | |
| 53 | + return success(true); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @DeleteMapping("/delete") | |
| 57 | + @Operation(summary = "删除物料入库") | |
| 58 | + @Parameter(name = "id", description = "编号", required = true) | |
| 59 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:delete')") | |
| 60 | + public CommonResult<Boolean> deleteMaterialInventoryIn(@RequestParam("id") Long id) { | |
| 61 | + materialInventoryInService.deleteMaterialInventoryIn(id); | |
| 62 | + return success(true); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 67 | + @Operation(summary = "批量删除物料入库") | |
| 68 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:delete')") | |
| 69 | + public CommonResult<Boolean> deleteMaterialInventoryInList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + materialInventoryInService.deleteMaterialInventoryInListByIds(ids); | |
| 71 | + return success(true); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @GetMapping("/get") | |
| 75 | + @Operation(summary = "获得物料入库") | |
| 76 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 77 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:query')") | |
| 78 | + public CommonResult<MaterialInventoryInRespVO> getMaterialInventoryIn(@RequestParam("id") Long id) { | |
| 79 | + MaterialInventoryInDO materialInventoryIn = materialInventoryInService.getMaterialInventoryIn(id); | |
| 80 | + return success(BeanUtils.toBean(materialInventoryIn, MaterialInventoryInRespVO.class)); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @GetMapping("/page") | |
| 84 | + @Operation(summary = "获得物料入库分页") | |
| 85 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:query')") | |
| 86 | + public CommonResult<PageResult<MaterialInventoryInRespVO>> getMaterialInventoryInPage(@Valid MaterialInventoryInPageReqVO pageReqVO) { | |
| 87 | + PageResult<MaterialInventoryInDO> pageResult = materialInventoryInService.getMaterialInventoryInPage(pageReqVO); | |
| 88 | + return success(BeanUtils.toBean(pageResult, MaterialInventoryInRespVO.class)); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @GetMapping("/export-excel") | |
| 92 | + @Operation(summary = "导出物料入库 Excel") | |
| 93 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-in:export')") | |
| 94 | + @ApiAccessLog(operateType = EXPORT) | |
| 95 | + public void exportMaterialInventoryInExcel(@Valid MaterialInventoryInPageReqVO pageReqVO, | |
| 96 | + HttpServletResponse response) throws IOException { | |
| 97 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 98 | + List<MaterialInventoryInDO> list = materialInventoryInService.getMaterialInventoryInPage(pageReqVO).getList(); | |
| 99 | + // 导出 Excel | |
| 100 | + ExcelUtils.write(response, "物料入库.xls", "数据", MaterialInventoryInRespVO.class, | |
| 101 | + BeanUtils.toBean(list, MaterialInventoryInRespVO.class)); | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | |
| 0 | 105 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 7 | +import java.math.BigDecimal; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 12 | + | |
| 13 | +@Schema(description = "管理后台 - 物料入库分页 Request VO") | |
| 14 | +@Data | |
| 15 | +public class MaterialInventoryInPageReqVO extends PageParam { | |
| 16 | + | |
| 17 | + @Schema(description = "入库批次号") | |
| 18 | + private String inventoryInNo; | |
| 19 | + | |
| 20 | + @Schema(description = "物料ID", example = "7335") | |
| 21 | + private Long materialId; | |
| 22 | + | |
| 23 | + @Schema(description = "物料名称", example = "芋艿") | |
| 24 | + private String materialName; | |
| 25 | + | |
| 26 | + @Schema(description = "物料类型ID", example = "27813") | |
| 27 | + private Long materialTypeId; | |
| 28 | + | |
| 29 | + @Schema(description = "耗材类型名称", example = "李四") | |
| 30 | + private String materialTypeName; | |
| 31 | + | |
| 32 | + @Schema(description = "类别ID", example = "24913") | |
| 33 | + private Long typeId; | |
| 34 | + | |
| 35 | + @Schema(description = "类别名称:药品", example = "李四") | |
| 36 | + private String typeName; | |
| 37 | + | |
| 38 | + @Schema(description = "类别明细ID", example = "53") | |
| 39 | + private Long typeDetailId; | |
| 40 | + | |
| 41 | + @Schema(description = "类别明细", example = "张三") | |
| 42 | + private String typeDetailName; | |
| 43 | + | |
| 44 | + @Schema(description = "规格") | |
| 45 | + private String specifications; | |
| 46 | + | |
| 47 | + @Schema(description = "归属单位ID", example = "27639") | |
| 48 | + private Long belongCompanyId; | |
| 49 | + | |
| 50 | + @Schema(description = "归属单位", example = "王五") | |
| 51 | + private String belongCompanyName; | |
| 52 | + | |
| 53 | + @Schema(description = "入库数量") | |
| 54 | + private Long inInventoryNum; | |
| 55 | + | |
| 56 | + @Schema(description = "单价", example = "17670") | |
| 57 | + private BigDecimal materialPrice; | |
| 58 | + | |
| 59 | + @Schema(description = "单位ID", example = "11362") | |
| 60 | + private Long unitId; | |
| 61 | + | |
| 62 | + @Schema(description = "单位", example = "李四") | |
| 63 | + private String unitName; | |
| 64 | + | |
| 65 | + @Schema(description = "采购日期") | |
| 66 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 67 | + private LocalDateTime[] buyDate; | |
| 68 | + | |
| 69 | + @Schema(description = "供应商名称", example = "王五") | |
| 70 | + private String supplierName; | |
| 71 | + | |
| 72 | + @Schema(description = "联系人", example = "赵六") | |
| 73 | + private String contactsName; | |
| 74 | + | |
| 75 | + @Schema(description = "联系人 电话") | |
| 76 | + private String contactsPhone; | |
| 77 | + | |
| 78 | + @Schema(description = "创建时间") | |
| 79 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 80 | + private LocalDateTime[] createTime; | |
| 81 | + | |
| 82 | + @Schema(description = "部门ID", example = "18025") | |
| 83 | + private Long deptId; | |
| 84 | + | |
| 85 | +} | |
| 0 | 86 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import java.math.BigDecimal; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import cn.idev.excel.annotation.*; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - 物料入库 Response VO") | |
| 12 | +@Data | |
| 13 | +@ExcelIgnoreUnannotated | |
| 14 | +public class MaterialInventoryInRespVO { | |
| 15 | + | |
| 16 | + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16290") | |
| 17 | + @ExcelProperty("入库ID") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 21 | + @ExcelProperty("入库批次号") | |
| 22 | + private String inventoryInNo; | |
| 23 | + | |
| 24 | + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7335") | |
| 25 | + @ExcelProperty("物料ID") | |
| 26 | + private Long materialId; | |
| 27 | + | |
| 28 | + @Schema(description = "物料名称", example = "芋艿") | |
| 29 | + @ExcelProperty("物料名称") | |
| 30 | + private String materialName; | |
| 31 | + | |
| 32 | + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27813") | |
| 33 | + @ExcelProperty("物料类型ID") | |
| 34 | + private Long materialTypeId; | |
| 35 | + | |
| 36 | + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 37 | + @ExcelProperty("耗材类型名称") | |
| 38 | + private String materialTypeName; | |
| 39 | + | |
| 40 | + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24913") | |
| 41 | + @ExcelProperty("类别ID") | |
| 42 | + private Long typeId; | |
| 43 | + | |
| 44 | + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 45 | + @ExcelProperty("类别名称:药品") | |
| 46 | + private String typeName; | |
| 47 | + | |
| 48 | + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "53") | |
| 49 | + @ExcelProperty("类别明细ID") | |
| 50 | + private Long typeDetailId; | |
| 51 | + | |
| 52 | + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 53 | + @ExcelProperty("类别明细") | |
| 54 | + private String typeDetailName; | |
| 55 | + | |
| 56 | + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 57 | + @ExcelProperty("规格") | |
| 58 | + private String specifications; | |
| 59 | + | |
| 60 | + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27639") | |
| 61 | + @ExcelProperty("归属单位ID") | |
| 62 | + private Long belongCompanyId; | |
| 63 | + | |
| 64 | + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 65 | + @ExcelProperty("归属单位") | |
| 66 | + private String belongCompanyName; | |
| 67 | + | |
| 68 | + @Schema(description = "入库数量", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 69 | + @ExcelProperty("入库数量") | |
| 70 | + private Long inInventoryNum; | |
| 71 | + | |
| 72 | + @Schema(description = "单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") | |
| 73 | + @ExcelProperty("单价") | |
| 74 | + private BigDecimal materialPrice; | |
| 75 | + | |
| 76 | + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11362") | |
| 77 | + @ExcelProperty("单位ID") | |
| 78 | + private Long unitId; | |
| 79 | + | |
| 80 | + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 81 | + @ExcelProperty("单位") | |
| 82 | + private String unitName; | |
| 83 | + | |
| 84 | + @Schema(description = "采购日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 85 | + @ExcelProperty("采购日期") | |
| 86 | + private LocalDateTime buyDate; | |
| 87 | + | |
| 88 | + @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 89 | + @ExcelProperty("供应商名称") | |
| 90 | + private String supplierName; | |
| 91 | + | |
| 92 | + @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") | |
| 93 | + @ExcelProperty("联系人") | |
| 94 | + private String contactsName; | |
| 95 | + | |
| 96 | + @Schema(description = "联系人 电话", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 97 | + @ExcelProperty("联系人 电话") | |
| 98 | + private String contactsPhone; | |
| 99 | + | |
| 100 | + @Schema(description = "创建时间") | |
| 101 | + @ExcelProperty("创建时间") | |
| 102 | + private LocalDateTime createTime; | |
| 103 | + | |
| 104 | + @Schema(description = "部门ID", example = "18025") | |
| 105 | + @ExcelProperty("部门ID") | |
| 106 | + private Long deptId; | |
| 107 | + | |
| 108 | +} | |
| 0 | 109 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryin/vo/MaterialInventoryInSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import jakarta.validation.constraints.*; | |
| 7 | +import java.math.BigDecimal; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - 物料入库新增/修改 Request VO") | |
| 12 | +@Data | |
| 13 | +public class MaterialInventoryInSaveReqVO { | |
| 14 | + | |
| 15 | + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16290") | |
| 16 | + private Long id; | |
| 17 | + | |
| 18 | + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 19 | + @NotEmpty(message = "入库批次号不能为空") | |
| 20 | + private String inventoryInNo; | |
| 21 | + | |
| 22 | + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7335") | |
| 23 | + @NotNull(message = "物料ID不能为空") | |
| 24 | + private Long materialId; | |
| 25 | + | |
| 26 | + @Schema(description = "物料名称", example = "芋艿") | |
| 27 | + private String materialName; | |
| 28 | + | |
| 29 | + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27813") | |
| 30 | + @NotNull(message = "物料类型ID不能为空") | |
| 31 | + private Long materialTypeId; | |
| 32 | + | |
| 33 | + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 34 | + @NotEmpty(message = "耗材类型名称不能为空") | |
| 35 | + private String materialTypeName; | |
| 36 | + | |
| 37 | + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24913") | |
| 38 | + @NotNull(message = "类别ID不能为空") | |
| 39 | + private Long typeId; | |
| 40 | + | |
| 41 | + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 42 | + @NotEmpty(message = "类别名称:药品不能为空") | |
| 43 | + private String typeName; | |
| 44 | + | |
| 45 | + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "53") | |
| 46 | + @NotNull(message = "类别明细ID不能为空") | |
| 47 | + private Long typeDetailId; | |
| 48 | + | |
| 49 | + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") | |
| 50 | + @NotEmpty(message = "类别明细不能为空") | |
| 51 | + private String typeDetailName; | |
| 52 | + | |
| 53 | + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 54 | + @NotEmpty(message = "规格不能为空") | |
| 55 | + private String specifications; | |
| 56 | + | |
| 57 | + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27639") | |
| 58 | + @NotNull(message = "归属单位ID不能为空") | |
| 59 | + private Long belongCompanyId; | |
| 60 | + | |
| 61 | + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 62 | + @NotEmpty(message = "归属单位不能为空") | |
| 63 | + private String belongCompanyName; | |
| 64 | + | |
| 65 | + @Schema(description = "入库数量", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 66 | + @NotNull(message = "入库数量不能为空") | |
| 67 | + private Long inInventoryNum; | |
| 68 | + | |
| 69 | + @Schema(description = "单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "17670") | |
| 70 | + @NotNull(message = "单价不能为空") | |
| 71 | + private BigDecimal materialPrice; | |
| 72 | + | |
| 73 | + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11362") | |
| 74 | + @NotNull(message = "单位ID不能为空") | |
| 75 | + private Long unitId; | |
| 76 | + | |
| 77 | + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 78 | + @NotEmpty(message = "单位不能为空") | |
| 79 | + private String unitName; | |
| 80 | + | |
| 81 | + @Schema(description = "采购日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 82 | + @NotNull(message = "采购日期不能为空") | |
| 83 | + private LocalDateTime buyDate; | |
| 84 | + | |
| 85 | + @Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 86 | + @NotEmpty(message = "供应商名称不能为空") | |
| 87 | + private String supplierName; | |
| 88 | + | |
| 89 | + @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") | |
| 90 | + @NotEmpty(message = "联系人不能为空") | |
| 91 | + private String contactsName; | |
| 92 | + | |
| 93 | + @Schema(description = "联系人 电话", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 94 | + @NotEmpty(message = "联系人 电话不能为空") | |
| 95 | + private String contactsPhone; | |
| 96 | + | |
| 97 | + @Schema(description = "部门ID", example = "18025") | |
| 98 | + private Long deptId; | |
| 99 | + | |
| 100 | +} | |
| 0 | 101 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/MaterialInventoryOutController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout; | |
| 2 | + | |
| 3 | +import org.springframework.web.bind.annotation.*; | |
| 4 | +import jakarta.annotation.Resource; | |
| 5 | +import org.springframework.validation.annotation.Validated; | |
| 6 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.Operation; | |
| 10 | + | |
| 11 | +import jakarta.validation.constraints.*; | |
| 12 | +import jakarta.validation.*; | |
| 13 | +import jakarta.servlet.http.*; | |
| 14 | +import java.util.*; | |
| 15 | +import java.io.IOException; | |
| 16 | + | |
| 17 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 18 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 19 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 20 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 21 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 24 | + | |
| 25 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 26 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 27 | + | |
| 28 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; | |
| 29 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; | |
| 30 | +import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; | |
| 31 | + | |
| 32 | +@Tag(name = "管理后台 - 物料出库") | |
| 33 | +@RestController | |
| 34 | +@RequestMapping("/garden/material-inventory-out") | |
| 35 | +@Validated | |
| 36 | +public class MaterialInventoryOutController { | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private MaterialInventoryOutService materialInventoryOutService; | |
| 40 | + | |
| 41 | + @PostMapping("/create") | |
| 42 | + @Operation(summary = "创建物料出库") | |
| 43 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:create')") | |
| 44 | + public CommonResult<Long> createMaterialInventoryOut(@Valid @RequestBody MaterialInventoryOutSaveReqVO createReqVO) { | |
| 45 | + return success(materialInventoryOutService.createMaterialInventoryOut(createReqVO)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @PutMapping("/update") | |
| 49 | + @Operation(summary = "更新物料出库") | |
| 50 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:update')") | |
| 51 | + public CommonResult<Boolean> updateMaterialInventoryOut(@Valid @RequestBody MaterialInventoryOutSaveReqVO updateReqVO) { | |
| 52 | + materialInventoryOutService.updateMaterialInventoryOut(updateReqVO); | |
| 53 | + return success(true); | |
| 54 | + } | |
| 55 | + | |
| 56 | + @DeleteMapping("/delete") | |
| 57 | + @Operation(summary = "删除物料出库") | |
| 58 | + @Parameter(name = "id", description = "编号", required = true) | |
| 59 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:delete')") | |
| 60 | + public CommonResult<Boolean> deleteMaterialInventoryOut(@RequestParam("id") Long id) { | |
| 61 | + materialInventoryOutService.deleteMaterialInventoryOut(id); | |
| 62 | + return success(true); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | + @Parameter(name = "ids", description = "编号", required = true) | |
| 67 | + @Operation(summary = "批量删除物料出库") | |
| 68 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:delete')") | |
| 69 | + public CommonResult<Boolean> deleteMaterialInventoryOutList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + materialInventoryOutService.deleteMaterialInventoryOutListByIds(ids); | |
| 71 | + return success(true); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @GetMapping("/get") | |
| 75 | + @Operation(summary = "获得物料出库") | |
| 76 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 77 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:query')") | |
| 78 | + public CommonResult<MaterialInventoryOutRespVO> getMaterialInventoryOut(@RequestParam("id") Long id) { | |
| 79 | + MaterialInventoryOutDO materialInventoryOut = materialInventoryOutService.getMaterialInventoryOut(id); | |
| 80 | + return success(BeanUtils.toBean(materialInventoryOut, MaterialInventoryOutRespVO.class)); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @GetMapping("/page") | |
| 84 | + @Operation(summary = "获得物料出库分页") | |
| 85 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:query')") | |
| 86 | + public CommonResult<PageResult<MaterialInventoryOutRespVO>> getMaterialInventoryOutPage(@Valid MaterialInventoryOutPageReqVO pageReqVO) { | |
| 87 | + PageResult<MaterialInventoryOutDO> pageResult = materialInventoryOutService.getMaterialInventoryOutPage(pageReqVO); | |
| 88 | + return success(BeanUtils.toBean(pageResult, MaterialInventoryOutRespVO.class)); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @GetMapping("/export-excel") | |
| 92 | + @Operation(summary = "导出物料出库 Excel") | |
| 93 | + @PreAuthorize("@ss.hasPermission('garden:material-inventory-out:export')") | |
| 94 | + @ApiAccessLog(operateType = EXPORT) | |
| 95 | + public void exportMaterialInventoryOutExcel(@Valid MaterialInventoryOutPageReqVO pageReqVO, | |
| 96 | + HttpServletResponse response) throws IOException { | |
| 97 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 98 | + List<MaterialInventoryOutDO> list = materialInventoryOutService.getMaterialInventoryOutPage(pageReqVO).getList(); | |
| 99 | + // 导出 Excel | |
| 100 | + ExcelUtils.write(response, "物料出库.xls", "数据", MaterialInventoryOutRespVO.class, | |
| 101 | + BeanUtils.toBean(list, MaterialInventoryOutRespVO.class)); | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | |
| 0 | 105 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 11 | + | |
| 12 | +@Schema(description = "管理后台 - 物料出库分页 Request VO") | |
| 13 | +@Data | |
| 14 | +public class MaterialInventoryOutPageReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @Schema(description = "入库批次号") | |
| 17 | + private String inventoryOutNo; | |
| 18 | + | |
| 19 | + @Schema(description = "物料ID", example = "14541") | |
| 20 | + private Long materialId; | |
| 21 | + | |
| 22 | + @Schema(description = "物料名称", example = "芋艿") | |
| 23 | + private String materialName; | |
| 24 | + | |
| 25 | + @Schema(description = "物料类型ID", example = "9209") | |
| 26 | + private Long materialTypeId; | |
| 27 | + | |
| 28 | + @Schema(description = "耗材类型名称", example = "王五") | |
| 29 | + private String materialTypeName; | |
| 30 | + | |
| 31 | + @Schema(description = "类别ID", example = "12624") | |
| 32 | + private Long typeId; | |
| 33 | + | |
| 34 | + @Schema(description = "类别名称:药品", example = "芋艿") | |
| 35 | + private String typeName; | |
| 36 | + | |
| 37 | + @Schema(description = "类别明细ID", example = "24611") | |
| 38 | + private Long typeDetailId; | |
| 39 | + | |
| 40 | + @Schema(description = "类别明细", example = "王五") | |
| 41 | + private String typeDetailName; | |
| 42 | + | |
| 43 | + @Schema(description = "规格") | |
| 44 | + private String specifications; | |
| 45 | + | |
| 46 | + @Schema(description = "归属单位ID", example = "17128") | |
| 47 | + private Long belongCompanyId; | |
| 48 | + | |
| 49 | + @Schema(description = "归属单位", example = "李四") | |
| 50 | + private String belongCompanyName; | |
| 51 | + | |
| 52 | + @Schema(description = "出库数量") | |
| 53 | + private Long outInventoryNum; | |
| 54 | + | |
| 55 | + @Schema(description = "单位ID", example = "1033") | |
| 56 | + private Long unitId; | |
| 57 | + | |
| 58 | + @Schema(description = "单位", example = "芋艿") | |
| 59 | + private String unitName; | |
| 60 | + | |
| 61 | + @Schema(description = "出库日期") | |
| 62 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 63 | + private LocalDateTime[] outDate; | |
| 64 | + | |
| 65 | + @Schema(description = "备注", example = "你说的对") | |
| 66 | + private String remark; | |
| 67 | + | |
| 68 | + @Schema(description = "创建时间") | |
| 69 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 70 | + private LocalDateTime[] createTime; | |
| 71 | + | |
| 72 | + @Schema(description = "部门ID", example = "22618") | |
| 73 | + private Long deptId; | |
| 74 | + | |
| 75 | + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") | |
| 76 | + private Integer type; | |
| 77 | + | |
| 78 | +} | |
| 0 | 79 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import cn.idev.excel.annotation.*; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - 物料出库 Response VO") | |
| 11 | +@Data | |
| 12 | +@ExcelIgnoreUnannotated | |
| 13 | +public class MaterialInventoryOutRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") | |
| 16 | + @ExcelProperty("入库ID") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 20 | + @ExcelProperty("入库批次号") | |
| 21 | + private String inventoryOutNo; | |
| 22 | + | |
| 23 | + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") | |
| 24 | + @ExcelProperty("物料ID") | |
| 25 | + private Long materialId; | |
| 26 | + | |
| 27 | + @Schema(description = "物料名称", example = "芋艿") | |
| 28 | + @ExcelProperty("物料名称") | |
| 29 | + private String materialName; | |
| 30 | + | |
| 31 | + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9209") | |
| 32 | + @ExcelProperty("物料类型ID") | |
| 33 | + private Long materialTypeId; | |
| 34 | + | |
| 35 | + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 36 | + @ExcelProperty("耗材类型名称") | |
| 37 | + private String materialTypeName; | |
| 38 | + | |
| 39 | + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12624") | |
| 40 | + @ExcelProperty("类别ID") | |
| 41 | + private Long typeId; | |
| 42 | + | |
| 43 | + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 44 | + @ExcelProperty("类别名称:药品") | |
| 45 | + private String typeName; | |
| 46 | + | |
| 47 | + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24611") | |
| 48 | + @ExcelProperty("类别明细ID") | |
| 49 | + private Long typeDetailId; | |
| 50 | + | |
| 51 | + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 52 | + @ExcelProperty("类别明细") | |
| 53 | + private String typeDetailName; | |
| 54 | + | |
| 55 | + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 56 | + @ExcelProperty("规格") | |
| 57 | + private String specifications; | |
| 58 | + | |
| 59 | + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128") | |
| 60 | + @ExcelProperty("归属单位ID") | |
| 61 | + private Long belongCompanyId; | |
| 62 | + | |
| 63 | + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 64 | + @ExcelProperty("归属单位") | |
| 65 | + private String belongCompanyName; | |
| 66 | + | |
| 67 | + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 68 | + @ExcelProperty("出库数量") | |
| 69 | + private Long outInventoryNum; | |
| 70 | + | |
| 71 | + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1033") | |
| 72 | + @ExcelProperty("单位ID") | |
| 73 | + private Long unitId; | |
| 74 | + | |
| 75 | + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 76 | + @ExcelProperty("单位") | |
| 77 | + private String unitName; | |
| 78 | + | |
| 79 | + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 80 | + @ExcelProperty("出库日期") | |
| 81 | + private LocalDateTime outDate; | |
| 82 | + | |
| 83 | + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 84 | + @ExcelProperty("备注") | |
| 85 | + private String remark; | |
| 86 | + | |
| 87 | + @Schema(description = "创建时间") | |
| 88 | + @ExcelProperty("创建时间") | |
| 89 | + private LocalDateTime createTime; | |
| 90 | + | |
| 91 | + @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22618") | |
| 92 | + @ExcelProperty("部门ID") | |
| 93 | + private Long deptId; | |
| 94 | + | |
| 95 | + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") | |
| 96 | + @ExcelProperty("类型: 1:手动出库;2:养护类出库") | |
| 97 | + private Integer type; | |
| 98 | + | |
| 99 | +} | |
| 0 | 100 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.*; | |
| 5 | +import java.util.*; | |
| 6 | +import jakarta.validation.constraints.*; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - 物料出库新增/修改 Request VO") | |
| 11 | +@Data | |
| 12 | +public class MaterialInventoryOutSaveReqVO { | |
| 13 | + | |
| 14 | + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") | |
| 15 | + private Long id; | |
| 16 | + | |
| 17 | + @Schema(description = "入库批次号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 18 | + @NotEmpty(message = "入库批次号不能为空") | |
| 19 | + private String inventoryOutNo; | |
| 20 | + | |
| 21 | + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") | |
| 22 | + @NotNull(message = "物料ID不能为空") | |
| 23 | + private Long materialId; | |
| 24 | + | |
| 25 | + @Schema(description = "物料名称", example = "芋艿") | |
| 26 | + private String materialName; | |
| 27 | + | |
| 28 | + @Schema(description = "物料类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9209") | |
| 29 | + @NotNull(message = "物料类型ID不能为空") | |
| 30 | + private Long materialTypeId; | |
| 31 | + | |
| 32 | + @Schema(description = "耗材类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 33 | + @NotEmpty(message = "耗材类型名称不能为空") | |
| 34 | + private String materialTypeName; | |
| 35 | + | |
| 36 | + @Schema(description = "类别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12624") | |
| 37 | + @NotNull(message = "类别ID不能为空") | |
| 38 | + private Long typeId; | |
| 39 | + | |
| 40 | + @Schema(description = "类别名称:药品", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 41 | + @NotEmpty(message = "类别名称:药品不能为空") | |
| 42 | + private String typeName; | |
| 43 | + | |
| 44 | + @Schema(description = "类别明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24611") | |
| 45 | + @NotNull(message = "类别明细ID不能为空") | |
| 46 | + private Long typeDetailId; | |
| 47 | + | |
| 48 | + @Schema(description = "类别明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 49 | + @NotEmpty(message = "类别明细不能为空") | |
| 50 | + private String typeDetailName; | |
| 51 | + | |
| 52 | + @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 53 | + @NotEmpty(message = "规格不能为空") | |
| 54 | + private String specifications; | |
| 55 | + | |
| 56 | + @Schema(description = "归属单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128") | |
| 57 | + @NotNull(message = "归属单位ID不能为空") | |
| 58 | + private Long belongCompanyId; | |
| 59 | + | |
| 60 | + @Schema(description = "归属单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | |
| 61 | + @NotEmpty(message = "归属单位不能为空") | |
| 62 | + private String belongCompanyName; | |
| 63 | + | |
| 64 | + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 65 | + @NotNull(message = "出库数量不能为空") | |
| 66 | + private Long outInventoryNum; | |
| 67 | + | |
| 68 | + @Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1033") | |
| 69 | + @NotNull(message = "单位ID不能为空") | |
| 70 | + private Long unitId; | |
| 71 | + | |
| 72 | + @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 73 | + @NotEmpty(message = "单位不能为空") | |
| 74 | + private String unitName; | |
| 75 | + | |
| 76 | + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 77 | + @NotNull(message = "出库日期不能为空") | |
| 78 | + private LocalDateTime outDate; | |
| 79 | + | |
| 80 | + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 81 | + @NotEmpty(message = "备注不能为空") | |
| 82 | + private String remark; | |
| 83 | + | |
| 84 | + @Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22618") | |
| 85 | + @NotNull(message = "部门ID不能为空") | |
| 86 | + private Long deptId; | |
| 87 | + | |
| 88 | + @Schema(description = "类型: 1:手动出库;2:养护类出库", example = "1") | |
| 89 | + private Integer type; | |
| 90 | + | |
| 91 | +} | |
| 0 | 92 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeController.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeController.java
| 1 | -package com.zteits.urbanops.module.garden.controller.admin.material; | |
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialtype; | |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; | |
| 4 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeRespVO; | |
| 5 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeSaveReqVO; | |
| 6 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; | |
| 7 | -import com.zteits.urbanops.module.garden.service.material.MaterialTypeService; | |
| 3 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; | |
| 4 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeRespVO; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; | |
| 7 | +import com.zteits.urbanops.module.garden.service.materialtype.MaterialTypeService; | |
| 8 | 8 | import org.springframework.web.bind.annotation.*; |
| 9 | 9 | import jakarta.annotation.Resource; |
| 10 | 10 | import org.springframework.validation.annotation.Validated; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/MaterialTypeManagerController.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/MaterialTypeManagerController.java
| 1 | -package com.zteits.urbanops.module.garden.controller.admin.material; | |
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.materialtype; | |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; | |
| 4 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerRespVO; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; | |
| 3 | 6 | import org.springframework.web.bind.annotation.*; |
| 4 | 7 | import jakarta.annotation.Resource; |
| 5 | 8 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -8,7 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; |
| 8 | 11 | import io.swagger.v3.oas.annotations.Parameter; |
| 9 | 12 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 13 | |
| 11 | -import jakarta.validation.constraints.*; | |
| 12 | 14 | import jakarta.validation.*; |
| 13 | 15 | import jakarta.servlet.http.*; |
| 14 | 16 | import java.util.*; |
| ... | ... | @@ -25,9 +27,8 @@ import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; |
| 25 | 27 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; |
| 26 | 28 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; |
| 27 | 29 | |
| 28 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; | |
| 29 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; | |
| 30 | -import com.zteits.urbanops.module.garden.service.material.MaterialTypeManagerService; | |
| 30 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; | |
| 31 | +import com.zteits.urbanops.module.garden.service.materialtype.MaterialTypeManagerService; | |
| 31 | 32 | |
| 32 | 33 | @Tag(name = "管理后台 - 耗材类别管理") |
| 33 | 34 | @RestController | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerPageReqVO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerPageReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerRespVO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerRespVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeManagerSaveReqVO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeManagerSaveReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypePageReqVO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypePageReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeResp.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeResp.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeRespVO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeRespVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/material/vo/MaterialTypeSaveReqVO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialtype/vo/MaterialTypeSaveReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryInDO.java deleted
| 1 | -package com.zteits.urbanops.module.garden.dal.dataobject.material; | |
| 2 | - | |
| 3 | -import com.baomidou.mybatisplus.annotation.TableId; | |
| 4 | -import com.baomidou.mybatisplus.annotation.TableName; | |
| 5 | -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 6 | -import lombok.Data; | |
| 7 | - | |
| 8 | -import java.math.BigDecimal; | |
| 9 | -import java.util.Date; | |
| 10 | - | |
| 11 | -@TableName("garden_material_inventory_in") | |
| 12 | -@Data | |
| 13 | -public class MaterialInventoryInDO extends BaseDO { | |
| 14 | - @TableId | |
| 15 | - private Long id; | |
| 16 | - private String inventoryInNo; | |
| 17 | - private Long materialId; | |
| 18 | - private String materialName; | |
| 19 | - private Long materialTypeId; | |
| 20 | - private String materialTypeName; | |
| 21 | - private Long typeId; | |
| 22 | - private String typeName; | |
| 23 | - private Long typeDetailId; | |
| 24 | - private String typeDetailName; | |
| 25 | - private String specifications; | |
| 26 | - private Long belongCompanyId; | |
| 27 | - private String belongCompanyName; | |
| 28 | - private Long inInventoryNum; | |
| 29 | - private BigDecimal materialPrice; | |
| 30 | - private Long unitId; | |
| 31 | - private String unitName; | |
| 32 | - private Date buyDate; | |
| 33 | - private String supplierName; | |
| 34 | - private String contactsName; | |
| 35 | - private String contactsPhone; | |
| 36 | - private String status; | |
| 37 | - private Long deptId; | |
| 38 | -} | |
| 39 | 0 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryOutDO.java deleted
| 1 | -package com.zteits.urbanops.module.garden.dal.dataobject.material; | |
| 2 | - | |
| 3 | -import com.baomidou.mybatisplus.annotation.TableId; | |
| 4 | -import com.baomidou.mybatisplus.annotation.TableName; | |
| 5 | -import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 6 | -import lombok.Data; | |
| 7 | - | |
| 8 | -import java.util.Date; | |
| 9 | - | |
| 10 | -@TableName("garden_material_inventory_out") | |
| 11 | -@Data | |
| 12 | -public class MaterialInventoryOutDO extends BaseDO { | |
| 13 | - @TableId | |
| 14 | - private Long id; | |
| 15 | - private String inventoryOutNo; | |
| 16 | - private Long materialId; | |
| 17 | - private String materialName; | |
| 18 | - private Long materialTypeId; | |
| 19 | - private String materialTypeName; | |
| 20 | - private Long typeId; | |
| 21 | - private String typeName; | |
| 22 | - private Long typeDetailId; | |
| 23 | - private String typeDetailName; | |
| 24 | - private String specifications; | |
| 25 | - private Long belongCompanyId; | |
| 26 | - private String belongCompanyName; | |
| 27 | - private Long outInventoryNum; | |
| 28 | - private Long unitId; | |
| 29 | - private String unitName; | |
| 30 | - private Date outDate; | |
| 31 | - private String status; | |
| 32 | - private Integer type; | |
| 33 | - private Long deptId; | |
| 34 | -} | |
| 35 | 0 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialInventoryDO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventory/MaterialInventoryDO.java
| 1 | -package com.zteits.urbanops.module.garden.dal.dataobject.material; | |
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventory; | |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.annotation.TableId; |
| 4 | 4 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -29,4 +29,4 @@ public class MaterialInventoryDO extends BaseDO { |
| 29 | 29 | private String status; |
| 30 | 30 | private Long inventoryAlermNum; |
| 31 | 31 | private Long deptId; |
| 32 | -} | |
| 33 | 32 | \ No newline at end of file |
| 33 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryin/MaterialInventoryInDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.math.BigDecimal; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import com.baomidou.mybatisplus.annotation.*; | |
| 10 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 物料入库 DO | |
| 14 | + * | |
| 15 | + * @author 超级管理员 | |
| 16 | + */ | |
| 17 | +@TableName("garden_material_inventory_in") | |
| 18 | +@KeySequence("garden_material_inventory_in_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 19 | +@Data | |
| 20 | +@EqualsAndHashCode(callSuper = true) | |
| 21 | +@ToString(callSuper = true) | |
| 22 | +@Builder | |
| 23 | +@NoArgsConstructor | |
| 24 | +@AllArgsConstructor | |
| 25 | +public class MaterialInventoryInDO extends BaseDO { | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 入库ID | |
| 29 | + */ | |
| 30 | + @TableId | |
| 31 | + private Long id; | |
| 32 | + /** | |
| 33 | + * 入库批次号 | |
| 34 | + */ | |
| 35 | + private String inventoryInNo; | |
| 36 | + /** | |
| 37 | + * 物料ID | |
| 38 | + */ | |
| 39 | + private Long materialId; | |
| 40 | + /** | |
| 41 | + * 物料名称 | |
| 42 | + */ | |
| 43 | + private String materialName; | |
| 44 | + /** | |
| 45 | + * 物料类型ID | |
| 46 | + */ | |
| 47 | + private Long materialTypeId; | |
| 48 | + /** | |
| 49 | + * 耗材类型名称 | |
| 50 | + */ | |
| 51 | + private String materialTypeName; | |
| 52 | + /** | |
| 53 | + * 类别ID | |
| 54 | + */ | |
| 55 | + private Long typeId; | |
| 56 | + /** | |
| 57 | + * 类别名称:药品 | |
| 58 | + */ | |
| 59 | + private String typeName; | |
| 60 | + /** | |
| 61 | + * 类别明细ID | |
| 62 | + */ | |
| 63 | + private Long typeDetailId; | |
| 64 | + /** | |
| 65 | + * 类别明细 | |
| 66 | + */ | |
| 67 | + private String typeDetailName; | |
| 68 | + /** | |
| 69 | + * 规格 | |
| 70 | + */ | |
| 71 | + private String specifications; | |
| 72 | + /** | |
| 73 | + * 归属单位ID | |
| 74 | + */ | |
| 75 | + private Long belongCompanyId; | |
| 76 | + /** | |
| 77 | + * 归属单位 | |
| 78 | + */ | |
| 79 | + private String belongCompanyName; | |
| 80 | + /** | |
| 81 | + * 入库数量 | |
| 82 | + */ | |
| 83 | + private Long inInventoryNum; | |
| 84 | + /** | |
| 85 | + * 单价 | |
| 86 | + */ | |
| 87 | + private BigDecimal materialPrice; | |
| 88 | + /** | |
| 89 | + * 单位ID | |
| 90 | + */ | |
| 91 | + private Long unitId; | |
| 92 | + /** | |
| 93 | + * 单位 | |
| 94 | + */ | |
| 95 | + private String unitName; | |
| 96 | + /** | |
| 97 | + * 采购日期 | |
| 98 | + */ | |
| 99 | + private LocalDateTime buyDate; | |
| 100 | + /** | |
| 101 | + * 供应商名称 | |
| 102 | + */ | |
| 103 | + private String supplierName; | |
| 104 | + /** | |
| 105 | + * 联系人 | |
| 106 | + */ | |
| 107 | + private String contactsName; | |
| 108 | + /** | |
| 109 | + * 联系人 电话 | |
| 110 | + */ | |
| 111 | + private String contactsPhone; | |
| 112 | + /** | |
| 113 | + * 部门ID | |
| 114 | + */ | |
| 115 | + private Long deptId; | |
| 116 | + | |
| 117 | + | |
| 118 | +} | |
| 0 | 119 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialinventoryout/MaterialInventoryOutDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.time.LocalDateTime; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import com.baomidou.mybatisplus.annotation.*; | |
| 9 | +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 物料出库 DO | |
| 13 | + * | |
| 14 | + * @author 超级管理员 | |
| 15 | + */ | |
| 16 | +@TableName("garden_material_inventory_out") | |
| 17 | +@KeySequence("garden_material_inventory_out_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 18 | +@Data | |
| 19 | +@EqualsAndHashCode(callSuper = true) | |
| 20 | +@ToString(callSuper = true) | |
| 21 | +@Builder | |
| 22 | +@NoArgsConstructor | |
| 23 | +@AllArgsConstructor | |
| 24 | +public class MaterialInventoryOutDO extends BaseDO { | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 入库ID | |
| 28 | + */ | |
| 29 | + @TableId | |
| 30 | + private Long id; | |
| 31 | + /** | |
| 32 | + * 入库批次号 | |
| 33 | + */ | |
| 34 | + private String inventoryOutNo; | |
| 35 | + /** | |
| 36 | + * 物料ID | |
| 37 | + */ | |
| 38 | + private Long materialId; | |
| 39 | + /** | |
| 40 | + * 物料名称 | |
| 41 | + */ | |
| 42 | + private String materialName; | |
| 43 | + /** | |
| 44 | + * 物料类型ID | |
| 45 | + */ | |
| 46 | + private Long materialTypeId; | |
| 47 | + /** | |
| 48 | + * 耗材类型名称 | |
| 49 | + */ | |
| 50 | + private String materialTypeName; | |
| 51 | + /** | |
| 52 | + * 类别ID | |
| 53 | + */ | |
| 54 | + private Long typeId; | |
| 55 | + /** | |
| 56 | + * 类别名称:药品 | |
| 57 | + */ | |
| 58 | + private String typeName; | |
| 59 | + /** | |
| 60 | + * 类别明细ID | |
| 61 | + */ | |
| 62 | + private Long typeDetailId; | |
| 63 | + /** | |
| 64 | + * 类别明细 | |
| 65 | + */ | |
| 66 | + private String typeDetailName; | |
| 67 | + /** | |
| 68 | + * 规格 | |
| 69 | + */ | |
| 70 | + private String specifications; | |
| 71 | + /** | |
| 72 | + * 归属单位ID | |
| 73 | + */ | |
| 74 | + private Long belongCompanyId; | |
| 75 | + /** | |
| 76 | + * 归属单位 | |
| 77 | + */ | |
| 78 | + private String belongCompanyName; | |
| 79 | + /** | |
| 80 | + * 出库数量 | |
| 81 | + */ | |
| 82 | + private Long outInventoryNum; | |
| 83 | + /** | |
| 84 | + * 单位ID | |
| 85 | + */ | |
| 86 | + private Long unitId; | |
| 87 | + /** | |
| 88 | + * 单位 | |
| 89 | + */ | |
| 90 | + private String unitName; | |
| 91 | + /** | |
| 92 | + * 出库日期 | |
| 93 | + */ | |
| 94 | + private LocalDateTime outDate; | |
| 95 | + /** | |
| 96 | + * 备注 | |
| 97 | + */ | |
| 98 | + private String remark; | |
| 99 | + /** | |
| 100 | + * 部门ID | |
| 101 | + */ | |
| 102 | + private Long deptId; | |
| 103 | + /** | |
| 104 | + * 类型: 1:手动出库;2:养护类出库 | |
| 105 | + */ | |
| 106 | + private Integer type; | |
| 107 | + | |
| 108 | + | |
| 109 | +} | |
| 0 | 110 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeDO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeDO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/material/MaterialTypeManagerDO.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/materialtype/MaterialTypeManagerDO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryInMapper.java deleted
| 1 | -package com.zteits.urbanops.module.garden.dal.mysql.material; | |
| 2 | - | |
| 3 | -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 4 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryInDO; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface MaterialInventoryInMapper extends BaseMapperX<MaterialInventoryInDO> { | |
| 9 | - default MaterialInventoryInDO selectByNo(String inventoryInNo) { | |
| 10 | - return selectOne(new com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX<MaterialInventoryInDO>() | |
| 11 | - .eq(MaterialInventoryInDO::getInventoryInNo, inventoryInNo)); | |
| 12 | - } | |
| 13 | -} | |
| 14 | 0 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryOutMapper.java deleted
| 1 | -package com.zteits.urbanops.module.garden.dal.mysql.material; | |
| 2 | - | |
| 3 | -import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 4 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryOutDO; | |
| 5 | -import org.apache.ibatis.annotations.Mapper; | |
| 6 | - | |
| 7 | -@Mapper | |
| 8 | -public interface MaterialInventoryOutMapper extends BaseMapperX<MaterialInventoryOutDO> { | |
| 9 | -} | |
| 10 | 0 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialInventoryMapper.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventory/MaterialInventoryMapper.java
| 1 | -package com.zteits.urbanops.module.garden.dal.mysql.material; | |
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.materialinventory; | |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | 4 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 5 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; | |
| 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; | |
| 6 | 6 | import org.apache.ibatis.annotations.Mapper; |
| 7 | -import org.apache.ibatis.annotations.Param; | |
| 8 | 7 | |
| 9 | 8 | @Mapper |
| 10 | 9 | public interface MaterialInventoryMapper extends BaseMapperX<MaterialInventoryDO> { |
| ... | ... | @@ -37,4 +36,4 @@ public interface MaterialInventoryMapper extends BaseMapperX<MaterialInventoryDO |
| 37 | 36 | upd.setInventoryAlermNum(inventoryAlermNum); |
| 38 | 37 | return updateById(upd); |
| 39 | 38 | } |
| 40 | -} | |
| 41 | 39 | \ No newline at end of file |
| 40 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryin/MaterialInventoryInMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.materialinventoryin; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 物料入库 Mapper | |
| 14 | + * | |
| 15 | + * @author 超级管理员 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface MaterialInventoryInMapper extends BaseMapperX<MaterialInventoryInDO> { | |
| 19 | + | |
| 20 | + default PageResult<MaterialInventoryInDO> selectPage(MaterialInventoryInPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryInDO>() | |
| 22 | + .eqIfPresent(MaterialInventoryInDO::getInventoryInNo, reqVO.getInventoryInNo()) | |
| 23 | + .eqIfPresent(MaterialInventoryInDO::getMaterialId, reqVO.getMaterialId()) | |
| 24 | + .likeIfPresent(MaterialInventoryInDO::getMaterialName, reqVO.getMaterialName()) | |
| 25 | + .eqIfPresent(MaterialInventoryInDO::getMaterialTypeId, reqVO.getMaterialTypeId()) | |
| 26 | + .likeIfPresent(MaterialInventoryInDO::getMaterialTypeName, reqVO.getMaterialTypeName()) | |
| 27 | + .eqIfPresent(MaterialInventoryInDO::getTypeId, reqVO.getTypeId()) | |
| 28 | + .likeIfPresent(MaterialInventoryInDO::getTypeName, reqVO.getTypeName()) | |
| 29 | + .eqIfPresent(MaterialInventoryInDO::getTypeDetailId, reqVO.getTypeDetailId()) | |
| 30 | + .likeIfPresent(MaterialInventoryInDO::getTypeDetailName, reqVO.getTypeDetailName()) | |
| 31 | + .eqIfPresent(MaterialInventoryInDO::getSpecifications, reqVO.getSpecifications()) | |
| 32 | + .eqIfPresent(MaterialInventoryInDO::getBelongCompanyId, reqVO.getBelongCompanyId()) | |
| 33 | + .likeIfPresent(MaterialInventoryInDO::getBelongCompanyName, reqVO.getBelongCompanyName()) | |
| 34 | + .eqIfPresent(MaterialInventoryInDO::getInInventoryNum, reqVO.getInInventoryNum()) | |
| 35 | + .eqIfPresent(MaterialInventoryInDO::getMaterialPrice, reqVO.getMaterialPrice()) | |
| 36 | + .eqIfPresent(MaterialInventoryInDO::getUnitId, reqVO.getUnitId()) | |
| 37 | + .likeIfPresent(MaterialInventoryInDO::getUnitName, reqVO.getUnitName()) | |
| 38 | + .betweenIfPresent(MaterialInventoryInDO::getBuyDate, reqVO.getBuyDate()) | |
| 39 | + .likeIfPresent(MaterialInventoryInDO::getSupplierName, reqVO.getSupplierName()) | |
| 40 | + .likeIfPresent(MaterialInventoryInDO::getContactsName, reqVO.getContactsName()) | |
| 41 | + .eqIfPresent(MaterialInventoryInDO::getContactsPhone, reqVO.getContactsPhone()) | |
| 42 | + .betweenIfPresent(MaterialInventoryInDO::getCreateTime, reqVO.getCreateTime()) | |
| 43 | + .eqIfPresent(MaterialInventoryInDO::getDeptId, reqVO.getDeptId()) | |
| 44 | + .orderByDesc(MaterialInventoryInDO::getId)); | |
| 45 | + } | |
| 46 | + | |
| 47 | +} | |
| 0 | 48 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialinventoryout/MaterialInventoryOutMapper.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.materialinventoryout; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 6 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 物料出库 Mapper | |
| 14 | + * | |
| 15 | + * @author 超级管理员 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface MaterialInventoryOutMapper extends BaseMapperX<MaterialInventoryOutDO> { | |
| 19 | + | |
| 20 | + default PageResult<MaterialInventoryOutDO> selectPage(MaterialInventoryOutPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<MaterialInventoryOutDO>() | |
| 22 | + .eqIfPresent(MaterialInventoryOutDO::getInventoryOutNo, reqVO.getInventoryOutNo()) | |
| 23 | + .eqIfPresent(MaterialInventoryOutDO::getMaterialId, reqVO.getMaterialId()) | |
| 24 | + .likeIfPresent(MaterialInventoryOutDO::getMaterialName, reqVO.getMaterialName()) | |
| 25 | + .eqIfPresent(MaterialInventoryOutDO::getMaterialTypeId, reqVO.getMaterialTypeId()) | |
| 26 | + .likeIfPresent(MaterialInventoryOutDO::getMaterialTypeName, reqVO.getMaterialTypeName()) | |
| 27 | + .eqIfPresent(MaterialInventoryOutDO::getTypeId, reqVO.getTypeId()) | |
| 28 | + .likeIfPresent(MaterialInventoryOutDO::getTypeName, reqVO.getTypeName()) | |
| 29 | + .eqIfPresent(MaterialInventoryOutDO::getTypeDetailId, reqVO.getTypeDetailId()) | |
| 30 | + .likeIfPresent(MaterialInventoryOutDO::getTypeDetailName, reqVO.getTypeDetailName()) | |
| 31 | + .eqIfPresent(MaterialInventoryOutDO::getSpecifications, reqVO.getSpecifications()) | |
| 32 | + .eqIfPresent(MaterialInventoryOutDO::getBelongCompanyId, reqVO.getBelongCompanyId()) | |
| 33 | + .likeIfPresent(MaterialInventoryOutDO::getBelongCompanyName, reqVO.getBelongCompanyName()) | |
| 34 | + .eqIfPresent(MaterialInventoryOutDO::getOutInventoryNum, reqVO.getOutInventoryNum()) | |
| 35 | + .eqIfPresent(MaterialInventoryOutDO::getUnitId, reqVO.getUnitId()) | |
| 36 | + .likeIfPresent(MaterialInventoryOutDO::getUnitName, reqVO.getUnitName()) | |
| 37 | + .betweenIfPresent(MaterialInventoryOutDO::getOutDate, reqVO.getOutDate()) | |
| 38 | + .eqIfPresent(MaterialInventoryOutDO::getRemark, reqVO.getRemark()) | |
| 39 | + .betweenIfPresent(MaterialInventoryOutDO::getCreateTime, reqVO.getCreateTime()) | |
| 40 | + .eqIfPresent(MaterialInventoryOutDO::getDeptId, reqVO.getDeptId()) | |
| 41 | + .eqIfPresent(MaterialInventoryOutDO::getType, reqVO.getType()) | |
| 42 | + .orderByDesc(MaterialInventoryOutDO::getId)); | |
| 43 | + } | |
| 44 | + | |
| 45 | +} | |
| 0 | 46 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeManagerMapper.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeManagerMapper.java
| 1 | -package com.zteits.urbanops.module.garden.dal.mysql.material; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.materialtype; | |
| 4 | 2 | |
| 5 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 4 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 5 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; | |
| 7 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; | |
| 9 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; | |
| 11 | 9 | |
| 12 | 10 | /** |
| 13 | 11 | * 耗材类别管理 Mapper | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/material/MaterialTypeMapper.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/materialtype/MaterialTypeMapper.java
| 1 | -package com.zteits.urbanops.module.garden.dal.mysql.material; | |
| 1 | +package com.zteits.urbanops.module.garden.dal.mysql.materialtype; | |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 4 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 5 | 5 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 6 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; | |
| 7 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; | |
| 7 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; | |
| 8 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | |
| 10 | 10 | /** | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
| ... | ... | @@ -76,4 +76,9 @@ public interface ErrorCodeConstants { |
| 76 | 76 | ErrorCode MATERIAL_TYPE_MANAGER_NOT_EXISTS = new ErrorCode(1-100-004-002, "耗材类别管理不存在"); |
| 77 | 77 | |
| 78 | 78 | ErrorCode MATERIAL_NOT_EXISTS = new ErrorCode(1-100-004-003, "耗材管理不存在"); |
| 79 | + | |
| 80 | + ErrorCode MATERIAL_INVENTORY_IN_NOT_EXISTS = new ErrorCode(1-100-004-004, "物料入库不存在"); | |
| 81 | + | |
| 82 | + ErrorCode MATERIAL_INVENTORY_OUT_NOT_EXISTS = new ErrorCode(1-100-004-005, "物料出库不存在"); | |
| 83 | + | |
| 79 | 84 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.material; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 4 | -import com.baomidou.mybatisplus.core.conditions.Wrapper; | |
| 5 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 6 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; | |
| 7 | 4 | import org.springframework.stereotype.Service; |
| 8 | 5 | import jakarta.annotation.Resource; |
| 9 | 6 | import org.springframework.validation.annotation.Validated; |
| 10 | -import org.springframework.transaction.annotation.Transactional; | |
| 11 | 7 | |
| 12 | 8 | import java.util.*; |
| 13 | 9 | import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; |
| 14 | 10 | import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialDO; |
| 15 | 11 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 16 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 17 | 12 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 18 | 13 | |
| 19 | 14 | import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialMapper; |
| ... | ... | @@ -22,7 +17,6 @@ import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCo |
| 22 | 17 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 23 | 18 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0; |
| 24 | 19 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; |
| 25 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 26 | 20 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; |
| 27 | 21 | |
| 28 | 22 | /** | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryService.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryService.java
| 1 | -package com.zteits.urbanops.module.garden.service.material; | |
| 1 | +package com.zteits.urbanops.module.garden.service.materialinventory; | |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 4 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; | |
| 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; | |
| 6 | 6 | |
| 7 | 7 | public interface MaterialInventoryService { |
| 8 | 8 | PageResult<MaterialInventoryDO> selectPage(PageParam pageParam, MaterialInventoryDO where); |
| 9 | 9 | Boolean updateInventoryAlarmNum(Long materialId, Long alermNum); |
| 10 | -} | |
| 11 | 10 | \ No newline at end of file |
| 11 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialInventoryServiceImpl.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java
| 1 | -package com.zteits.urbanops.module.garden.service.material; | |
| 1 | +package com.zteits.urbanops.module.garden.service.materialinventory; | |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 4 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialInventoryDO; | |
| 6 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialInventoryMapper; | |
| 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventory.MaterialInventoryDO; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.mysql.materialinventory.MaterialInventoryMapper; | |
| 7 | 7 | import jakarta.annotation.Resource; |
| 8 | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 | |
| ... | ... | @@ -27,4 +27,4 @@ public class MaterialInventoryServiceImpl implements MaterialInventoryService { |
| 27 | 27 | public Boolean updateInventoryAlarmNum(Long materialId, Long alermNum) { |
| 28 | 28 | return mapper.updateInventoryAlarmNum(materialId, alermNum) > 0; |
| 29 | 29 | } |
| 30 | -} | |
| 31 | 30 | \ No newline at end of file |
| 31 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.materialinventoryin; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; | |
| 7 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 物料入库 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +public interface MaterialInventoryInService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建物料入库 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createMaterialInventoryIn(@Valid MaterialInventoryInSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新物料入库 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updateMaterialInventoryIn(@Valid MaterialInventoryInSaveReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除物料入库 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deleteMaterialInventoryIn(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除物料入库 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deleteMaterialInventoryInListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得物料入库 | |
| 48 | + * | |
| 49 | + * @param id 编号 | |
| 50 | + * @return 物料入库 | |
| 51 | + */ | |
| 52 | + MaterialInventoryInDO getMaterialInventoryIn(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得物料入库分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 物料入库分页 | |
| 59 | + */ | |
| 60 | + PageResult<MaterialInventoryInDO> getMaterialInventoryInPage(MaterialInventoryInPageReqVO pageReqVO); | |
| 61 | + | |
| 62 | +} | |
| 0 | 63 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryin/MaterialInventoryInServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.materialinventoryin; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import org.springframework.stereotype.Service; | |
| 5 | +import jakarta.annotation.Resource; | |
| 6 | +import org.springframework.validation.annotation.Validated; | |
| 7 | +import org.springframework.transaction.annotation.Transactional; | |
| 8 | + | |
| 9 | +import java.util.*; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryin.vo.*; | |
| 11 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryin.MaterialInventoryInDO; | |
| 12 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 13 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 14 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 15 | + | |
| 16 | +import com.zteits.urbanops.module.garden.dal.mysql.materialinventoryin.MaterialInventoryInMapper; | |
| 17 | + | |
| 18 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | |
| 20 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 21 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 物料入库 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author 超级管理员 | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class MaterialInventoryInServiceImpl implements MaterialInventoryInService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private MaterialInventoryInMapper materialInventoryInMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createMaterialInventoryIn(MaterialInventoryInSaveReqVO createReqVO) { | |
| 37 | + // 插入 | |
| 38 | + MaterialInventoryInDO materialInventoryIn = BeanUtils.toBean(createReqVO, MaterialInventoryInDO.class); | |
| 39 | + materialInventoryInMapper.insert(materialInventoryIn); | |
| 40 | + | |
| 41 | + // 返回 | |
| 42 | + return materialInventoryIn.getId(); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Override | |
| 46 | + public void updateMaterialInventoryIn(MaterialInventoryInSaveReqVO updateReqVO) { | |
| 47 | + // 校验存在 | |
| 48 | + validateMaterialInventoryInExists(updateReqVO.getId()); | |
| 49 | + // 更新 | |
| 50 | + MaterialInventoryInDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryInDO.class); | |
| 51 | + materialInventoryInMapper.updateById(updateObj); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public void deleteMaterialInventoryIn(Long id) { | |
| 56 | + // 校验存在 | |
| 57 | + validateMaterialInventoryInExists(id); | |
| 58 | + // 删除 | |
| 59 | + materialInventoryInMapper.deleteById(id); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public void deleteMaterialInventoryInListByIds(List<Long> ids) { | |
| 64 | + // 删除 | |
| 65 | + materialInventoryInMapper.deleteByIds(ids); | |
| 66 | + } | |
| 67 | + | |
| 68 | + | |
| 69 | + private void validateMaterialInventoryInExists(Long id) { | |
| 70 | + if (materialInventoryInMapper.selectById(id) == null) { | |
| 71 | + throw exception(MATERIAL_INVENTORY_IN_NOT_EXISTS); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public MaterialInventoryInDO getMaterialInventoryIn(Long id) { | |
| 77 | + return materialInventoryInMapper.selectById(id); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<MaterialInventoryInDO> getMaterialInventoryInPage(MaterialInventoryInPageReqVO pageReqVO) { | |
| 82 | + return materialInventoryInMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | +} | |
| 0 | 86 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.materialinventoryout; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | +import jakarta.validation.*; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; | |
| 6 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; | |
| 7 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 8 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 物料出库 Service 接口 | |
| 12 | + * | |
| 13 | + * @author 超级管理员 | |
| 14 | + */ | |
| 15 | +public interface MaterialInventoryOutService { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 创建物料出库 | |
| 19 | + * | |
| 20 | + * @param createReqVO 创建信息 | |
| 21 | + * @return 编号 | |
| 22 | + */ | |
| 23 | + Long createMaterialInventoryOut(@Valid MaterialInventoryOutSaveReqVO createReqVO); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 更新物料出库 | |
| 27 | + * | |
| 28 | + * @param updateReqVO 更新信息 | |
| 29 | + */ | |
| 30 | + void updateMaterialInventoryOut(@Valid MaterialInventoryOutSaveReqVO updateReqVO); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 删除物料出库 | |
| 34 | + * | |
| 35 | + * @param id 编号 | |
| 36 | + */ | |
| 37 | + void deleteMaterialInventoryOut(Long id); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量删除物料出库 | |
| 41 | + * | |
| 42 | + * @param ids 编号 | |
| 43 | + */ | |
| 44 | + void deleteMaterialInventoryOutListByIds(List<Long> ids); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得物料出库 | |
| 48 | + * | |
| 49 | + * @param id 编号 | |
| 50 | + * @return 物料出库 | |
| 51 | + */ | |
| 52 | + MaterialInventoryOutDO getMaterialInventoryOut(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得物料出库分页 | |
| 56 | + * | |
| 57 | + * @param pageReqVO 分页查询 | |
| 58 | + * @return 物料出库分页 | |
| 59 | + */ | |
| 60 | + PageResult<MaterialInventoryOutDO> getMaterialInventoryOutPage(MaterialInventoryOutPageReqVO pageReqVO); | |
| 61 | + | |
| 62 | +} | |
| 0 | 63 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.service.materialinventoryout; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import org.springframework.stereotype.Service; | |
| 5 | +import jakarta.annotation.Resource; | |
| 6 | +import org.springframework.validation.annotation.Validated; | |
| 7 | +import org.springframework.transaction.annotation.Transactional; | |
| 8 | + | |
| 9 | +import java.util.*; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.*; | |
| 11 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialinventoryout.MaterialInventoryOutDO; | |
| 12 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 13 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 14 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 15 | + | |
| 16 | +import com.zteits.urbanops.module.garden.dal.mysql.materialinventoryout.MaterialInventoryOutMapper; | |
| 17 | + | |
| 18 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | |
| 20 | +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 21 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 物料出库 Service 实现类 | |
| 25 | + * | |
| 26 | + * @author 超级管理员 | |
| 27 | + */ | |
| 28 | +@Service | |
| 29 | +@Validated | |
| 30 | +public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutService { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private MaterialInventoryOutMapper materialInventoryOutMapper; | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Long createMaterialInventoryOut(MaterialInventoryOutSaveReqVO createReqVO) { | |
| 37 | + // 插入 | |
| 38 | + MaterialInventoryOutDO materialInventoryOut = BeanUtils.toBean(createReqVO, MaterialInventoryOutDO.class); | |
| 39 | + materialInventoryOutMapper.insert(materialInventoryOut); | |
| 40 | + | |
| 41 | + // 返回 | |
| 42 | + return materialInventoryOut.getId(); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @Override | |
| 46 | + public void updateMaterialInventoryOut(MaterialInventoryOutSaveReqVO updateReqVO) { | |
| 47 | + // 校验存在 | |
| 48 | + validateMaterialInventoryOutExists(updateReqVO.getId()); | |
| 49 | + // 更新 | |
| 50 | + MaterialInventoryOutDO updateObj = BeanUtils.toBean(updateReqVO, MaterialInventoryOutDO.class); | |
| 51 | + materialInventoryOutMapper.updateById(updateObj); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public void deleteMaterialInventoryOut(Long id) { | |
| 56 | + // 校验存在 | |
| 57 | + validateMaterialInventoryOutExists(id); | |
| 58 | + // 删除 | |
| 59 | + materialInventoryOutMapper.deleteById(id); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public void deleteMaterialInventoryOutListByIds(List<Long> ids) { | |
| 64 | + // 删除 | |
| 65 | + materialInventoryOutMapper.deleteByIds(ids); | |
| 66 | + } | |
| 67 | + | |
| 68 | + | |
| 69 | + private void validateMaterialInventoryOutExists(Long id) { | |
| 70 | + if (materialInventoryOutMapper.selectById(id) == null) { | |
| 71 | + throw exception(MATERIAL_INVENTORY_OUT_NOT_EXISTS); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + | |
| 75 | + @Override | |
| 76 | + public MaterialInventoryOutDO getMaterialInventoryOut(Long id) { | |
| 77 | + return materialInventoryOutMapper.selectById(id); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public PageResult<MaterialInventoryOutDO> getMaterialInventoryOutPage(MaterialInventoryOutPageReqVO pageReqVO) { | |
| 82 | + return materialInventoryOutMapper.selectPage(pageReqVO); | |
| 83 | + } | |
| 84 | + | |
| 85 | +} | |
| 0 | 86 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerService.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerService.java
| 1 | -package com.zteits.urbanops.module.garden.service.material; | |
| 1 | +package com.zteits.urbanops.module.garden.service.materialtype; | |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | + | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; | |
| 4 | 7 | import jakarta.validation.*; |
| 5 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; | |
| 6 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; | |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; | |
| 7 | 9 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 8 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * 耗材类别管理 Service 接口 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeManagerServiceImpl.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeManagerServiceImpl.java
| 1 | -package com.zteits.urbanops.module.garden.service.material; | |
| 1 | +package com.zteits.urbanops.module.garden.service.materialtype; | |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 3 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerPageReqVO; | |
| 4 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeManagerSaveReqVO; | |
| 4 | 5 | import org.springframework.stereotype.Service; |
| 5 | 6 | import jakarta.annotation.Resource; |
| 6 | 7 | import org.springframework.validation.annotation.Validated; |
| 7 | -import org.springframework.transaction.annotation.Transactional; | |
| 8 | 8 | |
| 9 | 9 | import java.util.*; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.*; | |
| 11 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeManagerDO; | |
| 10 | + | |
| 11 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeManagerDO; | |
| 12 | 12 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 13 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 14 | 13 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 15 | 14 | |
| 16 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialTypeManagerMapper; | |
| 15 | +import com.zteits.urbanops.module.garden.dal.mysql.materialtype.MaterialTypeManagerMapper; | |
| 17 | 16 | |
| 18 | 17 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 19 | 18 | import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; |
| 20 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | |
| 21 | 19 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; |
| 22 | 20 | |
| 23 | 21 | /** | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeService.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeService.java
| 1 | -package com.zteits.urbanops.module.garden.service.material; | |
| 1 | +package com.zteits.urbanops.module.garden.service.materialtype; | |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | 4 | |
| 5 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; | |
| 6 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeResp; | |
| 7 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeSaveReqVO; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeResp; | |
| 7 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; | |
| 8 | 8 | import jakarta.validation.*; |
| 9 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; | |
| 9 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; | |
| 10 | 10 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 11 | 11 | |
| 12 | 12 | /** | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/material/MaterialTypeServiceImpl.java renamed to urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialtype/MaterialTypeServiceImpl.java
| 1 | -package com.zteits.urbanops.module.garden.service.material; | |
| 1 | +package com.zteits.urbanops.module.garden.service.materialtype; | |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 4 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypePageReqVO; | |
| 5 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeResp; | |
| 6 | -import com.zteits.urbanops.module.garden.controller.admin.material.vo.MaterialTypeSaveReqVO; | |
| 4 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypePageReqVO; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeResp; | |
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.materialtype.vo.MaterialTypeSaveReqVO; | |
| 7 | 7 | import org.apache.commons.collections4.CollectionUtils; |
| 8 | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 | import jakarta.annotation.Resource; |
| ... | ... | @@ -12,11 +12,11 @@ import org.springframework.validation.annotation.Validated; |
| 12 | 12 | import java.util.*; |
| 13 | 13 | import java.util.stream.Collectors; |
| 14 | 14 | |
| 15 | -import com.zteits.urbanops.module.garden.dal.dataobject.material.MaterialTypeDO; | |
| 15 | +import com.zteits.urbanops.module.garden.dal.dataobject.materialtype.MaterialTypeDO; | |
| 16 | 16 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 17 | 17 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 18 | 18 | |
| 19 | -import com.zteits.urbanops.module.garden.dal.mysql.material.MaterialTypeMapper; | |
| 19 | +import com.zteits.urbanops.module.garden.dal.mysql.materialtype.MaterialTypeMapper; | |
| 20 | 20 | |
| 21 | 21 | import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; |
| 22 | 22 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ... | ... |