Browse Source

新增订单流程时间

anderx 6 years ago
parent
commit
0622e612f1

+ 6 - 6
GeneratorConfig.xml

@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
 <generatorConfiguration>
-  <classPathEntry location="C:/Users/Administrator/.dbeaver-drivers/maven/maven-central/mysql/mysql-connector-java-5.1.44.jar" />
+  <classPathEntry location="C:/Users/Administrator/.dbeaver-drivers/maven/maven-central/mysql/mysql-connector-java-5.1.39.jar" />
    <!-- <classPathEntry location="E:/mysql-connector-java-5.1.40.jar" /> -->
   <context id="context1">	
-    <jdbcConnection connectionURL="jdbc:mysql://192.168.0.14:3306/aft" 
+    <jdbcConnection connectionURL="jdbc:mysql://localhost:3306/aft" 
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="dev" />
-    <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="aft" />
-    <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="aft" />
-    <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="aft" type="XMLMAPPER" />
-    <table schema="aft" tableName="t_task_log"/> 
+    <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="kede-server" />
+    <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="kede-server" />
+    <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="kede-server" type="XMLMAPPER" />
+    <table schema="aft" tableName="t_order_log"/> 
   </context>
 </generatorConfiguration>

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

@@ -825,7 +825,7 @@
   	select * from (
   	select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
   	o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
-  	,liquidation_status,contract_no as contractNo
+  	,liquidation_status,o.finance_id as financeId,contract_no as contractNo
   	from t_order_new o 
   	left join `user` u on o.buyer_id = u.id
   	left join admin a on o.salesman_id = a.id
@@ -858,7 +858,7 @@
   	union 
 	select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus, 
 	o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
-	,liquidation_status ,contract_no as contractNo
+	,liquidation_status ,o.finance_id as financeId,contract_no as contractNo
 	from t_order_new o 
 	left join `user` u on o.buyer_id = u.id 
 	left join admin a on o.salesman_id = a.id 
@@ -886,9 +886,7 @@
   </select>
   <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
   select count(*) from (
-  	select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus,
-  	o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
-  	,liquidation_status
+  	select o.*
   	from t_order_new o 
   	left join `user` u on o.buyer_id = u.id
   	left join admin a on o.salesman_id = a.id
@@ -919,9 +917,7 @@
   	and o.create_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
   	</if>
   	union 
-	select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus, 
-	o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
-	,liquidation_status 
+	select o.*
 	from t_order_new o 
 	left join `user` u on o.buyer_id = u.id 
 	left join admin a on o.salesman_id = a.id 

+ 21 - 2
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -23,15 +23,18 @@ import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.TOrderBackMapper;
 import com.goafanti.common.dao.TOrderBillNewMapper;
 import com.goafanti.common.dao.TOrderBonusMapper;
+import com.goafanti.common.dao.TOrderLogMapper;
 import com.goafanti.common.dao.TOrderMonthReportMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderRefundMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.enums.NoticeStatus;
+import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.TOrderBack;
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.model.TOrderBonus;
+import com.goafanti.common.model.TOrderLog;
 import com.goafanti.common.model.TOrderMonthReport;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderRefund;
@@ -52,6 +55,7 @@ import com.goafanti.order.enums.OrderNewState;
 import com.goafanti.order.enums.ProcessStatus;
 import com.goafanti.order.enums.refundState;
 import com.goafanti.order.service.FundManageOrderService;
+import com.goafanti.order.service.OrderNewService;
 
 @Service
 public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements FundManageOrderService {
@@ -73,6 +77,8 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 	@Autowired
 	private TOrderTaskMapper taskMapper;
 	@Autowired
+	private TOrderLogMapper	tOrderLogMapper;
+	@Autowired
 	JDBCIdGenerator	idGenerator;
 	@Autowired
 	NoticeMapper	noticeMapper;
@@ -117,6 +123,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			if(torder.getProcessStatus()<ProcessStatus.YPZXSGLY.getCode()) {
 				record.setProcessStatus(ProcessStatus.YPCWZY.getCode());				
 			}
+			addOrderLog(orderNo, OrderLogProcess.CWPD.getCode());
 			r = tOrderNewMapper.updateByPrimaryKeySelective(record);
 		}else{
 			//返回错误标志 提示订单编号或者财务专员选择错误
@@ -124,7 +131,16 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		}
 		return r;
 	}
-
+	
+	public void addOrderLog(String orderNo, Integer code) {
+		TOrderLog tl=new TOrderLog();
+		tl.setOrderNo(orderNo);
+		tl.setProcess(code);
+		tl.setAid(TokenManager.getAdminId());
+		tOrderLogMapper.insertSelective(tl);
+		
+	}
+	
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<OrderListBo> financeList(OrderListBo order,
@@ -159,6 +175,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			back.setBackStatus(0);
 			back.setInitiate(TokenManager.getAdminId());//发起人
 			back.setAccept(b.getSalesmanId());	//查看该订单的负责人	
+			addOrderLog(back.getOrderNo(), OrderLogProcess.BH.getCode());
 			c = backMapper.insertSelective(back);
 			
 			//发送站内消息
@@ -228,7 +245,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 				}
 				
 			}
-			
+			addOrderLog(billNew.getOrderNo(), OrderLogProcess.CWQK.getCode());	
 		}else if(bd.compareTo(o.getTotalAmount()) == -1){//如果订单流水小于总金额
 			if(bd.compareTo(o.getFirstAmount()) == 0 || bd.compareTo(o.getFirstAmount()) == 1){//首付完成
 				//查看首付奖是否存在
@@ -243,6 +260,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 					bonus.setBonusSubject(BonusSubject.SF.getCode());//11
 				}
 				lstaus = 1;
+				addOrderLog(billNew.getOrderNo(), OrderLogProcess.CWSF.getCode());
 			}
 		}
 		//否则新增流水信息
@@ -405,6 +423,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		
 		orderNew.setLiquidationStatus(lstaus);
 		if(lstaus == 4){//如果款项全部退完就更改订单状态,这里不一定待商榷
+			addOrderLog(billNew.getOrderNo(), OrderLogProcess.WCTD.getCode());
 			//orderNew.setProcessStatus(6);
 		}
 		if(result > 0){

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

@@ -34,11 +34,13 @@ import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.TDunLogMapper;
 import com.goafanti.common.dao.TOrderBackMapper;
 import com.goafanti.common.dao.TOrderDunMapper;
+import com.goafanti.common.dao.TOrderLogMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderRefundMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.enums.NoticeStatus;
+import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationContactBook;
@@ -46,6 +48,7 @@ import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderBack;
 import com.goafanti.common.model.TOrderDun;
+import com.goafanti.common.model.TOrderLog;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderRefund;
 import com.goafanti.common.model.TOrderRefundWithBLOBs;
@@ -98,6 +101,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Autowired
 	private AdminMapper	adminMapper;
 	@Autowired
+	private TOrderLogMapper tOrderLogMapper;
+	@Autowired
 	NoticeMapper	noticeMapper;
 	@Autowired
 	OrderService	orderService;
@@ -207,12 +212,15 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			contactBook.setMobile(t.getContactMobile());
 			organizationContactBookMapper.insertSelective(contactBook);
 		}
-		if (isSubmit==1) {
+		if (isSubmit==1) {//订单
 			t.setOrderStatus(OrderNewState.QDDS.getCode());
 			t.setProcessStatus(ProcessStatus.YPYXGLY.getCode());
 			if (t2.getApproval()==ApprovalNewState.BH.getCode()){
 				t.setApproval(ApprovalNewState.DSH.getCode());
 			}
+			//生成流转
+			addOrderLog(t.getOrderNo(),OrderLogProcess.TJ.getCode());
+			
 		}
 		if (t2.getApproval()==ApprovalNewState.BH.getCode()||
 				t2.getOrderStatus()==OrderNewState.QDSHJJ.getCode()||
@@ -225,6 +233,17 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
+	public void addOrderLog(String orderNo, Integer code) {
+		TOrderLog tl=new TOrderLog();
+		tl.setOrderNo(orderNo);
+		tl.setProcess(code);
+		tl.setAid(TokenManager.getAdminId());
+		tOrderLogMapper.insertSelective(tl);
+		
+	}
+
+
+
 	@Override
 	public TOrderNewBo getOrderNewDetail(String orderNo) {
 		TOrderNewBo tOrder= tOrderNewMapper.getOrderNewDetail(orderNo);
@@ -311,10 +330,14 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		t.setOrderNo(orderNo);
 		if (orderStatus==OrderNewState.QDSHTG.getCode()&&t2.getApproval()==ApprovalNewState.FTP.getCode()) {//如果通过分配给财务管理员
 				t.setProcessStatus(ProcessStatus.YPCWGLY.getCode());
+				addOrderLog(orderNo, OrderLogProcess.SH.getCode());
+		}else if (orderStatus==OrderNewState.QDSHTG.getCode()&&t2.getApproval()==ApprovalNewState.DSH.getCode()) {
+				addOrderLog(orderNo, OrderLogProcess.SH.getCode());
 		}
 		if (orderStatus==OrderNewState.QDSHJJ.getCode()) {//如果不通过新增驳回
 			t.setProcessStatus(ProcessStatus.YPYXY.getCode());
 			addBackOrder(orderNo, reason);
+			addOrderLog(orderNo, OrderLogProcess.BH.getCode());
 		}
 		t.setOrderStatus(orderStatus);
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
@@ -403,6 +426,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		tOrder.setOrderNo(t.getOrderNo());
 		tOrder.setOrderStatus(OrderNewState.TDZ.getCode());
 		tOrderNewMapper.updateByPrimaryKeySelective(tOrder);
+		addOrderLog(t.getOrderNo(), OrderLogProcess.FQTD.getCode());
 		return tOrderRefundMapper.insertSelective(t);
 	}
 
@@ -415,10 +439,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (confirm==2) {
 			t.setApproval(2);
 			t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
+			addOrderLog(orderNo, OrderLogProcess.TP.getCode());
 		} else {
 			t.setApproval(3);
 			t.setOrderStatus(OrderNewState.YBH.getCode());
 			addBackOrder(orderNo, reason);
+			addOrderLog(orderNo, OrderLogProcess.BH.getCode());
 		}
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}

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

@@ -23,12 +23,15 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.TOrderBonusMapper;
+import com.goafanti.common.dao.TOrderLogMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.TTaskHoursMapper;
 import com.goafanti.common.dao.TTaskLogMapper;
+import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.TOrderBonus;
+import com.goafanti.common.model.TOrderLog;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TTaskHours;
@@ -58,6 +61,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Autowired
 	private TTaskLogMapper	tTaskLogMapper;
 	@Autowired
+	private TOrderLogMapper	tOrderLogMapper;
+	@Autowired
 	private OrganizationContactBookMapper	organizationContactBookMapper;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
@@ -73,7 +78,13 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		insetLog(taskId, taskReceiverId);
 		tOrderTaskMapper.updateByPrimaryKeySelective(t);
 		updateOrder(t);
+		
 		//0-经理 (经理分派会创建子项目)1 管理员或经理转交
+		if (specially==1) {
+			addOrderLog(t.getOrderNo(), OrderLogProcess.XMDDPD.getCode());
+		}else if (specially==0) {
+			addOrderLog(t.getOrderNo(), OrderLogProcess.XMPD.getCode());
+		}
 		if (specially==0&&t.getCommodityQuantity()>1) {
 			for (int i = 0; i < t.getCommodityQuantity(); i++) {
 				TOrderTask tOrderTask=new TOrderTask();
@@ -91,7 +102,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}
 		return 1;
 	}
-
+	public void addOrderLog(String orderNo, Integer code) {
+		TOrderLog tl=new TOrderLog();
+		tl.setOrderNo(orderNo);
+		tl.setProcess(code);
+		tl.setAid(TokenManager.getAdminId());
+		tOrderLogMapper.insertSelective(tl);
+		
+	}
 	private void updateOrder(TOrderTask t) {
 		List<TOrderTaskBo> taskBos=tOrderTaskMapper.selectOrderTask(t.getOrderNo());
 		TOrderNew tNew=new TOrderNew();
@@ -200,10 +218,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	private void checkSettlementAward(TOrderNew tn,TOrderTask task) {
 		if(task.getTaskStatus()==TaskState.COMPLETE.getCode()&&tn.getTotalAmount().compareTo(tn.getSettlementAmount())==0) {
 			List<TOrderTask> l = tOrderTaskMapper.getReceiverByOid(tn.getOrderNo());
-//					取消没有技术员不能支付全款
-//					if(null == l || l.size() == 0){
-//						return -3;//没有给将任务分给咨询师(技术员)
-//					}
 			for (TOrderTask tOrderTask : l) {
 				if(null != tOrderTask &&null != tOrderTask.getTaskReceiver()){
 					TOrderBonus bonus = new TOrderBonus();
@@ -234,15 +248,16 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			tNew.setProjectStatus(task.getProjectStatus());
 			tNew.setOrderNo(task.getOrderNo());
 			tOrderNewMapper.updateByPrimaryKeySelective(tNew);
-			
-			
 			if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode()||task.getProjectStatus()==ProjectNewStage.LS.getCode()||
 					task.getProjectStatus()==ProjectNewStage.GS.getCode()) {
 				TOrderBonus tb=new TOrderBonus();
 				TOrderNew t=tOrderNewMapper.selectByPrimaryKey(task.getOrderNo());
 				tb.setId(UUID.randomUUID().toString());
 				tb.setOrderNo(task.getOrderNo());
-				if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode())tb.setBonusSubject(21);//项目已提交
+				if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode()) {
+					tb.setBonusSubject(21);//项目已提交
+					addOrderLog(task.getOrderNo(),OrderLogProcess.XMWC.getCode());
+				}
 				if (task.getProjectStatus()==ProjectNewStage.LS.getCode())tb.setBonusSubject(23);//项目立项
 				if (task.getProjectStatus()==ProjectNewStage.GS.getCode())tb.setBonusSubject(24);//项目公示
 				tb.setGrantType(1);//技术员

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

@@ -60,12 +60,12 @@ template.cacheable=false
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-static.host=//sb.jishutao.com/1.0.96
-avatar.host=//sb.jishutao.com
+#static.host=//sb.jishutao.com/1.0.97
+#avatar.host=//sb.jishutao.com
 
 #连生产
-#avatar.host=//static.kedexinxi.com
-#static.host=//s.kedexinxi.com/1.0.92
+avatar.host=//static.kedexinxi.com
+static.host=//s.kedexinxi.com/1.0.97
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload