Przeglądaj źródła

新增超级管理员驳回

anderx 5 lat temu
rodzic
commit
71c2287ba3

+ 21 - 0
src/main/java/com/goafanti/order/controller/OutsourceOrgApiController.java

@@ -14,10 +14,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.OutsourceOrganization;
 import com.goafanti.common.model.TOrderOutsource;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.enums.OrderNewState;
 import com.goafanti.order.service.OrderNewService;
@@ -219,4 +221,23 @@ public class OutsourceOrgApiController extends CertifyApiController {
         return res;
     } 
     
+    
+    /**
+	 * 	超级管理员驳回
+	 */
+	@RequestMapping(value="/superAdminReject", method = RequestMethod.POST)
+	public Result superAdminReject(Integer id){
+		Result res=new Result();
+		if (null==id) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "外包编号","外包编号"));
+			return res;
+		}
+		if(!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			res.getError().add(buildError("","本驳回只允许超级管理员执行!"));
+			return res;
+		}
+		res.data(outsourceOrgService.updateSuperAdminReject(id));
+		return res;
+	}
+    
 }

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

@@ -33,5 +33,7 @@ public interface OutsourceOrgService {
 
 	List<OutOutsourceLog> selectOutsourceLog(Integer tid);
 
+	int updateSuperAdminReject(Integer id);
+
 	
 }

+ 23 - 0
src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java

@@ -25,6 +25,7 @@ import com.goafanti.common.model.OutsourceLog;
 import com.goafanti.common.model.OutsourceOrganization;
 import com.goafanti.common.model.TOrderLog;
 import com.goafanti.common.model.TOrderNew;
+import com.goafanti.common.model.TOrderOutsource;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -193,5 +194,27 @@ public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapp
 	public List<OutOutsourceLog> selectOutsourceLog(Integer tid) {
 		return outsourceLogMapper.selectByTid(tid);
 	}
+	@Override
+	public int updateSuperAdminReject(Integer id) {
+		TOrderOutsource tto=tOrderOutsourceMapper.selectByPrimaryKey(id);
+		//start_type 0外包 1供应商
+		if (tto.getStartType()==0) {
+			TOrderTask tt=new TOrderTask();
+			tt.setId(tto.getTid());
+			tt.setOutsource(0);
+			tOrderTaskMapper.updateByPrimaryKeySelective(tt);
+		}
+		OutsourceLog ol=new OutsourceLog();
+		ol.setTid(tto.getTid());
+		ol.setAid(TokenManager.getAdminId());
+		ol.setAname("超级管理员");
+		ol.setStatus(2);
+		ol.setRemarks("超级管理员强制驳回");
+		outsourceLogMapper.insert(ol);
+		TOrderOutsource tto2=new  TOrderOutsource();
+		tto2.setId(id);
+		tto2.setRefundStatus(2);
+		return tOrderOutsourceMapper.updateByPrimaryKeySelective(tto2);
+	}
 
 }