Преглед изворни кода

变更发起订单操作限制

Signed-off-by: anderx <312518615@qq.com>
anderx пре 5 година
родитељ
комит
f03ac70de8

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

@@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.BusinessProjectMapper;
 import com.goafanti.common.dao.NewOrderDunMapper;
@@ -115,6 +116,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Override
 	public int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially,String remarks) {
 		TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(taskId);
+		checkDeleteSign(t.getOrderNo());
 		t.setTaskStatus(TaskState.DISTRIBUTION.getCode());
 		t.setTaskAllocator(TokenManager.getAdminId());
 		t.setTaskReceiver(taskReceiverId);
@@ -143,9 +145,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		checkProjiectAllocation(t.getOrderNo());
 		return 1;
 	}
-	private TOrderNew checkDeleteSign(String orderNo) {
+	public TOrderNew checkDeleteSign(String orderNo) {
 		TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
-		//if(t.getDeleteSign()==2) throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_REVOKE, t.getOrderNo(),""));
+		if(t.getDeleteSign()==2||t.getDeleteSign()==3) throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_REVOKE, t.getOrderNo(),""));
 		return t;
 	}
 	public void addOrderLog(String orderNo, Integer code,String remarks) {
@@ -480,6 +482,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 
 	@Override
 	public int addTaskHours(TTaskHours t) {
+		TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(Integer.valueOf(t.getTaskId()));
+		checkDeleteSign(tt.getOrderNo());
 		t.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
 		t.setId(UUID.randomUUID().toString());
 		t.setCreateTime(new Date());