anderx 3 years ago
parent
commit
78c4caaab0

+ 58 - 28
src/main/java/com/goafanti/common/mapper/TTaskMidMapper.xml

@@ -25,12 +25,16 @@
     <result column="set_up_count" jdbcType="INTEGER" property="setUpCount" />
     <result column="spot_check_count" jdbcType="INTEGER" property="spotCheckCount" />
     <result column="fail_count" jdbcType="INTEGER" property="failCount" />
+    <result column="last_year" jdbcType="VARCHAR" property="lastYear" />
+    <result column="last_year_capital" jdbcType="VARCHAR" property="lastYearCapital" />
+    <result column="last_year_income" jdbcType="VARCHAR" property="lastYearIncome" />
   </resultMap>
   <sql id="Base_Column_List">
     id, tid, cost_amount, party_amount, create_time, certificates_count, urgent_day,
     if_material, reject_count, accept_count, end_count, authorize_count, apply_count,
     high_new_retrial, dispatch_count, stock_count, complete_count, promulgate_count,
-    dispatch_province, duty_dep, set_up_count, spot_check_count, fail_count
+    dispatch_province, duty_dep, set_up_count, spot_check_count, fail_count, last_year,
+    last_year_capital, last_year_income
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -42,30 +46,29 @@
     delete from t_task_mid
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.TTaskMid">
-    insert into t_task_mid (id, tid, cost_amount,
-      party_amount, create_time, certificates_count,
-      urgent_day, if_material, reject_count,
-      accept_count, end_count, authorize_count,
-      apply_count, high_new_retrial, dispatch_count,
-      stock_count, complete_count, promulgate_count,
-      dispatch_province, duty_dep, set_up_count,
-      spot_check_count, fail_count)
-    values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL},
-      #{partyAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER},
-      #{urgentDay,jdbcType=INTEGER}, #{ifMaterial,jdbcType=INTEGER}, #{rejectCount,jdbcType=INTEGER},
-      #{acceptCount,jdbcType=INTEGER}, #{endCount,jdbcType=INTEGER}, #{authorizeCount,jdbcType=INTEGER},
-      #{applyCount,jdbcType=INTEGER}, #{highNewRetrial,jdbcType=INTEGER}, #{dispatchCount,jdbcType=INTEGER},
-      #{stockCount,jdbcType=INTEGER}, #{completeCount,jdbcType=INTEGER}, #{promulgateCount,jdbcType=INTEGER},
-      #{dispatchProvince,jdbcType=INTEGER}, #{dutyDep,jdbcType=VARCHAR}, #{setUpCount,jdbcType=INTEGER},
-      #{spotCheckCount,jdbcType=INTEGER}, #{failCount,jdbcType=INTEGER})
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TTaskMid" useGeneratedKeys="true">
+    insert into t_task_mid (tid, cost_amount, party_amount,
+      create_time, certificates_count, urgent_day,
+      if_material, reject_count, accept_count,
+      end_count, authorize_count, apply_count,
+      high_new_retrial, dispatch_count, stock_count,
+      complete_count, promulgate_count, dispatch_province,
+      duty_dep, set_up_count, spot_check_count,
+      fail_count, last_year, last_year_capital,
+      last_year_income)
+    values (#{tid,jdbcType=INTEGER}, #{costAmount,jdbcType=DECIMAL}, #{partyAmount,jdbcType=DECIMAL},
+      #{createTime,jdbcType=TIMESTAMP}, #{certificatesCount,jdbcType=INTEGER}, #{urgentDay,jdbcType=INTEGER},
+      #{ifMaterial,jdbcType=INTEGER}, #{rejectCount,jdbcType=INTEGER}, #{acceptCount,jdbcType=INTEGER},
+      #{endCount,jdbcType=INTEGER}, #{authorizeCount,jdbcType=INTEGER}, #{applyCount,jdbcType=INTEGER},
+      #{highNewRetrial,jdbcType=INTEGER}, #{dispatchCount,jdbcType=INTEGER}, #{stockCount,jdbcType=INTEGER},
+      #{completeCount,jdbcType=INTEGER}, #{promulgateCount,jdbcType=INTEGER}, #{dispatchProvince,jdbcType=INTEGER},
+      #{dutyDep,jdbcType=VARCHAR}, #{setUpCount,jdbcType=INTEGER}, #{spotCheckCount,jdbcType=INTEGER},
+      #{failCount,jdbcType=INTEGER}, #{lastYear,jdbcType=VARCHAR}, #{lastYearCapital,jdbcType=VARCHAR},
+      #{lastYearIncome,jdbcType=VARCHAR})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.TTaskMid">
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TTaskMid" useGeneratedKeys="true">
     insert into t_task_mid
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
       <if test="tid != null">
         tid,
       </if>
@@ -132,11 +135,17 @@
       <if test="failCount != null">
         fail_count,
       </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="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
       <if test="tid != null">
         #{tid,jdbcType=INTEGER},
       </if>
@@ -203,6 +212,15 @@
       <if test="failCount != null">
         #{failCount,jdbcType=INTEGER},
       </if>
+      <if test="lastYear != null">
+        #{lastYear,jdbcType=VARCHAR},
+      </if>
+      <if test="lastYearCapital != null">
+        #{lastYearCapital,jdbcType=VARCHAR},
+      </if>
+      <if test="lastYearIncome != null">
+        #{lastYearIncome,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TTaskMid">
@@ -274,6 +292,15 @@
       <if test="failCount != null">
         fail_count = #{failCount,jdbcType=INTEGER},
       </if>
+      <if test="lastYear != null">
+        last_year = #{lastYear,jdbcType=VARCHAR},
+      </if>
+      <if test="lastYearCapital != null">
+        last_year_capital = #{lastYearCapital,jdbcType=VARCHAR},
+      </if>
+      <if test="lastYearIncome != null">
+        last_year_income = #{lastYearIncome,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -300,7 +327,10 @@
       duty_dep = #{dutyDep,jdbcType=VARCHAR},
       set_up_count = #{setUpCount,jdbcType=INTEGER},
       spot_check_count = #{spotCheckCount,jdbcType=INTEGER},
-      fail_count = #{failCount,jdbcType=INTEGER}
+      fail_count = #{failCount,jdbcType=INTEGER},
+      last_year = #{lastYear,jdbcType=VARCHAR},
+      last_year_capital = #{lastYearCapital,jdbcType=VARCHAR},
+      last_year_income = #{lastYearIncome,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -439,8 +469,8 @@
   <select id="getDtails" resultType="com.goafanti.common.model.TTaskMid">
     select a.id tid,dg.id dispatchProvince,tr.department_id dutyDep
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
-    left join department c on b.order_dep =c.id  left join admin tr on a.task_receiver =tr.id
-    left join district_glossory dg on c.province =dg.id
+                        left join department c on b.order_dep =c.id  left join admin tr on a.task_receiver =tr.id
+                        left join district_glossory dg on c.province =dg.id
     where a.id= #{id};
   </select>
 

+ 39 - 0
src/main/java/com/goafanti/common/model/TTaskMid.java

@@ -124,6 +124,21 @@ public class TTaskMid implements Serializable {
      */
     private Integer failCount;
 
+    /**
+     * 上年度年份
+     */
+    private String lastYear;
+
+    /**
+     * 上年度总资本
+     */
+    private String lastYearCapital;
+
+    /**
+     * 上年度总收入
+     */
+    private String lastYearIncome;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -309,6 +324,30 @@ public class TTaskMid implements Serializable {
     public void setFailCount(Integer failCount) {
         this.failCount = failCount;
     }
+
+    public String getLastYear() {
+        return lastYear;
+    }
+
+    public void setLastYear(String lastYear) {
+        this.lastYear = lastYear;
+    }
+
+    public String getLastYearCapital() {
+        return lastYearCapital;
+    }
+
+    public void setLastYearCapital(String lastYearCapital) {
+        this.lastYearCapital = lastYearCapital;
+    }
+
+    public String getLastYearIncome() {
+        return lastYearIncome;
+    }
+
+    public void setLastYearIncome(String lastYearIncome) {
+        this.lastYearIncome = lastYearIncome;
+    }
     public TTaskMid(Integer tid, BigDecimal costAmount) {
         this.tid = tid;
         this.costAmount = costAmount;

+ 29 - 0
src/main/java/com/goafanti/order/bo/InputAddTask.java

@@ -2,11 +2,40 @@ package com.goafanti.order.bo;
 
 import com.goafanti.common.model.TOrderTask;
 
+import java.math.BigDecimal;
+
 public class InputAddTask  extends TOrderTask {
     private String serviceLife;
     private String serviceYear;
     private Integer yearSum;
     private String contractTerm;
+    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;
+    }
 
     public String getContractTerm() {
         return contractTerm;

+ 1 - 1
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -93,7 +93,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	/**
-	 * 添加项目
+	 * 添加项目、新增项目
 	 */
 	@RequestMapping(value = "/addOrderTask",method = RequestMethod.POST)
 	public Result addOrderTask(InputAddTask in){

+ 1 - 3
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -213,7 +213,5 @@ public interface OrderNewService {
 
 	int updateSalesType(TOrderNew in);
 
-
-	int addTaskMid(Integer id,String commodityId, String orderNo);
-
+	void addTaskMid(Integer id, String commodityId, String orderNo);
 }

+ 27 - 13
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -195,7 +195,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if(t.getCommodityPrice()!=null) {
 			order.setTotalAmount(order.getTotalAmount());
 		}
-		addTTaskMember(t, order);
+		addTTaskMember(t);
+		addTaskMid(t);
 		//如果是会员添加同性质不同项目
 		BusinessProject bp=businessProjectMapper.selectByPrimaryKey(t.getCommodityId());
 		if (bp.getType()==ProjectType.HY.getCode()){
@@ -218,12 +219,13 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			t2.setMain(0);
 			t2.setCommodityPrice(new BigDecimal(0));
 			t2.setId(null);
-			addTTaskMember(t2, order);
+			addTTaskMember(t2);
+			addTaskMid(t2);
 		}
 		return t;
 	}
 
-	private void addTTaskMember(InputAddTask t, TOrderNew order) {
+	private void addTTaskMember(InputAddTask t) {
 		String str=tOrderTaskMapper.selectByidGetCname(t.getCommodityId());
 		t.setCname(str);
 		tOrderTaskMapper.insertSelective(t);
@@ -236,34 +238,45 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			if(t.getContractTerm()!=null)ttm.setContractTerm(t.getContractTerm());
 			tTaskMemberMapper.insertSelective(ttm);
 		}
-		addTaskMid(t.getId(), t.getCommodityId(), order.getOrderNo());
 	}
 
 	@Override
-	public int addTaskMid(Integer id,String commodityId, String orderNo) {
+	public void addTaskMid(Integer id, String commodityId, String orderNo) {
+		InputAddTask t = new InputAddTask();
+		t.setId(id);
+		t.setCommodityId(commodityId);
+		t.setOrderNo(orderNo);
+		addTaskMid( t);
+	}
+
+
+	public int addTaskMid(InputAddTask t) {
 		TTaskMid tm=new TTaskMid();
-		tm.setTid(id);
+		tm.setTid(t.getId());
 		//判断这个项目是不是高新复审
 		int highNewRetrial=0;
-		BusinessProject b=businessProjectMapper.selectByPrimaryKey(commodityId);
+		BusinessProject b=businessProjectMapper.selectByPrimaryKey(t.getCommodityId());
 		if (b.getType()==5){
-			int i=tOrderTaskMapper.getHighNewRetrial(orderNo);
+			int i=tOrderTaskMapper.getHighNewRetrial(t.getOrderNo());
 			if (i>0) {
 				highNewRetrial =1;
 			}
 			BusinessCategory bc =businessCategoryMapper.selectByPrimaryKey(b.getCid());
 			if (bc !=null && bc.getSort().equals(6)){
 				TOrderMid tom=new TOrderMid();
-				tom.setOrderNo(orderNo);
+				tom.setOrderNo(t.getOrderNo());
 				tom.setProjectType(1);
 				tOrderMidMapper.updateByOrderNo(tom);
 			}
 		}
 		tm.setHighNewRetrial(highNewRetrial);
-		TTaskMid dtails = tTaskMidMapper.getDtails(id);
-		TTaskMid tTaskMid = new TTaskMid(id, new BigDecimal(0));
-		tTaskMid.setDispatchProvince(dtails.getDispatchProvince());
-		tTaskMid.setDutyDep(dtails.getDutyDep());
+		tm.setLastYear(t.getLastYear());
+		tm.setLastYearCapital(new BigDecimal(t.getLastYearCapital()));
+		tm.setLastYearIncome(t.getLastYearIncome());
+		//获取派单省份与部门
+		TTaskMid dtails = tTaskMidMapper.getDtails(t.getId());
+		tm.setDispatchProvince(dtails.getDispatchProvince());
+		tm.setDutyDep(dtails.getDutyDep());
 		return tTaskMidMapper.insertSelective(tm);
 	}
 
@@ -861,6 +874,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
+
 	@Override
 	public int updateOrderNew(String orderNo, Integer orderStatus,String reason,Integer outsource, TOrderOutsource o) {
 		TOrderNew t= new TOrderNew();

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20