以大代小出库插入记录

This commit is contained in:
bonus 2025-03-07 11:05:40 +08:00
parent 40b6fa35b9
commit 6c5a14c811
6 changed files with 52 additions and 18 deletions

View File

@ -167,4 +167,4 @@ public class LeaseOutDetails implements Serializable {
private int preStoreNum;
/** 操作后库存 */
private int postStoreNum;
}
}

View File

@ -8,6 +8,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@ -173,4 +174,10 @@ public class LeaseApplyDetails implements Serializable {
private String maStatus;
@ApiModelProperty(value="预领数量-已领数量的差值")
private Integer nums;
}
@ApiModelProperty(value="租赁单价")
private BigDecimal leasePrice;
@ApiModelProperty(value="代替规格id")
private Integer replaceTypeId;
}

View File

@ -36,6 +36,8 @@ public class TreeNode {
private String manageType;
private String isReplace;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeNode> children = new ArrayList<>();
}

View File

@ -19,12 +19,12 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
id, parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
select
<include refid="Base_Column_List" />
from lease_apply_details
where id = #{id,jdbcType=INTEGER}
@ -117,14 +117,14 @@
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.app.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details (parennt_id, type_id, pre_num,
al_num, `status`, create_by,
create_time, update_by, update_time,
remark, company_id)
values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT},
#{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
insert into lease_apply_details (parennt_id, type_id, pre_num,
al_num, `status`, create_by,
create_time, update_by, update_time,
remark, company_id,type_name,model_name,lease_price,replace_type_id)
values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT},
#{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
NOW(), #{updateBy,jdbcType=VARCHAR}, NOW(),
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER})
#{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},#{typeName},#{typeModelName},#{leasePrice},#{replaceTypeId})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.app.domain.LeaseApplyDetails" useGeneratedKeys="true">
<!--@mbg.generated-->
@ -400,7 +400,7 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into lease_apply_details
(parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
(parennt_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id)
values
<foreach collection="list" item="item" separator=",">
@ -447,7 +447,7 @@
#{remark,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER},
</trim>
on duplicate key update
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
@ -545,7 +545,7 @@
#{companyId,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
@ -595,4 +595,4 @@
where tta.agreement_id = #{agreementId} and lad.`status` = '2'
group by lad.type_id
</select>
</mapper>
</mapper>

View File

@ -242,6 +242,18 @@
<if test="carCode!= null">
car_code,
</if>
<if test="typeName!= null">
type_name,
</if>
<if test="modelName!= null">
model_name,
</if>
<if test="leasePrice!= null">
lease_price,
</if>
<if test="replaceTypeId!= null">
replace_type_id,
</if>
create_time,
update_time
</trim>
@ -276,6 +288,18 @@
<if test="carCode!= null">
#{carCode},
</if>
<if test="typeName!= null">
#{typeName},
</if>
<if test="model_name!= null">
#{model_name},
</if>
<if test="leasePrice!= null">
#{leasePrice},
</if>
<if test="replaceTypeId!= null">
#{replaceTypeId},
</if>
NOW(),
NOW()
</trim>
@ -483,4 +507,4 @@
parennt_id = #{record.parentId}
AND type_id = #{record.typeId}
</select>
</mapper>
</mapper>

View File

@ -111,7 +111,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(mt.num, 0)
END as num,
mt.model_code AS modelCode,
mt.manage_type AS manageType
mt.manage_type AS manageType,
mt.is_replace as isReplace
FROM ma_type mt
left join (SELECT mt.type_id,
mt2.type_name AS typeName,
@ -228,4 +229,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bm_unit_info bui on slc.unit_id = bui.unit_id
</select>
</mapper>
</mapper>