Compare commits
	
		
			5 Commits
		
	
	
		
			5222132678
			...
			158254b880
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 158254b880 | ||
|   | a6789cb3b1 | ||
|   | 3013afb9c7 | ||
|   | 967e66a7da | ||
|   | 87bbe404ce | 
| @ -0,0 +1,12 @@ | ||||
| package cn.iocoder.yudao.common; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.exception.ErrorCode; | ||||
| 
 | ||||
| /** | ||||
|  * 维修异常定义类 | ||||
|  * @author 小李 | ||||
|  * @date 11:43 2024/9/14 | ||||
| **/ | ||||
| public interface RepairErrorCodeConstants { | ||||
|     ErrorCode GOODS_IS_EMPTY = new ErrorCode(500, "商品为空"); | ||||
| } | ||||
| @ -5,19 +5,21 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; | ||||
| import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService; | ||||
| import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO; | ||||
| import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| 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 io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| /** | ||||
|  * 采购单领料单(DlRepairSo)表控制层 | ||||
|  * | ||||
|  * @author 小李 | ||||
|  * @date 9:13 2024/9/13 | ||||
| **/ | ||||
|  **/ | ||||
| @RestController | ||||
| @RequestMapping("/repair/so") | ||||
| public class DlRepairSoController { | ||||
| @ -28,19 +30,35 @@ public class DlRepairSoController { | ||||
|     private DlRepairSoService dlRepairSoService; | ||||
| 
 | ||||
|     /** | ||||
|      * 分页查询所有数据 | ||||
|      * 采购单/领料单 新增 | ||||
|      * | ||||
|      * @param repairSoRespVO 采购单对象 | ||||
|      * @author 小李 | ||||
|      * @date 16:12 2024/9/13 | ||||
|      * @date 10:49 2024/9/14 | ||||
|      **/ | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "采购单/领料单新增") | ||||
|     public CommonResult<?> createRepairSo(@RequestBody DlRepairSoRespVO repairSoRespVO) { | ||||
|         dlRepairSoService.createRepairSo(repairSoRespVO); | ||||
|         return CommonResult.ok(); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 采购单/领料单新增分页 | ||||
|      * | ||||
|      * @param repairSoReqVO 查询对象 | ||||
|      * @param pageNo 页码 | ||||
|      * @param pageSize 条数 | ||||
|     **/ | ||||
|      * @author 小李 | ||||
|      * @date 18:14 2024/9/14 | ||||
|      **/ | ||||
|     @GetMapping("/page") | ||||
|     public CommonResult<?> getDlRepairSoPage(DlRepairSoReqVO repairSoReqVO, | ||||
|                                              @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, | ||||
|                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||||
|     @Operation(summary = "采购单/领料单新增分页") | ||||
|     public CommonResult<?> getRepairSoPage(DlRepairSoReqVO repairSoReqVO, | ||||
|                                            @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, | ||||
|                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { | ||||
|         Page<DlRepairSo> page = new Page<>(pageNo, pageSize); | ||||
|         return null; | ||||
|         return success(dlRepairSoService.getRepairSoPage(repairSoReqVO, page)); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -1,8 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.stockOperate.mapper; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; | ||||
| import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO; | ||||
| 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_so(采购单领料单)】的数据库操作Mapper | ||||
| @ -12,6 +16,7 @@ import org.apache.ibatis.annotations.Mapper; | ||||
| @Mapper | ||||
| public interface DlRepairSoMapper extends BaseMapper<DlRepairSo> { | ||||
| 
 | ||||
|     IPage<DlRepairSo> getRepairSoPage(@Param("map") DlRepairSoReqVO repairSoReqVO, Page<DlRepairSo> page); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -1,6 +1,11 @@ | ||||
| package cn.iocoder.yudao.module.stockOperate.service; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; | ||||
| import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoReqVO; | ||||
| import cn.iocoder.yudao.module.stockOperate.vo.DlRepairSoRespVO; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| 
 | ||||
| /** | ||||
| @ -9,4 +14,21 @@ import com.baomidou.mybatisplus.extension.service.IService; | ||||
|  * @date 9:09 2024/9/13 | ||||
| **/ | ||||
| public interface DlRepairSoService extends IService<DlRepairSo> { | ||||
| 
 | ||||
|     /** | ||||
|      * 采购单/领料单 新增 | ||||
|      * @author 小李 | ||||
|      * @date 10:49 2024/9/14 | ||||
|      * @param repairSoRespVO 采购单对象 | ||||
|      **/ | ||||
|     void createRepairSo(DlRepairSoRespVO repairSoRespVO); | ||||
| 
 | ||||
|     /** | ||||
|      * 采购单/领料单新增分页 | ||||
|      * | ||||
|      * @param repairSoReqVO 查询对象 | ||||
|      * @author 小李 | ||||
|      * @date 18:14 2024/9/14 | ||||
|      **/ | ||||
|     IPage<DlRepairSo> getRepairSoPage(DlRepairSoReqVO repairSoReqVO, Page<DlRepairSo> page); | ||||
| } | ||||
|  | ||||
| @ -1,11 +1,27 @@ | ||||
| package cn.iocoder.yudao.module.stockOperate.service.impl; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollectionUtil; | ||||
| import cn.iocoder.yudao.common.RepairErrorCodeConstants; | ||||
| 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 com.baomidou.dynamic.datasource.annotation.DSTransactional; | ||||
| 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; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| 
 | ||||
| import java.util.List; | ||||
| import java.util.stream.Collectors; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||
| 
 | ||||
| /** | ||||
|  * 针对表【dl_repair_so(采购单领料单)】的数据库操作Service实现 | ||||
|  * | ||||
| @ -16,6 +32,39 @@ import org.springframework.stereotype.Service; | ||||
| public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepairSo> | ||||
|         implements DlRepairSoService { | ||||
| 
 | ||||
|     @Resource | ||||
|     private DlRepairSoiService repairSoiService; | ||||
| 
 | ||||
|     /** | ||||
|      * 采购单/领料单 新增 | ||||
|      * @author 小李 | ||||
|      * @date 10:49 2024/9/14 | ||||
|      * @param repairSoRespVO 采购单对象 | ||||
|      **/ | ||||
|     @DSTransactional | ||||
|     @Override | ||||
|     public void createRepairSo(DlRepairSoRespVO repairSoRespVO){ | ||||
|         // 新增主表 | ||||
|         baseMapper.insertOrUpdate(repairSoRespVO); | ||||
|         // 新增子表 | ||||
|         if (CollectionUtil.isEmpty(repairSoRespVO.getGoodsList())){ | ||||
|             throw exception(RepairErrorCodeConstants.GOODS_IS_EMPTY); | ||||
|         } | ||||
|         repairSoRespVO.getGoodsList().forEach(item -> item.setSoId(repairSoRespVO.getId())); | ||||
|         repairSoiService.saveBatch(repairSoRespVO.getGoodsList()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 采购单/领料单新增分页 | ||||
|      * | ||||
|      * @param repairSoReqVO 查询对象 | ||||
|      * @author 小李 | ||||
|      * @date 18:14 2024/9/14 | ||||
|      **/ | ||||
|     @Override | ||||
|     public IPage<DlRepairSo> getRepairSoPage(DlRepairSoReqVO repairSoReqVO, Page<DlRepairSo> page){ | ||||
|         return baseMapper.getRepairSoPage(repairSoReqVO, page); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -1,7 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.stockOperate.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.module.project.entity.RepairWares; | ||||
| import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSo; | ||||
| import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi; | ||||
| import lombok.Data; | ||||
| import org.apache.poi.ss.formula.functions.T; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 采购单/领料单 响应VO | ||||
| @ -10,4 +15,7 @@ import lombok.Data; | ||||
| **/ | ||||
| @Data | ||||
| public class DlRepairSoRespVO extends DlRepairSo { | ||||
| 
 | ||||
|     // 商品List | ||||
|     private List<DlRepairSoi> goodsList; | ||||
| } | ||||
|  | ||||
| @ -43,4 +43,9 @@ | ||||
|         from dl_repair_so so | ||||
|         where so.deleted = '0' | ||||
|     </sql> | ||||
| 
 | ||||
|     <select id="getRepairSoPage" resultMap="BaseResultMap"> | ||||
|         <include refid="Base_SQL"/> | ||||
|         and so_type = #{map.soType} | ||||
|     </select> | ||||
| </mapper> | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user