8/14 工位单据管理
parent
fda2478831
commit
904e8a9950
@ -0,0 +1,77 @@
|
||||
package com.glxp.api.controller.basic;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.entity.basic.BasicCollectBustypeEntity;
|
||||
import com.glxp.api.req.basic.BasicCollectBusTypeRequest;
|
||||
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.basic.BasicCollectBusTypeResponse;
|
||||
import com.glxp.api.service.basic.BasicCollectBustypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : zhuhzu
|
||||
* @date : 2024/8/13 9:49
|
||||
* @modyified By :
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class BasicCollectBusTypeController {
|
||||
|
||||
@Resource
|
||||
private BasicCollectBustypeService basicCollectBustypeService;
|
||||
|
||||
@GetMapping("/udiwms/basic/collectBusType/getList")
|
||||
public BaseResponse page(BasicCollectBusTypeRequest request) {
|
||||
List<BasicCollectBusTypeResponse> page = basicCollectBustypeService.filterList(request);
|
||||
PageInfo<BasicCollectBusTypeResponse> pageInfo = new PageInfo<>(page);
|
||||
PageSimpleResponse<BasicCollectBusTypeResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(page);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/udiwms/basic/collectPoints/addCollectBusType")
|
||||
public BaseResponse addCollectBusType(@RequestBody BasicCollectBustypeEntity entity) {
|
||||
entity.setId(IdUtil.getSnowflakeNextId());
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setUpdateTime(new Date());
|
||||
boolean save = basicCollectBustypeService.save(entity);
|
||||
if (!save){
|
||||
return ResultVOUtils.error("新增错误");
|
||||
}
|
||||
return ResultVOUtils.success("成功!!!!!");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/udiwms/basic/collectPoints/updateCollectBusType")
|
||||
public BaseResponse updateCollectPoint(@RequestBody BasicCollectBustypeEntity entity) {
|
||||
entity.setUpdateTime(new Date());
|
||||
boolean save = basicCollectBustypeService.updateById(entity);
|
||||
if (!save){
|
||||
return ResultVOUtils.error("更新错误");
|
||||
}
|
||||
return ResultVOUtils.success("成功!!!!!");
|
||||
}
|
||||
|
||||
@PostMapping("/udiwms/basic/collectPoints/delCollectBusType")
|
||||
public BaseResponse delCollectPoint(@RequestBody BasicCollectBustypeEntity entity) {
|
||||
boolean del = basicCollectBustypeService.removeById(entity);
|
||||
if (!del){
|
||||
return ResultVOUtils.error("删除错误");
|
||||
}
|
||||
return ResultVOUtils.success("成功!!!!!");
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.req.basic;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2024/8/13 15:00
|
||||
* @modyified By :
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BasicCollectBusTypeRequest extends ListPageRequest {
|
||||
|
||||
private String key;
|
||||
private String invCode;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.glxp.api.res.basic;
|
||||
|
||||
import com.glxp.api.entity.basic.BasicCollectBustypeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2024/8/13 15:03
|
||||
* @modyified By :
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BasicCollectBusTypeResponse extends BasicCollectBustypeEntity {
|
||||
//仓库名称
|
||||
private String invName;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.api.res.basic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.glxp.api.entity.auth.SysWorkplace;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2024/8/14 16:28
|
||||
* @modyified By :
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class SysWorkplaceResponse extends SysWorkplace {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//组别名称
|
||||
private String categoryName;
|
||||
//单据编号
|
||||
private String busTypeCode;
|
||||
|
||||
//单据名称
|
||||
private String busTypeName;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.glxp.api.res.basic;
|
||||
|
||||
import com.glxp.api.entity.auth.SysWorkplace;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2024/8/14 18:59
|
||||
* @modyified By :
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserWorkResponse extends SysWorkplace {
|
||||
|
||||
}
|
@ -1,10 +1,26 @@
|
||||
package com.glxp.api.service.basic;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.req.basic.BasicCollectBusTypeRequest;
|
||||
import com.glxp.api.res.basic.BasicCollectBusTypeResponse;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.glxp.api.dao.basic.BasicCollectBustypeMapper;
|
||||
import com.glxp.api.entity.basic.BasicCollectBustypeEntity;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BasicCollectBustypeService extends ServiceImpl<BasicCollectBustypeMapper, BasicCollectBustypeEntity> {
|
||||
|
||||
public List<BasicCollectBusTypeResponse> filterList(BasicCollectBusTypeRequest request) {
|
||||
if (null == request) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != request.getPage() && null != request.getLimit()) {
|
||||
PageHelper.offsetPage((request.getPage() - 1) * request.getLimit(), request.getLimit());
|
||||
}
|
||||
return super.baseMapper.filterList(request);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.basic.BasicCollectBustypeMapper">
|
||||
<select id="filterList" resultType="com.glxp.api.res.basic.BasicCollectBusTypeResponse">
|
||||
select bcb.*,aw.name invName
|
||||
from basic_collect_bustype bcb
|
||||
left join auth_warehouse aw on bcb.invCode = aw.code
|
||||
<where>
|
||||
<if test="key != null and key != ''">
|
||||
AND (bcb.name like concat('%', #{key}, '%')
|
||||
or bcb.code like concat('%', #{key}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test=" invCode != null and invCode != ''">
|
||||
AND bcb.invCode = #{invCode}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY bcb.updateTime desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue