给单据增加sku字段

This commit is contained in:
季圣华
2021-07-28 00:54:30 +08:00
parent f073488317
commit 1f166552b2
9 changed files with 141 additions and 27 deletions

View File

@@ -1177,3 +1177,10 @@ alter table jsh_depot_item drop column other_field2;
alter table jsh_depot_item drop column other_field3; alter table jsh_depot_item drop column other_field3;
alter table jsh_depot_item drop column other_field4; alter table jsh_depot_item drop column other_field4;
alter table jsh_depot_item drop column other_field5; alter table jsh_depot_item drop column other_field5;
-- --------------------------------------------------------
-- 时间 2021年7月27日
-- by jishenghua
-- 移除机构表的全名字段
-- --------------------------------------------------------
alter table jsh_depot_item add sku varchar(50) DEFAULT NULL COMMENT '多属性' after material_unit;

View File

@@ -185,6 +185,7 @@ public class DepotItemController {
} }
item.put("stock", stock); item.put("stock", stock);
item.put("unit", diEx.getMaterialUnit()); item.put("unit", diEx.getMaterialUnit());
item.put("sku", diEx.getSku());
item.put("operNumber", diEx.getOperNumber()); item.put("operNumber", diEx.getOperNumber());
item.put("basicNumber", diEx.getBasicNumber()); item.put("basicNumber", diEx.getBasicNumber());
item.put("unitPrice", diEx.getUnitPrice()); item.put("unitPrice", diEx.getUnitPrice());

View File

@@ -195,7 +195,7 @@ public class MaterialController {
item.put("standard", material.getStandard()); item.put("standard", material.getStandard());
item.put("model", material.getModel()); item.put("model", material.getModel());
item.put("unit", material.getCommodityUnit() + ratio); item.put("unit", material.getCommodityUnit() + ratio);
if(depotId!=null) { item.put("sku", material.getSku());
BigDecimal stock = depotItemService.getStockByParam(depotId,material.getId(),null,null,tenantId); BigDecimal stock = depotItemService.getStockByParam(depotId,material.getId(),null,null,tenantId);
if (material.getUnitId()!=null){ if (material.getUnitId()!=null){
Unit unit = unitService.getUnit(material.getUnitId()); Unit unit = unitService.getUnit(material.getUnitId());
@@ -206,7 +206,6 @@ public class MaterialController {
} }
} }
item.put("stock", stock); item.put("stock", stock);
}
String expand = ""; //扩展信息 String expand = ""; //扩展信息
for (int i = 0; i < mpArr.length; i++) { for (int i = 0; i < mpArr.length; i++) {
if (mpArr[i].equals("制造商")) { if (mpArr[i].equals("制造商")) {

View File

@@ -13,6 +13,8 @@ public class DepotItem {
private String materialUnit; private String materialUnit;
private String sku;
private BigDecimal operNumber; private BigDecimal operNumber;
private BigDecimal basicNumber; private BigDecimal basicNumber;
@@ -81,6 +83,14 @@ public class DepotItem {
this.materialUnit = materialUnit == null ? null : materialUnit.trim(); this.materialUnit = materialUnit == null ? null : materialUnit.trim();
} }
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku == null ? null : sku.trim();
}
public BigDecimal getOperNumber() { public BigDecimal getOperNumber() {
return operNumber; return operNumber;
} }

View File

@@ -415,6 +415,76 @@ public class DepotItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSkuIsNull() {
addCriterion("sku is null");
return (Criteria) this;
}
public Criteria andSkuIsNotNull() {
addCriterion("sku is not null");
return (Criteria) this;
}
public Criteria andSkuEqualTo(String value) {
addCriterion("sku =", value, "sku");
return (Criteria) this;
}
public Criteria andSkuNotEqualTo(String value) {
addCriterion("sku <>", value, "sku");
return (Criteria) this;
}
public Criteria andSkuGreaterThan(String value) {
addCriterion("sku >", value, "sku");
return (Criteria) this;
}
public Criteria andSkuGreaterThanOrEqualTo(String value) {
addCriterion("sku >=", value, "sku");
return (Criteria) this;
}
public Criteria andSkuLessThan(String value) {
addCriterion("sku <", value, "sku");
return (Criteria) this;
}
public Criteria andSkuLessThanOrEqualTo(String value) {
addCriterion("sku <=", value, "sku");
return (Criteria) this;
}
public Criteria andSkuLike(String value) {
addCriterion("sku like", value, "sku");
return (Criteria) this;
}
public Criteria andSkuNotLike(String value) {
addCriterion("sku not like", value, "sku");
return (Criteria) this;
}
public Criteria andSkuIn(List<String> values) {
addCriterion("sku in", values, "sku");
return (Criteria) this;
}
public Criteria andSkuNotIn(List<String> values) {
addCriterion("sku not in", values, "sku");
return (Criteria) this;
}
public Criteria andSkuBetween(String value1, String value2) {
addCriterion("sku between", value1, value2, "sku");
return (Criteria) this;
}
public Criteria andSkuNotBetween(String value1, String value2) {
addCriterion("sku not between", value1, value2, "sku");
return (Criteria) this;
}
public Criteria andOperNumberIsNull() { public Criteria andOperNumberIsNull() {
addCriterion("oper_number is null"); addCriterion("oper_number is null");
return (Criteria) this; return (Criteria) this;

View File

@@ -34,6 +34,8 @@ public class MaterialVo4Unit extends Material{
private BigDecimal currentStockPrice; private BigDecimal currentStockPrice;
private String sku;
public String getUnitName() { public String getUnitName() {
return unitName; return unitName;
} }
@@ -153,4 +155,12 @@ public class MaterialVo4Unit extends Material{
public void setCurrentStockPrice(BigDecimal currentStockPrice) { public void setCurrentStockPrice(BigDecimal currentStockPrice) {
this.currentStockPrice = currentStockPrice; this.currentStockPrice = currentStockPrice;
} }
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
} }

View File

@@ -331,6 +331,7 @@ public class DepotItemService {
depotItem.setMaterialId(materialExtend.getMaterialId()); depotItem.setMaterialId(materialExtend.getMaterialId());
depotItem.setMaterialExtendId(materialExtend.getId()); depotItem.setMaterialExtendId(materialExtend.getId());
depotItem.setMaterialUnit(rowObj.getString("unit")); depotItem.setMaterialUnit(rowObj.getString("unit"));
depotItem.setSku(rowObj.getString("sku"));
if (StringUtil.isExist(rowObj.get("operNumber"))) { if (StringUtil.isExist(rowObj.get("operNumber"))) {
depotItem.setOperNumber(rowObj.getBigDecimal("operNumber")); depotItem.setOperNumber(rowObj.getBigDecimal("operNumber"));
String unit = rowObj.get("unit").toString(); String unit = rowObj.get("unit").toString();

View File

@@ -7,6 +7,7 @@
<result column="material_id" jdbcType="BIGINT" property="materialId" /> <result column="material_id" jdbcType="BIGINT" property="materialId" />
<result column="material_extend_id" jdbcType="BIGINT" property="materialExtendId" /> <result column="material_extend_id" jdbcType="BIGINT" property="materialExtendId" />
<result column="material_unit" jdbcType="VARCHAR" property="materialUnit" /> <result column="material_unit" jdbcType="VARCHAR" property="materialUnit" />
<result column="sku" jdbcType="VARCHAR" property="sku" />
<result column="oper_number" jdbcType="DECIMAL" property="operNumber" /> <result column="oper_number" jdbcType="DECIMAL" property="operNumber" />
<result column="basic_number" jdbcType="DECIMAL" property="basicNumber" /> <result column="basic_number" jdbcType="DECIMAL" property="basicNumber" />
<result column="unit_price" jdbcType="DECIMAL" property="unitPrice" /> <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
@@ -81,9 +82,9 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, header_id, material_id, material_extend_id, material_unit, oper_number, basic_number, id, header_id, material_id, material_extend_id, material_unit, sku, oper_number,
unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id, tax_rate, basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id,
tax_money, tax_last_money, material_type, tenant_id, delete_flag tax_rate, tax_money, tax_last_money, material_type, tenant_id, delete_flag
</sql> </sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
select select
@@ -117,19 +118,19 @@
</delete> </delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem"> <insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
insert into jsh_depot_item (id, header_id, material_id, insert into jsh_depot_item (id, header_id, material_id,
material_extend_id, material_unit, oper_number, material_extend_id, material_unit, sku,
basic_number, unit_price, tax_unit_price, oper_number, basic_number, unit_price,
all_price, remark, depot_id, tax_unit_price, all_price, remark,
another_depot_id, tax_rate, tax_money, depot_id, another_depot_id, tax_rate,
tax_last_money, material_type, tenant_id, tax_money, tax_last_money, material_type,
delete_flag) tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
#{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{operNumber,jdbcType=DECIMAL}, #{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR},
#{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL}, #{taxUnitPrice,jdbcType=DECIMAL}, #{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
#{allPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{depotId,jdbcType=BIGINT}, #{taxUnitPrice,jdbcType=DECIMAL}, #{allPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
#{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL}, #{taxMoney,jdbcType=DECIMAL}, #{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL},
#{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=VARCHAR}) #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem"> <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
insert into jsh_depot_item insert into jsh_depot_item
@@ -149,6 +150,9 @@
<if test="materialUnit != null"> <if test="materialUnit != null">
material_unit, material_unit,
</if> </if>
<if test="sku != null">
sku,
</if>
<if test="operNumber != null"> <if test="operNumber != null">
oper_number, oper_number,
</if> </if>
@@ -208,6 +212,9 @@
<if test="materialUnit != null"> <if test="materialUnit != null">
#{materialUnit,jdbcType=VARCHAR}, #{materialUnit,jdbcType=VARCHAR},
</if> </if>
<if test="sku != null">
#{sku,jdbcType=VARCHAR},
</if>
<if test="operNumber != null"> <if test="operNumber != null">
#{operNumber,jdbcType=DECIMAL}, #{operNumber,jdbcType=DECIMAL},
</if> </if>
@@ -276,6 +283,9 @@
<if test="record.materialUnit != null"> <if test="record.materialUnit != null">
material_unit = #{record.materialUnit,jdbcType=VARCHAR}, material_unit = #{record.materialUnit,jdbcType=VARCHAR},
</if> </if>
<if test="record.sku != null">
sku = #{record.sku,jdbcType=VARCHAR},
</if>
<if test="record.operNumber != null"> <if test="record.operNumber != null">
oper_number = #{record.operNumber,jdbcType=DECIMAL}, oper_number = #{record.operNumber,jdbcType=DECIMAL},
</if> </if>
@@ -330,6 +340,7 @@
material_id = #{record.materialId,jdbcType=BIGINT}, material_id = #{record.materialId,jdbcType=BIGINT},
material_extend_id = #{record.materialExtendId,jdbcType=BIGINT}, material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
material_unit = #{record.materialUnit,jdbcType=VARCHAR}, material_unit = #{record.materialUnit,jdbcType=VARCHAR},
sku = #{record.sku,jdbcType=VARCHAR},
oper_number = #{record.operNumber,jdbcType=DECIMAL}, oper_number = #{record.operNumber,jdbcType=DECIMAL},
basic_number = #{record.basicNumber,jdbcType=DECIMAL}, basic_number = #{record.basicNumber,jdbcType=DECIMAL},
unit_price = #{record.unitPrice,jdbcType=DECIMAL}, unit_price = #{record.unitPrice,jdbcType=DECIMAL},
@@ -363,6 +374,9 @@
<if test="materialUnit != null"> <if test="materialUnit != null">
material_unit = #{materialUnit,jdbcType=VARCHAR}, material_unit = #{materialUnit,jdbcType=VARCHAR},
</if> </if>
<if test="sku != null">
sku = #{sku,jdbcType=VARCHAR},
</if>
<if test="operNumber != null"> <if test="operNumber != null">
oper_number = #{operNumber,jdbcType=DECIMAL}, oper_number = #{operNumber,jdbcType=DECIMAL},
</if> </if>
@@ -414,6 +428,7 @@
material_id = #{materialId,jdbcType=BIGINT}, material_id = #{materialId,jdbcType=BIGINT},
material_extend_id = #{materialExtendId,jdbcType=BIGINT}, material_extend_id = #{materialExtendId,jdbcType=BIGINT},
material_unit = #{materialUnit,jdbcType=VARCHAR}, material_unit = #{materialUnit,jdbcType=VARCHAR},
sku = #{sku,jdbcType=VARCHAR},
oper_number = #{operNumber,jdbcType=DECIMAL}, oper_number = #{operNumber,jdbcType=DECIMAL},
basic_number = #{basicNumber,jdbcType=DECIMAL}, basic_number = #{basicNumber,jdbcType=DECIMAL},
unit_price = #{unitPrice,jdbcType=DECIMAL}, unit_price = #{unitPrice,jdbcType=DECIMAL},

View File

@@ -25,6 +25,7 @@
<resultMap extends="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap" id="ResultAndUnitMap" type="com.jsh.erp.datasource.entities.MaterialVo4Unit"> <resultMap extends="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap" id="ResultAndUnitMap" type="com.jsh.erp.datasource.entities.MaterialVo4Unit">
<result column="unit_name" jdbcType="VARCHAR" property="unitName" /> <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="sku" jdbcType="VARCHAR" property="sku" />
</resultMap> </resultMap>
<select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList"> <select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
@@ -124,7 +125,7 @@
</select> </select>
<select id="findBySelectWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap"> <select id="findBySelectWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.name unit_name,mc.name categoryName,me.bar_code m_bar_code,me.id meId,me.commodity_unit from jsh_material m select m.*,u.name unit_name,mc.name categoryName,me.bar_code m_bar_code,me.id meId,me.commodity_unit,me.sku from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1' left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.delete_Flag,'0') !='1'
@@ -302,7 +303,7 @@
<select id="getMaterialByBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap"> <select id="getMaterialByBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.name unit_name,me.bar_code m_bar_code, me.commodity_unit, me.purchase_decimal, me.commodity_decimal, select m.*,u.name unit_name,me.bar_code m_bar_code, me.commodity_unit, me.purchase_decimal, me.commodity_decimal,
me.wholesale_decimal, me.low_decimal me.wholesale_decimal, me.low_decimal, me.sku
from jsh_material m from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1' left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1' left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'