给商品增加图片上传功能

This commit is contained in:
季圣华
2021-07-02 00:51:54 +08:00
parent 3d32e3ae88
commit 9af01678a7
7 changed files with 123 additions and 23 deletions

View File

@@ -23,6 +23,8 @@ public class Material {
private String remark;
private String imgName;
private Long unitId;
private Boolean enabled;
@@ -119,6 +121,14 @@ public class Material {
this.remark = remark == null ? null : remark.trim();
}
public String getImgName() {
return imgName;
}
public void setImgName(String imgName) {
this.imgName = imgName == null ? null : imgName.trim();
}
public Long getUnitId() {
return unitId;
}

View File

@@ -775,6 +775,76 @@ public class MaterialExample {
return (Criteria) this;
}
public Criteria andImgNameIsNull() {
addCriterion("img_name is null");
return (Criteria) this;
}
public Criteria andImgNameIsNotNull() {
addCriterion("img_name is not null");
return (Criteria) this;
}
public Criteria andImgNameEqualTo(String value) {
addCriterion("img_name =", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameNotEqualTo(String value) {
addCriterion("img_name <>", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameGreaterThan(String value) {
addCriterion("img_name >", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameGreaterThanOrEqualTo(String value) {
addCriterion("img_name >=", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameLessThan(String value) {
addCriterion("img_name <", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameLessThanOrEqualTo(String value) {
addCriterion("img_name <=", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameLike(String value) {
addCriterion("img_name like", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameNotLike(String value) {
addCriterion("img_name not like", value, "imgName");
return (Criteria) this;
}
public Criteria andImgNameIn(List<String> values) {
addCriterion("img_name in", values, "imgName");
return (Criteria) this;
}
public Criteria andImgNameNotIn(List<String> values) {
addCriterion("img_name not in", values, "imgName");
return (Criteria) this;
}
public Criteria andImgNameBetween(String value1, String value2) {
addCriterion("img_name between", value1, value2, "imgName");
return (Criteria) this;
}
public Criteria andImgNameNotBetween(String value1, String value2) {
addCriterion("img_name not between", value1, value2, "imgName");
return (Criteria) this;
}
public Criteria andUnitIdIsNull() {
addCriterion("unit_id is null");
return (Criteria) this;

View File

@@ -18,7 +18,6 @@ import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
@@ -50,8 +49,6 @@ public class AccountHeadService {
private LogService logService;
@Resource
private AccountItemMapperEx accountItemMapperEx;
@Value(value="${file.path}")
private String filePath;
public AccountHead getAccountHead(long id) throws Exception {
AccountHead result=null;

View File

@@ -257,6 +257,6 @@ public class AccountItemService {
}
public BigDecimal getEachAmountByBillId(Long billId) {
return accountItemMapperEx.getEachAmountByBillId(billId);
return accountItemMapperEx.getEachAmountByBillId(billId).abs();
}
}

View File

@@ -12,6 +12,7 @@
<result column="color" jdbcType="VARCHAR" property="color" />
<result column="unit" jdbcType="VARCHAR" property="unit" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="img_name" jdbcType="VARCHAR" property="imgName" />
<result column="unit_id" jdbcType="BIGINT" property="unitId" />
<result column="enabled" jdbcType="BIT" property="enabled" />
<result column="other_field1" jdbcType="VARCHAR" property="otherField1" />
@@ -81,7 +82,7 @@
</sql>
<sql id="Base_Column_List">
id, category_id, name, mfrs, safety_stock, model, standard, color, unit, remark,
unit_id, enabled, other_field1, other_field2, other_field3, enable_serial_number,
img_name, unit_id, enabled, other_field1, other_field2, other_field3, enable_serial_number,
tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="BaseResultMap">
@@ -118,17 +119,17 @@
insert into jsh_material (id, category_id, name,
mfrs, safety_stock, model,
standard, color, unit,
remark, unit_id, enabled,
other_field1, other_field2, other_field3,
enable_serial_number, tenant_id, delete_flag
)
remark, img_name, unit_id,
enabled, other_field1, other_field2,
other_field3, enable_serial_number, tenant_id,
delete_flag)
values (#{id,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{mfrs,jdbcType=VARCHAR}, #{safetyStock,jdbcType=DECIMAL}, #{model,jdbcType=VARCHAR},
#{standard,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{unitId,jdbcType=BIGINT}, #{enabled,jdbcType=BIT},
#{otherField1,jdbcType=VARCHAR}, #{otherField2,jdbcType=VARCHAR}, #{otherField3,jdbcType=VARCHAR},
#{enableSerialNumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
#{remark,jdbcType=VARCHAR}, #{imgName,jdbcType=VARCHAR}, #{unitId,jdbcType=BIGINT},
#{enabled,jdbcType=BIT}, #{otherField1,jdbcType=VARCHAR}, #{otherField2,jdbcType=VARCHAR},
#{otherField3,jdbcType=VARCHAR}, #{enableSerialNumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT},
#{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Material">
insert into jsh_material
@@ -163,6 +164,9 @@
<if test="remark != null">
remark,
</if>
<if test="imgName != null">
img_name,
</if>
<if test="unitId != null">
unit_id,
</if>
@@ -219,6 +223,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="imgName != null">
#{imgName,jdbcType=VARCHAR},
</if>
<if test="unitId != null">
#{unitId,jdbcType=BIGINT},
</if>
@@ -284,6 +291,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.imgName != null">
img_name = #{record.imgName,jdbcType=VARCHAR},
</if>
<if test="record.unitId != null">
unit_id = #{record.unitId,jdbcType=BIGINT},
</if>
@@ -325,6 +335,7 @@
color = #{record.color,jdbcType=VARCHAR},
unit = #{record.unit,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
img_name = #{record.imgName,jdbcType=VARCHAR},
unit_id = #{record.unitId,jdbcType=BIGINT},
enabled = #{record.enabled,jdbcType=BIT},
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
@@ -367,6 +378,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="imgName != null">
img_name = #{imgName,jdbcType=VARCHAR},
</if>
<if test="unitId != null">
unit_id = #{unitId,jdbcType=BIGINT},
</if>
@@ -405,6 +419,7 @@
color = #{color,jdbcType=VARCHAR},
unit = #{unit,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
img_name = #{imgName,jdbcType=VARCHAR},
unit_id = #{unitId,jdbcType=BIGINT},
enabled = #{enabled,jdbcType=BIT},
other_field1 = #{otherField1,jdbcType=VARCHAR},