Browse Source

Merge branch 'test' of jishutao/kede-server into prod

anderx 6 years ago
parent
commit
c672a736ff

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -246,5 +246,7 @@ public interface UserMapper {
 	userDataListBo userDataStatisticsCount(@Param("depId")String depId);
 
 	int UserReceiveCount( @Param("aid")String aid);
+
+	int getAidAndUser(@Param("uid")String uid,@Param("aid") String aid);
 	
 }

+ 29 - 5
src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml

@@ -716,12 +716,24 @@
   </select>
   
   <select id="approvalOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
-     select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
-     ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,
+      	select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
+     ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status, a.approval,
      b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a 
 	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
 	left join (select order_no,sum(amount)as  sumAmount from t_order_invoice where status =2 group by order_no) d
-	on a.order_no=d.order_no where a.status =1 and a.approval =1
+	on a.order_no=d.order_no where 1=1
+	<if test="status ==null"> 
+	and a.status in(1,2)
+	</if>
+	<if test="status != null">
+	 and a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="approval ==null and special==null">
+	 and a.approval in(1,2)
+	</if>
+	<if test="approval != null">
+	 and a.approval = #{approval,jdbcType=INTEGER}
+	</if>
 	<if test="type !=null">
 	and a.type= #{type,jdbcType=INTEGER}
 	</if>
@@ -737,7 +749,7 @@
 	<if test="aDep !=null">
 	and c.department_id= #{aDep,jdbcType=VARCHAR}
 	</if>
-	order by a.create_time desc
+	order by a.approval,a.status,a.create_time desc
 	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -746,7 +758,19 @@
   <select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
   	   select count(*) from t_order_invoice a 
 	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
-	where a.status =1 and a.approval =1
+	where  1=1
+	<if test="status ==null"> 
+	and a.status in(1,2)
+	</if>
+	<if test="status != null">
+	 and a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="approval ==null and special==null">
+	 and a.approval in(1,2)
+	</if>
+	<if test="approval != null">
+	 and a.approval = #{approval,jdbcType=INTEGER}
+	</if>
 	<if test="type !=null">
 	and a.type= #{type,jdbcType=INTEGER}
 	</if>

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

@@ -893,14 +893,12 @@
   	left join department d on o.order_dep=d.id left join (select order_no,max(name)as name from outsource_organization group by order_no) e
   	 on o.order_no=e.order_no where delete_sign = 0 and order_status = 2
   	and approval in (0,2) and outsource=#{o.outsource,jdbcType=INTEGER}
+  	and process_status &gt;= 2
   	<if test="o.processStatus == 2">
-  	and process_status = #{o.processStatus,jdbcType=INTEGER}
+  	and o.finance_id is null
   	</if>
   	<if test="o.processStatus == 3">
-  	and process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
-  	</if>
-  	<if test="o.processStatus == null or o.processStatus ==''">
-  	and process_status &gt;= 2
+  	and o.finance_id is not null
   	</if>
   	<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
   	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
@@ -925,14 +923,12 @@
   <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
   select count(*) 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
   	where delete_sign = 0 and order_status = 2 and approval in (0,2) and outsource=#{o.outsource,jdbcType=INTEGER}
+  	and process_status &gt;= 2
   	<if test="o.processStatus == 2">
-  	and process_status = #{o.processStatus,jdbcType=INTEGER}
+  	and o.finance_id is null
   	</if>
   	<if test="o.processStatus == 3">
-  	and process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
-  	</if>
-  	<if test="o.processStatus == null or o.processStatus ==''">
-  	and process_status &gt;= 2
+  	and o.finance_id is not null
   	</if>
   	<if test="o.orderNo != null and o.orderNo != &quot;&quot;">
   	and o.order_no = #{o.orderNo,jdbcType=VARCHAR}

+ 4 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1613,4 +1613,8 @@
 			transfer_time=now()
 		where aid=#{aid,jdbcType=VARCHAR}
   </update>
+  <select id="getAidAndUser" resultType="java.lang.Integer">
+  select count(*) from `user`
+	where aid=#{aid,jdbcType=VARCHAR} and id=#{uid,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 4 - 2
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -929,11 +929,13 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 			throw new BusinessException(new Error(ErrorConstants.CUSTOM_EREXCESS,""+(AFTConstants.USER_RCEIVE_MAX+1),""));
 			organizationContactBookMapper.updateAdmin(uid,TokenManager.getAdminId());
 		}else if(operatorType.equals(AFTConstants.USER_TRANSFER_TO_OTHER)){
-			user.setAid(String.valueOf(params[0]));
+			user.setAid(String.valueOf(TokenManager.getAdminId()));
 			user.setSource(3);//客户来源设置为转交
 			user.setTransferTime(now);
+			//查询这个客户是否是登陆人的客户
+			if(userMapper.getAidAndUser(uid,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
 			flag = updateUserLock(uid,oldAid,UserLockReleaseStatus.LOCKED.getCode(),UserLockReleaseStatus.RELEASE.getCode()); //原用户释放客户
-			if(flag > 0 ) flag = addUserLock(uid,String.valueOf(params[0]),now); //指定用户锁定客户
+			if(flag > 0 ) flag = addUserLock(uid,TokenManager.getAdminId(),now); //指定用户锁定客户
 			if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_TRANSFER_FAIL,""));
 		}
 		return userMapper.updateByPrimaryKeySelective(user);

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

@@ -13,6 +13,7 @@ public class TOrderInvoiceBo {
 	private String notAmount;
 	private String settlementAmount;
 	private String rejectReason;
+	private Integer approval;
 	public Integer getId() {
 		return id;
 	}
@@ -86,6 +87,12 @@ public class TOrderInvoiceBo {
 	public void setRejectReason(String rejectReason) {
 		this.rejectReason = rejectReason;
 	}
+	public Integer getApproval() {
+		return approval;
+	}
+	public void setApproval(Integer approval) {
+		this.approval = approval;
+	}
 	
 	
 }

+ 5 - 2
src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java

@@ -107,6 +107,9 @@ public class OrderInvoiceApiController extends CertifyApiController {
 		res.data(orderInvoiceService.financeOrderInvoiceList( orderDep, orderNo , name,type,pageNo,pageSize));
 		return res;
 	}
+	
+	
+	
 	/**
 	 *  开票特批列表
 	 * @param uid
@@ -114,10 +117,10 @@ public class OrderInvoiceApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/approvalOrderInvoiceList",method = RequestMethod.GET)
-	public Result approvalOrderInvoiceList(Integer type,String orderDep,String orderNo ,String name,Integer pageNo,Integer pageSize){
+	public Result approvalOrderInvoiceList(Integer status,Integer approval,Integer type,String orderDep,String orderNo ,String name,Integer pageNo,Integer pageSize){
 		Result res = new Result();
 		
-		res.data(orderInvoiceService.approvalOrderInvoiceList(type, orderDep, orderNo , name,pageNo,pageSize));
+		res.data(orderInvoiceService.approvalOrderInvoiceList( status,approval,type, orderDep, orderNo, name,pageNo,pageSize));
 		return res;
 	}
 	

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

@@ -36,7 +36,7 @@ public interface OrderInvoiceService {
 
 	int updatefinanceExamine(Integer id, Integer examine, String reason);
 
-	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer type, String orderDep, String orderNo, String name, Integer pageNo,
+	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name, Integer pageNo,
 			Integer pageSize);
 
 	int updateapprovalExamine(Integer id, Integer examine, String reason);

+ 11 - 2
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -112,7 +112,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer type, String orderDep, String orderNo, String name,
+	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name,
 			Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
@@ -120,12 +120,21 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		if(StringUtils.isNotBlank(orderDep))params.put("orderDep", orderDep);
 		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
 		if(StringUtils.isNotBlank(name))params.put("name", name);
-		if(type!=null)params.put("type", type);
+		if(approval!=null)params.put("approval", approval);
+		if(status!=null)params.put("status", status);
+		//0省内 1省外 2查看所有省外
+		if(type==0||type==1)params.put("type", type);
+		if (type==2) {
+			params.put("type", 1);
+			params.put("special", 1);
+		}
 		if (type ==1) {
 			//如果是省外则直接查本部门
 			Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
 			params.put("aDep", a.getDepartmentId());
 		}
+		
+		
 		return (Pagination<TOrderInvoiceBo>)findPage("approvalOrderInvoiceList", "approvalOrderInvoiceCount", params, pageNo, pageSize);
 	}
 

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

@@ -421,7 +421,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		}else if (t2.getApproval()==ApprovalNewState.DSH.getCode()) {
 				addOrderLog(orderNo, OrderLogProcess.SH.getCode());
 		}
-			if(outsource==1)t.setOutsource(outsource);
+			if(outsource!=null&&outsource==1)t.setOutsource(outsource);
+			
 		}
 	
 		if (orderStatus==OrderNewState.QDSHJJ.getCode()) {//如果不通过新增驳回

+ 3 - 3
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.1.08
+static.host=//sb.jishutao.com/1.1.10
 avatar.host=//sb.jishutao.com
 
-#连生产
+#连测试
 #avatar.host=//static.jishutao.com
-#static.host=//static.jishutao.com/1.1.08
+#static.host=//static.jishutao.com/1.1.10
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//static.jishutao.com/1.1.08
+static.host=//static.jishutao.com/1.1.10
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload