Просмотр исходного кода

Merge branch 'test' of http://git.jishutao.com/jishutao/kede-server.git into test

limin лет назад: 7
Родитель
Сommit
f8e46e829a

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

@@ -1077,6 +1077,7 @@
   	</if>
   	<if test="specially == 4">
   	and a.process_status in (4,5,6)
+  	and a.order_status not in(3,5)
   	</if>
   	<if test="specially == 5">
   	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
@@ -1284,4 +1285,4 @@
      left join t_order_new b  on a.order_no=b.order_no
      where a.id= #{id,jdbcType=INTEGER}
   </select>
-</mapper>
+</mapper>

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

@@ -758,7 +758,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
     where a.id= #{id,jdbcType=VARCHAR}
   </select>
   <select id="selectBySuperId"  resultType="com.goafanti.common.model.TOrderTask">
-     select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus  from t_order_task
+     select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus,max(main) as main  from t_order_task
     where super_id = #{superId,jdbcType=VARCHAR} group by super_id
   </select>
   

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

@@ -409,9 +409,9 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * 咨询师驳回
 	 */
 	@RequestMapping(value = "/technicianBackOrder", method = RequestMethod.POST)
-	public Result technicianBackOrder(String orderNo){
+	public Result technicianBackOrder(String orderNo,String reason){
 		Result res = new Result();
-		int i=orderNewService.technicianBackOrder(orderNo);
+		int i=orderNewService.technicianBackOrder(orderNo, reason);
 		if (i==-1) {
 			res.getError().add(buildError("不符合驳回条件","不符合驳回条件"));
 			return res;

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

@@ -159,7 +159,7 @@ public interface OrderNewService {
 	int updateOrderOver(String orderNo);
 	OrderRefundDetailBo orderRefundDetail(String id);
 	int updateOrderRefund(TOrderRefundWithBLOBs t);
-	int technicianBackOrder(String orderNo);
+	int technicianBackOrder(String orderNo, String reason);
 	List<OrderDunTaskBo> selectAllOrderDun();
 	void updateOrderDun(TOrderDun tDun);
 	void addNoticAndSendEmail(String orderNo, OrderDunTaskBo t, Integer code)throws UnsupportedEncodingException, MessagingException;

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

@@ -562,18 +562,15 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 	@Override
-	public int technicianBackOrder(String orderNo) {
+	public int technicianBackOrder(String orderNo,String reason) {
 		TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
-		if (t.getSettlementAmount().compareTo(new BigDecimal(0))==0) {
+		if (t.getSettlementAmount().compareTo(new BigDecimal(0))==0||
+				t.getProcessStatus()>ProcessStatus.YPZXSGLY.getCode()) {
 			return -1;
 		}
 		t.setOrderStatus(OrderNewState.YBH.getCode());
-		try {
-			addNoticAndSendEmail(orderNo, null, NoticeStatus.ORDER_BACK.getCode());
-		} catch (UnsupportedEncodingException | MessagingException e) {
-			LoggerUtils.error(getClass(), "发送邮件失败", e);
-		}
-		return tOrderNewMapper.updateByPrimaryKey(t);
+		addBackOrder(orderNo, reason);
+		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}
 	
 	@Override
@@ -590,9 +587,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
 		LoggerUtils.debug(logger, "======================站内消息发送启动===================");
-		 String id="1";
-		if (type==NoticeStatus.ORDER_DUN.getCode())  id=b.getSalesmanId();
-		if (type==NoticeStatus.ORDER_BACK.getCode())  id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
 		String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+orderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
 		Notice n =new Notice();
 		n.setId(UUID.randomUUID().toString());