add:成品库存

This commit is contained in:
2023-06-06 17:20:33 +08:00
parent ae846b5fd6
commit 70e84ce4da
8 changed files with 289 additions and 0 deletions

View File

@@ -2,15 +2,20 @@ package org.nl.wms.storage_manage.productmanage.controller.structIvt;
import io.swagger.annotations.ApiOperation;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* <p>
* 仓位库存表 前端控制器
@@ -26,6 +31,14 @@ public class StIvtStructivtCpController {
@Autowired
private IStIvtStructivtCpService iStIvtStructivtCpService;
@GetMapping
@Log("成品库存查询")
@ApiOperation("成品库存查询")
public ResponseEntity<Object> query(CpIvtQuery query, PageQuery page) {
return new ResponseEntity<>(iStIvtStructivtCpService.packageQuery(query,page), HttpStatus.OK);
}
@PostMapping("/getStructIvt")
@Log("查询库存")
@ApiOperation("查询库存")

View File

@@ -2,7 +2,9 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import java.util.List;
@@ -18,6 +20,13 @@ import java.util.Map;
*/
public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
/**
* 成品库存查询
* @param query /
*/
Object packageQuery(CpIvtQuery query, PageQuery page);
/**
* 成品库存更新
* @param json
@@ -58,4 +67,5 @@ public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
* }
*/
List<Map> getStructIvtMore(StructIvtYLQuery whereJson);
}

View File

@@ -3,7 +3,9 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import java.util.List;
@@ -27,4 +29,5 @@ public interface StIvtStructivtCpMapper extends BaseMapper<StIvtStructivtCp> {
List<Map> getStructIvtMoreBox(JSONObject json);
List<Map> packageQuery(@Param("query") CpIvtQuery query);
}

View File

@@ -138,4 +138,44 @@
</where>
</select>
<select id="packageQuery" resultType="java.util.Map">
SELECT
attr.stor_name,
attr.sect_name,
ivt.struct_code,
ivt.struct_name,
mater.material_name,
mater.material_code,
attr.storagevehicle_code,
ivt.canuse_qty,
ivt.frozen_qty,
ivt.ivt_qty,
ivt.warehousing_qty,
unit.unit_name,
ivt.instorage_time
FROM
st_ivt_structivt_cp ivt
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
<where>
1=1
<if test="query.material_code!= null and query.material_code != ''">
and mater.material_code LIKE #{query.material_code} or
(mater.material_name LIKE #{query.material_code})
</if>
<if test="query.struct_code!= null and query.struct_code != ''">
and attr.struct_code LIKE #{query.struct_code} or
(attr.struct_name LIKE #{query.struct_code})
</if>
<if test="query.start_time!= null and query.start_time != ''">
and ivt.instorage_time &gt;= #{query.start_time}
</if>
<if test="query.end_time!= null and query.end_time != ''">
and ivt.instorage_time &lt;= #{query.end_time}
</if>
</where>
order by ivt.instorage_time DESC,attr.struct_code ASC
</select>
</mapper>

View File

@@ -0,0 +1,27 @@
package org.nl.wms.storage_manage.productmanage.service.structIvt.dto;
import lombok.Data;
import org.nl.common.domain.query.BaseQuery;
import org.nl.common.domain.query.QParam;
import org.nl.common.enums.QueryTEnum;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
/*
* @author LXY
* @Date 2023/5/4 19:49
*/
@Data
public class CpIvtQuery extends BaseQuery<StIvtStructivtCp> {
private String struct_code;
private String material_code;
@Override
public void paramMapping() {
super.doP.put("struct_code", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
}
}

View File

@@ -6,6 +6,10 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.IdUtil;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
@@ -17,11 +21,13 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper.StIvtStructivtCpMapper;
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -48,6 +54,15 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
@Autowired
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
@Override
public Object packageQuery(CpIvtQuery query, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
TableDataInfo build = TableDataInfo.build(this.baseMapper.packageQuery(query));
build.setTotalElements(page.getTotal());
return build;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void UpdateIvt(JSONObject json) {