Compare commits
2 Commits
3c930a106b
...
fbe4568fa4
| Author | SHA1 | Date |
|---|---|---|
|
|
fbe4568fa4 | |
|
|
bebe8d530d |
|
|
@ -1,13 +1,16 @@
|
|||
package com.bonus.canteen.core.ims.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail;
|
||||
import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryAdd;
|
||||
import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryQuery;
|
||||
import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.vo.ImsIntoInventoryVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -54,6 +57,23 @@ public class ImsIntoInventoryController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入库货品记录按照仓库编号
|
||||
*/
|
||||
@ApiOperation(value = "查询入库货品记录按照仓库编号")
|
||||
//@RequiresPermissions("ims:inventory:list")
|
||||
@PostMapping("/warehouse/materials")
|
||||
public TableDataInfo selectDetailListByWarehouseIdAndMaterialId(@RequestBody ImsIntoInventoryQuery imsIntoInventoryQuery)
|
||||
{
|
||||
if(Objects.isNull(imsIntoInventoryQuery.getMaterialId()) || Objects.isNull(imsIntoInventoryQuery.getWarehouseId())) {
|
||||
throw new ServiceException("参数错误");
|
||||
}
|
||||
startPage();
|
||||
List<ImsIntoInventoryDetail> list = imsIntoInventoryService.
|
||||
selectDetailListByWarehouseIdAndMaterialId(imsIntoInventoryQuery);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库记录列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class ImsInventoryController extends BaseController
|
|||
@ApiOperation(value = "获取库存详细信息")
|
||||
//@RequiresPermissions("ims:inventory:query")
|
||||
@GetMapping(value = "/{inventoryId}")
|
||||
public AjaxResult getInfo(@PathVariable("inventoryId") Long inventoryId)
|
||||
public AjaxResult getInfoByInventoryId(@PathVariable("inventoryId") Long inventoryId)
|
||||
{
|
||||
return success(imsInventoryService.selectImsInventoryByInventoryId(inventoryId));
|
||||
}
|
||||
|
|
@ -83,20 +83,20 @@ public class ImsInventoryController extends BaseController
|
|||
/**
|
||||
* 新增库存
|
||||
*/
|
||||
@ApiOperation(value = "新增库存")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:inventory:add")
|
||||
@SysLog(title = "库存", businessType = OperaType.INSERT, logType = 1,module = "库存->新增库存")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ImsInventoryAdd imsInventoryAdd)
|
||||
{
|
||||
try {
|
||||
imsInventoryService.insertImsInventory(imsInventoryAdd);
|
||||
}catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
// @ApiOperation(value = "新增库存")
|
||||
// //@PreventRepeatSubmit
|
||||
// //@RequiresPermissions("ims:inventory:add")
|
||||
// @SysLog(title = "库存", businessType = OperaType.INSERT, logType = 1,module = "库存->新增库存")
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody ImsInventoryAdd imsInventoryAdd)
|
||||
// {
|
||||
// try {
|
||||
// imsInventoryService.insertImsInventory(imsInventoryAdd);
|
||||
// }catch (Exception e) {
|
||||
// return AjaxResult.error(e.getMessage());
|
||||
// }
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改库存
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@ public class ImsIntoInventory extends BaseEntity
|
|||
@Excel(name = "区域ID")
|
||||
private Long areaId;
|
||||
|
||||
@ApiModelProperty(value = "原料id")
|
||||
private Long materialId;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startDateTime;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
|
|
@ -152,4 +154,13 @@ public class ImsIntoInventoryDetail extends BaseEntity
|
|||
@Excel(name = "货品编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty(value = "仓库名称")
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty(value = "入库时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime intoDate;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.canteen.core.ims.domain;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -110,4 +111,7 @@ public class ImsInventory extends BaseEntity
|
|||
@ApiModelProperty(value = "货品编码")
|
||||
@Excel(name = "货品编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty(value = "货品名称")
|
||||
private List<Long> materialTypeIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import java.io.Serializable;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -88,4 +90,7 @@ public class ImsIntoInventoryQuery implements Serializable
|
|||
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
@ApiModelProperty(value = "原料id")
|
||||
private Long materialId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
|
@ -63,4 +63,13 @@ public class ImsInventoryQuery implements Serializable
|
|||
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
@ApiModelProperty(value = "货品名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty(value = "货品编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty(value = "货品名称")
|
||||
private List<Long> materialTypeIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
|
|
@ -149,4 +151,13 @@ public class ImsIntoInventoryDetailVO extends BaseEntity
|
|||
@Excel(name = "货品编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty(value = "仓库名称")
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty(value = "入库时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime intoDate;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,6 @@ public interface ImsIntoInventoryMapper {
|
|||
public int updateIntoInventoryNum(@Param("intoDetailId") Long intoDetailId, @Param("fetchNum") BigDecimal fetchNum);
|
||||
|
||||
public ImsIntoInventoryDetail selectImsIntoInventoryDetailListByIntoDetailId(@Param("intoDetailId") Long intoDetailId);
|
||||
|
||||
public List<ImsIntoInventoryDetail> selectDetailListByWarehouseIdAndMaterialId(ImsIntoInventory imsIntoInventory);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@ package com.bonus.canteen.core.ims.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.ims.domain.ImsIntoInventory;
|
||||
import com.bonus.canteen.core.ims.domain.ImsIntoInventoryDetail;
|
||||
import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryAdd;
|
||||
import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryQuery;
|
||||
import com.bonus.canteen.core.ims.domain.param.ImsIntoInventoryUpdate;
|
||||
import com.bonus.canteen.core.ims.domain.vo.ImsIntoInventoryVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 入库记录Service接口
|
||||
|
|
@ -62,4 +64,6 @@ public interface IImsIntoInventoryService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteImsIntoInventoryByIntoId(Long intoId);
|
||||
|
||||
public List<ImsIntoInventoryDetail> selectDetailListByWarehouseIdAndMaterialId(ImsIntoInventoryQuery imsIntoInventoryQuery);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
|
@ -168,6 +169,13 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService
|
|||
return imsIntoInventoryMapper.deleteImsIntoInventoryByIntoId(intoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ImsIntoInventoryDetail> selectDetailListByWarehouseIdAndMaterialId(ImsIntoInventoryQuery imsIntoInventoryQuery) {
|
||||
ImsIntoInventory imsIntoInventory = new ImsIntoInventory();
|
||||
BeanUtils.copyProperties(imsIntoInventoryQuery, imsIntoInventory);
|
||||
return imsIntoInventoryMapper.selectDetailListByWarehouseIdAndMaterialId(imsIntoInventory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库记录明细信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="barCode" column="bar_code" />
|
||||
<result property="materialSize" column="material_size" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="intoDate" column="into_date" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectImsIntoInventoryVo">
|
||||
|
|
@ -172,6 +174,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by iii.into_date
|
||||
</select>
|
||||
|
||||
<select id="selectDetailListByWarehouseIdAndMaterialId" resultMap="ImsIntoInventoryDetailResult">
|
||||
select into_detail_id, iiid.into_id, iiid.into_code, inventory_id, iiid.material_id, iiid.supplier_id,
|
||||
iiid.unit_id, iiid.size, iiid.unit_price, total_price, delivery_num, pur_num, unqualified_num,
|
||||
inventory_num, product_date, expire_time, iiid.img_url, if_fill_inventory,
|
||||
relate_order_goods_detail_id, relate_delivery_goods_detail_id, iiid.del_flag,
|
||||
iiid.create_by, iiid.create_time, iiid.update_by, iiid.update_time, isr.supplier_name,
|
||||
cm.material_name, cmt.material_type_name, iii.into_date, iwi.warehouse_name,
|
||||
iu.unit_name, cm.bar_code, cm.size AS material_size, cm.material_code
|
||||
from ims_into_inventory_detail iiid
|
||||
left join ims_into_inventory iii on iii.into_id = iiid.into_id
|
||||
left join ims_supplier isr on iiid.supplier_id = isr.supplier_id
|
||||
left join cook_material cm on iiid.material_id = cm.material_id
|
||||
left join cook_material_type cmt on cm.material_type_id = cmt.material_type_id
|
||||
left join ims_unit iu on iiid.unit_id = iu.unit_id
|
||||
left join ims_warehouse_info iwi on iii.warehouse_id = iwi.warehouse_id
|
||||
where iiid.material_id = #{materialId}
|
||||
and iii.warehouse_id = #{warehouseId}
|
||||
and iii.status = '2'
|
||||
and iiid.inventory_num > 0
|
||||
and iiid.del_flag = '0'
|
||||
<if test="intoCode != null and intoCode != ''">
|
||||
and iii.into_code = #{intoCode}
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and iii.into_date <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and iii.into_date <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
order by iii.into_date
|
||||
</select>
|
||||
|
||||
<select id="selectImsIntoInventoryDetailListByIntoDetailId" resultMap="ImsIntoInventoryDetailResult">
|
||||
select into_detail_id,
|
||||
iiid.into_id,
|
||||
|
|
|
|||
|
|
@ -55,6 +55,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maxNum != null "> and ii.max_num = #{maxNum}</if>
|
||||
<if test="materialNum != null "> and ii.material_num = #{materialNum}</if>
|
||||
<if test="inventoryStatus != null "> and ii.inventory_status = #{inventoryStatus}</if>
|
||||
<if test="materialTypeIds != null and materialTypeIds.size() > 0">
|
||||
and cmt.material_type_id in
|
||||
<foreach collection="materialTypeIds" item="materialTypeId" separator="," open="(" close=")">
|
||||
#{materialTypeId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="materialName != null">
|
||||
and cm.material_name like CONCAT('%',#{materialName},'%')
|
||||
</if>
|
||||
<if test="barCode != null">
|
||||
and cm.bar_code like CONCAT('%',#{barCode},'%')
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and ii.create_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
|
|
@ -62,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and ii.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by ii.create_time desc
|
||||
order by ii.material_id, ii.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectImsInventoryByInventoryId" parameterType="Long" resultMap="ImsInventoryResult">
|
||||
|
|
@ -118,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="materialNum != null">material_num = #{materialNum},</if>
|
||||
<if test="fetchNum != null">material_num = material_num - #{fetchNum},</if>
|
||||
<if test="inventoryStatus != null">inventory_status = #{inventoryStatus},</if>
|
||||
<if test="inventoryStatus == null and fetchNum != null">
|
||||
<if test="inventoryStatus == null">
|
||||
inventory_status = CASE
|
||||
WHEN material_num <![CDATA[ < ]]> min_num THEN 2
|
||||
WHEN material_num <![CDATA[ > ]]> max_num THEN 3
|
||||
|
|
|
|||
Loading…
Reference in New Issue