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