diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java index fccd3952..8de6d485 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoController.java @@ -37,7 +37,7 @@ public class DlRepairSoController { * @date 10:49 2024/9/14 **/ @PostMapping("/create") - @Operation(summary = "采购单/领料单新增") + @Operation(summary = "采购单/领料单 新增") public CommonResult createRepairSo(@RequestBody DlRepairSoRespVO repairSoRespVO) { dlRepairSoService.createRepairSo(repairSoRespVO); return CommonResult.ok(); @@ -53,12 +53,26 @@ public class DlRepairSoController { * @date 18:14 2024/9/14 **/ @GetMapping("/page") - @Operation(summary = "采购单/领料单新增分页") + @Operation(summary = "采购单/领料单 分页") public CommonResult getRepairSoPage(DlRepairSoReqVO repairSoReqVO, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { Page page = new Page<>(pageNo, pageSize); return success(dlRepairSoService.getRepairSoPage(repairSoReqVO, page)); } + + /** + * 采购单/领料单 作废 + * + * @author 小李 + * @date 11:12 2024/9/18 + * @param repairSoReqVO 作废对象 + **/ + @PostMapping("/void") + @Operation(summary = "采购单/领料单 作废") + public CommonResult voidRepairSo(@RequestBody DlRepairSoReqVO repairSoReqVO) { + dlRepairSoService.voidRepairSo(repairSoReqVO); + return CommonResult.ok(); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java index 15888bd3..e23b4fec 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/controller/admin/DlRepairSoiController.java @@ -1,12 +1,21 @@ package cn.iocoder.yudao.module.stockOperate.controller.admin; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService; +import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + /** * 采购单领料单子表(DlRepairSoi)表控制层 * @author 小李 @@ -21,60 +30,22 @@ public class DlRepairSoiController{ @Resource private DlRepairSoiService dlRepairSoiService; -// /** -// * 分页查询所有数据 -// * -// * @param page 分页对象 -// * @param dlRepairSoi 查询实体 -// * @return 所有数据 -// */ -// @GetMapping -// public R selectAll(Page page, DlRepairSoi dlRepairSoi) { -// return success(this.dlRepairSoiService.page(page, new QueryWrapper<>(dlRepairSoi))); -// } -// -// /** -// * 通过主键查询单条数据 -// * -// * @param id 主键 -// * @return 单条数据 -// */ -// @GetMapping("{id}") -// public R selectOne(@PathVariable Serializable id) { -// return success(this.dlRepairSoiService.getById(id)); -// } -// -// /** -// * 新增数据 -// * -// * @param dlRepairSoi 实体对象 -// * @return 新增结果 -// */ -// @PostMapping -// public R insert(@RequestBody DlRepairSoi dlRepairSoi) { -// return success(this.dlRepairSoiService.save(dlRepairSoi)); -// } -// -// /** -// * 修改数据 -// * -// * @param dlRepairSoi 实体对象 -// * @return 修改结果 -// */ -// @PutMapping -// public R update(@RequestBody DlRepairSoi dlRepairSoi) { -// return success(this.dlRepairSoiService.updateById(dlRepairSoi)); -// } -// -// /** -// * 删除数据 -// * -// * @param idList 主键结合 -// * @return 删除结果 -// */ -// @DeleteMapping -// public R delete(@RequestParam("idList") List idList) { -// return success(this.dlRepairSoiService.removeByIds(idList)); -// } + /** + * 采购单领料单子表 分页 + * + * @author 小李 + * @date 10:44 2024/9/18 + * @param repairSoiReqVO 查询对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "采购单领料单子表 分页") + public CommonResult getRepairSoiPage(DlRepairSoiReqVO repairSoiReqVO, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairSoiService.getRepairSoiPage(repairSoiReqVO, page)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java index c7067e42..c7bbb867 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSo.java @@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; @@ -69,6 +71,8 @@ public class DlRepairSo extends TenantBaseDO { /** * 采购时间/领料时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern="yyyy-MM-dd") private Date soTime; /** diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSoi.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSoi.java index 295e0b67..02309b59 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSoi.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/entity/DlRepairSoi.java @@ -29,10 +29,15 @@ public class DlRepairSoi extends TenantBaseDO { private String id; /** - * 采购单ID(dl_repair_so表的ID) + * 采购单/领料单ID(dl_repair_so表的ID) */ private String soId; + /** + * 子表类型(字典repair_so_type) + **/ + private String soiType; + /** * 配件表ID(dl_base_type的ID) */ diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/mapper/DlRepairSoiMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/mapper/DlRepairSoiMapper.java index 0eb5a78c..4551b233 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/mapper/DlRepairSoiMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/mapper/DlRepairSoiMapper.java @@ -1,8 +1,12 @@ package cn.iocoder.yudao.module.stockOperate.mapper; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; +import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 针对表【dl_repair_soi(采购单领料单子表)】的数据库操作Mapper @@ -11,6 +15,15 @@ import org.apache.ibatis.annotations.Mapper; **/ @Mapper public interface DlRepairSoiMapper extends BaseMapper { + + /** + * 采购单领料单子表 分页 + * + * @author 小李 + * @date 10:44 2024/9/18 + * @param repairSoiReqVO 查询对象 + **/ + IPage getRepairSoiPage(@Param("map") DlRepairSoiReqVO repairSoiReqVO, Page page); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoService.java index 610f4cd2..14a3bb91 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoService.java @@ -31,4 +31,13 @@ public interface DlRepairSoService extends IService { * @date 18:14 2024/9/14 **/ IPage getRepairSoPage(DlRepairSoReqVO repairSoReqVO, Page page); + + /** + * 采购单/领料单 作废 + * + * @author 小李 + * @date 11:12 2024/9/18 + * @param repairSoReqVO 作废对象 + **/ + void voidRepairSo(DlRepairSoReqVO repairSoReqVO); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoiService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoiService.java index 15b0a3e6..a634f621 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoiService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/DlRepairSoiService.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.stockOperate.service; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; +import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; /** @@ -9,4 +12,13 @@ import com.baomidou.mybatisplus.extension.service.IService; * @date 9:09 2024/9/13 **/ public interface DlRepairSoiService extends IService { + + /** + * 采购单领料单子表 分页 + * + * @author 小李 + * @date 10:44 2024/9/18 + * @param repairSoiReqVO 查询对象 + **/ + IPage getRepairSoiPage(DlRepairSoiReqVO repairSoiReqVO, Page page); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java index 4e839995..a44c6f5a 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java @@ -1,15 +1,21 @@ package cn.iocoder.yudao.module.stockOperate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.common.RepairErrorCodeConstants; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.company.entity.Company; +import cn.iocoder.yudao.module.company.service.CompanyService; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; -import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; import cn.iocoder.yudao.module.stockOperate.mapper.DlRepairSoMapper; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService; import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO; import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -17,9 +23,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.List; -import java.util.stream.Collectors; - import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; /** @@ -35,6 +38,12 @@ public class DlRepairSoServiceImpl extends ServiceImpl getRepairSoPage(DlRepairSoReqVO repairSoReqVO, Page page){ return baseMapper.getRepairSoPage(repairSoReqVO, page); } + + /** + * 采购单/领料单 作废 + * + * @author 小李 + * @date 11:12 2024/9/18 + * @param repairSoReqVO 作废对象 + **/ + @Override + public void voidRepairSo(DlRepairSoReqVO repairSoReqVO){ + baseMapper.updateById(repairSoReqVO); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoiServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoiServiceImpl.java index 353728fd..9919118a 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoiServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoiServiceImpl.java @@ -3,6 +3,9 @@ package cn.iocoder.yudao.module.stockOperate.service.impl; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; import cn.iocoder.yudao.module.stockOperate.mapper.DlRepairSoiMapper; import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService; +import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoiReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -15,6 +18,18 @@ import org.springframework.stereotype.Service; @Service public class DlRepairSoiServiceImpl extends ServiceImpl implements DlRepairSoiService { + + /** + * 采购单领料单子表 分页 + * + * @author 小李 + * @date 10:44 2024/9/18 + * @param repairSoiReqVO 查询对象 + **/ + @Override + public IPage getRepairSoiPage(DlRepairSoiReqVO repairSoiReqVO, Page page){ + return baseMapper.getRepairSoiPage(repairSoiReqVO, page); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoReqVO.java index a9997442..d9c4b607 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoReqVO.java @@ -1,7 +1,13 @@ package cn.iocoder.yudao.module.stockOperate.vo; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; /** * 采购单/领料单 请求VO @@ -10,4 +16,8 @@ import lombok.Data; **/ @Data public class DlRepairSoReqVO extends DlRepairSo { + + @Schema(description = "时间区间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] searchTimeArray; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoiReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoiReqVO.java index 0a3849de..a8366783 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoiReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/vo/DlRepairSoiReqVO.java @@ -1,7 +1,13 @@ package cn.iocoder.yudao.module.stockOperate.vo; import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; /** * 采购单/领料单子表 请求VO @@ -10,4 +16,14 @@ import lombok.Data; **/ @Data public class DlRepairSoiReqVO extends DlRepairSoi { + + @Schema(pattern = "时间区间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] searchTimeArray; + + @Schema(pattern = "单据状态") + private String soStatus; + + @Schema(pattern = "门店") + private String corpId; } diff --git a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml index 72943820..b1541d9b 100644 --- a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoMapper.xml @@ -21,6 +21,9 @@ + + + @@ -39,13 +42,35 @@ remark, corp_id, corp_name, - dept_id + dept_id, + create_time, + update_time, + updater from dl_repair_so so where so.deleted = '0' diff --git a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoiMapper.xml b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoiMapper.xml index 17645a27..894d6346 100644 --- a/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoiMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/stockOperate/DlRepairSoiMapper.xml @@ -7,6 +7,7 @@ + @@ -16,15 +17,41 @@ - select id, + select soi.id, so_id, + soi_type, goods_id, goods_type, ware_id, goods_count, goods_price, - remark + soi.remark, + so.create_time, + so.so_status, + so.corp_id from dl_repair_soi soi + left join + dl_repair_so so + on soi.so_id = so.id where soi.deleted = '0' + +