Commit c00006c1 authored by luben's avatar luben

Merge branch 'dev-lb' into 'main'

fix

See merge request !17
parents a447de02 1f2dcd33
Pipeline #142890 passed with stages
in 3 minutes and 43 seconds
...@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -77,6 +78,18 @@ public class CompanyEconomyInfoController { ...@@ -77,6 +78,18 @@ public class CompanyEconomyInfoController {
*/ */
@PostMapping(value = "/save") @PostMapping(value = "/save")
public AjaxResult save(@RequestBody GridCompanyEconomyInfoExt infoExt) { public AjaxResult save(@RequestBody GridCompanyEconomyInfoExt infoExt) {
infoExt.setYearSales(infoExt.getSales().toString());
infoExt.setYearTaxes(infoExt.getTaxes().toString());
int sale = 0;
for(String s:infoExt.getSales()){
sale += Integer.parseInt(s);
}
infoExt.setSale(BigDecimal.valueOf(sale));
int tax = 0;
for (String s:infoExt.getTaxes()){
tax += Integer.parseInt(s);
}
infoExt.setTax(BigDecimal.valueOf(tax));
companyEconomyInfoService.save(infoExt); companyEconomyInfoService.save(infoExt);
return AjaxResult.success("提交成功"); return AjaxResult.success("提交成功");
} }
......
package com.ruoyi.system.domain.grid; package com.ruoyi.system.domain.grid;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
@Data
public class GridCompanyEconomyInfo implements Serializable { public class GridCompanyEconomyInfo implements Serializable {
private String id; private String id;
...@@ -58,71 +62,79 @@ public class GridCompanyEconomyInfo implements Serializable { ...@@ -58,71 +62,79 @@ public class GridCompanyEconomyInfo implements Serializable {
private String companyName; private String companyName;
private static final long serialVersionUID = 1L; private List<String> sales;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public BigDecimal getSale() {
return sale;
}
public void setSale(BigDecimal sale) {
this.sale = sale;
}
public BigDecimal getTax() {
return tax;
}
public void setTax(BigDecimal tax) {
this.tax = tax;
}
public BigDecimal getPerMu() {
return perMu;
}
public void setPerMu(BigDecimal perMu) { private List<String> taxes;
this.perMu = perMu;
}
public String getYear() { private String yearSales;
return year;
}
public void setYear(String year) { private String yearTaxes;
this.year = year;
}
public String getIsValid() { private static final long serialVersionUID = 1L;
return isValid;
}
public void setIsValid(String isValid) {
this.isValid = isValid;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) { // public String getId() {
this.createTime = createTime; // return id;
} // }
//
// public void setId(String id) {
// this.id = id;
// }
//
// public String getCompanyId() {
// return companyId;
// }
//
// public void setCompanyId(String companyId) {
// this.companyId = companyId;
// }
//
// public BigDecimal getSale() {
// return sale;
// }
//
// public void setSale(BigDecimal sale) {
// this.sale = sale;
// }
//
// public BigDecimal getTax() {
// return tax;
// }
//
// public void setTax(BigDecimal tax) {
// this.tax = tax;
// }
//
// public BigDecimal getPerMu() {
// return perMu;
// }
//
// public void setPerMu(BigDecimal perMu) {
// this.perMu = perMu;
// }
//
// public String getYear() {
// return year;
// }
//
// public void setYear(String year) {
// this.year = year;
// }
//
// public String getIsValid() {
// return isValid;
// }
//
// public void setIsValid(String isValid) {
// this.isValid = isValid;
// }
//
// public String getCreateTime() {
// return createTime;
// }
//
// public void setCreateTime(String createTime) {
// this.createTime = createTime;
// }
@Override @Override
public String toString() { public String toString() {
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<result column="year" jdbcType="VARCHAR" property="year" /> <result column="year" jdbcType="VARCHAR" property="year" />
<result column="is_valid" jdbcType="VARCHAR" property="isValid" /> <result column="is_valid" jdbcType="VARCHAR" property="isValid" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" /> <result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="year_sales" jdbcType="VARCHAR" property="yearSales" />
<result column="year_taxes" jdbcType="VARCHAR" property="yearTaxes" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -70,7 +72,7 @@ ...@@ -70,7 +72,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, company_id, sale, tax, per_mu, year, is_valid, create_time id, company_id, sale, tax, per_mu, year, is_valid, create_time, year_sales, year_taxes
</sql> </sql>
<select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultMap="BaseResultMap">
select select
...@@ -105,10 +107,11 @@ ...@@ -105,10 +107,11 @@
<insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo"> <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
insert into grid_company_economy_info (id, company_id, sale, insert into grid_company_economy_info (id, company_id, sale,
tax, per_mu, year, tax, per_mu, year,
is_valid, create_time) is_valid, create_time, year_sales, year_taxes)
values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{sale,jdbcType=DECIMAL}, values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{sale,jdbcType=DECIMAL},
#{tax,jdbcType=DECIMAL}, #{perMu,jdbcType=DECIMAL}, #{year,jdbcType=VARCHAR}, #{tax,jdbcType=DECIMAL}, #{perMu,jdbcType=DECIMAL}, #{year,jdbcType=VARCHAR},
#{isValid,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}) #{isValid,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}
, #{yearSales,jdbcType=VARCHAR}, #{yearTaxes,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo"> <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
insert into grid_company_economy_info insert into grid_company_economy_info
...@@ -137,6 +140,12 @@ ...@@ -137,6 +140,12 @@
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="yearSales != null">
year_sales,
</if>
<if test="yearTaxes != null">
year_taxes,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -163,6 +172,12 @@ ...@@ -163,6 +172,12 @@
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR},
</if> </if>
<if test="yearSales != null">
#{yearSales,jdbcType=VARCHAR},
</if>
<if test="yearTaxes != null">
#{yearTaxes,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultType="java.lang.Long">
...@@ -198,6 +213,12 @@ ...@@ -198,6 +213,12 @@
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=VARCHAR},
</if> </if>
<if test="record.yearSales != null">
year_sales = #{record.yearSales,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
year_taxes = #{record.yearTaxes,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -212,7 +233,9 @@ ...@@ -212,7 +233,9 @@
per_mu = #{record.perMu,jdbcType=DECIMAL}, per_mu = #{record.perMu,jdbcType=DECIMAL},
year = #{record.year,jdbcType=VARCHAR}, year = #{record.year,jdbcType=VARCHAR},
is_valid = #{record.isValid,jdbcType=VARCHAR}, is_valid = #{record.isValid,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=VARCHAR} create_time = #{record.createTime,jdbcType=VARCHAR},
year_sales = #{record.yearSales,jdbcType=VARCHAR},
year_taxes = #{record.yearTaxes,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -241,6 +264,12 @@ ...@@ -241,6 +264,12 @@
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=VARCHAR},
</if> </if>
<if test="record.yearSales != null">
year_sales = #{record.yearSales,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
year_taxes = #{record.yearTaxes,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
...@@ -252,7 +281,9 @@ ...@@ -252,7 +281,9 @@
per_mu = #{perMu,jdbcType=DECIMAL}, per_mu = #{perMu,jdbcType=DECIMAL},
year = #{year,jdbcType=VARCHAR}, year = #{year,jdbcType=VARCHAR},
is_valid = #{isValid,jdbcType=VARCHAR}, is_valid = #{isValid,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=VARCHAR} create_time = #{createTime,jdbcType=VARCHAR},
year_sales = #{yearSales,jdbcType=VARCHAR},
year_taxes = #{yearTaxes,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment