chb il y a 7 ans
Parent
commit
9f6a5ce0d4

+ 6 - 3
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/PlannerServiceImpl.java

@@ -17,6 +17,7 @@ import com.fuzamei.mapperInterface.ReceivingClerkMapper;
 import com.fuzamei.mapperInterface.UserMapper;
 import com.fuzamei.service.PlannerService;
 import com.fuzamei.util.blockchain.BlockChainUtil;
+import com.fuzamei.util.blockchain.ProtobufBean;
 @Service
 public class PlannerServiceImpl implements  PlannerService{
   @Autowired
@@ -69,10 +70,12 @@ public class PlannerServiceImpl implements  PlannerService{
 		pp.setOperationTime(currentTime);//操作时间
 		pp.setHash(hash);//操作hash
 		userMapper.insertOperationHistory(pp);//插入到操作记录表去
-		
-		boolean flag = blockChainUtil.sendBlockChain(pp.getSign());//发送签名直接转发到区块链
+		ProtobufBean protobufBean = blockChainUtil.getProtobufBean(pp.getSign());
+		String result = blockChainUtil.sendPostParam(protobufBean);
+		boolean flag = blockChainUtil.vilaResult(result);
+//		boolean flag = blockChainUtil.sendBlockChain(pp.getSign());//发送签名直接转发到区块链
 		if(!flag) {
-			 throw new RuntimeException("区块链操作失败");
+			 throw new RuntimeException("区块链操作失败:"+result);
 		}
 
 	}

+ 1 - 1
saicLogistics/src/main/java/com/fuzamei/web/PlannerAction.java

@@ -92,7 +92,7 @@ public class PlannerAction {
 			Integer user_id = ValidationUtil.checkAndAssignInt(req.getHeader("Authorization").split("&")[1]);
 			userAuthoricationService.queryUserAuthority(user_id, Roles.ADMIN);
 			int plannerId = ValidationUtil.checkAndAssignInt(map.get("plannerId"));// 管理员根据传计划员id  来配置供应商
-			userAuthoricationService.queryUserAuthority(plannerId);//??????由计划员来配置??---TODO
+			userAuthoricationService.queryUserAuthority(plannerId);//??????
 		    SupplierList=plannerService.queryAllSupplierByPlannerId(plannerId);
 		    SupplierList2=plannerService.queryAllNoSupplierByPlannerId(plannerId);
 		    Map<String, Object>  twolist =new HashMap<String, Object>();