Browse Source

主项目本次派单关于新增、修改及变更等多接口修改

anderx 3 years ago
parent
commit
9467f4a269

+ 1 - 1
src/main/java/com/goafanti/common/dao/TOrderMidMapper.java

@@ -36,7 +36,7 @@ public interface TOrderMidMapper {
 
     void updateCostAmount(@Param("tid")Integer tid, @Param("cost")BigDecimal cost, @Param("payment")BigDecimal payment);
 
-    void updateAddCostAmount(@Param("tid")Integer tid, @Param("cost")BigDecimal cost);
+    void updateAddCostAmount(TOrderMid in);
 
     int updateByOrderNo(TOrderMid tm);
 

+ 179 - 13
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml

@@ -27,13 +27,26 @@
     <result column="project_type" jdbcType="INTEGER" property="projectType" />
     <result column="service_type" jdbcType="VARCHAR" property="serviceType" />
     <result column="service_project" jdbcType="VARCHAR" property="serviceProject" />
+    <result column="cost_actual" jdbcType="DECIMAL" property="costActual" />
+    <result column="patent_cost" jdbcType="DECIMAL" property="patentCost" />
+    <result column="patent_cost_actual" jdbcType="DECIMAL" property="patentCostActual" />
+    <result column="soft_cost" jdbcType="DECIMAL" property="softCost" />
+    <result column="soft_cost_actual" jdbcType="DECIMAL" property="softCostActual" />
+    <result column="audit_cost" jdbcType="DECIMAL" property="auditCost" />
+    <result column="audit_cost_actual" jdbcType="DECIMAL" property="auditCostActual" />
+    <result column="other_cost" jdbcType="DECIMAL" property="otherCost" />
+    <result column="other_cost_actual" jdbcType="DECIMAL" property="otherCostActual" />
+    <result column="expect_profit" jdbcType="DECIMAL" property="expectProfit" />
+    <result column="actual_profit" jdbcType="DECIMAL" property="actualProfit" />
   </resultMap>
   <sql id="Base_Column_List">
     id, order_no, salesman_id, finance_id, salesman_name, finance_name, final_receivables,
     final_Receivables_time, invoice_amount, create_time, buyer_name, order_receivables,
     order_arrears, payment_amount, cost_amount, dep_name, province_name, legal_affairs,
     dun_start_time, legal_affairs_type, operation_time, legal_affairs_status, project_type,
-    service_type, service_project
+    service_type, service_project, cost_actual, patent_cost, patent_cost_actual, soft_cost,
+    soft_cost_actual, audit_cost, audit_cost_actual, other_cost, other_cost_actual, expect_profit,
+    actual_profit
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -54,7 +67,11 @@
       dep_name, province_name, legal_affairs,
       dun_start_time, legal_affairs_type, operation_time,
       legal_affairs_status, project_type, service_type,
-      service_project)
+      service_project, cost_actual, patent_cost,
+      patent_cost_actual, soft_cost, soft_cost_actual,
+      audit_cost, audit_cost_actual, other_cost,
+      other_cost_actual, expect_profit, actual_profit
+      )
     values (#{orderNo,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR},
       #{salesmanName,jdbcType=VARCHAR}, #{financeName,jdbcType=VARCHAR}, #{finalReceivables,jdbcType=DECIMAL},
       #{finalReceivablesTime,jdbcType=TIMESTAMP}, #{invoiceAmount,jdbcType=DECIMAL},
@@ -63,7 +80,11 @@
       #{depName,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, #{legalAffairs,jdbcType=INTEGER},
       #{dunStartTime,jdbcType=TIMESTAMP}, #{legalAffairsType,jdbcType=INTEGER}, #{operationTime,jdbcType=DATE},
       #{legalAffairsStatus,jdbcType=INTEGER}, #{projectType,jdbcType=INTEGER}, #{serviceType,jdbcType=VARCHAR},
-      #{serviceProject,jdbcType=VARCHAR})
+      #{serviceProject,jdbcType=VARCHAR}, #{costActual,jdbcType=DECIMAL}, #{patentCost,jdbcType=DECIMAL},
+      #{patentCostActual,jdbcType=DECIMAL}, #{softCost,jdbcType=DECIMAL}, #{softCostActual,jdbcType=DECIMAL},
+      #{auditCost,jdbcType=DECIMAL}, #{auditCostActual,jdbcType=DECIMAL}, #{otherCost,jdbcType=DECIMAL},
+      #{otherCostActual,jdbcType=DECIMAL}, #{expectProfit,jdbcType=DECIMAL}, #{actualProfit,jdbcType=DECIMAL}
+      )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderMid" useGeneratedKeys="true">
     insert into t_order_mid
@@ -140,6 +161,39 @@
       <if test="serviceProject != null">
         service_project,
       </if>
+      <if test="costActual != null">
+        cost_actual,
+      </if>
+      <if test="patentCost != null">
+        patent_cost,
+      </if>
+      <if test="patentCostActual != null">
+        patent_cost_actual,
+      </if>
+      <if test="softCost != null">
+        soft_cost,
+      </if>
+      <if test="softCostActual != null">
+        soft_cost_actual,
+      </if>
+      <if test="auditCost != null">
+        audit_cost,
+      </if>
+      <if test="auditCostActual != null">
+        audit_cost_actual,
+      </if>
+      <if test="otherCost != null">
+        other_cost,
+      </if>
+      <if test="otherCostActual != null">
+        other_cost_actual,
+      </if>
+      <if test="expectProfit != null">
+        expect_profit,
+      </if>
+      <if test="actualProfit != null">
+        actual_profit,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -214,6 +268,39 @@
       <if test="serviceProject != null">
         #{serviceProject,jdbcType=VARCHAR},
       </if>
+      <if test="costActual != null">
+        #{costActual,jdbcType=DECIMAL},
+      </if>
+      <if test="patentCost != null">
+        #{patentCost,jdbcType=DECIMAL},
+      </if>
+      <if test="patentCostActual != null">
+        #{patentCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="softCost != null">
+        #{softCost,jdbcType=DECIMAL},
+      </if>
+      <if test="softCostActual != null">
+        #{softCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="auditCost != null">
+        #{auditCost,jdbcType=DECIMAL},
+      </if>
+      <if test="auditCostActual != null">
+        #{auditCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="otherCost != null">
+        #{otherCost,jdbcType=DECIMAL},
+      </if>
+      <if test="otherCostActual != null">
+        #{otherCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="expectProfit != null">
+        #{expectProfit,jdbcType=DECIMAL},
+      </if>
+      <if test="actualProfit != null">
+        #{actualProfit,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderMid">
@@ -291,6 +378,39 @@
       <if test="serviceProject != null">
         service_project = #{serviceProject,jdbcType=VARCHAR},
       </if>
+      <if test="costActual != null">
+        cost_actual = #{costActual,jdbcType=DECIMAL},
+      </if>
+      <if test="patentCost != null">
+        patent_cost = #{patentCost,jdbcType=DECIMAL},
+      </if>
+      <if test="patentCostActual != null">
+        patent_cost_actual = #{patentCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="softCost != null">
+        soft_cost = #{softCost,jdbcType=DECIMAL},
+      </if>
+      <if test="softCostActual != null">
+        soft_cost_actual = #{softCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="auditCost != null">
+        audit_cost = #{auditCost,jdbcType=DECIMAL},
+      </if>
+      <if test="auditCostActual != null">
+        audit_cost_actual = #{auditCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="otherCost != null">
+        other_cost = #{otherCost,jdbcType=DECIMAL},
+      </if>
+      <if test="otherCostActual != null">
+        other_cost_actual = #{otherCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="expectProfit != null">
+        expect_profit = #{expectProfit,jdbcType=DECIMAL},
+      </if>
+      <if test="actualProfit != null">
+        actual_profit = #{actualProfit,jdbcType=DECIMAL},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -319,7 +439,18 @@
       legal_affairs_status = #{legalAffairsStatus,jdbcType=INTEGER},
       project_type = #{projectType,jdbcType=INTEGER},
       service_type = #{serviceType,jdbcType=VARCHAR},
-      service_project = #{serviceProject,jdbcType=VARCHAR}
+      service_project = #{serviceProject,jdbcType=VARCHAR},
+      cost_actual = #{costActual,jdbcType=DECIMAL},
+      patent_cost = #{patentCost,jdbcType=DECIMAL},
+      patent_cost_actual = #{patentCostActual,jdbcType=DECIMAL},
+      soft_cost = #{softCost,jdbcType=DECIMAL},
+      soft_cost_actual = #{softCostActual,jdbcType=DECIMAL},
+      audit_cost = #{auditCost,jdbcType=DECIMAL},
+      audit_cost_actual = #{auditCostActual,jdbcType=DECIMAL},
+      other_cost = #{otherCost,jdbcType=DECIMAL},
+      other_cost_actual = #{otherCostActual,jdbcType=DECIMAL},
+      expect_profit = #{expectProfit,jdbcType=DECIMAL},
+      actual_profit = #{actualProfit,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -364,15 +495,7 @@
     where  a.order_no=b.order_no and a.id= #{tid}
   </update>
 
-  <update id="updateAddCostAmount">
-    update t_order_task a ,t_order_mid b
-    <set>
-      <if test="cost !=null">
-        b.cost_amount= b.cost_amount+#{cost},
-      </if>
-    </set>
-    where  a.order_no=b.order_no and a.id= #{tid}
-  </update>
+
   <update id="updateByOrderNo">
     update t_order_mid
     <set>
@@ -596,4 +719,47 @@
     set a.service_project =b.pname,a.service_type =b.cname
     where a.order_no=b.order_no and a.order_no = #{orderNo};
   </update>
+
+  <update id="updateAddCostAmount" parameterType="com.goafanti.common.model.TOrderMid">
+    update t_order_mid
+    <set>
+      <if test="costActual != null">
+        cost_actual =cost_actual+ #{costActual,jdbcType=DECIMAL},
+      </if>
+      <if test="patentCost != null">
+        patent_cost =patent_cost+ #{patentCost,jdbcType=DECIMAL},
+      </if>
+      <if test="patentCostActual != null">
+        patent_cost_actual =patent_cost_actual+ #{patentCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="softCost != null">
+        soft_cost =soft_cost+ #{softCost,jdbcType=DECIMAL},
+      </if>
+      <if test="softCostActual != null">
+        soft_cost_actual =soft_cost_actual+ #{softCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="auditCost != null">
+        audit_cost =audit_cost+ #{auditCost,jdbcType=DECIMAL},
+      </if>
+      <if test="auditCostActual != null">
+        audit_cost_actual =audit_cost_actual+ #{auditCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="otherCost != null">
+        other_cost =other_cost+ #{otherCost,jdbcType=DECIMAL},
+      </if>
+      <if test="otherCostActual != null">
+        other_cost_actual =other_cost_actual+ #{otherCostActual,jdbcType=DECIMAL},
+      </if>
+      <if test="expectProfit != null">
+        expect_profit =expect_profit+ #{expectProfit,jdbcType=DECIMAL},
+      </if>
+      <if test="actualProfit != null">
+        actual_profit =actual_profit+ #{actualProfit,jdbcType=DECIMAL},
+      </if>
+      <if test="costAmount != null">
+        cost_amount =cost_amount+ #{costAmount,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where  order_no =#{orderNo}
+  </update>
 </mapper>

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

@@ -1737,9 +1737,10 @@
   </select>
 
   <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
-    select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
-           c.amount officialAmount,c.proportion85,b.patent_type outPatentType from t_order_task a left join t_order_outsource b on a.id=b.tid
-                                                                                                  left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
+    select a.id,a.order_no orderNo,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,
+           b.patent_name_type projectType, c.amount officialAmount,c.proportion85,b.patent_type outPatentType,d.type
+    from t_order_task a left join t_order_outsource b on a.id=b.tid left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
+    left join business_project d on a.commodity_id=d.id
     where a.id= #{tid}
   </select>
   <select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">

+ 2 - 1
src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml

@@ -525,7 +525,8 @@
 	 select a.id,a.tid,a.company_name companyName,a.unit_price unitPrice,a.quantity,a.total_amount totalAmount,a.material,a.urgent,
 	a.patent_name_type patentNameType,a.audit,a.assets,a.income,a.remarks,a.cid,b.cost_reduction costReduction,b.official_cost officialCost,
 	a.type,a.party_amount partyAmount ,op.amount officialUnitPrice,op.proportion85 reductionAmount,a.start_type startType,a.patent_type patentType
-	from third_party_company a left join t_order_task b on a.tid=b.id  left join official_fee_price op on b.patent_type =op.patent_type  and a.patent_name_type =op.`type`
+	from third_party_company a left join t_order_task b on a.tid=b.id
+	left join official_fee_price op on b.patent_type =op.patent_type  and a.patent_name_type =op.`type`
  where tid= #{tid}
   </select>
 <!--   <select id="selectByTidPuls" resultType="com.goafanti.organization.bo.ProjectTypePuls">

+ 143 - 0
src/main/java/com/goafanti/common/model/TOrderMid.java

@@ -134,6 +134,61 @@ public class TOrderMid implements Serializable {
      */
     private String serviceProject;
 
+    /**
+     * 成本实付
+     */
+    private BigDecimal costActual;
+
+    /**
+     * 专利成本
+     */
+    private BigDecimal patentCost;
+
+    /**
+     * 专利成本实付
+     */
+    private BigDecimal patentCostActual;
+
+    /**
+     * 软著成本
+     */
+    private BigDecimal softCost;
+
+    /**
+     * 软著成本实付
+     */
+    private BigDecimal softCostActual;
+
+    /**
+     * 审计成本
+     */
+    private BigDecimal auditCost;
+
+    /**
+     * 审计成本实付
+     */
+    private BigDecimal auditCostActual;
+
+    /**
+     * 其他成本
+     */
+    private BigDecimal otherCost;
+
+    /**
+     * 其他成本实付
+     */
+    private BigDecimal otherCostActual;
+
+    /**
+     * 预计毛利
+     */
+    private BigDecimal expectProfit;
+
+    /**
+     * 实际毛利
+     */
+    private BigDecimal actualProfit;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -335,4 +390,92 @@ public class TOrderMid implements Serializable {
     public void setServiceProject(String serviceProject) {
         this.serviceProject = serviceProject;
     }
+
+    public BigDecimal getCostActual() {
+        return costActual;
+    }
+
+    public void setCostActual(BigDecimal costActual) {
+        this.costActual = costActual;
+    }
+
+    public BigDecimal getPatentCost() {
+        return patentCost;
+    }
+
+    public void setPatentCost(BigDecimal patentCost) {
+        this.patentCost = patentCost;
+    }
+
+    public BigDecimal getPatentCostActual() {
+        return patentCostActual;
+    }
+
+    public void setPatentCostActual(BigDecimal patentCostActual) {
+        this.patentCostActual = patentCostActual;
+    }
+
+    public BigDecimal getSoftCost() {
+        return softCost;
+    }
+
+    public void setSoftCost(BigDecimal softCost) {
+        this.softCost = softCost;
+    }
+
+    public BigDecimal getSoftCostActual() {
+        return softCostActual;
+    }
+
+    public void setSoftCostActual(BigDecimal softCostActual) {
+        this.softCostActual = softCostActual;
+    }
+
+    public BigDecimal getAuditCost() {
+        return auditCost;
+    }
+
+    public void setAuditCost(BigDecimal auditCost) {
+        this.auditCost = auditCost;
+    }
+
+    public BigDecimal getAuditCostActual() {
+        return auditCostActual;
+    }
+
+    public void setAuditCostActual(BigDecimal auditCostActual) {
+        this.auditCostActual = auditCostActual;
+    }
+
+    public BigDecimal getOtherCost() {
+        return otherCost;
+    }
+
+    public void setOtherCost(BigDecimal otherCost) {
+        this.otherCost = otherCost;
+    }
+
+    public BigDecimal getOtherCostActual() {
+        return otherCostActual;
+    }
+
+    public void setOtherCostActual(BigDecimal otherCostActual) {
+        this.otherCostActual = otherCostActual;
+    }
+
+    public BigDecimal getExpectProfit() {
+        return expectProfit;
+    }
+
+    public void setExpectProfit(BigDecimal expectProfit) {
+        this.expectProfit = expectProfit;
+    }
+
+    public BigDecimal getActualProfit() {
+        return actualProfit;
+    }
+
+    public void setActualProfit(BigDecimal actualProfit) {
+        this.actualProfit = actualProfit;
+    }
 }

+ 15 - 8
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -1692,6 +1692,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	public void updateOrderCostAmount(Integer tid,Integer type) {
 		//计算项目成本
 		List<OutThirdPartyCompany>list=thirdPartyCompanyMapper.selectByTid(tid);
+
 		BigDecimal tCount=new BigDecimal(0);
 		for (OutThirdPartyCompany op : list) {
 			tCount=tCount.add(new BigDecimal(op.getTotalAmount()));
@@ -1709,15 +1710,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			}
 		}
 		tTaskMidMapper.updateCostAmount(tid,tCount);
-		//计算订单成本
-		BigDecimal oCount=new BigDecimal(0);
-		List <TTaskMid> tlist=tTaskMidMapper.selectListByTid(tid);
-		for (TTaskMid tm : tlist) {
-			if (tm!=null&&tm.getCostAmount()!=null) {
-				oCount=oCount.add(tm.getCostAmount()==null?new BigDecimal(0):tm.getCostAmount());
-			}
+		// //计算订单成本 分类成本
+		ProjectTypePuls projectTypePuls = tOrderTaskMapper.selectByTidGetDtails(tid);
+		TOrderMid in=new TOrderMid();
+		in.setOrderNo(projectTypePuls.getOrderNo());
+		in.setCostAmount(tCount);
+		if (projectTypePuls.getType()== ProjectType.ZL.getCode()){
+			in.setPatentCost(tCount);
+		}else if (projectTypePuls.getType()== ProjectType.RZ.getCode()){
+			in.setSoftCost(tCount);
+		}else if (projectTypePuls.getType()== ProjectType.SJ.getCode()){
+			in.setAuditCost(tCount);
+		}else {
+			in.setOtherCost(tCount);
 		}
-		tOrderMidMapper.updateCostAmount(tid,oCount,null);
+		tOrderMidMapper.updateAddCostAmount(in);
 	}
 
 	@Override

+ 167 - 166
src/main/java/com/goafanti/organization/bo/OutThirdPartyCompany.java

@@ -5,330 +5,331 @@ import java.util.Date;
 
 
 public class OutThirdPartyCompany  {
-	
+
 	private Integer costReduction;
-	
+
 	private Integer officialCost;
-	private String officialUnitPrice; 
+	private String officialUnitPrice;
 	private String reductionAmount;
-	
+
 	private Integer  patentType;
 
 	private BigDecimal proportion85;
-	
-	
+
+
 	private Integer id;
-	
-	
-	
+
+
+
 	private Integer tid;
-	
-	
-	
+
+
+
 	private String companyName;
-	
-	
-	
+
+
+
 	private String unitPrice;
-	
-	
-	
+
+
+
 	private Integer quantity;
-	
-	
-	
+
+
+
 	private String totalAmount;
-	
-	
-	
+
+
+
 	private Integer material;
-	
-	
-	
+
+
+
 	private Integer urgent;
-	
-	
-	
+
+
+
 	private Integer audit;
-	
-	
-	
+
+
+
 	private String assets;
-	
-	
-	
+
+
+
 	private String income;
-	
-	
-	
+
+
+
 	private String remarks;
-	
-	
-	
+
+
+
 	private Date createTime;
-	
-	
-	
+
+
+
 	private Integer cid;
-	
-	
-	
+
+
+
 	private BigDecimal partyAmount;
-	
-	
-	
+
+
+
 	private Integer type;
-	
-	
-	
+
+
+
 	private Integer patentNameType;
-	
-	
-	
-	
-	
 
-	
+
+
+
+
+
+
 	private Integer startType;
-	
-	
-	
+
+
+
+
 	public Integer getId() {
 		return id;
 	}
 
-	
-	
-	
-	
-	
+
+
+
+
+
 	public void setId(Integer id) {
 		this.id = id;
 	}
 
-	
-	
+
+
 	public Integer getTid() {
 		return tid;
 	}
 
-	
-	
-	
+
+
+
 	public void setTid(Integer tid) {
 		this.tid = tid;
 	}
 
-	
-	
-	
+
+
+
 	public String getCompanyName() {
 		return companyName;
 	}
 
-	
-	
-	
+
+
+
 	public void setCompanyName(String companyName) {
 		this.companyName = companyName;
 	}
 
-	
-	
-	
+
+
+
 	public String getUnitPrice() {
 		return unitPrice;
 	}
 
-	
-	
-	
+
+
+
 	public void setUnitPrice(String unitPrice) {
 		this.unitPrice = unitPrice;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getQuantity() {
 		return quantity;
 	}
 
-	
-	
-	
+
+
+
 	public void setQuantity(Integer quantity) {
 		this.quantity = quantity;
 	}
 
-	
-	
-	
+
+
+
 	public String getTotalAmount() {
 		return totalAmount;
 	}
 
-	
-	
-	
+
+
+
 	public void setTotalAmount(String totalAmount) {
 		this.totalAmount = totalAmount;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getMaterial() {
 		return material;
 	}
 
-	
-	
-	
+
+
+
 	public void setMaterial(Integer material) {
 		this.material = material;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getUrgent() {
 		return urgent;
 	}
 
-	
-	
-	
+
+
+
 	public void setUrgent(Integer urgent) {
 		this.urgent = urgent;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getAudit() {
 		return audit;
 	}
 
-	
-	
-	
+
+
+
 	public void setAudit(Integer audit) {
 		this.audit = audit;
 	}
 
-	
-	
-	
+
+
+
 	public String getAssets() {
 		return assets;
 	}
 
-	
-	
-	
+
+
+
 	public void setAssets(String assets) {
 		this.assets = assets;
 	}
 
-	
-	
-	
+
+
+
 	public String getIncome() {
 		return income;
 	}
 
-	
-	
-	
+
+
+
 	public void setIncome(String income) {
 		this.income = income;
 	}
 
-	
-	
-	
+
+
+
 	public String getRemarks() {
 		return remarks;
 	}
 
-	
-	
-	
+
+
+
 	public void setRemarks(String remarks) {
 		this.remarks = remarks;
 	}
 
-	
-	
-	
+
+
+
 	public Date getCreateTime() {
 		return createTime;
 	}
 
-	
-	
-	
+
+
+
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getCid() {
 		return cid;
 	}
 
-	
-	
-	
+
+
+
 	public void setCid(Integer cid) {
 		this.cid = cid;
 	}
 
-	
-	
-	
+
+
+
 	public BigDecimal getPartyAmount() {
 		return partyAmount;
 	}
 
-	
-	
-	
+
+
+
 	public void setPartyAmount(BigDecimal partyAmount) {
 		this.partyAmount = partyAmount;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getType() {
 		return type;
 	}
 
-	
-	
-	
+
+
+
 	public void setType(Integer type) {
 		this.type = type;
 	}
 
-	
-	
-	
+
+
+
 	public Integer getPatentNameType() {
 		return patentNameType;
 	}
 
-	
-	
-	
+
+
+
 	public void setPatentNameType(Integer patentNameType) {
 		this.patentNameType = patentNameType;
 	}
-	
+
 	public Integer getCostReduction() {
 		return costReduction;
 	}
@@ -431,7 +432,7 @@ public class OutThirdPartyCompany  {
 	public void setProportion85(BigDecimal proportion85) {
 		this.proportion85 = proportion85;
 	}
-	
-	
+
+
 
 }

+ 21 - 3
src/main/java/com/goafanti/organization/bo/ProjectTypePuls.java

@@ -3,8 +3,9 @@ package com.goafanti.organization.bo;
 import java.math.BigDecimal;
 
 public class ProjectTypePuls {
-	
+
 	private Integer id;
+	private String orderNo;
 	private Integer patentType;
 	private Integer projectType;
 	private BigDecimal officialAmount;
@@ -13,6 +14,23 @@ public class ProjectTypePuls {
 	private Integer quantity;
 	private Integer officialCost;
 	private Integer outPatentType;
+	private Integer Type;
+
+	public String getOrderNo() {
+		return orderNo;
+	}
+
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	public Integer getType() {
+		return Type;
+	}
+
+	public void setType(Integer type) {
+		Type = type;
+	}
 
 	public Integer getOutPatentType() {
 		return outPatentType;
@@ -71,7 +89,7 @@ public class ProjectTypePuls {
 	public void setOfficialAmount(BigDecimal officialAmount) {
 		this.officialAmount = officialAmount;
 	}
-	
-	
+
+
 
 }

+ 16 - 13
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -13,6 +13,8 @@ import java.util.UUID;
 import javax.servlet.http.HttpServletResponse;
 
 import com.goafanti.admin.service.DepartmentService;
+import com.goafanti.common.model.*;
+import com.goafanti.order.enums.ProjectType;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
@@ -38,18 +40,6 @@ import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.TTaskMidMapper;
 import com.goafanti.common.dao.ThirdPartyCompanyMapper;
 import com.goafanti.common.enums.NoticeStatus;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.CompanyLibrary;
-import com.goafanti.common.model.Notice;
-import com.goafanti.common.model.OfficialFeePrice;
-import com.goafanti.common.model.PatentPrice;
-import com.goafanti.common.model.PaymentLog;
-import com.goafanti.common.model.PaymentNode;
-import com.goafanti.common.model.SoftWritingPrice;
-import com.goafanti.common.model.TOrderPayment;
-import com.goafanti.common.model.TOrderTask;
-import com.goafanti.common.model.TTaskMid;
-import com.goafanti.common.model.ThirdPartyCompany;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
@@ -136,7 +126,20 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			}
 			if (type!=null&&type==1) {
 				tOrderTaskMapper.updateAddCostAmount(t.getTid(), t.getTotalAmount());
-				tOrderMidMapper.updateAddCostAmount(t.getTid(), t.getTotalAmount());
+				ProjectTypePuls projectTypePuls = tOrderTaskMapper.selectByTidGetDtails(t.getTid());
+				TOrderMid in=new TOrderMid();
+				in.setOrderNo(projectTypePuls.getOrderNo());
+				in.setCostAmount(t.getTotalAmount());
+				if (projectTypePuls.getType()== ProjectType.ZL.getCode()){
+					in.setPatentCost(t.getTotalAmount());
+				}else if (projectTypePuls.getType()== ProjectType.RZ.getCode()){
+					in.setSoftCost(t.getTotalAmount());
+				}else if (projectTypePuls.getType()== ProjectType.SJ.getCode()){
+					in.setAuditCost(t.getTotalAmount());
+				}else {
+					in.setOtherCost(t.getTotalAmount());
+				}
+				tOrderMidMapper.updateAddCostAmount(in);
 			}
 		thirdPartyCompanyMapper.insertSelective(t);
 		return 1;