This commit is contained in:
PQZ 2024-09-18 08:46:18 +08:00
commit cbdb65411e
11 changed files with 159 additions and 17 deletions

View File

@ -69,7 +69,7 @@ public class AppSwiperController extends BaseController
/**
* 查询请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:swiper:list')")
@GetMapping("/system/appSwiper/list")
public TableDataInfo list(AppSwiper appSwiper)
{
@ -81,7 +81,7 @@ public class AppSwiperController extends BaseController
/**
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:swiper:export')")
@PostMapping("/system/appSwiper/export")
public void export(HttpServletResponse response, AppSwiper appSwiper)
{
@ -93,7 +93,7 @@ public class AppSwiperController extends BaseController
/**
* 获取请填写功能名称详细信息
*/
@PreAuthorize("@ss.hasPermi('system:swiper:query')")
@GetMapping(value = "/system/appSwiper/{swiperId}")
public CommonResult getInfo(@PathVariable("swiperId") Long swiperId)
{
@ -103,7 +103,7 @@ public class AppSwiperController extends BaseController
/**
* 新增请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:swiper:add')")
@PostMapping("/system/appSwiper/add")
public CommonResult add(@RequestBody AppSwiper appSwiper)
{

View File

@ -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, "商品为空");
}

View File

@ -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));
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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>

View File

@ -161,6 +161,27 @@ public class SysLoginController {
authLoginReqVO.setPassword(loginBody.getPassword());
return success(loginService.login(authLoginReqVO));
}
/**
* 登录方法
*
* @param loginBody 登录信息
* @return 结果
*/
@PostMapping("/loginJcApp")
public CommonResult loginJcApp(@RequestBody LoginBody loginBody) throws Exception {
String userName = loginBody.getUsername();
AdminUserDO user = userService.getUserByUsername(userName);
if (ObjectUtil.isEmpty(user)) {
return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST);
}
AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO();
authLoginReqVO.setUsername(loginBody.getUsername());
authLoginReqVO.setPassword(loginBody.getPassword());
return success(loginService.login(authLoginReqVO));
}
/**
* 司机登录方法
*

View File

@ -108,7 +108,8 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> {
.stream(new ByteArrayInputStream(content), content.length, -1) // 文件内容
.build());
// 拼接返回路径
return config.getDomain() + "/" + path;
// return config.getDomain() + "/" + path;
return config.getBucket() + "/" + path;
}
@Override

View File

@ -224,6 +224,7 @@ yudao:
- /websocket/**
- /admin-api/rescue/wxLoginRescue
- /admin-api/rescue/wxLoginJc
- /admin-api/rescue/loginJcApp
websocket:
enable: true # websocket的开关
path: /infra/ws # 路径