Browse Source

项目完成修改审计新增字段

anderx 3 years ago
parent
commit
b4fc588aad

+ 44 - 8
src/main/java/com/goafanti/common/mapper/TChangeTaskMapper.xml

@@ -26,12 +26,15 @@
     <result column="declaration_batch" jdbcType="INTEGER" property="declarationBatch" />
     <result column="patent_type" jdbcType="INTEGER" property="patentType" />
     <result column="change_split_super" jdbcType="INTEGER" property="changeSplitSuper" />
+    <result column="last_year" jdbcType="VARCHAR" property="lastYear" />
+    <result column="last_year_capital" jdbcType="DECIMAL" property="lastYearCapital" />
+    <result column="last_year_income" jdbcType="DECIMAL" property="lastYearIncome" />
   </resultMap>
   <sql id="Base_Column_List">
     id, tid, cid, order_no, main, commodity_id, commodity_name, commodity_quantity, commodity_price,
     task_comment, `type`, create_time, split_status, split_super, receiver_name, official_cost,
     cost_reduction, service_life, service_year, year_sum, contract_term, declaration_batch,
-    patent_type, change_split_super
+    patent_type, change_split_super, last_year, last_year_capital, last_year_income
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -43,7 +46,6 @@
     delete from t_change_task
     where id = #{id,jdbcType=INTEGER}
   </delete>
-
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TChangeTask" useGeneratedKeys="true">
     insert into t_change_task (tid, cid, order_no,
       main, commodity_id, commodity_name,
@@ -52,7 +54,8 @@
       split_super, receiver_name, official_cost,
       cost_reduction, service_life, service_year,
       year_sum, contract_term, declaration_batch,
-      patent_type, change_split_super)
+      patent_type, change_split_super, last_year,
+      last_year_capital, last_year_income)
     values (#{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR},
       #{main,jdbcType=INTEGER}, #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR},
       #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL}, #{taskComment,jdbcType=VARCHAR},
@@ -60,7 +63,8 @@
       #{splitSuper,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR}, #{officialCost,jdbcType=INTEGER},
       #{costReduction,jdbcType=INTEGER}, #{serviceLife,jdbcType=VARCHAR}, #{serviceYear,jdbcType=VARCHAR},
       #{yearSum,jdbcType=INTEGER}, #{contractTerm,jdbcType=VARCHAR}, #{declarationBatch,jdbcType=INTEGER},
-      #{patentType,jdbcType=INTEGER}, #{changeSplitSuper,jdbcType=INTEGER})
+      #{patentType,jdbcType=INTEGER}, #{changeSplitSuper,jdbcType=INTEGER}, #{lastYear,jdbcType=VARCHAR},
+      #{lastYearCapital,jdbcType=DECIMAL}, #{lastYearIncome,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TChangeTask" useGeneratedKeys="true">
     insert into t_change_task
@@ -134,6 +138,15 @@
       <if test="changeSplitSuper != null">
         change_split_super,
       </if>
+      <if test="lastYear != null">
+        last_year,
+      </if>
+      <if test="lastYearCapital != null">
+        last_year_capital,
+      </if>
+      <if test="lastYearIncome != null">
+        last_year_income,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="tid != null">
@@ -205,6 +218,15 @@
       <if test="changeSplitSuper != null">
         #{changeSplitSuper,jdbcType=INTEGER},
       </if>
+      <if test="lastYear != null">
+        #{lastYear,jdbcType=VARCHAR},
+      </if>
+      <if test="lastYearCapital != null">
+        #{lastYearCapital,jdbcType=DECIMAL},
+      </if>
+      <if test="lastYearIncome != null">
+        #{lastYearIncome,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TChangeTask">
@@ -279,6 +301,15 @@
       <if test="changeSplitSuper != null">
         change_split_super = #{changeSplitSuper,jdbcType=INTEGER},
       </if>
+      <if test="lastYear != null">
+        last_year = #{lastYear,jdbcType=VARCHAR},
+      </if>
+      <if test="lastYearCapital != null">
+        last_year_capital = #{lastYearCapital,jdbcType=DECIMAL},
+      </if>
+      <if test="lastYearIncome != null">
+        last_year_income = #{lastYearIncome,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -306,7 +337,10 @@
       contract_term = #{contractTerm,jdbcType=VARCHAR},
       declaration_batch = #{declarationBatch,jdbcType=INTEGER},
       patent_type = #{patentType,jdbcType=INTEGER},
-      change_split_super = #{changeSplitSuper,jdbcType=INTEGER}
+      change_split_super = #{changeSplitSuper,jdbcType=INTEGER},
+      last_year = #{lastYear,jdbcType=VARCHAR},
+      last_year_capital = #{lastYearCapital,jdbcType=DECIMAL},
+      last_year_income = #{lastYearIncome,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -315,7 +349,8 @@
       order_no, commodity_id, commodity_name,
       commodity_quantity, commodity_price, task_comment,
         split_super , receiver_name, create_time,service_life,
-    service_year, year_sum, contract_term,declaration_batch,patent_type)
+    service_year, year_sum, contract_term,declaration_batch,patent_type,
+    last_year,last_year_capital,last_year_income)
     values
     <foreach collection="list" index="index" item="item" separator=",">
       ( #{item.tid,jdbcType=INTEGER}, #{item.cid,jdbcType=INTEGER}, #{item.splitStatus,jdbcType=INTEGER},
@@ -323,7 +358,8 @@
       #{item.commodityQuantity,jdbcType=INTEGER}, #{item.commodityPrice,jdbcType=DECIMAL}, #{item.taskComment,jdbcType=VARCHAR},
        #{item.splitSuper,jdbcType=INTEGER}, #{item.receiverName,jdbcType=VARCHAR}, now(), #{item.serviceLife,jdbcType=VARCHAR},
       #{item.serviceYear,jdbcType=VARCHAR}, #{item.yearSum,jdbcType=INTEGER},#{item.contractTerm,jdbcType=VARCHAR},
-      #{item.declarationBatch,jdbcType=INTEGER},#{item.patentType,jdbcType=INTEGER})
+      #{item.declarationBatch,jdbcType=INTEGER},#{item.patentType,jdbcType=INTEGER},
+       #{item.lastYear,jdbcType=VARCHAR}, #{item.lastYearCapital,jdbcType=DECIMAL},#{item.lastYearIncome,jdbcType=DECIMAL})
     </foreach>
   </insert>
   <select id="selectByCid" resultType="com.goafanti.order.bo.TChangeTaskOut">
@@ -332,7 +368,7 @@
 	a.receiver_name receiverName, a.task_comment as taskComment ,a.commodity_price as commodityPrice,a.split_status splitStatus,
 	a.split_super splitSuper, a.service_life serviceLife ,a.service_year serviceYear,a.year_sum yearSum,i.patent_transfer patentTransfer,
     i.type taskType, a.declaration_batch declarationBatch,a.patent_type patentType,a.contract_term contractTerm,
-    a.change_split_super changeSplitSuper
+    a.change_split_super changeSplitSuper,a.last_year lastYear,a.last_year_income lastYearIncome,a.last_year_capital lastYearCapital
     from t_change_task a left join business_project i on a.commodity_id=i.id
   	left join business_category c on i.cid=c.id
   	where 1=1

+ 3 - 1
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -792,11 +792,13 @@
     a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus,
     a.task_receiver as taskReceiver ,a.if_certification_fee ifCertificationFee , a.split_status splitStatus,
     a.cost_reduction costReduction,a.official_cost officialCost,i.`type` ,d.name ,a.declaration_batch declarationBatch,
-    a.patent_type patentType,a.picture_url pictureUrl,j.service_life serviceLife ,j.service_year serviceYear,j.year_sum yearSum
+    a.patent_type patentType,a.picture_url pictureUrl,j.service_life serviceLife ,j.service_year serviceYear,j.year_sum yearSum,
+    ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome
     from t_order_task a left join business_project b on a.commodity_id=b.id left join t_order_new e on a.order_no=e.order_no
     left join admin f on e.salesman_id=f.id left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id
     left join business_project i on a.commodity_id=i.id left join business_category c on b.cid=c.id
     left join admin d on a.task_receiver=d.id left join t_task_member j on a.id =j.tid
+    left join t_task_mid ttm on a.id=ttm.tid
     where a.super_id is null and a.split_status in(0,1)
       <if test="orderNo != null">
       and a.order_no= #{orderNo,jdbcType=VARCHAR}

+ 44 - 4
src/main/java/com/goafanti/common/model/TChangeTask.java

@@ -6,7 +6,7 @@ import java.util.Date;
 
 /**
  * t_change_task
- * @author
+ * @author 
  */
 public class TChangeTask implements Serializable {
     /**
@@ -60,7 +60,7 @@ public class TChangeTask implements Serializable {
     private String taskComment;
 
     /**
-     * 状态 0正常 1新增 2修改 3删除
+     * 状态 0正常 1新增 2修改 3删除 
      */
     private Integer type;
 
@@ -90,7 +90,7 @@ public class TChangeTask implements Serializable {
     private Integer officialCost;
 
     /**
-     * 费减 0否 1有
+     * 费减 0否 1有 
      */
     private Integer costReduction;
 
@@ -129,6 +129,22 @@ public class TChangeTask implements Serializable {
      */
     private Integer changeSplitSuper;
 
+    /**
+     * 上年度年份
+     */
+    private String lastYear;
+
+    /**
+     * 上年度总资本
+     */
+    private BigDecimal lastYearCapital;
+
+    /**
+     * 上年度总收入
+     */
+    private BigDecimal lastYearIncome;
+
+    private static final long serialVersionUID = 1L;
 
     public Integer getId() {
         return id;
@@ -321,4 +337,28 @@ public class TChangeTask implements Serializable {
     public void setChangeSplitSuper(Integer changeSplitSuper) {
         this.changeSplitSuper = changeSplitSuper;
     }
-}
+
+    public String getLastYear() {
+        return lastYear;
+    }
+
+    public void setLastYear(String lastYear) {
+        this.lastYear = lastYear;
+    }
+
+    public BigDecimal getLastYearCapital() {
+        return lastYearCapital;
+    }
+
+    public void setLastYearCapital(BigDecimal lastYearCapital) {
+        this.lastYearCapital = lastYearCapital;
+    }
+
+    public BigDecimal getLastYearIncome() {
+        return lastYearIncome;
+    }
+
+    public void setLastYearIncome(BigDecimal lastYearIncome) {
+        this.lastYearIncome = lastYearIncome;
+    }
+}

+ 28 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskBo.java

@@ -50,6 +50,34 @@ public class TOrderTaskBo extends TOrderTask{
 	private String contractTerm;
 	private Integer	yearSum;
 
+	private String lastYear;
+	private BigDecimal lastYearCapital;
+	private BigDecimal lastYearIncome;
+
+	public String getLastYear() {
+		return lastYear;
+	}
+
+	public void setLastYear(String lastYear) {
+		this.lastYear = lastYear;
+	}
+
+	public BigDecimal getLastYearCapital() {
+		return lastYearCapital;
+	}
+
+	public void setLastYearCapital(BigDecimal lastYearCapital) {
+		this.lastYearCapital = lastYearCapital;
+	}
+
+	public BigDecimal getLastYearIncome() {
+		return lastYearIncome;
+	}
+
+	public void setLastYearIncome(BigDecimal lastYearIncome) {
+		this.lastYearIncome = lastYearIncome;
+	}
+
 	private List<TOrderTaskListBo> splitList;
 
 

+ 24 - 0
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -846,6 +846,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				if (cd.getServiceLife()!=null){
 					addTaskMember(ot.getId(),cd.getServiceLife(),cd.getServiceYear(),cd.getYearSum(),cd.getContractTerm());
 				}
+				if (cd.getLastYear()!=null){
+					addTaskMid(ot.getId(),cd.getLastYear(),cd.getLastYearCapital(),cd.getLastYearIncome());
+				}
 				cd.setTid(ot.getId());
 				tChangeTaskMapper.updateByPrimaryKeySelective(cd);
 				tChangeDunMapper.updateByCTid(cd.getId(), ot.getId());
@@ -859,6 +862,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				if (cd.getServiceLife()!=null){
 					updateTaskMember(ot.getId(),cd.getServiceLife(),cd.getServiceYear(),cd.getYearSum(),cd.getContractTerm());
 				}
+				if (cd.getLastYear()!=null){
+					updateTaskMid(ot.getId(),cd.getLastYear(),cd.getLastYearCapital(),cd.getLastYearIncome());
+				}
 			}else if(cd.getType()==3) {
 				tOrderTaskMapper.deleteByPrimaryKey(cd.getTid());
 			}
@@ -866,6 +872,24 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		return map;
 	}
 
+	private void updateTaskMid(Integer id, String lastYear, BigDecimal lastYearCapital, BigDecimal lastYearIncome) {
+		TTaskMid tTaskMid = new TTaskMid();
+		tTaskMid.setTid(id);
+		tTaskMid.setLastYear(lastYear);
+		tTaskMid.setLastYearCapital(lastYearCapital);
+		tTaskMid.setLastYearIncome(lastYearIncome);
+		tTaskMidMapper.updateByTid(tTaskMid);
+	}
+
+	private void addTaskMid(Integer id, String lastYear, BigDecimal lastYearCapital, BigDecimal lastYearIncome) {
+		TTaskMid tTaskMid = new TTaskMid();
+		tTaskMid.setTid(id);
+		tTaskMid.setLastYear(lastYear);
+		tTaskMid.setLastYearCapital(lastYearCapital);
+		tTaskMid.setLastYearIncome(lastYearIncome);
+		tTaskMidMapper.insertSelective(tTaskMid);
+	}
+
 	private void updateTaskMember(Integer id, String serviceLife, String serviceYear, Integer yearSum,String contractTerm) {
 		TTaskMember ttm=new TTaskMember();
 		ttm.setTid(id);