Compare commits
2 Commits
8cdcbe03ac
...
725195c76e
| Author | SHA1 | Date |
|---|---|---|
|
|
725195c76e | |
|
|
e778663c81 |
|
|
@ -104,7 +104,7 @@ public class ImsIntoInventory extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "区域ID")
|
@ApiModelProperty(value = "区域ID")
|
||||||
@Excel(name = "区域ID")
|
@Excel(name = "区域ID")
|
||||||
private String areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@ApiModelProperty("开始时间")
|
@ApiModelProperty("开始时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public class ImsInventory extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "区域ID")
|
@ApiModelProperty(value = "区域ID")
|
||||||
@Excel(name = "区域ID")
|
@Excel(name = "区域ID")
|
||||||
private String areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "货品编码")
|
@ApiModelProperty(value = "货品编码")
|
||||||
@Excel(name = "货品编码")
|
@Excel(name = "货品编码")
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public class ImsOutInventory extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "区域ID")
|
@ApiModelProperty(value = "区域ID")
|
||||||
@Excel(name = "区域ID")
|
@Excel(name = "区域ID")
|
||||||
private String areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@ApiModelProperty("开始时间")
|
@ApiModelProperty("开始时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -85,4 +85,7 @@ public class ImsIntoInventoryQuery implements Serializable
|
||||||
@ApiModelProperty("结束时间")
|
@ApiModelProperty("结束时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime endDateTime;
|
private LocalDateTime endDateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区域id")
|
||||||
|
private Long areaId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,7 @@ public class ImsInventoryQuery implements Serializable
|
||||||
@ApiModelProperty("结束时间")
|
@ApiModelProperty("结束时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime endDateTime;
|
private LocalDateTime endDateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区域id")
|
||||||
|
private Long areaId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,4 +85,7 @@ public class ImsOutInventoryQuery implements Serializable
|
||||||
@ApiModelProperty(value = "领料人")
|
@ApiModelProperty(value = "领料人")
|
||||||
private String fetchUser;
|
private String fetchUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区域id")
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ public class ImsIntoInventoryVO extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "区域ID")
|
@ApiModelProperty(value = "区域ID")
|
||||||
@Excel(name = "区域ID")
|
@Excel(name = "区域ID")
|
||||||
private String areaId;
|
private Long areaId;
|
||||||
|
|
||||||
/** 入库记录明细信息 */
|
/** 入库记录明细信息 */
|
||||||
private List<ImsIntoInventoryDetailVO> imsIntoInventoryDetailVOList;
|
private List<ImsIntoInventoryDetailVO> imsIntoInventoryDetailVOList;
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public class ImsInventoryVO extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "区域ID")
|
@ApiModelProperty(value = "区域ID")
|
||||||
@Excel(name = "区域ID")
|
@Excel(name = "区域ID")
|
||||||
private String areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "材料名称")
|
@ApiModelProperty(value = "材料名称")
|
||||||
@Excel(name = "材料名称")
|
@Excel(name = "材料名称")
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ public class ImsOutInventoryVO extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "区域ID")
|
@ApiModelProperty(value = "区域ID")
|
||||||
@Excel(name = "区域ID")
|
@Excel(name = "区域ID")
|
||||||
private String areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "仓库名称")
|
@ApiModelProperty(value = "仓库名称")
|
||||||
@Excel(name = "仓库名称")
|
@Excel(name = "仓库名称")
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService
|
||||||
}
|
}
|
||||||
ImsInventoryUpdate imsInventoryUpdate = new ImsInventoryUpdate();
|
ImsInventoryUpdate imsInventoryUpdate = new ImsInventoryUpdate();
|
||||||
imsInventoryUpdate.setInventoryId(imsOutInventoryDetail.getInventoryId());
|
imsInventoryUpdate.setInventoryId(imsOutInventoryDetail.getInventoryId());
|
||||||
|
imsInventoryUpdate.setFetchNum(imsOutInventoryDetail.getFetchNum());
|
||||||
int rows = imsInventoryService.updateImsInventory(imsInventoryUpdate);
|
int rows = imsInventoryService.updateImsInventory(imsInventoryUpdate);
|
||||||
if(rows < 1) {
|
if(rows < 1) {
|
||||||
throw new ServiceException("库存不足");
|
throw new ServiceException("库存不足");
|
||||||
|
|
@ -231,22 +232,30 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService
|
||||||
int updateRows = imsIntoInventoryMapper.
|
int updateRows = imsIntoInventoryMapper.
|
||||||
updateIntoInventoryNum(imsIntoInventoryDetail.getIntoDetailId(), imsIntoInventoryDetail.getInventoryNum());
|
updateIntoInventoryNum(imsIntoInventoryDetail.getIntoDetailId(), imsIntoInventoryDetail.getInventoryNum());
|
||||||
if(updateRows > 0) {
|
if(updateRows > 0) {
|
||||||
totalPrice += (imsIntoInventoryDetail.getInventoryNum()
|
long outTotalPrice = (imsIntoInventoryDetail.getInventoryNum()
|
||||||
.multiply(BigDecimal.valueOf(imsIntoInventoryDetail.getUnitPrice()))).longValue();
|
.multiply(BigDecimal.valueOf(imsIntoInventoryDetail.getUnitPrice()))).longValue();
|
||||||
imsOutInventoryDetail.setIntoDetailId(imsIntoInventoryDetail.getIntoDetailId());
|
totalPrice += outTotalPrice;
|
||||||
imsOutInventoryDetail.setFetchNum(imsIntoInventoryDetail.getInventoryNum());
|
ImsOutInventoryDetail imsOutInventoryDetailForInsert = new ImsOutInventoryDetail();
|
||||||
list.add(imsOutInventoryDetail);
|
BeanUtils.copyProperties(imsOutInventoryDetail, imsOutInventoryDetailForInsert);
|
||||||
|
imsOutInventoryDetailForInsert.setIntoDetailId(imsIntoInventoryDetail.getIntoDetailId());
|
||||||
|
imsOutInventoryDetailForInsert.setFetchNum(imsIntoInventoryDetail.getInventoryNum());
|
||||||
|
imsOutInventoryDetailForInsert.setTotalPrice(outTotalPrice);
|
||||||
|
list.add(imsOutInventoryDetailForInsert);
|
||||||
tempFetchLeftNum = tempFetchLeftNum.subtract(imsIntoInventoryDetail.getInventoryNum());
|
tempFetchLeftNum = tempFetchLeftNum.subtract(imsIntoInventoryDetail.getInventoryNum());
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
int updateRows = imsIntoInventoryMapper.
|
int updateRows = imsIntoInventoryMapper.
|
||||||
updateIntoInventoryNum(imsIntoInventoryDetail.getIntoDetailId(), tempFetchLeftNum);
|
updateIntoInventoryNum(imsIntoInventoryDetail.getIntoDetailId(), tempFetchLeftNum);
|
||||||
if(updateRows > 0) {
|
if(updateRows > 0) {
|
||||||
totalPrice += (tempFetchLeftNum
|
long outTotalPrice = (tempFetchLeftNum
|
||||||
.multiply(BigDecimal.valueOf(imsIntoInventoryDetail.getUnitPrice()))).longValue();
|
.multiply(BigDecimal.valueOf(imsIntoInventoryDetail.getUnitPrice()))).longValue();
|
||||||
imsOutInventoryDetail.setIntoDetailId(imsIntoInventoryDetail.getIntoDetailId());
|
totalPrice += outTotalPrice;
|
||||||
imsOutInventoryDetail.setFetchNum(tempFetchLeftNum);
|
ImsOutInventoryDetail imsOutInventoryDetailForInsert = new ImsOutInventoryDetail();
|
||||||
list.add(imsOutInventoryDetail);
|
BeanUtils.copyProperties(imsOutInventoryDetail, imsOutInventoryDetailForInsert);
|
||||||
|
imsOutInventoryDetailForInsert.setIntoDetailId(imsIntoInventoryDetail.getIntoDetailId());
|
||||||
|
imsOutInventoryDetailForInsert.setFetchNum(tempFetchLeftNum);
|
||||||
|
imsOutInventoryDetailForInsert.setTotalPrice(outTotalPrice);
|
||||||
|
list.add(imsOutInventoryDetailForInsert);
|
||||||
tempFetchLeftNum = tempFetchLeftNum.subtract(tempFetchLeftNum);
|
tempFetchLeftNum = tempFetchLeftNum.subtract(tempFetchLeftNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -254,7 +263,6 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService
|
||||||
if(tempFetchLeftNum.compareTo(BigDecimal.ZERO) > 0) {
|
if(tempFetchLeftNum.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
throw new ServiceException("出口失败,库存不足");
|
throw new ServiceException("出口失败,库存不足");
|
||||||
}
|
}
|
||||||
imsOutInventoryDetail.setTotalPrice(totalPrice);
|
|
||||||
totalPriceSum += totalPrice;
|
totalPriceSum += totalPrice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="totalNum != null "> and iii.total_num = #{totalNum}</if>
|
<if test="totalNum != null "> and iii.total_num = #{totalNum}</if>
|
||||||
<if test="intoType != null "> and iii.into_type = #{intoType}</if>
|
<if test="intoType != null "> and iii.into_type = #{intoType}</if>
|
||||||
<if test="status != null "> and iii.status = #{status}</if>
|
<if test="status != null "> and iii.status = #{status}</if>
|
||||||
|
<if test="areaId != null "> and ba.area_id = #{areaId}</if>
|
||||||
<if test="refundOutId != null and refundOutId != ''"> and iii.refund_out_id = #{refundOutId}</if>
|
<if test="refundOutId != null and refundOutId != ''"> and iii.refund_out_id = #{refundOutId}</if>
|
||||||
<if test="relateDeliveryGoodsId != null and relateDeliveryGoodsId != ''"> and iii.relate_delivery_goods_id = #{relateDeliveryGoodsId}</if>
|
<if test="relateDeliveryGoodsId != null and relateDeliveryGoodsId != ''"> and iii.relate_delivery_goods_id = #{relateDeliveryGoodsId}</if>
|
||||||
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
|
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
|
||||||
|
|
@ -104,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and iii.into_date <![CDATA[ <= ]]> #{endDateTime}
|
and iii.into_date <![CDATA[ <= ]]> #{endDateTime}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by iii.into_date desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectImsIntoInventoryByIntoId" parameterType="Long" resultMap="ImsIntoInventoryImsIntoInventoryDetailResult">
|
<select id="selectImsIntoInventoryByIntoId" parameterType="Long" resultMap="ImsIntoInventoryImsIntoInventoryDetailResult">
|
||||||
|
|
@ -132,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join cook_material_type cmt on cm.material_type_id = cmt.material_type_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_unit iu on iiid.unit_id = iu.unit_id
|
||||||
where iiid.into_id = #{into_id} and iiid.del_flag = '0'
|
where iiid.into_id = #{into_id} and iiid.del_flag = '0'
|
||||||
|
order by iiid.into_detail_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectImsIntoInventoryDetailListByInventoryId" resultMap="ImsIntoInventoryDetailResult">
|
<select id="selectImsIntoInventoryDetailListByInventoryId" resultMap="ImsIntoInventoryDetailResult">
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectImsInventoryVo"/>
|
<include refid="selectImsInventoryVo"/>
|
||||||
<where>
|
<where>
|
||||||
ii.del_flag = '0'
|
ii.del_flag = '0'
|
||||||
|
<if test="areaId != null "> and ba.area_id = #{areaId}</if>
|
||||||
<if test="warehouseId != null "> and ii.warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null "> and ii.warehouse_id = #{warehouseId}</if>
|
||||||
<if test="materialId != null "> and ii.material_id = #{materialId}</if>
|
<if test="materialId != null "> and ii.material_id = #{materialId}</if>
|
||||||
<if test="unitId != null "> and ii.unit_id = #{unitId}</if>
|
<if test="unitId != null "> and ii.unit_id = #{unitId}</if>
|
||||||
|
|
@ -61,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and ii.create_time <![CDATA[ <= ]]> #{endDateTime}
|
and ii.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by ii.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectImsInventoryByInventoryId" parameterType="Long" resultMap="ImsInventoryResult">
|
<select id="selectImsInventoryByInventoryId" parameterType="Long" resultMap="ImsInventoryResult">
|
||||||
|
|
@ -118,8 +120,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="inventoryStatus != null">inventory_status = #{inventoryStatus},</if>
|
<if test="inventoryStatus != null">inventory_status = #{inventoryStatus},</if>
|
||||||
<if test="inventoryStatus == null and fetchNum != null">
|
<if test="inventoryStatus == null and fetchNum != null">
|
||||||
inventory_status = CASE
|
inventory_status = CASE
|
||||||
WHEN (material_num - #{fetchNum}) <![CDATA[ < ]]> min_num THEN 2
|
WHEN material_num <![CDATA[ < ]]> min_num THEN 2
|
||||||
WHEN (material_num - #{fetchNum}) <![CDATA[ > ]]> max_num THEN 3
|
WHEN material_num <![CDATA[ > ]]> max_num THEN 3
|
||||||
ELSE 1
|
ELSE 1
|
||||||
END,
|
END,
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="planId != null and planId != ''"> and ioi.plan_id = #{planId}</if>
|
<if test="planId != null and planId != ''"> and ioi.plan_id = #{planId}</if>
|
||||||
<if test="fetchMaterialId != null and fetchMaterialId != ''"> and ioi.fetch_material_id = #{fetchMaterialId}</if>
|
<if test="fetchMaterialId != null and fetchMaterialId != ''"> and ioi.fetch_material_id = #{fetchMaterialId}</if>
|
||||||
<if test="goodsAllocationId != null and goodsAllocationId != ''"> and ioi.goods_allocation_id = #{goodsAllocationId}</if>
|
<if test="goodsAllocationId != null and goodsAllocationId != ''"> and ioi.goods_allocation_id = #{goodsAllocationId}</if>
|
||||||
|
<if test="areaId != null "> and ba.area_id = #{areaId}</if>
|
||||||
<if test="startDateTime != null">
|
<if test="startDateTime != null">
|
||||||
and ioi.out_date <![CDATA[ >= ]]> #{startDateTime}
|
and ioi.out_date <![CDATA[ >= ]]> #{startDateTime}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -102,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and ioi.out_date <![CDATA[ <= ]]> #{endDateTime}
|
and ioi.out_date <![CDATA[ <= ]]> #{endDateTime}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by ioi.out_date desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectImsOutInventoryByOutId" parameterType="Long" resultMap="ImsOutInventoryImsOutInventoryDetailResult">
|
<select id="selectImsOutInventoryByOutId" parameterType="Long" resultMap="ImsOutInventoryImsOutInventoryDetailResult">
|
||||||
|
|
@ -130,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join cook_material_type cmt on cm.material_type_id = cmt.material_type_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_unit iu on iiid.unit_id = iu.unit_id
|
||||||
where out_id = #{out_id} and ioid.del_flag = '0'
|
where out_id = #{out_id} and ioid.del_flag = '0'
|
||||||
|
order by ioid.out_detail_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertImsOutInventory" parameterType="com.bonus.canteen.core.ims.domain.ImsOutInventory" useGeneratedKeys="true" keyProperty="outId">
|
<insert id="insertImsOutInventory" parameterType="com.bonus.canteen.core.ims.domain.ImsOutInventory" useGeneratedKeys="true" keyProperty="outId">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue