51 changed files with 599 additions and 313 deletions
@ -0,0 +1,25 @@ |
|||
package com.yxt.supervise.cyf.api.materialtype; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:29 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "物料类型信息 视图数据对象", description = "物料入库信息 视图数据对象") |
|||
public class MaterialTypeVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
|
|||
//物料编号
|
|||
private String number; |
|||
//物料名称
|
|||
private String name; |
|||
//物料code
|
|||
private String code; |
|||
//1 原料 2 包装物
|
|||
private String type; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.yxt.supervise.cyf.biz.materialinventory; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.supervise.cyf.api.materialinventory.MaterialInventory; |
|||
import com.yxt.supervise.cyf.api.materialinventory.MaterialInventoryVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:37 |
|||
*/ |
|||
@Mapper |
|||
public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory> { |
|||
IPage<MaterialInventoryVo> selectPageVo(IPage<MaterialInventory> page, @Param(Constants.WRAPPER) Wrapper<MaterialInventory> qw); |
|||
@Select(" SELECT" + |
|||
" *,t.name as typeName" + |
|||
" FROM" + |
|||
" material_inventory r" + |
|||
" left join material_type t on t.sid=r.typeSid ") |
|||
List<MaterialInventoryVo> inventoryList(); |
|||
@Select("select * from material_inventory where sid=#{sid}") |
|||
MaterialInventory getInventoryBySid(@Param("sid")String sid); |
|||
} |
@ -1,14 +1,14 @@ |
|||
<?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.yxt.supervise.cyf.biz.rawmaterialinventory.RawMaterialInventoryMapper"> |
|||
<mapper namespace="com.yxt.supervise.cyf.biz.materialinventory.MaterialInventoryMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.rawmaterialinventory.RawMaterialInventoryVo"> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.materialinventory.MaterialInventoryVo"> |
|||
SELECT |
|||
*,t.name as typeName |
|||
FROM |
|||
raw_material_inventory r |
|||
left join raw_material_type t on t.sid=r.typeSid |
|||
material_inventory r |
|||
left join material_type t on t.sid=r.typeSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
@ -0,0 +1,20 @@ |
|||
package com.yxt.supervise.cyf.biz.materialinventoryrecord; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecord; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:37 |
|||
*/ |
|||
@Mapper |
|||
public interface MaterialInventoryRecordMapper extends BaseMapper<MaterialInventoryRecord> { |
|||
IPage<MaterialInventoryRecordVo> selectPageVo(IPage<MaterialInventoryRecord> page, @Param(Constants.WRAPPER) Wrapper<MaterialInventoryRecord> qw); |
|||
|
|||
} |
@ -1,15 +1,15 @@ |
|||
<?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.yxt.supervise.cyf.biz.rawmaterialinventoryrecord.RawMaterialInventoryRecordMapper"> |
|||
<mapper namespace="com.yxt.supervise.cyf.biz.materialinventoryrecord.MaterialInventoryRecordMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.rawmaterialinventoryrecord.RawMaterialInventoryRecordVo"> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordVo"> |
|||
SELECT |
|||
*,i.name as name,i.inventory as inventory,t.name as typeName; |
|||
FROM |
|||
raw_material_inventory_record r |
|||
left join raw_material_inventory i on r.inventorySid =i.sid |
|||
left join raw_material_type t on t.sid=i.typeSid |
|||
material_inventory_record r |
|||
left join material_inventory i on r.inventorySid =i.sid |
|||
left join material_type t on t.sid=i.typeSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
@ -0,0 +1,39 @@ |
|||
package com.yxt.supervise.cyf.biz.materialinventoryrecord; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordDto; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordQuery; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:38 |
|||
*/ |
|||
@Api(tags = "盘库信息") |
|||
@RestController |
|||
@RequestMapping("cyf/rawrecord") |
|||
public class MaterialInventoryRecordRest { |
|||
@Autowired |
|||
MaterialInventoryRecordService RawMaterialInventoryRecordService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<MaterialInventoryRecordVo>> listPage(@RequestBody PagerQuery<MaterialInventoryRecordQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<MaterialInventoryRecordVo> pv = RawMaterialInventoryRecordService.listPageVo(pq); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("新增") |
|||
@PostMapping("/save") |
|||
public ResultBean save (@RequestBody MaterialInventoryRecordDto dto){ |
|||
return RawMaterialInventoryRecordService.save(dto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.yxt.supervise.cyf.biz.materialinventoryrecord; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecord; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordDto; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordQuery; |
|||
import com.yxt.supervise.cyf.api.materialinventoryrecord.MaterialInventoryRecordVo; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:37 |
|||
*/ |
|||
@Service |
|||
public class MaterialInventoryRecordService extends MybatisBaseService<MaterialInventoryRecordMapper, MaterialInventoryRecord> { |
|||
|
|||
|
|||
public PagerVo<MaterialInventoryRecordVo> listPageVo(PagerQuery<MaterialInventoryRecordQuery> pq) { |
|||
MaterialInventoryRecordQuery query = pq.getParams(); |
|||
QueryWrapper<MaterialInventoryRecord> qw = new QueryWrapper<>(); |
|||
if (StringUtils.isNotBlank(query.getDate())) { |
|||
qw.eq("STR_TO_DATE(r.inventoryDate,'%Y-%m-%d')", query.getDate()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getName())) { |
|||
qw.like("i.name", query.getName()); |
|||
} |
|||
if (StringUtils.isNotBlank(query.getType())) { |
|||
qw.eq("r.type", query.getType()); |
|||
} |
|||
IPage<MaterialInventoryRecord> page = PagerUtil.queryToPage(pq); |
|||
IPage<MaterialInventoryRecordVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<MaterialInventoryRecordVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public ResultBean save(MaterialInventoryRecordDto dto){ |
|||
ResultBean rb=new ResultBean(); |
|||
MaterialInventoryRecord entity=new MaterialInventoryRecord(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("新增成功"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.supervise.cyf.biz.materialoutbound; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.supervise.cyf.api.materialoutbound.MaterialOutbound; |
|||
import com.yxt.supervise.cyf.api.materialoutbound.MaterialOutboundVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:37 |
|||
*/ |
|||
@Mapper |
|||
public interface MaterialOutboundMapper extends BaseMapper<MaterialOutbound> { |
|||
IPage<MaterialOutboundVo> selectPageVo(IPage<MaterialOutbound> page, @Param(Constants.WRAPPER) Wrapper<MaterialOutbound> qw); |
|||
@Select(" SELECT" + |
|||
" *,t.name as typeName,i.inventory as inventory" + |
|||
" FROM" + |
|||
" material_outbound o" + |
|||
" left join material_inventory i on i.sid=o.inventorySid" + |
|||
" left join material_type t on t.sid=i.typeSid") |
|||
List<MaterialOutboundVo> outboundList(); |
|||
@Select("select * from tank_information where sid=#{sid}") |
|||
MaterialOutbound getOutboundBySid(@Param("sid")String sid); |
|||
} |
@ -1,15 +1,15 @@ |
|||
<?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.yxt.supervise.cyf.biz.rawmaterialstorage.RawMaterialStorageMapper"> |
|||
<mapper namespace="com.yxt.supervise.cyf.biz.materialoutbound.MaterialOutboundMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.rawmaterialstorage.RawMaterialStorageVo"> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.materialoutbound.MaterialOutboundVo"> |
|||
SELECT |
|||
*,t.name as typeName,i.inventory as inventory |
|||
FROM |
|||
raw_material_storage s |
|||
left join raw_material_inventory i on i.sid=s.inventorySid |
|||
left join raw_material_type t on t.sid=i.typeSid |
|||
material_outbound o |
|||
left join material_inventory i on i.sid=o.inventorySid |
|||
left join material_type t on t.sid=i.typeSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
@ -0,0 +1,30 @@ |
|||
package com.yxt.supervise.cyf.biz.materialstorage; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.supervise.cyf.api.materialstorage.MaterialStorage; |
|||
import com.yxt.supervise.cyf.api.materialstorage.MaterialStorageVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:37 |
|||
*/ |
|||
@Mapper |
|||
public interface MaterialStorageMapper extends BaseMapper<MaterialStorage> { |
|||
IPage<MaterialStorageVo> selectPageVo(IPage<MaterialStorage> page, @Param(Constants.WRAPPER) Wrapper<MaterialStorage> qw); |
|||
@Select(" *,t.name as typeName,i.inventory as inventory" + |
|||
" FROM" + |
|||
" material_storage s" + |
|||
" left join material_inventory i on i.sid=s.inventorySid" + |
|||
" left join material_type t on t.sid=i.typeSid") |
|||
List<MaterialStorageVo> StorageList(); |
|||
@Select("select * from material_storage where sid=#{sid}") |
|||
MaterialStorage getStorageBySid(@Param("sid")String sid); |
|||
} |
@ -1,15 +1,15 @@ |
|||
<?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.yxt.supervise.cyf.biz.rawmaterialoutbound.RawMaterialOutboundMapper"> |
|||
<mapper namespace="com.yxt.supervise.cyf.biz.materialstorage.MaterialStorageMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.rawmaterialoutbound.RawMaterialOutboundVo"> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.materialstorage.MaterialStorageVo"> |
|||
SELECT |
|||
*,t.name as typeName,i.inventory as inventory |
|||
FROM |
|||
raw_material_outbound o |
|||
left join raw_material_inventory i on i.sid=o.inventorySid |
|||
left join raw_material_type t on t.sid=i.typeSid |
|||
material_storage s |
|||
left join material_inventory i on i.sid=s.inventorySid |
|||
left join material_type t on t.sid=i.typeSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
@ -0,0 +1,26 @@ |
|||
package com.yxt.supervise.cyf.biz.materialtype; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.supervise.cyf.api.materialtype.MaterialType; |
|||
import com.yxt.supervise.cyf.api.materialtype.MaterialTypeVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/5/4 14:37 |
|||
*/ |
|||
@Mapper |
|||
public interface MaterialTypeMapper extends BaseMapper<MaterialType> { |
|||
IPage<MaterialTypeVo> selectPageVo(IPage<MaterialType> page, @Param(Constants.WRAPPER) Wrapper<MaterialType> qw); |
|||
@Select("select * from material_type") |
|||
List<MaterialTypeVo> typeList(); |
|||
@Select("select * from material_type where sid=#{sid}") |
|||
MaterialType getTypeBySid(@Param("sid")String sid); |
|||
} |
@ -1,13 +1,13 @@ |
|||
<?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.yxt.supervise.cyf.biz.rawmaterialtype.RawMaterialTypeMapper"> |
|||
<mapper namespace="com.yxt.supervise.cyf.biz.materialtype.MaterialTypeMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.rawmaterialtype.RawMaterialTypeVo"> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.cyf.api.materialtype.MaterialTypeVo"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
raw_material_type |
|||
material_type |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
Loading…
Reference in new issue