Browse Source

1、订单详情项目列表新增专利转让字段
2、营销员订单列表新增下单开始结束时间。
3、项目状态修改判断修改订单项目状态

anderx 4 years ago
parent
commit
e083d775b1

+ 10 - 4
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -935,9 +935,12 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="depId != null">
   	and a.order_dep = #{depId,jdbcType=VARCHAR}
   	</if>
-  	<if test="starTime !=null and endTime !=null">
-  	and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-  	</if>
+    <if test="starTime !=null and endTime !=null">
+      and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+    </if>
+    <if test="contractStart !=null and contractEnd !=null">
+      and a.sign_time between #{contractStart,jdbcType=VARCHAR} and #{contractEnd,jdbcType=VARCHAR}
+    </if>
   	order by
   	<if test="specially == 3">
   	a.approval,
@@ -1050,10 +1053,13 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="starTime !=null and endTime !=null">
   	and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
+     <if test="contractStart !=null and contractEnd !=null">
+       and a.sign_time between #{contractStart,jdbcType=VARCHAR} and #{contractEnd,jdbcType=VARCHAR}
+     </if>
   </select>
 
   <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.outOrderDunListBo">
-    	select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,tm.salesman_name as salesmanName,b.project_status projectStatus,
+    select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,tm.salesman_name as salesmanName,e.project_status projectStatus,
 	b.total_amount as totalAmount,b.liquidation_status as liquidationStatus,b.settlement_amount as settlementAmount,a.money as accountsReceivable,
 	if((b.total_amount-b.settlement_amount) &lt; 0,0,(b.total_amount-b.settlement_amount)) as uncollectedAmount,b.order_status as orderStatus,
 	date_format(a.start_time, '%Y-%m-%d') as startDate,dep.name as depName,date_format(b.sign_time,'%Y-%m-%d') as signDate,

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

@@ -1222,17 +1222,17 @@
     </selectKey>
   </insert>
   <select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
-		select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,
-	a.outsource_name outsourceName,a.outsource, a.outsource_price outsourcePrice,g.name depName,
-	e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
-	c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,
-	i.price,a.certificate_number as certificateNumber, a.commodity_id as commodityId,a.manager_id managerId,
-	a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
-	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 
-	from t_order_task a left join business_project b on a.commodity_id=b.id
+    select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,
+           a.outsource_name outsourceName,a.outsource, a.outsource_price outsourcePrice,g.name depName,
+           e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
+           c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,b.patent_transfer patentTransfer ,
+           i.price,a.certificate_number as certificateNumber, a.commodity_id as commodityId,a.manager_id managerId,
+           a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
+           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
+    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

+ 11 - 2
src/main/java/com/goafanti/order/bo/TOrderTaskBo.java

@@ -37,10 +37,19 @@ public class TOrderTaskBo extends TOrderTask{
 	
 	private Integer patentType;
 	private String patentTypeName;
-	
+	private Integer patentTransfer;
+
 	@Excel(name = "项目状态",sort = 13)
 	private String projectStatusName;
-	
+
+	public Integer getPatentTransfer() {
+		return patentTransfer;
+	}
+
+	public void setPatentTransfer(Integer patentTransfer) {
+		this.patentTransfer = patentTransfer;
+	}
+
 	public Integer getPatentType() {
 		return patentType;
 	}

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

@@ -242,10 +242,11 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value="/orderNewList", method = RequestMethod.GET)
 	public Result orderNewList(String aid,String name,String orderNo,String starTime,String endTime ,Integer specially ,Integer approval,
-			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer amountStatus,Integer pageNo,Integer pageSize){
+			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer amountStatus,
+							   String contractStart,String contractEnd,Integer pageNo,Integer pageSize){
 		Result res=new Result();
 		res.data(orderNewService.orderNewList(aid,name, orderNo, starTime, endTime, specially ,approval, distribution,depId,
-				contractNo,outsource, liquidationStatus,amountStatus,pageNo, pageSize));
+				contractNo,outsource, liquidationStatus,amountStatus,contractStart, contractEnd,pageNo, pageSize));
 		return res;
 	}
 	

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

@@ -79,7 +79,9 @@ public interface OrderNewService {
 	 * @param amountStatus 
 	 * @return
 	 */
-	Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially ,Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus,Integer pageNo, Integer pageSize);
+	Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially ,
+										 Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus,
+										 String contractStart, String contractEnd, Integer pageNo, Integer pageSize);
 	/**
 	 * 订单审核
 	 * @param orderNo
@@ -197,4 +199,6 @@ public interface OrderNewService {
     List<outStatisticsList> statisticsList(InputStatistics in);
 
 	List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in);
+
+
 }

+ 4 - 1
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -610,7 +610,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially,Integer approval,
-			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus, Integer pageNo, Integer pageSize) {
+			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus,
+												String contractStart, String contractEnd,  Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
@@ -638,6 +639,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		if (StringUtils.isNotBlank(contractStart)) params.put("contractStart", contractStart);
+		if (StringUtils.isNotBlank(contractEnd)) params.put("contractEnd", contractEnd+" 23:59:59");
 		params.put("outsource", outsource);
 		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, pageNo, pageSize);
 		return p;

+ 8 - 6
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -695,12 +695,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	}
 
 	private void meanwhileUpdateOrder(TOrderTask task) {
-//		if (task.getMain()==1) {//是否是主要项目 更改为不管是不是主项目都会有奖金信息
-			//更改订单项目状态
-			TOrderNew tNew=new TOrderNew();
-			tNew.setProjectStatus(task.getProjectStatus());
-			tNew.setOrderNo(task.getOrderNo());
-			tOrderNewMapper.updateByPrimaryKeySelective(tNew);
+		//是否是主要项目
+		if (task.getMain()==1) {
+		//更改订单项目状态
+		TOrderNew tNew = new TOrderNew();
+		tNew.setProjectStatus(task.getProjectStatus());
+		tNew.setOrderNo(task.getOrderNo());
+		tOrderNewMapper.updateByPrimaryKeySelective(tNew);
+		}
 			if (task.getProjectStatus()==NewProjectStatus.YTJ.getCode()||task.getProjectStatus()==NewProjectStatus.YLX.getCode()||
 					task.getProjectStatus()==NewProjectStatus.YNGS.getCode()) {
 				TOrderBonus tb=new TOrderBonus();