Browse Source

订单变更审核修改BUG修复

anderx 6 years ago
parent
commit
e091fdd0f1

+ 3 - 3
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import com.goafanti.admin.bo.InputAdmin;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.cognizance.bo.ActivityNumberBo;
 import com.goafanti.cognizance.bo.AnnualReportBo;
@@ -64,7 +63,6 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.enums.AdminFields;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.CertifySubmitType;
 import com.goafanti.common.enums.CognizanceApplyFields;
@@ -2619,7 +2617,8 @@ public class AdminApiController extends CertifyApiController {
 		res.setData(disposeCognizanceStatus());
 		return res;
 	}
-
+	
+	
 	/**
 	 * 高企认定流转状态
 	 */
@@ -2637,6 +2636,7 @@ public class AdminApiController extends CertifyApiController {
 
 	/**
 	 * 保存高企认定详情
+	 * 
 	 */
 	@RequestMapping(value = "/disposeCognizanceDetail", method = RequestMethod.POST)
 	public Result disposeCognizanceDetail(@Valid InputOrgCognizance cog, BindingResult bindingResult,

+ 1 - 0
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -83,4 +83,5 @@ public interface AdminService {
 	Pagination<AdminCustomerBo> selectAdminCustomerStatistics(String depId, String startTime, String endTime, Integer pageSize, Integer pageNo);
 
 	Pagination<AdminCustomerDetailBo> selectAdminCustomerList(String aid, String startTime, String endTime,Integer type, Integer pageSize, Integer pageNo);
+
 }

+ 15 - 0
src/main/java/com/goafanti/common/bo/OrderExamineBo.java

@@ -0,0 +1,15 @@
+package com.goafanti.common.bo;
+
+import com.goafanti.common.model.OrderExamine;
+
+public class OrderExamineBo extends OrderExamine {
+			private String name;
+
+			public String getName() {
+				return name;
+			}
+
+			public void setName(String name) {
+				this.name = name;
+			} 
+}

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

@@ -1,8 +1,11 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.bo.OrderExamineBo;
 import com.goafanti.common.model.OrderExamine;
 import com.goafanti.common.model.OrderExamineExample;
 import java.util.List;
+import java.util.Map;
+
 import org.apache.ibatis.annotations.Param;
 
 public interface OrderExamineMapper {
@@ -96,5 +99,9 @@ public interface OrderExamineMapper {
 
 	void updateByOrderNoAndAid(@Param("orderNo") String orderNo,@Param("aid") String aid,@Param("type")Integer type);
 
-	int checkCountStatus(@Param("orderNo")String orderNo, @Param("type")Integer type);
+	int checkCountStatus(@Param("orderNo")String orderNo, @Param("type")Integer type,@Param("status")Integer status);
+
+	List<OrderExamineBo> selectByOrderNo(@Param("orderNo")String orderNo, @Param("type")Integer type);
+
+	int selectByOrderNoAndAid(@Param("orderNo") String orderNo,@Param("aid") String aid);
 }

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

@@ -304,6 +304,22 @@
   update order_examine set status=1 where aid= #{aid} and order_no= #{orderNo} and type= #{type}
   </update>
   <select id="checkCountStatus" resultType="java.lang.Integer">
-  select count(*) from order_examine where order_no = #{orderNo} and `type`= #{type} and status=0
+  select count(*) from order_examine where order_no = #{orderNo}
+  <if test="status !=null">
+  and status=#{status}
+  </if>
+  <if test="type !=null">
+  and `type`= #{type}
+  </if>
+  </select>
+  
+  <select id="selectByOrderNo" resultType="com.goafanti.common.bo.OrderExamineBo">
+    		select a.id,b.name,a.type,a.status
+    from order_examine a left join admin b on a.aid=b.id
+    where a.order_no= #{orderNo} and a.type= #{type}
+  </select>
+  <select id="selectByOrderNoAndAid" resultType="java.lang.Integer">
+  select ifnull(min(status),2) from order_examine
+		where order_no= #{orderNo} and aid= #{aid}
   </select>
 </mapper>

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

@@ -903,8 +903,8 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
-  	select 
-  		a.id,a.order_no as orderNo,a.commodity_name as commodityName,a.commodity_id as commodityId,
+  select 
+  		a.id,a.order_no as orderNo,a.commodity_name as commodityName,a.commodity_id as commodityId,manager_id managerId,consultant_id consultantId,
   		a.commodity_quantity as commodityQuantity,a.commodity_price as commodityPrice,a.task_comment as taskComment,
   		a.task_status as taskStatus,a.project_status as projectStatus,a.main,a.task_receiver as taskReceiver ,a.certificate_number as certificateNumber,
   		d.name as contacts,d.contact_mobile as contactsMobile,c.cname

+ 29 - 2
src/main/java/com/goafanti/order/bo/NewOrderChangeBo.java

@@ -1,7 +1,9 @@
 package com.goafanti.order.bo;
 
 import java.math.BigDecimal;
+import java.util.List;
 
+import com.goafanti.common.bo.OrderExamineBo;
 import com.goafanti.common.model.NewOrderChange;
 
 public class NewOrderChangeBo extends NewOrderChange {
@@ -9,8 +11,9 @@ public class NewOrderChangeBo extends NewOrderChange {
 	private BigDecimal arrears;
 	private String paymentTimes;
 	private String invoiceTimes;
-	
-	
+	private List<OrderExamineBo> consultantExamine;
+	private List<OrderExamineBo> managerExamine;
+	private Integer isExamine;
 	public String getCreateTimes() {
 		return createTimes;
 	}
@@ -43,4 +46,28 @@ public class NewOrderChangeBo extends NewOrderChange {
 	public void setInvoiceTimes(String invoiceTimes) {
 		this.invoiceTimes = invoiceTimes;
 	}
+
+	public List<OrderExamineBo> getConsultantExamine() {
+		return consultantExamine;
+	}
+
+	public void setConsultantExamine(List<OrderExamineBo> consultantExamine) {
+		this.consultantExamine = consultantExamine;
+	}
+
+	public List<OrderExamineBo> getManagerExamine() {
+		return managerExamine;
+	}
+
+	public void setManagerExamine(List<OrderExamineBo> managerExamine) {
+		this.managerExamine = managerExamine;
+	}
+
+	public Integer getIsExamine() {
+		return isExamine;
+	}
+
+	public void setIsExamine(Integer isExamine) {
+		this.isExamine = isExamine;
+	}
 }

+ 18 - 5
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.bo.Error;
+import com.goafanti.common.bo.OrderExamineBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.NewOrderChangeMapper;
 import com.goafanti.common.dao.OrderChangeLogMapper;
@@ -116,9 +117,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				o.setStatus(0);//正常
 				orderExamineMapper.insertSelective(o);
 			}
-			if (t.getConsultantId()!=null) {
+			if (t.getManagerId()!=null) {
 				OrderExamine o=new OrderExamine();
-				o.setAid(t.getConsultantId());
+				o.setAid(t.getManagerId());
 				o.setOrderNo(orderNo);
 				o.setCreateTime(new Date());
 				o.setType(1);//咨询师经理
@@ -138,6 +139,12 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@Override
 	public NewOrderChangeBo orderChangeDetailsById(Integer id) {
 		NewOrderChangeBo nb=newOrderChangeMapper.selectById(id);
+		List<OrderExamineBo> consultantExamine =orderExamineMapper.selectByOrderNo(nb.getOrderNo(),0);
+		List<OrderExamineBo> managerExamine=orderExamineMapper.selectByOrderNo(nb.getOrderNo(),1);
+		int isExamine=orderExamineMapper.selectByOrderNoAndAid(nb.getOrderNo(),TokenManager.getAdminId());
+		nb.setConsultantExamine(consultantExamine);
+		nb.setManagerExamine(managerExamine);
+		nb.setIsExamine(isExamine);
 		return nb;
 	}
 	@Override
@@ -164,19 +171,25 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 				}
 				 if(nb.getProcessState()==1){//营销管理通过则设置技术管理员通过表
 					 nb.setProcessState(nb.getProcessState()+1);
-						insertOrderExamine(orderNo);
+					 if (orderExamineMapper.checkCountStatus(orderNo,null,null)<1) insertOrderExamine(orderNo);
+						if (orderExamineMapper.checkCountStatus(orderNo,0,0)<1) {
+							nb.setProcessState(nb.getProcessState()+1);
+						}
 					}else if(nb.getProcessState()==2){//咨询师
 						//找出当时人的审核改为通过
 						orderExamineMapper.updateByOrderNoAndAid(orderNo,TokenManager.getAdminId(),0);
 						//全部通过了则跳下个流程
-						if (orderExamineMapper.checkCountStatus(orderNo,0)<1) {
+						if (orderExamineMapper.checkCountStatus(orderNo,0,0)<1) {
+							nb.setProcessState(nb.getProcessState()+1);
+						}
+						if (orderExamineMapper.checkCountStatus(orderNo,1,0)<1) {
 							nb.setProcessState(nb.getProcessState()+1);
 						}
 					}else if(nb.getProcessState()==3){//咨询师经理
 						//找出当时人的审核改为通过
 						orderExamineMapper.updateByOrderNoAndAid(orderNo,TokenManager.getAdminId(),1);
 						//全部通过了则跳下个流程
-						if (orderExamineMapper.checkCountStatus(orderNo,1)<1) {
+						if (orderExamineMapper.checkCountStatus(orderNo,1,0)<1) {
 							nb.setProcessState(nb.getProcessState()+1);
 						}
 					}else if(nb.getProcessState()!=7&&nb.getProcessState()!=8) {

+ 2 - 3
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -95,15 +95,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if (specially==1) {
 			addOrderLog(t.getOrderNo(), OrderLogProcess.XMDDPD.getCode());
 			t.setManagerId(taskReceiverId);
-			tOrderTaskMapper.updateByPrimaryKeySelective(t);
+			t.setConsultantId(null);
 		}else if (specially==0) {
 			addOrderLog(t.getOrderNo(), OrderLogProcess.XMPD.getCode());
 			t.setConsultantId(taskReceiverId);
-			tOrderTaskMapper.updateByPrimaryKeySelective(t);
 		}else if(specially==2) { //咨询师推给咨询师经理
 			t.setConsultantId(null);
-			tOrderTaskMapper.updateByPrimaryKey(t);
 		}
+		tOrderTaskMapper.updateByPrimaryKey(t);
 		updateOrder(t);
 		return 1;
 	}

+ 1 - 10
src/main/resources/props/config_local.properties

@@ -60,22 +60,13 @@ template.cacheable=false
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-<<<<<<< HEAD
-#static.host=//sb.jishutao.com/1.1.18
-#avatar.host=//sb.jishutao.com
-=======
 static.host=//sb.jishutao.com/1.1.18
 avatar.host=//sb.jishutao.com
->>>>>>> refs/remotes/origin/test
 
 #连测试
-<<<<<<< HEAD
-avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.18
-=======
 #avatar.host=//static.jishutao.com
 #static.host=//static.jishutao.com/1.1.18
->>>>>>> refs/remotes/origin/test
+
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload