Browse Source

新增高新会员项目修改

anderx 10 months ago
parent
commit
ed0eb2c83e

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

@@ -679,7 +679,7 @@ project_type = values(project_type)
 
     <select id="selectBusinessProjectByName" parameterType="java.lang.String" resultType="com.goafanti.business.bo.BusinessProjectBo">
         select  a.id,a.bname,ifnull(a.price,0) as price,ifnull(a.first_payment,0) as firstPayment,
-        a.type ,a.patent_transfer patentTransfer,b.cname,b.sort CSort,b.project_type projectType
+        a.type ,a.patent_transfer patentTransfer,b.cname,b.sort CSort,a.project_type projectType
         from business_project a  left join business_category b on a.cid=b.id
         where 1=1
         <if test="cname != null">

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

@@ -1664,7 +1664,8 @@ progress_tid = values(progress_tid)
         a.patent_type patentType,a.picture_url pictureUrl,j.service_life serviceLife ,j.service_year serviceYear,j.year_sum yearSum,ttm.change,
         ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,ttm.stop_status projectStopStatus,
         a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy,a.just_forms justForms,
-        a.technology_project_Type technologyProjectType,a.ordinary_risk ordinaryRisk,a.days,a.scheme,a.unilateral_service unilateralService
+        a.technology_project_Type technologyProjectType,a.ordinary_risk ordinaryRisk,a.days,a.scheme,a.unilateral_service unilateralService,
+        a.ht_member htMember,a.additional_deduction additionalDeduction,a.rd_awardsubsidy rdAwardsubsidy
         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

+ 51 - 19
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -4,6 +4,7 @@ package com.goafanti.order.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.DepartmentService;
+import com.goafanti.business.bo.BusinessProjectBo;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.OrderOperator;
@@ -244,25 +245,56 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (bp.getType()==ProjectType.HY.getCode()){
 			InputAddTask t2=new InputAddTask();
 			BeanUtils.copyProperties(t,t2);
-			//会员项目替换
-			if (t.getCommodityName().contains("财税")){
-				String t2Name=t.getCommodityName().replaceAll("财税","技术");
-				BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
-				if (bp2==null)return t;
-				t2.setCommodityId(bp2.getId());
-				t2.setCommodityName(bp2.getBname());
-			}else if (t.getCommodityName().contains("技术")){
-				String t2Name=t.getCommodityName().replaceAll("技术","财税");
-				BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
-				if (bp2==null)return t;
-				t2.setCommodityId(bp2.getId());
-				t2.setCommodityName(bp2.getBname());
-			}
-			t2.setMain(0);
-			t2.setCommodityPrice(new BigDecimal(0));
-			t2.setId(null);
-			addTTaskMember(t2);
-			addTaskMid(t2);
+			if (t.getMemberType()==1){
+				//会员项目替换
+				if (t.getCommodityName().contains("财税")){
+					String t2Name=t.getCommodityName().replaceAll("财税","技术");
+					BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
+					if (bp2==null)return t;
+					t2.setCommodityId(bp2.getId());
+					t2.setCommodityName(bp2.getBname());
+				}else if (t.getCommodityName().contains("技术")){
+					String t2Name=t.getCommodityName().replaceAll("技术","财税");
+					BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
+					if (bp2==null)return t;
+					t2.setCommodityId(bp2.getId());
+					t2.setCommodityName(bp2.getBname());
+				}
+				t2.setMain(0);
+				t2.setCommodityPrice(new BigDecimal(0));
+				t2.setId(null);
+				addTTaskMember(t2);
+				addTaskMid(t2);
+			}
+			if(t.getAdditionalDeduction()==1){
+				//加计扣除
+				List<BusinessProjectBo> additionalDeductionList = businessProjectMapper.selectBusinessProjectByName("加计扣除", null);
+				for (BusinessProjectBo e : additionalDeductionList) {
+					t2.setCommodityId(e.getId());
+					t2.setCommodityName(e.getBname());
+					t2.setMain(0);
+					t2.setCommodityPrice(new BigDecimal(0));
+					t2.setId(null);
+					addTTaskMember(t2);
+					addTaskMid(t2);
+				}
+			}
+
+			if(t.getRdAwardsubsidy()==1){
+				//研发奖补
+				List<BusinessProjectBo> list = businessProjectMapper.selectBusinessProjectByName("研发奖补", null);
+				for (BusinessProjectBo e : list) {
+					t2.setCommodityId(e.getId());
+					t2.setCommodityName(e.getBname());
+					t2.setMain(0);
+					t2.setCommodityPrice(new BigDecimal(0));
+					t2.setId(null);
+					addTTaskMember(t2);
+					addTaskMid(t2);
+				}
+			}
+
+
 		}
 		return t;
 	}