Browse Source

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

anderx 5 years ago
parent
commit
01b85a50e9

+ 37 - 30
src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml

@@ -523,39 +523,42 @@
   </select>
   <!-- 查看自己创建的流水数据 -->
   <select id="myBillList" parameterType="Map" resultType="com.goafanti.common.model.TOrderBillNew">
-  select 
-  	b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,date_format(b.create_time,'%Y-%m-%d %H:%I:%S') as createTimes,
-  	b.payer_id as payerId, b.payee_id as payeeId, u.nickname as payerName, a.nickname as payeeName,  b.remarks,o.contract_no contractNo,
-  	b.transaction_subject as transactionSubject, b.transaction_channel as transactionChannel, b.delete_sign deleteSign,
-  	date_format(b.financial_pay_time,'%Y-%m-%d') as financialPayTimes,b.financial_pay_no as financialPayNo,date_format(b.refund_time,'%Y-%m-%d') refundTimes,
-  	b.creater, ad.name as createrName, o.salesman_id as saleId, oa.name as saleName,b.type,date_format(b.delete_time,'%Y-%m-%d %H:%I:%S') as deleteTimes
-  	from t_order_bill_new b
-  	left join `user` u on b.payer_id = u.id
-  	left join `user` a on b.payee_id = a.id
-  	left join admin ad on b.creater = ad.id
-  	left join t_order_new o on o.order_no = b.order_no
-  	left join admin oa on oa.id = o.salesman_id
-  	where 1=1 
+	   select b.bill_no as billNo, b.order_no as orderNo, b.transaction_amount as transactionAmount,
+		date_format(b.create_time, '%Y-%m-%d %H:%I:%S') as createTimes, b.payer_id as payerId, b.payee_id as payeeId,
+		tm.buyer_name as payerName, b.remarks, o.contract_no contractNo, b.transaction_subject as transactionSubject,
+		b.transaction_channel as transactionChannel, b.delete_sign deleteSign, date_format(b.financial_pay_time, '%Y-%m-%d') as financialPayTimes,
+		b.financial_pay_no as financialPayNo, date_format(b.refund_time, '%Y-%m-%d') refundTimes, b.creater, ad.name as createrName,
+		tm.salesman_name saleName, b.type, date_format(b.delete_time, '%Y-%m-%d %H:%I:%S') as deleteTimes
+		from t_order_bill_new b 
+		left join `user` u on b.payer_id = u.id 
+		left join `user` a on b.payee_id = a.id 
+		left join admin ad on b.creater = ad.id
+		left join t_order_new o on o.order_no = b.order_no
+		left join t_order_mid tm on tm.order_no=b.order_no
+	  	where 1=1 
+	  	<if test="fids != null and fids.size > 0">
+  		and ,o.finance_id in
+  		<foreach collection="fids" item="id" open="(" separator="," close=")">
+  		 #{id}
+  		</foreach>
+  		</if>
   	<if test="b.orderNo != null and b.orderNo != &quot;&quot;">
   	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
   	</if>
   	<if test="b.departmentId != null and b.departmentId != &quot;&quot;">
-	and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
+	and  o.order_dep = #{b.departmentId,jdbcType=VARCHAR}
 	</if>
   	<if test="b.creater != null and b.creater != &quot;&quot;">
   	and b.creater = #{b.creater,jdbcType=VARCHAR}
   	</if>
   	<if test="b.payerName != null and b.payerName != &quot;&quot;">
   	<bind name="nn" value="'%' + b.payerName + '%'" />
-  	and u.nickname like #{nn,jdbcType=VARCHAR}
+  	and tm.buyer_name like #{nn,jdbcType=VARCHAR}
   	</if>
   	<if test="b.payeeName != null and b.payeeName != &quot;&quot;">
   	<bind name="n" value="'%' + b.payeeName + '%'" />
   	and a.nickname like #{n,jdbcType=VARCHAR}
   	</if>
-  	<if test="b.departmentId != null and b.departmentId != &quot;&quot; ">
-  	and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
-  	</if>
   	<if test="b.startTime != null and b.startTime != &quot;&quot; and b.endTime != null and b.endTime != &quot;&quot;">
   	<bind name="a" value="b.startTime + ' 00:00:00'" />
   	<bind name="e" value="b.endTime + ' 23:59:59'" />
@@ -567,13 +570,20 @@
 	</if>
   </select>
   <select id="myBillCount" parameterType="Map" resultType="java.lang.Integer">
-  select count(*)
-  	from t_order_bill_new b
-  	left join `user` u on b.payer_id = u.id
-  	left join `user` a on b.payee_id = a.id
-  	left join t_order_new o on o.order_no = b.order_no
-  	left join admin oa on oa.id = o.salesman_id
-  	where 1=1 
+  	select count(*)
+  	from t_order_bill_new b 
+		left join `user` u on b.payer_id = u.id 
+		left join `user` a on b.payee_id = a.id 
+		left join admin ad on b.creater = ad.id
+		left join t_order_new o on o.order_no = b.order_no
+		left join t_order_mid tm on tm.order_no=b.order_no
+	  	where 1=1
+	<if test="fids != null and fids.size > 0">
+  		and ,o.finance_id in
+  		<foreach collection="fids" item="id" open="(" separator="," close=")">
+  		 #{id}
+  		</foreach>
+  	</if>
   	<if test="b.orderNo != null and b.orderNo != &quot;&quot;">
   	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
   	</if>
@@ -581,19 +591,16 @@
   	and b.creater = #{b.creater,jdbcType=VARCHAR}
   	</if>
   	<if test="b.departmentId != null and b.departmentId != &quot;&quot;">
-	and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
+	and  o.order_dep = #{b.departmentId,jdbcType=VARCHAR}
 	</if>
   	<if test="b.payerName != null and b.payerName != &quot;&quot;">
   	<bind name="nn" value="'%' + b.payerName + '%'" />
-  	and u.nickname like #{nn,jdbcType=VARCHAR}
+  	and tm.buyer_name like #{nn,jdbcType=VARCHAR}
   	</if>
   	<if test="b.payeeName != null and b.payeeName != &quot;&quot;">
   	<bind name="n" value="'%' + b.payeeName + '%'" />
   	and a.nickname like #{n,jdbcType=VARCHAR}
   	</if>
-  	<if test="b.departmentId != null and b.departmentId != &quot;&quot; ">
-  	and oa.department_id = #{b.departmentId,jdbcType=VARCHAR}
-  	</if>
   	<if test="b.startTime != null and b.startTime != &quot;&quot; and b.endTime != null and b.endTime != &quot;&quot;">
   	<bind name="a" value="b.startTime + ' 00:00:00'" />
   	<bind name="e" value="b.endTime + ' 23:59:59'" />

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

@@ -1086,15 +1086,15 @@
   
   
    <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,
+  	select  a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,a.receiver_name receiverName,a.project_status as projectStatus,e.contract_no contractNo,
 a.task_receiver taskReceiver,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate, a.commodity_quantity as commodityQuantity,
 e.approval,l.refund_status outsourceStatus,ifnull(i.alreadyNumber,0) as alreadyNumber,f.nickname as userName,h.name as depName, l.company_name as outsourceName ,
 ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId
     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 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 task_hours_count k on a.id=k.tid and a.task_receiver=k.aid left join t_order_outsource l
-    on a.id=l.tid where e.delete_sign !=1  and e.order_status not in (5,7) 
+    on a.id=l.tid where  e.delete_sign in (0,1,2)  and e.order_status in (2,4) 
     and a.outsource= #{outsource,jdbcType=INTEGER}
     <if test="role == 0 ">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
@@ -1106,10 +1106,10 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
      	</foreach>
 	</if>
     <if test="specially == 0 ">
-    and a.split_status !=1 
+    and a.split_status in (0,2) 
     </if>
     <if test="specially == 1 ">
-    and a.split_status !=2 
+    and a.split_status in (0,1) 
     </if>
     <if test="orderNo != null">
   	and a.order_no= #{orderNo,jdbcType=VARCHAR}
@@ -1148,7 +1148,7 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
   	and a.task_status= #{taskStatus,jdbcType=INTEGER}
   	</if>
   	<if test="adminName != null">
-  	and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
+  	and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
   	</if>
   	order by a.task_distribution_time desc
   	<if test="page_sql!=null">
@@ -1157,8 +1157,8 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
   </select>
   
    <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
-  	select  count(*) from t_order_task a 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 admin g on e.salesman_id=g.id left join department h on g.department_id=h.id where e.delete_sign !=1 and e.order_status not in (5,7)
+  	select  count(*) from t_order_task a  left join t_order_new e on a.order_no=e.order_no
+    left join admin g on e.salesman_id=g.id left join department h on g.department_id=h.id where e.delete_sign in (0,1,2)  and e.order_status in (2,4) 
     and a.outsource= #{outsource,jdbcType=INTEGER}
    <if test="role == 0 ">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
@@ -1170,10 +1170,10 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
      	</foreach>
 	</if>
     <if test="specially == 0 ">
-    and a.split_status !=1 
+    and a.split_status in (0,2) 
     </if>
     <if test="specially == 1 ">
-    and a.split_status !=2 
+    and a.split_status in (0,1) 
     </if>
     <if test="orderNo != null">
   	and a.order_no= #{orderNo,jdbcType=VARCHAR}
@@ -1212,7 +1212,7 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
   	and a.task_status= #{taskStatus,jdbcType=INTEGER}
   	</if>
   	<if test="adminName != null">
-  	and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
+  	and a.receiver_name  like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
   	</if>
   </select>
   <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">

+ 3 - 0
src/main/java/com/goafanti/common/model/TOrderBillNew.java

@@ -453,6 +453,9 @@ public class TOrderBillNew {
 	}
 
 	public String getPayeeName() {
+		if(payeeName==null) {
+			return "湖南科德信息咨询有限公司";
+		}
 		return payeeName;
 	}
 

+ 2 - 2
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -115,14 +115,14 @@ public class PatentTask {
 						 BigDecimal money=countMoney(y,p.getType());
 						ted.setTime(cst.getTime());
 						ted.add(Calendar.YEAR, y);
-						EmailBo emailBo = new EmailBo("专利提醒",p.getEmail(), p.getApplicant(), "科德集团", a.getName(),p.getName(), p.getPatentNo(), money.toString(), DateFormatUtils.format(ted, "yyyy-MM-dd"));
+						EmailBo emailBo = new EmailBo("专利提醒",p.getEmail().trim(), p.getApplicant(), "科德集团", a.getName(),p.getName(), p.getPatentNo(), money.toString(), DateFormatUtils.format(ted, "yyyy-MM-dd"));
 						SendEmailUtil.getInstance().patentSend(emailBo);
 						 p.setPatentAmount(money);
 						 p.setStatus(1);//提醒中
 						 p.setYears(y);
 						 patentNewService.updatePatenNew(p);
 						 PatentNewLog pl=new PatentNewLog();
-						 String str=StrToString("专利提醒",p.getEmail(), p.getApplicant(), a.getName(),p.getName(), p.getPatentNo(),
+						 String str=StrToString("专利提醒",p.getEmail().trim(), p.getApplicant(), a.getName(),p.getName(), p.getPatentNo(),
 								 money.toString(), DateFormatUtils.format(ted, "yyyy-MM-dd"));
 						 pl.setContent(str);
 						 pl.setCreateTime(new Date());

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

@@ -236,10 +236,10 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
      * @return
      */
     @RequestMapping(value = "/exportMyBill" , method = RequestMethod.GET)
-    public Result exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer whoType,Integer pageSize ,Integer pageNo)  {
+    public Result exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer pageSize ,Integer pageNo)  {
     	Result res=new Result();
 			try {
-				orderReceivablesService.exportMyBill( response, billNew,whoType,pageSize,pageNo);
+				orderReceivablesService.exportMyBill( response, billNew,pageSize,pageNo);
 			} catch (Exception e) {
 				res.getError().add(buildError("格式不正确"));
 				e.printStackTrace();

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

@@ -272,9 +272,9 @@ public class FundManagerOrderApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value="/myBillList", method = RequestMethod.GET)
-	public Result myBillList(TOrderBillNew billNew,Integer whoType ,Integer pageNo, Integer pageSize){
+	public Result myBillList(TOrderBillNew billNew ,Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		res.setData(orderBillServiceImpl.myBillList(billNew,whoType, pageNo, pageSize));
+		res.setData(orderBillServiceImpl.myBillList(billNew, pageNo, pageSize));
 		return res;
 	}
 
@@ -289,7 +289,7 @@ public class FundManagerOrderApiController extends CertifyApiController {
 		return res;
 	}
 	/**
-	 * 查看部门的流水
+	 * 查看部门的流水(并入查看自己)
 	 * @param billNew
 	 * @param pageNo
 	 * @param pageSize
@@ -298,7 +298,7 @@ public class FundManagerOrderApiController extends CertifyApiController {
 	@RequestMapping(value="/deptBillList", method = RequestMethod.GET)
 	public Result deptBillList(TOrderBillNew billNew, Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		res.setData(orderBillServiceImpl.myBillList(billNew, 1,pageNo, pageSize));
+		res.setData(orderBillServiceImpl.myBillList(billNew,pageNo, pageSize));
 		return res;
 	}
 	

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

@@ -15,7 +15,7 @@ public interface OrderBillService {
 	 * @param pageSize2 
 	 * @return
 	 */
-	Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew, Integer whoType, Integer pageNo, Integer pageSize);
+	Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew,  Integer pageNo, Integer pageSize);
 	
 	/**
 	 * 导出流水数据

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

@@ -38,7 +38,7 @@ public interface OrderReceivablesService {
 
 	void exportInvoice(HttpServletResponse response, String orderNo, Integer pageSize, Integer pageNo)throws Exception;
 
-	void exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer whoType, Integer pageSize, Integer pageNo)throws Exception;
+	void exportMyBill(HttpServletResponse response, TOrderBillNew billNew, Integer pageSize, Integer pageNo)throws Exception;
 
 
 }

+ 13 - 3
src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.order.service.impl;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -10,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.TOrderBillNewMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.model.TOrderBillNew;
@@ -29,17 +32,24 @@ public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> im
 	private TOrderBillNewMapper billNewMapper;
 	@Autowired
 	private TOrderNewMapper	tOrderNewMapper;
+	@Autowired
+	private AdminMapper	adminMapper;
 	@Value(value = "${upload.path}")
 	private String	uploadPath = null;
 
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew,Integer whoType,
+	public Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew,
 			Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
-		if(whoType==null)whoType=0;
-		if (whoType==0) billNew.setCreater(TokenManager.getAdminId());
+		List<String>fids= new ArrayList<>();
+		if (TokenManager.hasRole(AFTConstants.FINANCE)) {
+			fids.add(TokenManager.getAdminId());
+		}else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
+			fids=adminMapper.selectBySuperId(TokenManager.getAdminId());
+		}
+		params.put("fids", fids);
 		params.put("b", billNew);
 		return (Pagination<TOrderBillNew>)findPage("myBillList", "myBillCount", params, pageNo, pageSize);
 	}

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

@@ -595,7 +595,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	public void pushOrderDun(TOrderNew t2) {
 			List<OutNewOrderDunBo> list=newOrderDunMapper.selectListNewOrderDun(t2.getOrderNo(),null,0);
 			for (OutNewOrderDunBo o : list) {
-				if (o.getDunType()==1) {
+				if (o.getDunType()==1) {	
 					o.setStatus(1);
 					o.setStartTime(new Date());
 					newOrderDunMapper.updateByPrimaryKeySelective(o);

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

@@ -557,13 +557,13 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 		
 		@SuppressWarnings("unchecked")
 		@Override
-		public void exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer whoType, Integer pageSize, Integer pageNo)throws Exception {
+		public void exportMyBill(HttpServletResponse response, TOrderBillNew billNew, Integer pageSize, Integer pageNo)throws Exception {
 
 			 OutputStream out = response.getOutputStream();
 				if(pageSize==null||pageSize<0)pageSize=9999;
 				if(pageNo==null||pageNo<0)pageNo=1;
 				
-				List<TOrderBillNew>list=(List<TOrderBillNew>) orderBillService.myBillList(billNew, whoType,pageNo, pageSize).getList();
+				List<TOrderBillNew>list=(List<TOrderBillNew>) orderBillService.myBillList(billNew,pageNo, pageSize).getList();
 		    	try {
 		    		//设计表头
 		    		String[] comment = {"订单编号","合同编号","收款时间","财务流水时间","财务流水号","金额(万元)","收款方","付款方","流水科目","平台流水号","收款类型","备注"};

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

@@ -1,13 +1,13 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-jdbc.url=jdbc\:mysql\://localhost\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
-jdbc.username=dev
-jdbc.password=123456
+#jdbc.url=jdbc\:mysql\://localhost\:3306/aft?useUnicode\=true&characterEncoding\=UTF-8&autoReconnect\=true&useSSL\=false
+#jdbc.username=dev
+#jdbc.password=123456
 #测试
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft20200511?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=aftdev
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft20200511?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570