Browse Source

Merge branch 'test' of ssh://git@git.jishutao.com:55555/jishutao/kede-server.git into test

anderx 7 years ago
parent
commit
04aa5651d6

+ 2 - 1
src/main/java/com/goafanti/common/enums/NoticeStatus.java

@@ -23,8 +23,9 @@ public enum NoticeStatus {
 	ORDER_CHANGE_UDPATE(13,"订单变更信息修改"),
 	ORDER_DUN(14,"订单催款信息"),
 	ORDER_BACK(15,"订单驳回信息"),
-	ORDER_REFUND(16,"订单退单信息"),
+	ORDER_REFUND(16,"订单退单同意信息"),
 	ORDER_BONUS(17,"奖金信息"),
+	ORDER_REFUND_REFUSE(18,"退单拒绝信息"),
 	OTHER(0, "其他");
 
 	private NoticeStatus(Integer code, String desc) {

+ 13 - 0
src/main/java/com/goafanti/common/mapper/TOrderBonusMapper.xml

@@ -379,6 +379,9 @@
   		<if test="b.grantStatus != null">
 		and b.grant_status = #{b.grantStatus,jdbcType=INTEGER}
 		</if>
+		<if test='b.orderNo != null and b.orderNo !=""'>
+		and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
+		</if>
   		<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
   		<bind name="a" value="b.startTime +'-01'"/>
   		<bind name="e" value="b.endTime +'-31'"/>
@@ -414,6 +417,10 @@
   		<if test="b.grantStatus != null">
 		and b.grant_status = #{b.grantStatus,jdbcType=INTEGER}
 		</if>
+  		<if test='b.orderNo != null and b.orderNo !=""'>
+		and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
+		</if>
+		
   		<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
   		<bind name="a" value="b.startTime +'-01'"/>
   		<bind name="e" value="b.endTime +'-31'"/>
@@ -448,6 +455,9 @@
 	<if test="b.grantStatus != null">
 	and b.grant_status = #{b.grantStatus,jdbcType=INTEGER}
 	</if>
+	<if test='b.orderNo != null and b.orderNo !=""'>
+	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
+	</if>
 	<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
 	<bind name="a" value="b.startTime +'-01'"/>
 	<bind name="e" value="b.endTime +'-31'"/>
@@ -479,6 +489,9 @@
 	<if test="b.grantStatus != null">
 	and b.grant_status = #{b.grantStatus,jdbcType=INTEGER}
 	</if>
+	<if test='b.orderNo != null and b.orderNo !=""'>
+	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
+	</if>
 	<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
 	<bind name="a" value="b.startTime +'-01'"/>
 	<bind name="e" value="b.endTime +'-31'"/>

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

@@ -474,7 +474,7 @@
  <!-- 更新指定月份的统计数据 -->
  <insert id="updateByMonth" parameterType="java.lang.Integer">
  	REPLACE INTO t_order_month_report(`type`,`month`,amount,proof_count,salemans_id) 
-	select o.order_type, date_format(o.sign_time,'%Y%m'),sum(o.total_amount), sum(o.proof_count), o.salesman_id 
+	select o.order_type, #{month,jdbcType=INTEGER},sum(o.total_amount), sum(o.proof_count), o.salesman_id 
 	from t_order_new o
 	where 1 = 1
 	  and o.proof_status = 1

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

@@ -849,10 +849,10 @@
   	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
   	</if>
   	<if test="ob == 1">
-  	order by o.sign_time
+  	order by o.sign_time desc
   	</if>
   	<if test="ob == 2">
-  	order by o.liquidation_status,o.sign_time
+  	order by o.liquidation_status,o.sign_time desc
   	</if>
 	<if test="page_sql != null">
 		${page_sql}
@@ -992,7 +992,7 @@
 	  	<bind name="b" value="o.endTime + ' 23:59:59'"/>
 	  	and o.sign_time between #{a,jdbcType=VARCHAR} and #{b,jdbcType=VARCHAR}
 	  	</if>
-	  	order by o.liquidation_status, o.sign_time
+	  	order by o.liquidation_status, o.sign_time desc
 	  	<if test="page_sql != null">
 			${page_sql}
 		</if>
@@ -1269,7 +1269,7 @@
   
   <!-- 财务同意退款邮件通知需要的数据  -->
   <select id="agreeEmailData" parameterType="java.lang.Integer" resultType="com.goafanti.order.bo.TOrderNewBo">
-  	select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId,
+  	select u.nickname as userName, r.order_no as orderNo, o.order_status as orderStatus, o.salesman_id as salesmanId, o.technician_id as technicianId,
   		concat(a.email,"," , ifnull(t.email,"")) as email , concat(a.name,"," , ifnull(t.name,"")) as salesmanName
   		from t_order_refund r
   		left join t_order_new o on r.order_no = o.order_no

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

@@ -302,8 +302,8 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			bonus.setBonusSubject(16);
 			bonusMapper.insertSelective(bonus);
 			//发送站内消息
-			addNotic(o.getOrderNo(),16,o.getSalesmanId());
-			
+			addNotic(o.getOrderNo(),16,o.getSalesmanId());//给营销员
+			addNotic(o.getOrderNo(),16,o.getTechnicianId());//给技术员
 			//退单邮件发送需要的数据
 			AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 			
@@ -322,6 +322,32 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 					e.printStackTrace();
 				}
 			}
+		}else{//审核拒绝
+			//给营销员发通知和邮件
+			TOrderNewBo o = tOrderNewMapper.agreeEmailData(refund.getId());
+			addNotic(o.getOrderNo(),18,o.getSalesmanId());//给营销员
+			AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
+			
+			String content = "<div>退单编号: "+ refund.getId() +"</div><div>客户名称: " + o.getUserName() + "</div>";
+			 content += "<div>订单编号: "+ o.getOrderNo() +"</div>";
+			 String email = o.getEmail();
+			if(StringUtils.isNotEmpty(email)){
+				email = email.substring(0, email.indexOf(","));
+				String sale = o.getSalesmanName();
+				sale = sale.substring(0,sale.indexOf(","));
+				if(email.matches("[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w\\-]+")){//email格式校验
+					EmailBo emailBo = new EmailBo("拒绝退单",email, sale, a.getDepartmentName(), a.getName(), content);
+					try {
+						SendEmailUtil.getInstance().send(emailBo);
+					} catch (UnsupportedEncodingException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					} catch (MessagingException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+			}
 		}
 		
 		//修改退单审核状态