Browse Source

新增审核通知,新增筛选

anderx 6 years ago
parent
commit
3ca0430db8

+ 60 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1112,6 +1112,21 @@ left join t_order_outsource too on o.order_no=too.order_no where delete_sign !=
   		<if test="o.liquidationStatus != null">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
 	  	</if>
+	  	<if test="o.amountStatus == 0">
+	  	and o.total_amount &lt; 10
+	  	</if>
+	  	<if test="o.amountStatus == 1">
+	  	and o.total_amount between 10 and 20
+	  	</if>
+	  	<if test="o.amountStatus == 2">
+	  	and o.total_amount between 20 and 30
+	  	</if>
+	  	<if test="o.amountStatus == 3">
+	  	and o.total_amount between 30 and 40
+	  	</if>
+	  	<if test="o.amountStatus == 4">
+	  	and o.total_amount  &gt; 40
+	  	</if>
   		<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
 	  	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
 	  	</if>
@@ -1162,6 +1177,21 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   		<if test="o.liquidationStatus != null">
 	  	and o.liquidation_status = #{o.liquidationStatus,jdbcType=INTEGER}
 	  	</if>
+	  	<if test="o.amountStatus == 0">
+	  	and o.total_amount &lt; 10
+	  	</if>
+	  	<if test="o.amountStatus == 1">
+	  	and o.total_amount between 10 and 20
+	  	</if>
+	  	<if test="o.amountStatus == 2">
+	  	and o.total_amount between 20 and 30
+	  	</if>
+	  	<if test="o.amountStatus == 3">
+	  	and o.total_amount between 30 and 40
+	  	</if>
+	  	<if test="o.amountStatus == 4">
+	  	and o.total_amount  &gt; 40
+	  	</if>
   		<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
 	  	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
 	  	</if>
@@ -1279,6 +1309,21 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="liquidationStatus != null">
   	and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
   	</if>
+  	<if test="amountStatus == 0">
+  	and a.total_amount &lt; 10
+  	</if>
+  	<if test="amountStatus == 1">
+  	and a.total_amount between 10 and 20
+  	</if>
+  	<if test="amountStatus == 2">
+  	and a.total_amount between 20 and 30
+  	</if>
+  	<if test="amountStatus == 3">
+  	and a.total_amount between 30 and 40
+  	</if>
+  	<if test="amountStatus == 4">
+  	and a.total_amount  &gt; 40
+  	</if>
   	<if test="depId != null">
   	and dep.id = #{depId,jdbcType=VARCHAR}
   	</if>
@@ -1384,6 +1429,21 @@ where super_id is null ) e on e.order_no=a.order_no
   	<if test="liquidationStatus != null">
   	and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
   	</if>
+  	<if test="amountStatus == 0">
+  	and a.total_amount &lt; 10
+  	</if>
+  	<if test="amountStatus == 1">
+  	and a.total_amount between 10 and 20
+  	</if>
+  	<if test="amountStatus == 2">
+  	and a.total_amount between 20 and 30
+  	</if>
+  	<if test="amountStatus == 3">
+  	and a.total_amount between 30 and 40
+  	</if>
+  	<if test="amountStatus == 4">
+  	and a.total_amount  &gt; 40
+  	</if>
   	<if test="depId != null">
   	and dep.id = #{depId,jdbcType=VARCHAR}
   	</if>

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

@@ -921,21 +921,24 @@
   
   
    <select id="selectOrderTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
-  	select  a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.project_status as projectStatus,e.contract_no contractNo,
-    a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate, a.commodity_quantity as commodityQuantity,
+  		select  a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.project_status as projectStatus,e.contract_no contractNo,
+    a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate, a.commodity_quantity as commodityQuantity,e.approval,
     ifnull(i.alreadyNumber,0) as alreadyNumber,f.nickname as userName,h.name as depName, j.name as outsourceName ,ifnull(k.hours,0) hours
     from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id 
   	left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id
     left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber from task_progress 
     group by task_id) i on a.id=i.task_id  left join (select order_no,max(name)as name from outsource_organization group by order_no) j 
     on a.order_no=j.order_no left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid
-    where e.delete_sign !=1  and e.order_status not in (5,7)  and e.outsource= #{outsource,jdbcType=INTEGER}
+    where e.delete_sign !=1  and e.order_status not in (5,7)   and e.outsource= #{outsource,jdbcType=INTEGER}
     <if test="specially == 0 or specially == 1">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
     </if>
     <if test="orderNo != null">
   	and a.order_no= #{orderNo,jdbcType=VARCHAR}
   	</if>
+  	<if test="approval != null">
+  	and a.approval= #{approval,jdbcType=INTEGER}
+  	</if>
   	<if test="contractNo != null">
   	and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
   	</if>
@@ -981,6 +984,9 @@
     <if test="orderNo != null">
   	and a.order_no= #{orderNo,jdbcType=VARCHAR}
   	</if>
+  	<if test="approval != null">
+  	and a.approval= #{approval,jdbcType=INTEGER}
+  	</if>
   	<if test="contractNo != null">
   	and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
   	</if>

+ 8 - 0
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -88,6 +88,8 @@ public class OrderListBo {
 	private String startFinalReceivablesTime;	
 	/** 外包金额*/
 	private String outsourceAmount;
+	/** 筛选金额*/
+	private Integer amountStatus;
 	
 	public String getFinalReceivables() {
 		return finalReceivables;
@@ -338,4 +340,10 @@ public class OrderListBo {
 	public void setOutsourceAmount(String outsourceAmount) {
 		this.outsourceAmount = outsourceAmount;
 	}
+	public Integer getAmountStatus() {
+		return amountStatus;
+	}
+	public void setAmountStatus(Integer amountStatus) {
+		this.amountStatus = amountStatus;
+	}
 }

+ 7 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskListBo.java

@@ -23,6 +23,7 @@ public class TOrderTaskListBo {
 	private String salesmanName;
 	private String taskDistributionTime;
 	private String taskEndTime;
+	private Integer approval;
 	/** 外包部门 */
 	private String outsourceName;
 	public String getContractNo() {
@@ -151,5 +152,11 @@ public class TOrderTaskListBo {
 	public void setSalesmanName(String salesmanName) {
 		this.salesmanName = salesmanName;
 	}
+	public Integer getApproval() {
+		return approval;
+	}
+	public void setApproval(Integer approval) {
+		this.approval = approval;
+	}
 	
 }

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

@@ -242,12 +242,14 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * 
 	 *specially  0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询
 	 *distribution	(咨询师管理列表 0 未分配 1部分 2全部
+	 *amountStatus 0 10万元以下 1 10万~20万 2 20万~30万 3 30万~40万  4 40万以上
 	 */
 	@RequestMapping(value="/orderNewList", method = RequestMethod.GET)
 	public Result orderNewList(String name,String orderNo,String starTime,String endTime ,Integer specially ,Integer approval,
-			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer pageNo,Integer pageSize){
+			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer amountStatus,Integer pageNo,Integer pageSize){
 		Result res=new Result();
-		res.data(orderNewService.orderNewList(name, orderNo, starTime, endTime, specially ,approval, distribution,depId, contractNo,outsource, liquidationStatus,pageNo, pageSize));
+		res.data(orderNewService.orderNewList(name, orderNo, starTime, endTime, specially ,approval, distribution,depId, 
+				contractNo,outsource, liquidationStatus,amountStatus,pageNo, pageSize));
 		return res;
 	}
 	

+ 5 - 4
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -38,13 +38,13 @@ public class OrderProjectApiController extends CertifyApiController {
 	 * specially 0 任务派单(咨询师经理派单) 1项目派单(咨询师管理员派单)2咨询师退回给经理
 	 */
 	@RequestMapping(value = "/projectDistribution", method = RequestMethod.POST)
-	public Result projectDistribution(Integer taskId,String taskReceiverId,Integer specially ){
+	public Result projectDistribution(Integer taskId,String taskReceiverId,Integer specially ,String remarks){
 		Result res = new Result();
 		if(null==taskId || StringUtils.isBlank(taskReceiverId)){
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "任务编号和受理人"));
 			return res;
 		}
-		res.setData(orderProjectService.updateProjectDistribution( taskId, taskReceiverId,specially));
+		res.setData(orderProjectService.updateProjectDistribution( taskId, taskReceiverId,specially,remarks));
 		return res;
 	}
 	
@@ -53,9 +53,10 @@ public class OrderProjectApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value="/orderTaskList" ,method = RequestMethod.GET)
 	public Result orderTaskList(String name,String orderNo,String taskId,Integer taskStatus,String adminName,Integer specially,String depId  ,
-			String contractNo,Integer projectStatus ,Integer pageNo,Integer pageSize,Integer outsource){
+			String contractNo,Integer projectStatus ,Integer approval,Integer pageNo,Integer pageSize,Integer outsource){
 		Result res=new Result();
-		res.setData(orderProjectService.orderTaskList( name, orderNo, taskId, taskStatus, adminName,specially ,  depId,contractNo, projectStatus,pageNo, pageSize, outsource));
+		res.setData(orderProjectService.orderTaskList( name, orderNo, taskId, taskStatus, adminName,specially ,  depId,contractNo, 
+				projectStatus,approval,pageNo, pageSize, outsource));
 		return res;
 	}
 	

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

@@ -85,9 +85,10 @@ public interface OrderNewService {
 	 * @param orderStatus
 	 * @param pageNo
 	 * @param pageSize
+	 * @param amountStatus 
 	 * @return
 	 */
-	Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially ,Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer pageNo, Integer pageSize);
+	Pagination<TOrderNewBo> orderNewList(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);
 	/**
 	 * 订单审核
 	 * @param orderNo

+ 2 - 2
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -17,10 +17,10 @@ import com.goafanti.order.bo.inuptTaskHoursListBo;
 
 public interface OrderProjectService {
 
-	int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially);
+	int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially, String remarks);
 
 	Pagination<TOrderTaskListBo> orderTaskList(String name, String orderNo, String taskId, Integer taskStatus, String adminName,Integer specially, String depId,
-			String contractNo, Integer pageNo, Integer pageSize,Integer outsource, Integer outsource2);
+			String contractNo, Integer approval, Integer pageNo, Integer pageSize,Integer outsource, Integer outsource2);
 
 	TOrderTaskDetailBo orderTaskDetail(String id);
 

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

@@ -480,7 +480,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially,Integer approval,
-			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer pageNo, Integer pageSize) {
+			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus, 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;
@@ -501,6 +501,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (null!=liquidationStatus) params.put("liquidationStatus", liquidationStatus);
 		if (null==approval)params.put("approval", 0);
 		else 	params.put("approval", approval);
+		if(null != amountStatus) params.put("amountStatus", amountStatus);
 		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");
@@ -535,7 +536,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 					t.setProcessStatus(ProcessStatus.YPWBSH.getCode());
 					tl.setOrderNo(orderNo);
 					tl.setProcess(OrderLogProcess.FQWB.getCode());
-					addOrderLog(tl,null);
+					addOrderLog(tl,reason);
 					
 				}
 			}else {
@@ -548,7 +549,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tl.setOrderNo(orderNo);
 			tl.setProcess(OrderLogProcess.SH.getCode());
 			//增加日志
-			addOrderLog(tl,null);
+			addOrderLog(tl,reason);
 			//非特批增加催款信息
 			//外包
 			 if(outsource==1) {
@@ -567,7 +568,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				addBackOrder(orderNo, reason);
 				tl.setOrderNo(orderNo);
 				tl.setProcess(OrderLogProcess.SH.getCode());
-				addOrderLog(tl,null);
+				addOrderLog(tl,reason);
 			}
 				aids.add(t2.getSalesmanId());
 				type=NoticeStatus.ORDER_NO.getCode();

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

@@ -114,7 +114,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	
 	
 	@Override
-	public int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially) {
+	public int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially,String remarks) {
 		TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(taskId);
 		t.setTaskStatus(TaskState.DISTRIBUTION.getCode());
 		t.setTaskAllocator(TokenManager.getAdminId());
@@ -127,11 +127,11 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		insetLog(taskId, taskReceiverId);
 		//0-经理 (经理分派会创建子项目)1 管理员或经理转交
 		if (specially==1) {
-			addOrderLog(t.getOrderNo(), OrderLogProcess.XMDDPD.getCode());
+			addOrderLog(t.getOrderNo(), OrderLogProcess.XMDDPD.getCode(),remarks);
 			t.setManagerId(taskReceiverId);
 			t.setConsultantId(null);
 		}else if (specially==0) {
-			addOrderLog(t.getOrderNo(), OrderLogProcess.XMPD.getCode());
+			addOrderLog(t.getOrderNo(), OrderLogProcess.XMPD.getCode(),remarks);
 			t.setConsultantId(taskReceiverId);
 		}else if(specially==2) { //咨询师推给咨询师经理
 			t.setConsultantId(null);
@@ -148,11 +148,12 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		//if(t.getDeleteSign()==2) throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_REVOKE, t.getOrderNo(),""));
 		return t;
 	}
-	public void addOrderLog(String orderNo, Integer code) {
+	public void addOrderLog(String orderNo, Integer code,String remarks) {
 		TOrderLog tl=new TOrderLog();
 		tl.setOrderNo(orderNo);
 		tl.setProcess(code);
 		tl.setAid(TokenManager.getAdminId());
+		if(null!=remarks)tl.setRemarks(remarks);
 		tOrderLogMapper.insertSelective(tl);
 		
 	}
@@ -187,7 +188,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TOrderTaskListBo> orderTaskList(String name, String orderNo, String taskId, Integer taskStatus,
-			String adminName,Integer specially, String depId, String contractNo,Integer projectStatus ,Integer pageNo, Integer pageSize,Integer outsource) {
+			String adminName,Integer specially, String depId, String contractNo,Integer projectStatus , Integer approval,Integer pageNo, Integer pageSize,Integer outsource) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
@@ -199,6 +200,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
 		if (projectStatus !=null ) params.put("projectStatus", projectStatus);
 		if (StringUtils.isNotBlank(taskId)) params.put("taskId", taskId);
+		if (approval !=null) params.put("approval", approval);
 		if (StringUtils.isNotBlank(adminName)) params.put("adminName", adminName);
 		if (null != taskStatus) params.put("taskStatus", taskStatus);
 		params.put("outsource", outsource==null?0:outsource);
@@ -426,7 +428,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 				tb.setOrderNo(task.getOrderNo());
 				if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode()) {
 					tb.setBonusSubject(21);//项目已提交
-					addOrderLog(task.getOrderNo(),OrderLogProcess.XMWC.getCode());
+					addOrderLog(task.getOrderNo(),OrderLogProcess.XMWC.getCode(),null);
 				}
 				if (task.getProjectStatus()==ProjectNewStage.LS.getCode())tb.setBonusSubject(23);//项目立项
 				if (task.getProjectStatus()==ProjectNewStage.GS.getCode())tb.setBonusSubject(24);//项目公示